From 12375b2fc17a5a1c75b5e3f2dcd75980b4ef7a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Sun, 12 Jul 2026 00:44:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(user):=20=E4=BC=98=E5=8C=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=AE=A1=E6=A0=B8=E5=8A=9F=E8=83=BD=E5=8F=8A=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=BA=97=E5=90=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在用户模型中新增 storeName 字段以支持店名信息 - 用户列表页增加“店名”列,支持表格内显示及提示完整信息 - 审核弹窗新增单条审核时的关键信息展示,包括店名、姓名及所在地区 - 优化审核弹窗逻辑,批量审核时不展示单条用户信息 - 精简待审核用户专用页,固定只显示审核状态为“待审核”的用户 - 待审核页删除高级筛选功能,仅保留关键字搜索 - 保留待审核页的角色、注册来源、审核状态列展示,满足显示需求 - 调整用户列表页操作项样式,统一使用 a-space 包装,提升界面一致性 --- .workbuddy/memory/2026-07-12.md | 46 ++ src/api/system/user/model/index.ts | 2 + src/views/system/user/index.vue | 108 ++-- src/views/system/user/pending/index.vue | 681 ++++++++++++++++++++++++ 4 files changed, 780 insertions(+), 57 deletions(-) create mode 100644 .workbuddy/memory/2026-07-12.md create mode 100644 src/views/system/user/pending/index.vue diff --git a/.workbuddy/memory/2026-07-12.md b/.workbuddy/memory/2026-07-12.md new file mode 100644 index 0000000..549e64c --- /dev/null +++ b/.workbuddy/memory/2026-07-12.md @@ -0,0 +1,46 @@ +# 2026-07-12 工作日志 + +## 用户审核弹窗与列表增加店名/姓名/地区信息 + +针对用户管理 `system/user` 的审核功能做信息补全: + +### 1. 新增字段 +- `src/api/system/user/model/index.ts`:在 `User` 接口增加 `storeName?: string`(店名)。 + +### 2. 用户列表增加「店名」列 +- `src/views/system/user/index.vue`: + - 列配置在「昵称」后新增 `storeName` 列(`title: '店名'`,`align: 'center'`,`ellipsis: true`)。 + - `bodyCell` 渲染分支:空值显示 `-`,保留 `title` 提示完整店名。 + +### 3. 审核弹窗展示用户关键信息 +- 新增响应式变量 `currentAuditUser`。 +- `openAudit(row)` 时把当前行记录赋给 `currentAuditUser`;`openBatchAudit` 时清空(批量审核不展示单条信息)。 +- 审核弹窗顶部增加信息区(仅单条审核时展示): + - **店名**:`currentAuditUser.storeName || '-'` + - **姓名**:`currentAuditUser.realName || currentAuditUser.nickname || '-'`(真实姓名优先,无则取昵称) + - **所在地区**:`province + city + region` 拼接,空则显示 `-` + +### 验证 +- `vue-tsc --noEmit` 类型检查:本次改动文件无新增错误(列出的报错均为项目既有错误:`$router`、`getPageTitle`、`loginUser`/`updateIsAdmin` 未使用、导出数组隐式 any 等,与本次无关)。 +- 落地核对:模型 `storeName` 1 处、页面列配置 1 处、`bodyCell` 渲染 1 处、`currentAuditUser` 变量 7 处、弹窗信息区字段各 1 处。 + +## 待审核用户专用页 `/system/user/pending` 精简 + +`src/views/system/user/pending/index.vue` 已存在(基于 user 列表的副本)。按用户要求改造: + +### 1. 只显示待审核用户 +- `datasource` 改为固定 `auditStatus: 0`,不再读取筛选条件。 + +### 2. 删除高级筛选区(角色/注册来源/类型/审核状态 4个下拉 + 搜索/重置按钮) +- 模板删除整个 `` 高级筛选区。 +- 脚本删除 `searchWhere` reactive、`resetSearch`、`roles` 变量、`filters()` 调用。 +- 删除已无用的 `listRoles` import。 +- 顶部关键词搜索框(`a-input-search`)保留。 + +### 注意点(待用户确认) +- 列表的「角色」列、「注册来源」列、「审核状态」列均**保留**(用户要求删除的是筛选"功能",非列表展示列)。其中「审核状态」列在待审核页全会显示"待审核",若用户也想删列表列需再告知。 +- 工具栏「新建/修改/重置密码/批量审核/批量删除/导入/导出」按钮保留未动。 + +### 验证 +- `vue-tsc --noEmit`:本页面无新增类型错误(残留报错均为项目既有问题)。 +- 落地核对:高级筛选残留 0、searchWhere/resetSearch/roles/filters/listRoles 残留 0、datasource 固定 auditStatus:0 = 1。 diff --git a/src/api/system/user/model/index.ts b/src/api/system/user/model/index.ts index f34fb2f..4083c2c 100644 --- a/src/api/system/user/model/index.ts +++ b/src/api/system/user/model/index.ts @@ -135,6 +135,8 @@ export interface User { auditRemark?: string; // 审核时间 auditTime?: string; + // 店名 + storeName?: string; } /** diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 7f88376..8b31639 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -40,18 +40,6 @@ 普通用户 - - - 待审核 - 通过 - 拒绝 - - 搜索 重置 @@ -96,17 +84,6 @@ :disabled="selection.length === 0" >重置密码 - - - 批量审核 - {{ record.nickname }} + @@ -232,6 +209,22 @@ @ok="submitAudit" > + 通过 @@ -317,6 +310,8 @@ const showAudit = ref(false); // 是否批量审核 const batchAudit = ref(false); + // 当前审核用户(单条审核时显示详情) + const currentAuditUser = ref(null); // 审核弹窗标题 const auditTitle = ref('审核用户'); // 审核表单 @@ -479,26 +474,26 @@ key: 'birthday', hideInTable: true }, - { - title: '省份', - dataIndex: 'province', - key: 'province', - hideInTable: true - }, - { - title: '城市', - dataIndex: 'city', - key: 'city', - hideInTable: true, - showSorterTooltip: false - }, - { - title: '地区', - dataIndex: 'region', - key: 'region', - hideInTable: true, - showSorterTooltip: false - }, + // { + // title: '省份', + // dataIndex: 'province', + // key: 'province', + // hideInTable: true + // }, + // { + // title: '城市', + // dataIndex: 'city', + // key: 'city', + // hideInTable: true, + // showSorterTooltip: false + // }, + // { + // title: '地区', + // dataIndex: 'region', + // key: 'region', + // hideInTable: true, + // showSorterTooltip: false + // }, { title: '邮箱认证', dataIndex: 'emailVerified', @@ -526,13 +521,6 @@ align: 'center', width: 90 }, - { - title: '审核状态', - dataIndex: 'auditStatus', - key: 'auditStatus', - align: 'center', - width: 100 - }, { title: '管理员', key: 'isAdmin', @@ -684,6 +672,7 @@ /* 打开单条审核弹窗 */ const openAudit = (row: User) => { batchAudit.value = false; + currentAuditUser.value = row; auditForm.userId = row.userId; auditForm.status = 1; auditForm.remark = ''; @@ -698,6 +687,7 @@ return; } batchAudit.value = true; + currentAuditUser.value = null; auditForm.userId = undefined; auditForm.status = 1; auditForm.remark = ''; @@ -830,7 +820,11 @@ const customRow = (record: User) => { return { // 行点击查看用户详情 - onClick: () => { + // onClick: () => { + // openInfo(record); + // }, + // 行双击事件 + onDblclick: () => { openInfo(record); } }; diff --git a/src/views/system/user/pending/index.vue b/src/views/system/user/pending/index.vue new file mode 100644 index 0000000..95b557d --- /dev/null +++ b/src/views/system/user/pending/index.vue @@ -0,0 +1,681 @@ + + + + + + +