Files
zkxw/docs/superpowers/plans/2026-08-05-role-list-bound-users-posts.md
T
zlwuandCursor de22678c87 feat: ship OA drafts/badges, role dual-track, and test-env deploy tooling.
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>
2026-08-06 13:58:47 +08:00

1.3 KiB
Raw Blame History

角色列表有效用户与关联职位 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: 后端在 list_roles 批量 enrichment boundUserNames / boundPostNames;前端对齐职位列表的 link 与多值换行单元格。

Tech Stack: FastAPI/SQLAlchemy、Vue 3 + Element Plus


Task 1: 后端 enrichment

Files: backend/app/crud/role.py, backend/tests/test_role_list_bound_names.py

  • 实现 _bound_user_names_by_role_ids、_bound_post_names_by_role_ids
  • list_roles / _row_to_dict 输出新字段
  • 空入参与 enrichment 调用的单测

Task 2: 前端列表

Files: web-admin/src/types/api.d.ts, web-admin/src/views/system/role/index.vue

  • RoleItem 增加字段
  • 角色名称 link → handleView
  • 「拥有用户」「关联职位」两列

Task 3: 验证与图谱

  • pytest 相关用例(4 passed)
  • ./scripts/update-graph.sh backend(graphify 因节点数变化拒绝覆盖,可后续 force 重跑)