docs(spec+plan): 删除 AccountList 页(/accounts→/staff 重定向,总 spec 收尾)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
# 删除 AccountList 页 Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: superpowers:subagent-driven-development or superpowers:executing-plans.
|
||||
|
||||
**Goal:** 删除冗余 AccountList 页,`/accounts` 客户端重定向 `/staff`,清导航/注释;保留后端 `getAccounts`。
|
||||
|
||||
**Spec:** `docs/superpowers/specs/2026-08-08-yunke-delete-accountlist-design.md`(总 spec §115-122 收尾)。
|
||||
|
||||
## 关键事实(grep 已核实)
|
||||
- `router/index.ts:25-29` `/accounts` route;`MainLayout.vue:126` menu-item;`StaffList.vue:27,836` 注释;`api/index.ts:123` `getAccounts`(保留)。
|
||||
|
||||
## Task 1: 删除 AccountList + 重定向
|
||||
|
||||
**Files:** `router/index.ts`(改)、`views/AccountList.vue`(删)、`layouts/MainLayout.vue`(改)、`views/StaffList.vue`(改注释)。
|
||||
|
||||
- [ ] **Step 1: `router/index.ts` — 删 `/accounts` route + 加 redirect**
|
||||
|
||||
把
|
||||
```typescript
|
||||
{
|
||||
path: '/accounts',
|
||||
name: 'accounts',
|
||||
component: () => import('@/views/AccountList.vue'),
|
||||
meta: { title: '账号列表' },
|
||||
},
|
||||
```
|
||||
替换为重定向(放原位置):
|
||||
```typescript
|
||||
{
|
||||
path: '/accounts',
|
||||
redirect: { name: 'staff' },
|
||||
},
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 删 `yunkes/src/views/AccountList.vue`**
|
||||
```bash
|
||||
git rm yunkes/src/views/AccountList.vue
|
||||
```
|
||||
|
||||
- [ ] **Step 3: `layouts/MainLayout.vue` — 删 `/accounts` menu-item**
|
||||
删除 `<el-menu-item index="/accounts"> ... </el-menu-item>`(约 line 126,含其内容)。确认其它菜单项不受影响。
|
||||
|
||||
- [ ] **Step 4: `views/StaffList.vue` — 更新 2 处注释**
|
||||
- line ~27:` * Row click opens the all-fields drawer reused from AccountList.vue.` → ` * Row click opens the all-fields drawer (built via accountFields.ts).`
|
||||
- line ~836:`<!-- All-fields drawer (reused from AccountList.vue / accountFields.ts) -->` → `<!-- All-fields drawer (built via accountFields.ts) -->`
|
||||
|
||||
- [ ] **Step 5: vue-tsc + grep 兜底**
|
||||
```bash
|
||||
cd /d/refactor/yunke/yunkes && npx vue-tsc -b # exit 0(无悬空 AccountList import)
|
||||
```
|
||||
grep `AccountList` 在 `yunkes/src` 应无残留 UI 引用(`api/index.ts` 的 getAccounts 不算)。
|
||||
|
||||
- [ ] **Step 6: 浏览器实测**
|
||||
访问 `http://localhost:5173/accounts` → URL 变 `/staff`、StaffList 渲染;导航菜单无「账号」;StaffList 正常(`getAccounts` 工作)。
|
||||
|
||||
- [ ] **Step 7: Commit**
|
||||
```bash
|
||||
git add yunkes/src/router/index.ts yunkes/src/layouts/MainLayout.vue yunkes/src/views/StaffList.vue
|
||||
git commit -m "chore(ui): 删除冗余 AccountList 页,/accounts 重定向 /staff(总 spec 收尾)"
|
||||
```
|
||||
End with blank line + `Co-Authored-By: Claude <noreply@anthropic.com>`。
|
||||
(`AccountList.vue` 已 Step 2 `git rm` 暂存,一并入 commit。)
|
||||
|
||||
## 验收
|
||||
- `vue-tsc -b` exit 0;grep 无 AccountList UI 残留。
|
||||
- 浏览器:`/accounts`→`/staff` 客户端重定向 + StaffList 渲染;菜单无「账号」;getAccounts 仍工作。
|
||||
|
||||
## 风险
|
||||
- 悬空 import → vue-tsc 报错(grep + 编译兜底)。
|
||||
- redirect 用 `name:'staff'`(staff 路由存在,已核实)。
|
||||
@@ -0,0 +1,53 @@
|
||||
# 删除 AccountList 页(/accounts → /staff 重定向)设计
|
||||
|
||||
> 日期:2026-08-08|分支:`feat/yunke-data-mirror`|总 spec 收尾(§「AccountList 删除清单」L115-122)
|
||||
> 背景:AccountList(`/accounts`)与 StaffList(`/staff`)内容重复,云客无此页。总 spec 定:删路由+文件+导航入口,`/accounts`→`/staff` 客户端重定向;**保留后端 `GET /api/accounts` 与前端 `getAccounts()`**(StaffList 依赖)。
|
||||
|
||||
## 1. 目标与范围
|
||||
|
||||
**目标**:删除冗余的 AccountList 页,`/accounts` 客户端重定向到 `/staff`,清理导航入口与过期注释。
|
||||
|
||||
**改动(纯前端)**:
|
||||
1. `yunkes/src/router/index.ts`:移除 `/accounts` 路由记录;新增 `/accounts` → `/staff` 重定向(放在 customers 路由附近)。
|
||||
2. 删除 `yunkes/src/views/AccountList.vue`。
|
||||
3. `yunkes/src/layouts/MainLayout.vue`:移除指向 `/accounts` 的 `<el-menu-item>`。
|
||||
4. `yunkes/src/views/StaffList.vue`:更新 2 处注释("reused from AccountList.vue" → "reused from accountFields.ts")—— drawer 实际来自 `accountFields.ts`,与 AccountList.vue 无文件依赖。
|
||||
|
||||
**不动(保留数据层)**:
|
||||
- `yunkes/src/api/index.ts` 的 `getAccounts()`(→ 后端 `/api/accounts`)—— StaffList `loadTab` 依赖,**不删**。
|
||||
- 后端 `GET /api/accounts`、`Account` 模型—— 不动。
|
||||
|
||||
**不在本 plan**:
|
||||
- StaffList 本身的改动(仅注释)。
|
||||
- 后端任何改动。
|
||||
|
||||
## 2. 关键事实(plan 核实,grep `AccountList|/accounts|'accounts'`)
|
||||
|
||||
- `router/index.ts:25-29`:`/accounts` route(name 'accounts', component AccountList.vue)。
|
||||
- `MainLayout.vue:126`:`<el-menu-item index="/accounts">`。
|
||||
- `StaffList.vue:27, 836`:注释提及 AccountList.vue。
|
||||
- `api/index.ts:123`:`getAccounts` 调 `/accounts`(后端,保留)。
|
||||
- 无其它 UI 引用(无 `router.push({name:'accounts'})`、无其它 `/accounts` 链接)。
|
||||
- `/` 重定向到 `customers`;catch-all `/:pathMatch(.*)*` → customers。
|
||||
|
||||
## 3. 文件清单
|
||||
|
||||
- 改 `yunkes/src/router/index.ts`(删 route + 加 redirect)。
|
||||
- 删 `yunkes/src/views/AccountList.vue`。
|
||||
- 改 `yunkes/src/layouts/MainLayout.vue`(删 menu-item)。
|
||||
- 改 `yunkes/src/views/StaffList.vue`(2 处注释)。
|
||||
- **不改** `api/index.ts`、后端。
|
||||
|
||||
## 4. 验收
|
||||
|
||||
- `vue-tsc -b` exit 0(无对 AccountList 的悬空引用)。
|
||||
- **浏览器实测**(本地,无云客):
|
||||
- 访问 `/accounts` → URL 变 `/staff`、StaffList 渲染(客户端重定向,非 HTTP 301)。
|
||||
- 导航菜单无「账号」入口;其它菜单项不变。
|
||||
- StaffList 正常加载(`getAccounts` 仍工作)。
|
||||
- grep 全仓 `AccountList` 无 UI 残留引用(`api/index.ts` 的 `getAccounts`/`/accounts` 是后端调用,不算 UI 残留)。
|
||||
|
||||
## 5. 风险
|
||||
|
||||
- **悬空引用**:若有遗漏的 `AccountList` import/`name:'accounts'` → vue-tsc 报错(plan grep 兜底)。
|
||||
- **重定向 vs 路由匹配**:Vue Router 同路径 redirect + 无 component 即可;`/accounts` redirect 到 `name:'staff'`。
|
||||
Reference in New Issue
Block a user