Files
one-pipe-system/openspec/changes/add-polling-priority-queue/tasks.md
luo 5e7f5eaba4
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m3s
fix: some
2026-09-18 10:31:14 +08:00

31 lines
2.5 KiB
Markdown
Raw 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.
# Tasks: 轮询管理 - 优先队列
## 1. 类型
- [x] 1.1 新增 `src/types/api/pollingPriorityQueue.ts`:优先轮询项 `PollingPriorityItem``id` / `card_id` / `iccid` / `task_type` / `task_type_name` / `status` / `status_name` / `trigger_type` / `trigger_type_name` / `trigger_types` / `trigger_count` / `attempt_count` / `result` / `result_name` / `failure_reason` / `shop_id_snapshot` / `source_order_id` / `source_package_usage_id` / `manual_operator_id` / `manual_operator_name` / `manual_reason` / `claimed_at` / `last_triggered_at` / `created_at` / `updated_at`
- [x] 1.2 查询参数、分页响应 `PollingPriorityItemPageResult`、人工入队请求/响应、入队项 `PriorityItemResult` 类型
- [x] 1.3 `src/types/api/index.ts` 导出新类型
## 2. API
- [x] 2.1 新增 `src/api/modules/pollingPriorityQueue.ts`
- `getPriorityItems``GET /api/admin/polling-priority-items`,分页查询卡轮询优先项,按创建时间倒序,支持卡 `card_id`、任务类型 `task_type`、状态 `status`、触发类型 `trigger_type` 筛选
- `createPriorityItems``POST /api/admin/polling-priority-items`,人工优先入队,请求 `{ card_id, reason }`
- `getPriorityItemDetail``GET /api/admin/polling-priority-items/{id}`,查询单项详情
- [x] 2.2 `src/api/modules/index.ts` 导出新服务
## 3. 页面
- [x] 3.1 `src/router/routesAlias.ts` 新增优先队列路由别名,`src/router/routes/asyncRoutes.ts` 在轮询管理下注册路由与菜单
- [x] 3.2 新增 `src/views/polling-management/priority-queue/index.vue`:筛选(卡/任务类型/状态/触发类型)、分页、表格展示列表项字段
- [x] 3.3 实现任务类型、状态、触发类型、执行结果枚举映射与中文展示
- [x] 3.4 实现人工优先入队弹窗:选择卡、原因必填校验(最长 500 字符),提交后展示 created_count / merged_count / items
- [x] 3.5 实现单项详情查看(页面或抽屉),越权与不存在按同一错误处理
## 4. 常量与文案
- [x] 4.1 在 `src/config/constants/pollingPriorityQueue.ts` 登记任务类型/状态/触发类型/结果枚举与中文名称
- [x] 4.2 菜单与页面文案(与轮询管理其余页面一致使用中文文案,菜单标题「优先队列」)
## 5. Verification
- [x] 5.1 验证筛选与分页参数正确传递、列表按创建时间倒序
- [x] 5.2 验证人工入队成功/合并/原因校验(空与超长)
- [x] 5.3 验证详情接口与越权/不存在不区分
- [x] 5.4 运行 lint、类型检查与构建