feat(msg): 计数口径改消息总数 + 标识切换 appId
build / build (push) Successful in 43s

- 按分类计数改分类总数(sysTotal/bizTotal/approvalTotal,与列表内容对齐),已读=已读总数、全部=全部总数
- 按应用角标改 countByApp 按应用消息总数(含已读,已读后不清零),总数>0 才显示、总数降序
- 应用匹配/筛选全面改 appId:行与计数出参带 appId、筛选传 appId,appKey 不再出现在消息中心前端
This commit is contained in:
chenxing
2026-10-08 16:37:22 +08:00
parent 3250de382a
commit f9f97db272
2 changed files with 49 additions and 44 deletions
+13 -9
View File
@@ -107,18 +107,18 @@ class Base extends Abstract {
// ===== 消息中心代理(§3.5:经后端签名代理 UserMsg,前端不直连)=====
/**
* 消息中心分页列表({total, list[]};元素含改写后的绝对 jumpUrl)。
* 可选服务端筛选:msgType 0/1/2、appKey、isRead 0/1、keyword 标题/内容模糊。
* 消息中心分页列表({total, list[]};元素含改写后的绝对 jumpUrl、appId/appName)。
* 可选服务端筛选:msgType 0/1/2、appId(注册表应用 id)、isRead 0/1、keyword 标题/内容模糊。
* @memberof Basic
*/
getMsgCenterList(params: PageParams & { msgType?: number; appKey?: string; isRead?: number; keyword?: string }) {
getMsgCenterList(params: PageParams & { msgType?: number; appId?: string; isRead?: number; keyword?: string }) {
const url = path + "/msgCenter/list";
return this.getRequest<PageData>({ url, params });
}
/**
* 铃铛摘要:未读数 + 各应用待办角标 + 分类计数(sysUnread/bizUnread/approvalUnread/total/readCount,
* 旧版 UserMsg 无 summary 端点时这些字段缺省,前端按降级处理)
* 铃铛摘要:未读数 + 各应用待办角标 + 分类计数(sysUnread/bizUnread/approvalUnread 为未读口径,
* sysTotal/bizTotal/approvalTotal/total/readCount 为总数口径;旧版 UserMsg 无这些端点字段时缺省,前端按降级处理)
* @memberof Basic
*/
getMsgCenterSummary() {
@@ -129,18 +129,22 @@ class Base extends Abstract {
sysUnread?: number;
bizUnread?: number;
approvalUnread?: number;
sysTotal?: number;
bizTotal?: number;
approvalTotal?: number;
total?: number;
readCount?: number;
}>({ url });
}
/**
* 消息中心:按来源应用未读数映射(「按应用」清单角标):{appKey: 未读数},无未读的 appKey 不出现
* 消息中心:按来源应用消息计数(「按应用」清单角标):[{appId, appName, total, unread}],
* total 含已读;无消息的应用不出现
* @memberof Basic
*/
getMsgCenterUnreadCountByApp() {
const url = path + "/msgCenter/unreadCountByApp";
return this.getRequest<Record<string, number>>({ url });
getMsgCenterCountByApp() {
const url = path + "/msgCenter/countByApp";
return this.getRequest<{ appId: number | null; appName: string | null; total: number; unread: number }[]>({ url });
}
/**