收敛Salon网页后台管理范围

This commit is contained in:
2026-09-04 15:17:08 +08:00
parent c0a51a278e
commit 89c9deeeb2
5 changed files with 25 additions and 45 deletions
+12 -22
View File
@@ -1,10 +1,10 @@
<template>
<div class="users">
<a-page-header v-if="!isMobile" title="用户管理" sub-title="管理系统用户" />
<a-page-header v-if="!isMobile" title="店长账号" sub-title="管理店长账号及店铺授权" />
<section v-else class="admin-page-intro">
<span class="admin-page-intro__eyebrow">经营</span>
<h1 class="admin-page-intro__title">用户管理</h1>
<h1 class="admin-page-intro__title">店长账号</h1>
<div class="admin-page-intro__meta">
<span class="admin-page-chip">用户 {{ userList.length }}</span>
</div>
@@ -12,7 +12,7 @@
<a-card :bordered="false">
<template #title v-if="isMobile">
用户列表
店长账号列表
</template>
<template #extra>
<div class="admin-toolbar" :class="{ 'admin-toolbar--stacked': isMobile }">
@@ -26,7 +26,7 @@
<template #icon>
<PlusOutlined />
</template>
新增用户
新增店长
</a-button>
</div>
</template>
@@ -49,12 +49,6 @@
{{ shop.shopName }}
</a-select-option>
</a-select>
<a-select v-model:value="typeFilter" allow-clear placeholder="用户类型" style="width: 140px" @change="handleSearch">
<a-select-option :value="0">普通用户</a-select-option>
<a-select-option :value="2">店长</a-select-option>
<a-select-option :value="3">美甲师</a-select-option>
<a-select-option :value="4">管理员</a-select-option>
</a-select>
<a-select v-model:value="vipLevelFilter" allow-clear placeholder="VIP等级" style="width: 140px" @change="handleSearch">
<a-select-option v-for="level in vipLevelOptions" :key="level" :value="level">{{ level }}</a-select-option>
</a-select>
@@ -206,7 +200,7 @@
<AdminResponsiveModal
v-model:open="modalVisible"
:title="isEdit ? '编辑用户' : '新增用户'"
:title="isEdit ? '编辑店长' : '新增店长'"
:confirm-loading="modalLoading"
@ok="handleModalOk"
@cancel="handleModalCancel"
@@ -285,7 +279,7 @@
v-if="!isEdit"
label="密码"
name="password"
extra="留空则使用参数管理中配置的后台新增用户默认密码"
extra="留空则使用参数管理中配置的店长默认密码"
>
<a-input-password
v-model:value="formState.password"
@@ -314,7 +308,7 @@
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="用户类型" name="type">
<a-form-item label="用户类型" name="type" style="display: none">
<a-select v-model:value="formState.type" placeholder="请选择用户类型">
<a-select-option
v-for="option in availableUserTypeOptions"
@@ -537,7 +531,7 @@
<AdminMobileFab
:visible="isMobile && canCreateUser && !modalVisible && !viewModalVisible && !assetModalVisible"
label="新增用户"
label="新增店长"
@click="showAddModal"
/>
</div>
@@ -687,7 +681,7 @@ const shopFilter = ref<string | undefined>()
* Purpose: typeFilter supports UsersView.vue by holding or executing the type filter page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const typeFilter = ref<number | undefined>()
const typeFilter = ref<number | undefined>(2)
/**
* Purpose: vipLevelFilter supports UsersView.vue by holding or executing the vip level filter page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
@@ -875,7 +869,7 @@ const formState = reactive({
wechatId: '',
wechatQrCode: '',
password: '',
type: 0,
type: 2,
shopIds: [] as string[]
})
@@ -1382,7 +1376,7 @@ const fetchUserList = async () => {
const resetFilters = () => {
searchText.value = ''
shopFilter.value = currentUserType.value !== 4 ? normalizeShopId(currentUserInfo?.shopId) : undefined
typeFilter.value = undefined
typeFilter.value = 2
vipLevelFilter.value = undefined
statusFilter.value = undefined
createdRange.value = undefined
@@ -1393,10 +1387,6 @@ const resetFilters = () => {
/** resetFormState is a local helper used by this page script. */
const resetFormState = () => {
const defaultUserType = currentUserType.value === 4 && shopList.value.length === 0
? availableUserTypeOptions.value.find(option => option.value === 4)?.value
: availableUserTypeOptions.value[0]?.value
Object.assign(formState, {
account: '',
nickname: '',
@@ -1406,7 +1396,7 @@ const resetFormState = () => {
wechatId: '',
wechatQrCode: '',
password: '',
type: defaultUserType ?? 0,
type: 2,
shopIds: currentUserType.value !== 4 && currentUserInfo?.shopId
? [normalizeShopId(currentUserInfo.shopId)!]
: []