fix: update some files
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m44s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m44s
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
## Context
|
||||
|
||||
顶部通知抽屉已经通过通知列表接口加载最近 10 条,但当前共享状态没有保存列表分页信息。分页应复用现有通知列表接口,避免新增接口或改变通知数据契约。
|
||||
|
||||
## Decisions
|
||||
|
||||
- Decision: 分页状态由通知 store 保存,包括当前页、每页数量和总条数;列表请求返回后整体替换 `recentNotifications`。
|
||||
- Decision: 页码切换使用 `GET /api/admin/notifications?page=<page>&page_size=10`,加载期间沿用现有 loading 状态。
|
||||
- Decision: 分类切换将页码重置为 1,并重新加载列表;不使用滚动事件触发请求。
|
||||
- Decision: 分页控件放在通知列表底部,列表区域继续保持固定高度,避免抽屉整体布局跳动。
|
||||
|
||||
## Risks / Trade-offs
|
||||
|
||||
- 分类当前由抽屉对已加载页面进行过滤,分类页的总数仍由通知列表接口返回的总体 `total` 表示;本次不扩展后端分类分页契约。
|
||||
@@ -0,0 +1,24 @@
|
||||
# Change: 通知抽屉改为分页浏览
|
||||
|
||||
## Why
|
||||
|
||||
顶部通知抽屉目前只展示最近 10 条通知,用户无法通过页码查看更早的通知。通知列表应使用明确的分页操作,避免依赖下滑加载更多的交互。
|
||||
|
||||
## What Changes
|
||||
|
||||
- 顶部通知抽屉增加页码分页控件,默认每页展示 10 条。
|
||||
- 切换页码时调用通知列表接口并替换当前列表,不追加滚动加载。
|
||||
- 切换通知分类时重置到第 1 页,并保持现有分类统计、已读和跳转行为。
|
||||
- 保留 `/api/admin/notifications` 的 `page`、`page_size` 分页参数和后端返回的 `total`。
|
||||
|
||||
## Impact
|
||||
|
||||
- Affected specs:
|
||||
- `notification-center`
|
||||
- Affected code:
|
||||
- `src/components/core/layouts/art-notification/index.vue`
|
||||
- `src/components/core/layouts/art-notification/style.scss`
|
||||
- `src/store/modules/notification.ts`
|
||||
- Out of scope:
|
||||
- 不改变通知接口、通知分类统计和已读接口。
|
||||
- 不接入下滑加载、无限滚动或新的实时推送机制。
|
||||
@@ -0,0 +1,22 @@
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Global Notification Bell
|
||||
|
||||
The admin frontend SHALL provide a global notification bell in the top navigation near the settings and user avatar entries.
|
||||
|
||||
#### Scenario: Display unread count
|
||||
|
||||
- **GIVEN** 用户已登录后台
|
||||
- **WHEN** 顶部导航加载未读通知数量
|
||||
- **THEN** 铃铛 MUST call `GET /api/admin/notifications/unread-count`
|
||||
- **AND** 数量 MUST display as `0`, `1` through `99`, or `99+`
|
||||
|
||||
#### Scenario: Open paginated notification drawer
|
||||
|
||||
- **WHEN** 用户点击顶部通知铃铛
|
||||
- **THEN** 页面 MUST display notification items from `GET /api/admin/notifications` using `page=1` and `page_size=10`
|
||||
- **AND** 抽屉 MUST provide 全部、审批、临期、同步/系统分类
|
||||
- **AND** 抽屉 MUST provide page controls based on the response `total`
|
||||
- **AND** changing page MUST replace the visible items instead of appending items from a scroll event
|
||||
- **AND** changing category MUST reset the page to 1
|
||||
- **AND** 抽屉 MUST provide an entry to `/notifications`
|
||||
@@ -0,0 +1,15 @@
|
||||
## 1. Notification State
|
||||
|
||||
- [x] 1.1 在通知 store 中保存当前页、每页数量和列表总数。
|
||||
- [x] 1.2 支持按指定页请求通知,并用新结果替换当前列表。
|
||||
|
||||
## 2. Notification Drawer
|
||||
|
||||
- [x] 2.1 在通知列表底部增加页码分页控件,默认每页 10 条。
|
||||
- [x] 2.2 切换页码时重新请求列表并回到列表顶部。
|
||||
- [x] 2.3 切换分类时重置页码并保持现有分类、已读和跳转行为。
|
||||
|
||||
## 3. Verification
|
||||
|
||||
- [x] 3.1 验证分页请求携带正确的 `page` 和 `page_size`,且列表不会累加旧页数据。
|
||||
- [x] 3.2 运行通知相关 lint、类型、格式、样式和编码检查;当前仓库暂无通知专项测试。
|
||||
Reference in New Issue
Block a user