Files
luo d1ff4d5f6c
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m7s
feat: 顶部通知铃铛与站内通知中心
2026-07-24 17:12:29 +08:00

40 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 1. Contract And Types
- [x] 1.1 按产品文档落地通知项、未读统计、未读摘要、分页列表和受控目标响应字段。
- [x] 1.2 按产品文档落地分类、通知类型、严重级别、已读状态和 `ref_type` 兼容类型。
- [x] 1.3 新增通知中心菜单权限 `notifications:view`、单条已读权限 `notifications:read`、全部已读权限 `notifications:read_all`
- [x] 1.4 新增 `notification.ts` API service覆盖未读数、摘要、列表、单条已读、全部已读和目标接口。
- [x] 1.5 新增通知实体、筛选参数、分页响应和目标响应类型。
## 2. Global Header And Drawer
- [x] 2.1 在顶部设置按钮与用户头像入口区域增加通知铃铛。
- [x] 2.2 实现未读数量格式化为 `0``1``99``99+`
- [x] 2.3 顶部抽屉加载最近 10 条通知,并按全部、审批、临期、同步/系统分类展示。
- [x] 2.4 替换 `ArtNotification` 静态 mock 数据,接入真实摘要接口。
- [x] 2.5 提供进入 `/notifications` 通知中心的入口,并保证桌面端和移动端布局可用。
## 3. Notification Center
- [x] 3.1 新增 `/notifications` 路由和通知中心页面。
- [x] 3.2 支持分类、通知类型、严重级别和已读状态筛选。
- [x] 3.3 展示通知标题、正文、严重级别、分类、时间和已读状态。
- [x] 3.4 实现全部已读,并在成功后同步未读数和列表状态。
- [x] 3.5 处理空列表、加载失败、权限失败和未知枚举值的稳定展示。
## 4. Read And Controlled Navigation
- [x] 4.1 点击通知时先调用 `PUT /api/admin/notifications/{id}/read`
- [x] 4.2 已读成功后调用 `GET /api/admin/notifications/{id}/target` 获取受控目标。
- [x] 4.3 仅允许跳转到后端返回且前端路由表认可的内部目标。
- [x] 4.4 未知 `ref_type`、目标不存在或无权限时只展示正文,不执行任意 URL 跳转。
- [x] 4.5 抽屉和通知中心的已读操作后刷新共享未读数。
## 5. Verification
- [x] 5.1 验证余额、临期、审批和系统通知在抽屉及通知中心展示一致。
- [x] 5.2 验证未读数在单条已读、全部已读、抽屉关闭和页面刷新后与接口结果一致。
- [x] 5.3 验证通知点击不会跳转到任意外部或未注册 URL。
- [x] 5.4 验证未知目标通知仍可查看正文且不会阻塞其他通知操作。
- [x] 5.5 运行类型检查、lint、相关测试和构建。