完成店铺创建

This commit is contained in:
2026-03-13 16:32:37 +08:00
parent 3617a6a086
commit b180aeabd8
7 changed files with 1713 additions and 40 deletions

View File

@@ -18,6 +18,10 @@ import PlaceholderPage from '@/layouts/admin/components/PlaceholderPage.uvue'
import HomeIndex from '@/layouts/admin/pages/HomeIndex.uvue'
import UserCenter from '@/pages/mall/admin/userCenter/index.uvue'
// --- 店铺模块 ---
import ShopManage from '@/pages/mall/admin/shop/manage.uvue'
import ShopCreate from '@/pages/mall/admin/shop/create.uvue'
// --- 用户模块 ---
import UserStatistic from '@/pages/mall/admin/user/statistics/index.uvue'
import UserList from '@/pages/mall/admin/user/management/index.uvue'
@@ -180,8 +184,12 @@ import MaintainSysInfo from '@/pages/mall/admin/maintain/sys/info.uvue'
export const componentMap: Map<string, any> = new Map([
// 首页
['HomeIndex', HomeIndex],
['UserCenter', UserCenter],
['UserCenter', UserCenter],
// 店铺模块
['ShopManage', ShopManage],
['ShopCreate', ShopCreate],
// 用户模块
['UserStatistic', UserStatistic],
['UserList', UserList],

View File

@@ -67,12 +67,22 @@ export const topMenus: TopMenu[] = [
order: 1,
groups: []
},
{
id: 'shop',
title: '店铺',
icon: 'shop',
path: '/pages/mall/admin/shop/manage',
order: 2,
groups: [
{ id: 'shop-manage', title: '', order: 1 }
]
},
{
id: 'user',
title: '用户',
icon: 'user',
path: '/pages/mall/admin/user/management/index',
order: 2,
order: 3,
groups: [
{ id: 'user-manage', title: '', order: 1 }
]
@@ -233,6 +243,27 @@ export const routes: RouteRecord[] = [
order: 1
},
// ========== 店铺模块 ==========
{
id: 'shop_manage',
title: '店铺管理',
path: '/pages/mall/admin/shop/manage',
componentKey: 'ShopManage',
parentId: 'shop',
groupId: 'shop-manage',
order: 1
},
{
id: 'shop_create',
title: '申请入驻',
path: '/pages/mall/admin/shop/create',
componentKey: 'ShopCreate',
parentId: 'shop',
groupId: 'shop-manage',
hidden: true,
order: 2
},
// ========== 用户模块 ==========
// ========== 个人中心 ==========
{

View File

@@ -98,11 +98,11 @@ export async function refreshAdminRole(): Promise<string> {
export function getVisibleTopMenuIds(role: string): string[] {
const normRole = normalizeRole(role)
if (normRole === 'admin') {
return ['home', 'user', 'order', 'product', 'marketing', 'distribution', 'kefu', 'finance', 'cms', 'decoration', 'app', 'setting', 'maintain']
return ['home', 'shop', 'user', 'order', 'product', 'marketing', 'distribution', 'kefu', 'finance', 'cms', 'decoration', 'app', 'setting', 'maintain']
}
if (normRole === 'merchant') {
return ['home', 'order', 'product', 'marketing', 'finance']
return ['home', 'shop', 'order', 'product', 'marketing', 'finance']
}
return ['home']
@@ -123,7 +123,7 @@ export function hasAdminModuleAccess(moduleId: string | undefined): boolean {
}
if (normRole === 'merchant') {
const allowed = ['home', 'order', 'product', 'marketing', 'finance']
const allowed = ['home', 'shop', 'order', 'product', 'marketing', 'finance']
return allowed.includes(moduleId)
}