From da2aba757aee7e412387d0567f5fb8dad47a0b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=91=E7=BF=94?= <971366405@qq.com> Date: Sat, 14 Sep 2024 11:06:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=E5=8F=91=E9=80=81ws?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增通知公告发送ws消息 --- src/components/Notice/index.vue | 13 ++- .../Sidebar/components/SidebarMenuItem.vue | 2 +- src/views/dashboard/index.vue | 1 - src/views/notice/index.vue | 95 ++----------------- src/views/system/notice/index.vue | 24 +++-- 5 files changed, 39 insertions(+), 96 deletions(-) diff --git a/src/components/Notice/index.vue b/src/components/Notice/index.vue index 7247e5d4..a4ba322c 100644 --- a/src/components/Notice/index.vue +++ b/src/components/Notice/index.vue @@ -40,7 +40,7 @@
- + 查看更多 @@ -66,10 +66,11 @@ import { MessageTypeEnum, MessageTypeLabels } from "@/enums/MessageTypeEnum"; import NoticeAPI from "@/api/notice"; import socket from "@/api/socket"; import NoticeModal from "@/components/NoticeModal/index.vue"; +import router from "@/router"; const activeTab = ref(MessageTypeEnum.MESSAGE); const messages = ref([]); -const noticeModalRef = ref(null); +const noticeModalRef = ref(NoticeModal); const offset = ref([-15, 15]); const getFilteredMessages = (type: MessageTypeEnum) => { @@ -131,6 +132,14 @@ function readNotice(id: number) { noticeModalRef.value?.open(id); // 调用 open 方法,传入 ID } +/** + * 查看更多 + */ +function more() { + //跳转到我的消息页面 + router.push({ path: "notice/notice" }); +} + /** * 全部已读 */ diff --git a/src/layout/components/Sidebar/components/SidebarMenuItem.vue b/src/layout/components/Sidebar/components/SidebarMenuItem.vue index e45ec8d1..b742eadf 100644 --- a/src/layout/components/Sidebar/components/SidebarMenuItem.vue +++ b/src/layout/components/Sidebar/components/SidebarMenuItem.vue @@ -55,7 +55,7 @@ defineOptions({ }); import path from "path-browserify"; -import { isExternal } from "@/utils/index"; +import { isExternal } from "@/utils"; import { RouteRecordRaw } from "vue-router"; const props = defineProps({ diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index bfa301c1..f7d1ce1f 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -391,7 +391,6 @@ const getNoticeLevelTag = (type: number) => { function connectWebSocket() { WebSocketManager.getWebSocketClient("/topic/onlineUserCount", (message) => { - console.log("收到消息:", message); onlineUserCount.value = JSON.parse(message); }); } diff --git a/src/views/notice/index.vue b/src/views/notice/index.vue index 5957d303..f6c68d5e 100644 --- a/src/views/notice/index.vue +++ b/src/views/notice/index.vue @@ -29,8 +29,8 @@ v-loading="loading" :data="pageData" highlight-current-row - @selection-change="handleSelectionChange" > + @@ -95,20 +95,19 @@ @pagination="handleQuery()" /> +