收敛Salon网页后台管理范围
This commit is contained in:
@@ -24,8 +24,7 @@ export const ADMIN_DASHBOARD_PATH = '/admin/dashboard'
|
|||||||
|
|
||||||
export const adminNavigationItems: AdminNavigationItem[] = [
|
export const adminNavigationItems: AdminNavigationItem[] = [
|
||||||
{ path: ADMIN_HOME_PATH, iconKey: 'home', label: '首页', permissionCode: '' },
|
{ path: ADMIN_HOME_PATH, iconKey: 'home', label: '首页', permissionCode: '' },
|
||||||
{ path: ADMIN_DASHBOARD_PATH, iconKey: 'dashboard', label: '仪表盘', permissionCode: 'dashboard:view' },
|
{ path: '/admin/users', iconKey: 'user', label: '店长账号', permissionCode: 'user:view' },
|
||||||
{ path: '/admin/users', iconKey: 'user', label: '用户管理', permissionCode: 'user:view' },
|
|
||||||
{ path: '/admin/shops', iconKey: 'home', label: '店铺管理', permissionCode: 'shop:view' },
|
{ path: '/admin/shops', iconKey: 'home', label: '店铺管理', permissionCode: 'shop:view' },
|
||||||
{ path: '/admin/profile', iconKey: 'user', label: '个人设置', permissionCode: '' }
|
{ path: '/admin/profile', iconKey: 'user', label: '个人设置', permissionCode: '' }
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
} from '@/utils/admin-auth-bootstrap'
|
} from '@/utils/admin-auth-bootstrap'
|
||||||
|
|
||||||
const pageNames = [
|
const pageNames = [
|
||||||
['', 'HomeView', 'admin', undefined], ['dashboard', 'DashboardView', 'admin-dashboard', 'dashboard:view'],
|
['', 'HomeView', 'admin', undefined],
|
||||||
['users', 'UsersView', 'admin-users', 'user:view'], ['shops', 'ShopsView', 'admin-shops', 'shop:view'],
|
['users', 'UsersView', 'admin-users', 'user:view'], ['shops', 'ShopsView', 'admin-shops', 'shop:view'],
|
||||||
['profile', 'ProfileView', 'admin-profile', undefined]
|
['profile', 'ProfileView', 'admin-profile', undefined]
|
||||||
] as const
|
] as const
|
||||||
|
|||||||
@@ -154,7 +154,6 @@
|
|||||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import {
|
import {
|
||||||
DashboardOutlined,
|
|
||||||
HomeOutlined,
|
HomeOutlined,
|
||||||
SafetyCertificateOutlined,
|
SafetyCertificateOutlined,
|
||||||
UserOutlined
|
UserOutlined
|
||||||
@@ -231,16 +230,9 @@ const quickActions = computed(() => {
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
const actions = [
|
const actions = [
|
||||||
{
|
|
||||||
key: 'dashboard',
|
|
||||||
title: '仪表盘',
|
|
||||||
path: '/admin/dashboard',
|
|
||||||
icon: DashboardOutlined,
|
|
||||||
permissionCode: 'dashboard:view'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: 'users',
|
key: 'users',
|
||||||
title: '用户管理',
|
title: '店长账号',
|
||||||
path: '/admin/users',
|
path: '/admin/users',
|
||||||
icon: UserOutlined,
|
icon: UserOutlined,
|
||||||
permissionCode: 'user:view'
|
permissionCode: 'user:view'
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
@change="(checked: any) => handleStatusChange(record, checked === true)"
|
@change="(checked: any) => handleStatusChange(record, checked === true)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.key === 'authorization'">
|
<template v-else-if="column.key === 'authorization' && false">
|
||||||
<a-space direction="vertical" size="small">
|
<a-space direction="vertical" size="small">
|
||||||
<a-tag :color="record.authorizationExpired ? 'red' : 'green'">
|
<a-tag :color="record.authorizationExpired ? 'red' : 'green'">
|
||||||
{{ record.authorizationStatusText || (record.authorizationExpired ? '已到期' : '有效') }}
|
{{ record.authorizationStatusText || (record.authorizationExpired ? '已到期' : '有效') }}
|
||||||
@@ -262,7 +262,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="授权起始日" name="authorizationStartDate">
|
<a-form-item v-if="false" label="授权起始日" name="authorizationStartDate">
|
||||||
<a-date-picker
|
<a-date-picker
|
||||||
v-model:value="formState.authorizationStartDate"
|
v-model:value="formState.authorizationStartDate"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
@@ -272,7 +272,7 @@
|
|||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="有效期天数" name="authorizationDays">
|
<a-form-item v-if="false" label="有效期天数" name="authorizationDays">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
v-model:value="formState.authorizationDays"
|
v-model:value="formState.authorizationDays"
|
||||||
:min="1"
|
:min="1"
|
||||||
@@ -282,7 +282,7 @@
|
|||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="到期时间">
|
<a-form-item v-if="false" label="到期时间">
|
||||||
<a-input :value="computedAuthorizationExpireTimeText" disabled />
|
<a-input :value="computedAuthorizationExpireTimeText" disabled />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="Banner图片">
|
<a-form-item label="Banner图片">
|
||||||
@@ -327,7 +327,7 @@
|
|||||||
<img alt="预览" style="width: 100%" :src="previewImage" />
|
<img alt="预览" style="width: 100%" :src="previewImage" />
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<div class="theme-section">
|
<div v-if="false" class="theme-section">
|
||||||
<div class="theme-section__header">
|
<div class="theme-section__header">
|
||||||
<div>
|
<div>
|
||||||
<div class="theme-section__title">前台主题</div>
|
<div class="theme-section__title">前台主题</div>
|
||||||
@@ -500,19 +500,19 @@
|
|||||||
<a-form-item label="营业时间">
|
<a-form-item label="营业时间">
|
||||||
<a-input v-model:value="viewFormState.businessHours" :disabled="true" />
|
<a-input v-model:value="viewFormState.businessHours" :disabled="true" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="授权状态">
|
<a-form-item v-if="false" label="授权状态">
|
||||||
<a-input :value="viewFormState.authorizationStatusText || '有效'" :disabled="true" />
|
<a-input :value="viewFormState.authorizationStatusText || '有效'" :disabled="true" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="授权起始日">
|
<a-form-item v-if="false" label="授权起始日">
|
||||||
<a-input :value="viewFormState.authorizationStartDate || '长期有效'" :disabled="true" />
|
<a-input :value="viewFormState.authorizationStartDate || '长期有效'" :disabled="true" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="有效期天数">
|
<a-form-item v-if="false" label="有效期天数">
|
||||||
<a-input :value="viewFormState.authorizationDays ? `${viewFormState.authorizationDays} 天` : '长期有效'" :disabled="true" />
|
<a-input :value="viewFormState.authorizationDays ? `${viewFormState.authorizationDays} 天` : '长期有效'" :disabled="true" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="授权有效期">
|
<a-form-item v-if="false" label="授权有效期">
|
||||||
<a-input :value="formatAuthorizationExpireTime(viewFormState.authorizationExpireTime)" :disabled="true" />
|
<a-input :value="formatAuthorizationExpireTime(viewFormState.authorizationExpireTime)" :disabled="true" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="前台主题">
|
<a-form-item v-if="false" label="前台主题">
|
||||||
<div class="theme-view-swatches">
|
<div class="theme-view-swatches">
|
||||||
<span :style="{ background: viewThemePreview.primaryColor }"></span>
|
<span :style="{ background: viewThemePreview.primaryColor }"></span>
|
||||||
<span :style="{ background: viewThemePreview.secondaryColor }"></span>
|
<span :style="{ background: viewThemePreview.secondaryColor }"></span>
|
||||||
@@ -1241,7 +1241,6 @@ const columns = [
|
|||||||
{ title: '店铺地址', dataIndex: 'address', key: 'address' },
|
{ title: '店铺地址', dataIndex: 'address', key: 'address' },
|
||||||
{ title: '营业时间', dataIndex: 'businessHours', key: 'businessHours' },
|
{ title: '营业时间', dataIndex: 'businessHours', key: 'businessHours' },
|
||||||
{ title: '状态', key: 'status', width: 120 },
|
{ title: '状态', key: 'status', width: 120 },
|
||||||
{ title: '授权', key: 'authorization', width: 180 },
|
|
||||||
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime' },
|
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime' },
|
||||||
{ title: '操作', key: 'actions', width: 150, fixed: 'right' as const }
|
{ title: '操作', key: 'actions', width: 150, fixed: 'right' as const }
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="users">
|
<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">
|
<section v-else class="admin-page-intro">
|
||||||
<span class="admin-page-intro__eyebrow">经营</span>
|
<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">
|
<div class="admin-page-intro__meta">
|
||||||
<span class="admin-page-chip">用户 {{ userList.length }}</span>
|
<span class="admin-page-chip">用户 {{ userList.length }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
<template #title v-if="isMobile">
|
<template #title v-if="isMobile">
|
||||||
用户列表
|
店长账号列表
|
||||||
</template>
|
</template>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<div class="admin-toolbar" :class="{ 'admin-toolbar--stacked': isMobile }">
|
<div class="admin-toolbar" :class="{ 'admin-toolbar--stacked': isMobile }">
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</template>
|
</template>
|
||||||
新增用户
|
新增店长
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -49,12 +49,6 @@
|
|||||||
{{ shop.shopName }}
|
{{ shop.shopName }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</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 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-option v-for="level in vipLevelOptions" :key="level" :value="level">{{ level }}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
@@ -206,7 +200,7 @@
|
|||||||
|
|
||||||
<AdminResponsiveModal
|
<AdminResponsiveModal
|
||||||
v-model:open="modalVisible"
|
v-model:open="modalVisible"
|
||||||
:title="isEdit ? '编辑用户' : '新增用户'"
|
:title="isEdit ? '编辑店长' : '新增店长'"
|
||||||
:confirm-loading="modalLoading"
|
:confirm-loading="modalLoading"
|
||||||
@ok="handleModalOk"
|
@ok="handleModalOk"
|
||||||
@cancel="handleModalCancel"
|
@cancel="handleModalCancel"
|
||||||
@@ -285,7 +279,7 @@
|
|||||||
v-if="!isEdit"
|
v-if="!isEdit"
|
||||||
label="密码"
|
label="密码"
|
||||||
name="password"
|
name="password"
|
||||||
extra="留空则使用参数管理中配置的后台新增用户默认密码"
|
extra="留空则使用参数管理中配置的店长默认密码"
|
||||||
>
|
>
|
||||||
<a-input-password
|
<a-input-password
|
||||||
v-model:value="formState.password"
|
v-model:value="formState.password"
|
||||||
@@ -314,7 +308,7 @@
|
|||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</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 v-model:value="formState.type" placeholder="请选择用户类型">
|
||||||
<a-select-option
|
<a-select-option
|
||||||
v-for="option in availableUserTypeOptions"
|
v-for="option in availableUserTypeOptions"
|
||||||
@@ -537,7 +531,7 @@
|
|||||||
|
|
||||||
<AdminMobileFab
|
<AdminMobileFab
|
||||||
:visible="isMobile && canCreateUser && !modalVisible && !viewModalVisible && !assetModalVisible"
|
:visible="isMobile && canCreateUser && !modalVisible && !viewModalVisible && !assetModalVisible"
|
||||||
label="新增用户"
|
label="新增店长"
|
||||||
@click="showAddModal"
|
@click="showAddModal"
|
||||||
/>
|
/>
|
||||||
</div>
|
</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.
|
* 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.
|
* 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.
|
* 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.
|
* 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: '',
|
wechatId: '',
|
||||||
wechatQrCode: '',
|
wechatQrCode: '',
|
||||||
password: '',
|
password: '',
|
||||||
type: 0,
|
type: 2,
|
||||||
shopIds: [] as string[]
|
shopIds: [] as string[]
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1382,7 +1376,7 @@ const fetchUserList = async () => {
|
|||||||
const resetFilters = () => {
|
const resetFilters = () => {
|
||||||
searchText.value = ''
|
searchText.value = ''
|
||||||
shopFilter.value = currentUserType.value !== 4 ? normalizeShopId(currentUserInfo?.shopId) : undefined
|
shopFilter.value = currentUserType.value !== 4 ? normalizeShopId(currentUserInfo?.shopId) : undefined
|
||||||
typeFilter.value = undefined
|
typeFilter.value = 2
|
||||||
vipLevelFilter.value = undefined
|
vipLevelFilter.value = undefined
|
||||||
statusFilter.value = undefined
|
statusFilter.value = undefined
|
||||||
createdRange.value = undefined
|
createdRange.value = undefined
|
||||||
@@ -1393,10 +1387,6 @@ const resetFilters = () => {
|
|||||||
|
|
||||||
/** resetFormState is a local helper used by this page script. */
|
/** resetFormState is a local helper used by this page script. */
|
||||||
const resetFormState = () => {
|
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, {
|
Object.assign(formState, {
|
||||||
account: '',
|
account: '',
|
||||||
nickname: '',
|
nickname: '',
|
||||||
@@ -1406,7 +1396,7 @@ const resetFormState = () => {
|
|||||||
wechatId: '',
|
wechatId: '',
|
||||||
wechatQrCode: '',
|
wechatQrCode: '',
|
||||||
password: '',
|
password: '',
|
||||||
type: defaultUserType ?? 0,
|
type: 2,
|
||||||
shopIds: currentUserType.value !== 4 && currentUserInfo?.shopId
|
shopIds: currentUserType.value !== 4 && currentUserInfo?.shopId
|
||||||
? [normalizeShopId(currentUserInfo.shopId)!]
|
? [normalizeShopId(currentUserInfo.shopId)!]
|
||||||
: []
|
: []
|
||||||
|
|||||||
Reference in New Issue
Block a user