Files
shanxia2.0/docs/superpowers/specs/2026-08-20-user-list-role-view-design.md
T
2026-08-21 09:35:11 +08:00

31 lines
1.2 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.
# 用户管理列表展示角色并可打开角色详情 — 设计文档
> **日期**: 2026-08-20
> **状态**: 已确认
> **仓库**: shanxia2.0(`backend/` + `web-admin/`)
> **方案**: A — 抽取 `RoleManageDialogs` 本页复用
## 已确认决策
| # | 决策 |
|---|------|
| D1 | 用户列表展示用户角色;点击角色打开与角色管理「查看」一致的弹窗 |
| D2 | 弹窗含菜单配置 / 数据权限 / 编辑 / 删除,本页复用角色管理逻辑(不跳转) |
| D3 | 抽取可复用组件,角色管理页与用户管理页共用 |
| D4 | 用户列表接口批量返回 `roleIds`;新增角色详情 GET 供按 id 打开查看 |
## 后端
- `GET /web/admin/users`:当前页用户批量查 `sys_user_role`,写入 `roleIds`
- `GET /web/admin/role-management/{role_id}`:返回单条角色(租户校验)
## 前端
- 新建 `web-admin/src/components/business/role-manage-dialogs/index.vue`
- 角色页改为挂载该组件;工具栏/列表查看调用 expose 方法
- 用户页增加「角色」列(可点 tag);挂载同一组件;用户详情中角色亦可点
## 不在范围
- 按角色筛选用户;改角色权限模型