Add approval instance drafts with menu badges, dual-track user/role read model and role bound names, form-designer outline docs, and bare-metal test deploy scripts. Ignore local test-server credential file. Co-authored-by: Cursor <cursoragent@cursor.com>
1.8 KiB
OA 草稿箱/待办菜单角标 Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: 侧栏「草稿箱」「待办中心」展示数量角标,对齐「抄送我的」。
Architecture: 后端增加轻量 count 接口;前端扩展 oa-menu-badge store 与 refreshOaMenuBadges,在相关页操作后刷新。
Tech Stack: FastAPI / SQLAlchemy / Vue 3 / Pinia
Spec: docs/superpowers/specs/2026-08-06-oa-drafts-pending-menu-badge-design.md
Task 1: Backend count helpers + API
Files:
-
Modify:
backend/app/services/oa_engine.py(count_pending_tasks) -
Modify:
backend/app/crud/oa_instance_draft.py(count_drafts) -
Modify:
backend/app/api/oa_approval.py -
Test:
backend/tests/test_oa_menu_badge_counts.py -
Step 1: 写失败单测(mock query.count)
-
Step 2: 实现
count_pending_tasks/count_drafts+ 路由 -
Step 3: 跑通 pytest
Task 2: Frontend badge wiring
Files:
-
Modify:
web-admin/src/store/modules/oa-menu-badge.ts -
Modify:
web-admin/src/utils/oa-menu-badge.ts -
Modify:
web-admin/src/api/oaApproval.ts -
Modify:
web-admin/src/views/oa-approval/drafts/index.vue -
Modify:
web-admin/src/views/oa-approval/pending/index.vue -
Modify:
web-admin/src/views/oa-approval/start/index.vue -
Modify:
web-admin/src/views/oa-approval/instances/detail.vue -
Modify:
web-admin/src/store/modules/user.ts -
Step 1: API + store codes + refresh 并行拉取
-
Step 2: 页面操作后 refresh;logout clear
-
Step 3: 更新 graphify(frontend + backend;HTML viz 过大时跳过)