feat(user): 优化用户审核功能及新增店名显示

- 在用户模型中新增 storeName 字段以支持店名信息
- 用户列表页增加“店名”列,支持表格内显示及提示完整信息
- 审核弹窗新增单条审核时的关键信息展示,包括店名、姓名及所在地区
- 优化审核弹窗逻辑,批量审核时不展示单条用户信息
- 精简待审核用户专用页,固定只显示审核状态为“待审核”的用户
- 待审核页删除高级筛选功能,仅保留关键字搜索
- 保留待审核页的角色、注册来源、审核状态列展示,满足显示需求
- 调整用户列表页操作项样式,统一使用 a-space 包装,提升界面一致性
This commit is contained in:
2026-07-12 00:44:58 +08:00
parent 423d82d9c6
commit 12375b2fc1
4 changed files with 780 additions and 57 deletions

View File

@@ -40,18 +40,6 @@
<a-select-option :value="2">普通用户</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="审核状态">
<a-select
v-model:value="searchWhere.auditStatus"
placeholder="全部"
allow-clear
style="width: 140px"
>
<a-select-option :value="0">待审核</a-select-option>
<a-select-option :value="1">通过</a-select-option>
<a-select-option :value="2">拒绝</a-select-option>
</a-select>
</a-form-item>
<a-form-item>
<a-button type="primary" @click="reload()">搜索</a-button>
<a-button style="margin-left: 8px" @click="resetSearch">重置</a-button>
@@ -96,17 +84,6 @@
:disabled="selection.length === 0"
>重置密码
</a-button>
<a-button
type="primary"
class="ele-btn-icon"
@click="openBatchAudit"
:disabled="selection.length === 0"
>
<template #icon>
<CheckCircleOutlined />
</template>
<span>批量审核</span>
</a-button>
<a-button
danger
type="primary"
@@ -151,6 +128,9 @@
<template v-if="column.key === 'nickname'">
<span>{{ record.nickname }}</span>
</template>
<template v-if="column.key === 'storeName'">
<span :title="record.storeName">{{ record.storeName || '-' }}</span>
</template>
<template v-if="column.key === 'mobile'">
<span v-if="hasRole('superAdmin')">{{ record.phone }}</span>
<span v-else>{{ record.mobile }}</span>
@@ -195,13 +175,10 @@
<!-- />-->
</template>
<template v-if="column.key === 'action'">
<div>
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" v-if="record.auditStatus === 0" />
<a v-if="record.auditStatus === 0" @click.stop="openAudit(record)">审核</a>
<a-divider type="vertical" v-if="record.auditStatus === 0" />
<a-divider type="vertical" />
<!-- <a @click="resetPsw(record)">重置</a>-->
<!-- <a-divider type="vertical" />-->
<a-popconfirm
placement="topRight"
title="确定要删除此用户吗?"
@@ -209,7 +186,7 @@
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</div>
</a-space>
</template>
</template>
</ele-pro-table>
@@ -232,6 +209,22 @@
@ok="submitAudit"
>
<a-form :model="auditForm" layout="vertical">
<div
v-if="!batchAudit && currentAuditUser"
class="audit-user-info"
style="margin-bottom: 16px; padding: 12px; background: #f5f5f5; border-radius: 4px;"
>
<p style="margin-bottom: 8px;">
<strong>店名</strong>{{ currentAuditUser.storeName || '-' }}
</p>
<p style="margin-bottom: 8px;">
<strong>姓名</strong>{{ currentAuditUser.realName || currentAuditUser.nickname || '-' }}
</p>
<p style="margin-bottom: 0;">
<strong>所在地区</strong>
{{ [currentAuditUser.province, currentAuditUser.city, currentAuditUser.region].filter(Boolean).join(' ') || '-' }}
</p>
</div>
<a-form-item label="审核结果">
<a-radio-group v-model:value="auditForm.status">
<a-radio :value="1">通过</a-radio>
@@ -317,6 +310,8 @@
const showAudit = ref(false);
// 是否批量审核
const batchAudit = ref(false);
// 当前审核用户(单条审核时显示详情)
const currentAuditUser = ref<User | null>(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);
}
};