Commit 1bef16c6 authored by 沈翠玲's avatar 沈翠玲

消息中心

parent 3b4c7c75
...@@ -7,7 +7,19 @@ export const readMessage = (params) => { ...@@ -7,7 +7,19 @@ export const readMessage = (params) => {
export const pageMyMesage = (params) => { export const pageMyMesage = (params) => {
return request.get('/message/pageMyMesage', params); return request.get('/message/pageMyMesage', params);
}; };
// 获取我的消息 // 发送消息
export const sendMesage = (params) => { export const sendMesage = (params) => {
return request.post('/message/send', params); return request.get('/message/send', params);
};
// 保存消息
export const saveMesage = (params) => {
return request.post('/message/save', params);
};
// 消息中心列表
export const pageMesage = (params) => {
return request.get('/message/page', params);
}; };
// 查看消息详情
export const showMessage = (params) => {
return request.get('/message/detail', params);
};
\ No newline at end of file
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
} }
}; };
const handleSearch = async (params) => { const handleSearch = async (params) => {
const { result } = await getUserPage({ current: 1, size: 9999999 }); const { result } = await getUserPage({ current: 1, size: 9999999, ...params });
tableData.value = result.content; tableData.value = result.content;
}; };
onMounted(() => { onMounted(() => {
......
<template> <template>
<div class="table-box"> <div class="table-box">
<ProTable ref="proTable" :config="config" :api="pageMyMesage"> <ProTable ref="proTable" :config="config" :api="pageMesage">
<template #left_buttons> <template #left_buttons>
<el-button type="primary" @click="addNotice()">信息发布</el-button> <el-button type="primary" @click="addNotice()">信息发布</el-button>
</template> </template>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import sendNotice from './sendNotice.vue' import sendNotice from './sendNotice.vue'
import { pageMyMesage } from '@/api/message'; import { pageMesage, showMessage, sendMesage } from '@/api/message';
import { useDict } from '@/hooks/useDict'; import { useDict } from '@/hooks/useDict';
const { MessageStatus, SendType, MessageType, ServiceType, AuditStatus, CaseStatus, ReadStatus } = useDict("MessageStatus","ReadStatus","SendType", "MessageType", "ServiceType","AuditStatus", "CaseStatus"); const { MessageStatus, SendType, MessageType, ServiceType, AuditStatus, CaseStatus, ReadStatus } = useDict("MessageStatus","ReadStatus","SendType", "MessageType", "ServiceType","AuditStatus", "CaseStatus");
const showModal = ref(false) const showModal = ref(false)
...@@ -44,17 +44,32 @@ ...@@ -44,17 +44,32 @@
const socketStore = useSocketStore(); const socketStore = useSocketStore();
const router = useRouter(); const router = useRouter();
const showContent = (row) => { const showContent = (row) => {
currentRow.value = row showMessage({id: row.id}).then(res => {
showModal.value = true if (res.success) {
currentRow.value = res.result
showModal.value = true
}
})
} }
const handleClick = (row) => { const handleEdit = (row) => {
if (row.serviceUrl) { showMessage({id: row.id}).then(res => {
router.push(row.serviceUrl) if (res.success) {
} sendNoticeRef.value?.openModal(res.result);
}
})
}
const handleSend= (row) => {
sendMesage({id: row.id}).then(res => {
if (res.success) {
ElMessage.success({
message: '发送成功',
plain: true,
});
query()
}
})
} }
const addNotice = () => { const addNotice = () => {
console.log('sendNoticeRef.value', sendNoticeRef.value)
sendNoticeRef.value?.openModal(); sendNoticeRef.value?.openModal();
} }
const config = reactive({ const config = reactive({
...@@ -189,7 +204,7 @@ ...@@ -189,7 +204,7 @@
{ {
field: 'code', field: 'code',
title: '操作', title: '操作',
width: 160, width: 230,
slots: { slots: {
default: ({ row, rowIndex }) => { default: ({ row, rowIndex }) => {
return ( return (
...@@ -197,8 +212,11 @@ ...@@ -197,8 +212,11 @@
<ElButton type="primary" onClick={() => showContent(row)}> <ElButton type="primary" onClick={() => showContent(row)}>
查看详情 查看详情
</ElButton> </ElButton>
<ElButton type="primary" onClick={() => handleClick(row)}> <ElButton type="primary" onClick={() => handleEdit(row)}>
处理 编辑
</ElButton>
<ElButton type="primary" onClick={() => handleSend(row)}>
发送
</ElButton> </ElButton>
</> </>
); );
......
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
<myEditor class="myEditor" @select="getRich" ref="childrenRef" :editValue="editValue" /> <myEditor class="myEditor" @select="getRich" ref="childrenRef" :editValue="editValue" />
</el-form> </el-form>
</div> </div>
<div class="mb-5 w-full flex justify-end"> <div class="mb-5 w-full flex justify-end mt-2">
<el-button type="default" @click="showModal = false">取消</el-button> <el-button type="default" @click="showModal = false">取消</el-button>
<el-button type="primary" @click="submitForm">保存</el-button> <el-button type="primary" @click="save">保存草稿箱</el-button>
</div> </div>
</div> </div>
</vxe-modal> </vxe-modal>
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
import { inject, reactive } from 'vue'; import { inject, reactive } from 'vue';
import { getAppEnvConfig } from '@/utils/env'; import { getAppEnvConfig } from '@/utils/env';
import { useUserStore } from '@/stores/modules/user'; import { useUserStore } from '@/stores/modules/user';
import { sendMesage } from '@/api/message'; import { sendMesage, saveMesage } from '@/api/message';
import myEditor from './myEditor.vue' import myEditor from './myEditor.vue'
import UserModal from './UserModal.vue' import UserModal from './UserModal.vue'
const emits = defineEmits(['success']);
const showModal = ref(false); const showModal = ref(false);
const userModalRef = ref(null); const userModalRef = ref(null);
const { PaymentForm, ContractStatus, FlowStatus } = useDict("PaymentForm", "ContractStatus", "FlowStatus"); const { PaymentForm, ContractStatus, FlowStatus } = useDict("PaymentForm", "ContractStatus", "FlowStatus");
const emits = defineEmits(['success']);
const props = defineProps({ const props = defineProps({
mergerCase: String, mergerCase: String,
returnConfig: Array, returnConfig: Array,
...@@ -69,9 +69,8 @@ ...@@ -69,9 +69,8 @@
ruleForm.receivers = row ruleForm.receivers = row
ruleForm.username = row.map(v => v.username) ruleForm.username = row.map(v => v.username)
} }
const submitForm = () => { const save = () => {
console.log('ruleForm', ruleForm) saveMesage({
sendMesage({
title: ruleForm.title, title: ruleForm.title,
content: ruleForm.content, content: ruleForm.content,
status: "normal", status: "normal",
...@@ -79,9 +78,8 @@ ...@@ -79,9 +78,8 @@
sendType: "user", sendType: "user",
receiversIds: ruleForm.receivers.map(v => v.id) receiversIds: ruleForm.receivers.map(v => v.id)
}).then(res=> { }).then(res=> {
if(res.success) { showModal.value = false;
emits('success');
}
}) })
} }
const chooseUSER = () => { const chooseUSER = () => {
...@@ -91,12 +89,22 @@ ...@@ -91,12 +89,22 @@
const getRich = function (value) { const getRich = function (value) {
ruleForm.content = value ruleForm.content = value
} }
const openModal = () => { const openModal = (row) => {
editValue.value = "" console.log('asdas', row)
ruleForm.content = "" if (row) {
ruleForm.content = row.content
editValue.value = row.content
ruleForm.title = row.title
ruleForm.receivers = []
ruleForm.username = ""
} else {
ruleForm.content = ""
editValue.value = ""
ruleForm.title = "" ruleForm.title = ""
ruleForm.receivers = [] ruleForm.receivers = []
ruleForm.username = "" ruleForm.username = ""
}
showModal.value = true; showModal.value = true;
}; };
defineExpose({ defineExpose({
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
import { ElMessageBox, ElMessage, ElTag } from 'element-plus'; import { ElMessageBox, ElMessage, ElTag } from 'element-plus';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { pageMyMesage } from '@/api/message'; import { pageMyMesage, showMessage } from '@/api/message';
import { useDict } from '@/hooks/useDict'; import { useDict } from '@/hooks/useDict';
const { MessageStatus, SendType, MessageType, ServiceType, AuditStatus, CaseStatus, ReadStatus } = useDict("MessageStatus","ReadStatus","SendType", "MessageType", "ServiceType","AuditStatus", "CaseStatus"); const { MessageStatus, SendType, MessageType, ServiceType, AuditStatus, CaseStatus, ReadStatus } = useDict("MessageStatus","ReadStatus","SendType", "MessageType", "ServiceType","AuditStatus", "CaseStatus");
const showModal = ref(false) const showModal = ref(false)
...@@ -34,9 +34,12 @@ ...@@ -34,9 +34,12 @@
const socketStore = useSocketStore(); const socketStore = useSocketStore();
const router = useRouter(); const router = useRouter();
const showContent = (row) => { const showContent = (row) => {
currentRow.value = row showMessage({id: row.id}).then(res => {
showModal.value = true if (res.success) {
currentRow.value = res.result
showModal.value = true
}
})
} }
const handleClick = (row) => { const handleClick = (row) => {
if (row.serviceUrl) { if (row.serviceUrl) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment