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:
+14
-4
@@ -98,21 +98,31 @@ class Base extends Abstract {
|
||||
// ===== 消息中心代理(§3.5:经后端签名代理 UserMsg,前端不直连)=====
|
||||
|
||||
/**
|
||||
* 消息中心分页列表({total, list[]};元素含改写后的绝对 jumpUrl)
|
||||
* 消息中心分页列表({total, list[]};元素含改写后的绝对 jumpUrl)。
|
||||
* 可选服务端筛选:msgType 0/1/2、appKey、isRead 0/1、keyword 标题/内容模糊。
|
||||
* @memberof Basic
|
||||
*/
|
||||
getMsgCenterList(params: PageParams) {
|
||||
getMsgCenterList(params: PageParams & { msgType?: number; appKey?: string; isRead?: number; keyword?: string }) {
|
||||
const url = path + "/msgCenter/list";
|
||||
return this.getRequest<PageData>({ url, params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 铃铛摘要:未读数 + 各应用待办角标
|
||||
* 铃铛摘要:未读数 + 各应用待办角标 + 分类计数(sysUnread/bizUnread/approvalUnread/total/readCount,
|
||||
* 旧版 UserMsg 无 summary 端点时这些字段缺省,前端按降级处理)
|
||||
* @memberof Basic
|
||||
*/
|
||||
getMsgCenterSummary() {
|
||||
const url = path + "/msgCenter/summary";
|
||||
return this.getRequest<{ unreadCount: number; todos: { appKey: string; count: number }[] }>({ url });
|
||||
return this.getRequest<{
|
||||
unreadCount: number;
|
||||
todos: { appKey: string; count: number }[];
|
||||
sysUnread?: number;
|
||||
bizUnread?: number;
|
||||
approvalUnread?: number;
|
||||
total?: number;
|
||||
readCount?: number;
|
||||
}>({ url });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user