From 7297634be584e3ad11bb406b8213a4ca6cdbad46 Mon Sep 17 00:00:00 2001 From: "YUN-PC5\\user" Date: Fri, 20 Oct 2023 17:12:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=9A=E7=9F=A5=E5=85=AC?= =?UTF-8?q?=E5=91=8A=E6=B0=94=E6=B3=A1=E6=A1=86=E6=98=BE=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?SignalR=E6=8E=A5=E5=8F=97=E6=B6=88=E6=81=AF=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Notice/Index.vue | 12 +++++++----- src/signalr/analysis.js | 12 ++++++------ .../monitor/ipratelimit/ipratelimitlog/index.vue | 2 +- src/views/system/notice/index.vue | 6 +++++- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/components/Notice/Index.vue b/src/components/Notice/Index.vue index bbc2ba4..84b3b29 100644 --- a/src/components/Notice/Index.vue +++ b/src/components/Notice/Index.vue @@ -21,11 +21,11 @@
{{ item.noticeTitle }}
-
{{ formatDate(item.create_time) }}
+ {{ formatDate(item.create_time) }}
- - + @@ -194,7 +194,7 @@ const formatDate = (dateTime) => { } .content { margin-left: 8px; - + width: 100%; .name { color: var(--el-color-primary); } @@ -206,6 +206,8 @@ const formatDate = (dateTime) => { } .content-box-time { margin-top: 3px; + text-align: right; + display: block; } } .content-box-empty { diff --git a/src/signalr/analysis.js b/src/signalr/analysis.js index ca1844d..b2d1d2b 100644 --- a/src/signalr/analysis.js +++ b/src/signalr/analysis.js @@ -22,11 +22,11 @@ export default { webNotify({ title: title, body: data }) }) // 接受系统通知/公告 - connection.on(MsgType.M004, (data1, data2) => { - // if (data.code == 200) { - useSocketStore().setUnreadNoticeList(data1) - useSocketStore().setReadNoticeList(data2) - // } + connection.on(MsgType.M004, (data) => { + if (data.code == 200) { + useSocketStore().setUnreadNoticeList(data.data.unReadNotifications) + useSocketStore().setReadNoticeList(data.data.readNotifications) + } }) // 接受聊天数据 connection.on(MsgType.M005, (data) => { @@ -49,7 +49,7 @@ export default { connection.invoke('AllReadNotice') }, ReadNotice(connection, noticeId) { - connection.invoke('ReadNotice', noticeId) + connection.invoke('ReadNotice', noticeId.toString()) } } const MsgType = { diff --git a/src/views/monitor/ipratelimit/ipratelimitlog/index.vue b/src/views/monitor/ipratelimit/ipratelimitlog/index.vue index 6154f13..fba24bd 100644 --- a/src/views/monitor/ipratelimit/ipratelimitlog/index.vue +++ b/src/views/monitor/ipratelimit/ipratelimitlog/index.vue @@ -5,7 +5,7 @@ - + diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index 1333752..8c28139 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -102,7 +102,7 @@ @@ -125,6 +125,7 @@ const multiple = ref(true) const total = ref(0) const title = ref('') const noticeRef = ref() +const submitBtnLoading = ref(false) const data = reactive({ form: {}, @@ -195,6 +196,7 @@ function handleSelectionChange(selection) { /** 新增按钮操作 */ function handleAdd() { reset() + submitBtnLoading.value = false open.value = true title.value = '添加公告' } @@ -204,6 +206,7 @@ function handleUpdate(row) { const noticeId = row.noticeId || ids.value getNotice(noticeId).then((response) => { form.value = response.data + submitBtnLoading.value = false open.value = true title.value = '修改公告' }) @@ -212,6 +215,7 @@ function handleUpdate(row) { function submitForm() { proxy.$refs['noticeRef'].validate((valid) => { if (valid) { + submitBtnLoading.value = true if (form.value.noticeId != undefined) { updateNotice(form.value).then((response) => { proxy.$modal.msgSuccess('修改成功')