diff --git a/src/components/Header.vue b/src/components/Header.vue index 81ea9fc..4b0658e 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -79,6 +79,9 @@ + + + @@ -236,7 +239,7 @@ import ContextMenu from "@/components/ContextMenu.vue"; import TeacherCopilotModal from "@/components/TeacherCopilotModal.vue"; import BaseApi from "@/api/BaseApi"; import MsgApprovalModal from "@/components/MsgApprovalModal.vue"; -import { Notice } from "view-ui-plus"; +import WsToastLayer from "@/components/WsToastLayer.vue"; import { IframePageParmas, RoleInfo } from "@/types"; import { isEqual, orderBy } from "lodash"; import UserSettingApi from "@/api/UserSettingApi"; @@ -249,6 +252,7 @@ import { openAppPage } from "@/utils/bschLinkPage"; const route = useRoute(); const router = useRouter(); +const wsToastRef = ref>(); const store = useDefaultStore(); const refMsgApproval = ref(); const { $conf } = useCurrentInstance(); @@ -338,11 +342,6 @@ async function connectMsgWs() { }; } -/** WS 通知标题用类型标签(appKey 属后端签名标识,帧消费已随 0e57022 口径移除) */ -function frameAppName(frame: any) { - return msgTypeLabel(frame ? frame.msgType : null); -} - function onNewMessage(frame: any) { // 他校新消息对当前学校口径无信息量(不计未读、不打扰、也不触发 /msg 页重拉) if (!bellVisibleForCurrentSchool(frame)) { @@ -351,11 +350,8 @@ function onNewMessage(frame: any) { store.incUnread(); // /msg 页开着时自刷新(页内监听该事件重拉第一页与摘要) mittBus.emit("msgCenter:newMessage", frame); - Notice.info({ - title: `【${frameAppName(frame)}】新消息`, - desc: frame.content || "", - duration: 5, - }); + // design/03 .ws-toast 实时卡片(2026-10-09):类型色条+图标章+进度条自动消退,点击进 /msg + wsToastRef.value?.push(frame); } /** @@ -533,11 +529,6 @@ async function changeRole(role: RoleInfo) { await loadLogoList(); } -/** 消息类型名(UserMsg msgType:0系统通知/1业务提醒/2审批待办);WS 帧缺 appName 时的降级标签 */ -function msgTypeLabel(msgType: number | null) { - return { 0: "系统通知", 1: "业务提醒", 2: "审批待办" }[msgType as 0 | 1 | 2] || "系统通知"; -} - async function wallpaperSuccess(response: any, file: any, fileListt: any) { await getUserWallpaperList(); } diff --git a/src/components/WsToastLayer.vue b/src/components/WsToastLayer.vue new file mode 100644 index 0000000..9f24753 --- /dev/null +++ b/src/components/WsToastLayer.vue @@ -0,0 +1,275 @@ + + + + + + {{ t.ic }} + + {{ t.name }} + {{ t.tm }} + + ✕ + + {{ t.title }}{{ t.content }} + + + {{ t.go }} + + + + + + + + +