feat(msgcenter): /msg 换真实数据——服务端筛选+滚动分页、铃铛直跳、unreadCount 上提 store、WS 通知带应用名

- views/msg/index.vue:数据层整体替换(msgType 0/1/2 映射、isRead 1=已读、fmtTime 重写绝对时间);列表走 msgCenter/list 服务端筛选(msgType/appKey/isRead/keyword 防抖 300ms),滚动到底追加下一页,切视图/搜索重置第 1 页;左栏分类计数走 summary(旧版 UserMsg 缺字段降级显示 —),应用清单取 store 应用列表、计数同源 todos;点击卡片标已读、全部已读、去处理(showJump/jumpUrl)、审批直批(共享弹窗);失败态有重试;WS 新消息经 mittBus 自刷新
- components/Header.vue:铃铛直跳 /msg(移除 Poptip 浮层与 900 宽 Modal 及 columns/tableApi 死代码);unreadCount 上提 pinia store(角标与 /msg、LeftMenu 同源);WS Notice.info 标题带应用名(appKey 匹配 store 应用列表,缺失回退类型标签);壁纸/LOGO Modal 不动
- components/MsgApprovalModal.vue(新增):审批直批弹窗抽共享组件,逻辑照抄原 Header 内联实现(同意可选意见/拒绝必填校验/三种失败反馈)
- components/LeftMenu.vue:「消息」入口(url=/msg)未读角标(读 store,红底白字胶囊)
- store/index.ts:unreadCount + setUnreadCount/incUnread/decUnread
- api/BaseApi.ts:getMsgCenterList 参数类型放宽(服务端筛选项);getMsgCenterSummary 返回类型补分类计数字段(可缺省)
- assets/styles/header.scss:删除消息浮层死样式 .message-wrap 段
This commit is contained in:
chenxing
2026-09-30 12:37:30 +08:00
parent e91ce14408
commit 0f7101983e
7 changed files with 451 additions and 514 deletions
+12
View File
@@ -13,6 +13,8 @@ export interface IdefaultStore {
curUserMenuList: Array<any>; //当前角色菜单
curUserAppList: Array<any>; //当前角色所有应用
curRoleUid: string | null; //当前角色uid
/** 未读消息数(msgCenter/summary 拉取 + WS newMessage 实时累加;Header 角标与 /msg 页左栏同源) */
unreadCount: number;
// curUsedAppList: Array<any>; //当前角色常用应用
}
@@ -50,12 +52,22 @@ export const useDefaultStore = defineStore("defaultStore", {
curUserAppList: [],
curUserMenuList: [],
curRoleUid: null,
unreadCount: 0,
};
},
actions: {
setCurRoleInfo(info: RoleInfo) {
this.curRoleInfo = info;
},
setUnreadCount(count: number) {
this.unreadCount = Math.max(0, count || 0);
},
incUnread() {
this.unreadCount += 1;
},
decUnread() {
this.unreadCount = Math.max(0, this.unreadCount - 1);
},
setCurUserSettingsInfo(info: UserSettingInfo) {
this.curUserSettingInfo = info;
},