# 用户管理接口适配实施计划 > **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:** 基于现有 Vue 3 + Element Plus 技术栈,扩展 Service 层方法,修改视图组件以利用后端返回的聚合数据(depts/roles),添加树形筛选组件支持部门和角色筛选。 **Tech Stack:** Vue 3, TypeScript, Element Plus, Vite --- ## 文件变更清单 | 文件 | 变更类型 | 说明 | |------|---------|------| | `admin-ui/src/service/user/userService.ts` | 修改 | 添加 aggregate 方法 | | `admin-ui/src/views/user/info/Index.vue` | 修改 | 添加部门/角色列和树形筛选 | | `admin-ui/src/views/user/info/UserDetailDialog.vue` | 修改 | 使用聚合接口展示完整信息 | | `admin-ui/src/views/user/info/UserFormDialog.vue` | 修改 | 从 row 解析 deptIds/roleIds | --- ## Task 1: 扩展 UserService 添加聚合查询方法 **Files:** - Modify: `admin-ui/src/service/user/userService.ts` - [ ] **Step 1: 添加 aggregate 方法到 UserService** 在 `UserService` 类中,在 `assignRoles` 方法后添加: ```typescript /** * 聚合查询用户完整信息(基础信息 + 部门列表 + 角色列表) */ async aggregate(userId: number | string): Promise { const res: any = await request({ url: `/user/admin/user/${userId}/aggregate`, method: 'get', }) return res.data } ``` - [ ] **Step 2: 验证语法** Run: `cd admin-ui && npx vue-tsc --noEmit --skipLibCheck src/service/user/userService.ts` Expected: 无错误输出 - [ ] **Step 3: Commit** ```bash git add admin-ui/src/service/user/userService.ts git commit -m "feat(user): add aggregate method to UserService for fetching user with depts and roles" ``` --- ## Task 2: 用户列表页添加部门/角色列和树形筛选 **Files:** - Modify: `admin-ui/src/views/user/info/Index.vue` - [ ] **Step 1: 导入必要的依赖** 在 `