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
+22
View File
@@ -17,6 +17,10 @@
<FetchSvg v-else size="24" :src="$conf.serviceHost + item.icon"
:color="index == activeIndex ? '#fff' : '#ececec'" />
<span>{{ item.name }}</span>
<!-- 「消息」入口未读角标(读 store,与 Header 铃铛同源) -->
<span v-if="item.url === '/msg' && store.unreadCount > 0" class="menu-badge">
{{ store.unreadCount > 99 ? "99+" : store.unreadCount }}
</span>
</a>
</li>
</template>
@@ -147,6 +151,7 @@ async function linkPage(item: any, index: number) {
flex-direction: column;
height: 100%;
li {
position: relative;
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
@@ -212,6 +217,23 @@ async function linkPage(item: any, index: number) {
margin-top: auto;
}
}
/* 「消息」入口未读角标:图标右上角红底白字胶囊(与 Header Badge 同源数据) */
.menu-badge {
position: absolute;
top: 6px;
right: 4px;
min-width: 16px;
height: 16px;
padding: 0 4px;
border-radius: 8px;
background: #f24822;
color: #fff;
font-size: 11px;
line-height: 16px;
text-align: center;
pointer-events: none;
}
.menu-arrow_box {
position: relative;
left: 62px;