diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementChat.vue b/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementChat.vue index 2d34bfb0..57fb910c 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementChat.vue +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementChat.vue @@ -83,7 +83,7 @@ @click="closeMenu" @contextmenu.prevent > -
- + --> @@ -130,9 +130,9 @@ import { getNoticeMessages, addNoticeMessage } from '@/api/enforcement/notice'; const router = useRouter(); const route = useRoute(); - +const { useCommon } = $globalStore; // ========== 从路由参数获取信息 ========== -const noticeId = route.query.id|| ''; +const noticeId = route.query.noticeId|| ''; const bureauDeptName = ref(route.query.bureauDeptName || '深圳司法局'); const contactPerson = ref(route.query.contactPerson || '付明明 周昂'); const noticeTitle = ref(route.query.title || '安全生产检查'); @@ -149,10 +149,10 @@ const loadMessageList = () => { if (res && res.code === 200 && res.data) { messageList.value = res.data.map(item => ({ id: item.id, - sender: item.sender === 'self' ? 'self' : 'other', + sender: item.userName == useCommon.userName ? 'self' : 'other', content: item.content || item.message || '', time: item.createTime || item.time || '', - avatar: item.sender === 'self' ? selfAvatar : otherAvatar, + avatar: item.userName == useCommon.userName ? selfAvatar : otherAvatar, isRecalled: item.isRecalled || false, })); nextTick(() => scrollToBottom()); @@ -334,7 +334,9 @@ const sendMessage = () => { if (noticeId) { addNoticeMessage({ noticeId, - content: text, + userId: useCommon.userId, + userName: useCommon.userName, + message: text, }, (res) => { if (res && res.code === 200) { newMsg.id = res.data?.id || newMsg.id; diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementNoticeList.vue b/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementNoticeList.vue index a180a299..aae3a9da 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementNoticeList.vue +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementNoticeList.vue @@ -25,7 +25,7 @@