|
|
@@ -1,23 +1,13 @@
|
|
|
import React from 'react';
|
|
|
-import { useNavigate } from 'react-router';
|
|
|
+import { useNavigate } from 'react-router-dom';
|
|
|
import { useAuth } from '@d8d/tenant-management-ui';
|
|
|
import {
|
|
|
- Users,
|
|
|
Settings,
|
|
|
User,
|
|
|
LogOut,
|
|
|
BarChart3,
|
|
|
LayoutDashboard,
|
|
|
- File,
|
|
|
- Megaphone,
|
|
|
- Tag,
|
|
|
- Package,
|
|
|
- Truck,
|
|
|
- Building,
|
|
|
- UserCheck,
|
|
|
- CreditCard,
|
|
|
- TrendingUp,
|
|
|
- MapPin
|
|
|
+ Building
|
|
|
} from 'lucide-react';
|
|
|
|
|
|
export interface MenuItem {
|
|
|
@@ -81,149 +71,27 @@ export const useMenu = () => {
|
|
|
const { logout: handleLogout } = useAuth();
|
|
|
const [collapsed, setCollapsed] = React.useState(false);
|
|
|
|
|
|
- // 基础菜单项配置
|
|
|
+ // 基础菜单项配置 - 租户管理专用
|
|
|
const menuItems: MenuItem[] = [
|
|
|
{
|
|
|
key: 'dashboard',
|
|
|
- label: '控制台',
|
|
|
+ label: '租户控制台',
|
|
|
icon: <LayoutDashboard className="h-4 w-4" />,
|
|
|
- path: '/admin/dashboard'
|
|
|
+ path: '/tenant/dashboard'
|
|
|
},
|
|
|
{
|
|
|
- key: 'users',
|
|
|
- label: '用户管理',
|
|
|
- icon: <Users className="h-4 w-4" />,
|
|
|
- path: '/admin/users',
|
|
|
- permission: 'user:manage'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'files',
|
|
|
- label: '文件管理',
|
|
|
- icon: <File className="h-4 w-4" />,
|
|
|
- path: '/admin/files',
|
|
|
- permission: 'file:manage'
|
|
|
+ key: 'tenants',
|
|
|
+ label: '租户管理',
|
|
|
+ icon: <Building className="h-4 w-4" />,
|
|
|
+ path: '/tenant/tenants',
|
|
|
+ permission: 'tenant:manage'
|
|
|
},
|
|
|
{
|
|
|
key: 'analytics',
|
|
|
- label: '数据分析',
|
|
|
+ label: '租户数据',
|
|
|
icon: <BarChart3 className="h-4 w-4" />,
|
|
|
- path: '/admin/analytics',
|
|
|
- permission: 'analytics:view'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'advertisements',
|
|
|
- label: '广告管理',
|
|
|
- icon: <Megaphone className="h-4 w-4" />,
|
|
|
- permission: 'advertisement:manage',
|
|
|
- children: [
|
|
|
- {
|
|
|
- key: 'advertisements-list',
|
|
|
- label: '广告列表',
|
|
|
- path: '/admin/advertisements',
|
|
|
- permission: 'advertisement:manage'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'advertisement-types',
|
|
|
- label: '广告类型',
|
|
|
- path: '/admin/advertisement-types',
|
|
|
- permission: 'advertisement:manage'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'goods',
|
|
|
- label: '商品管理',
|
|
|
- icon: <Package className="h-4 w-4" />,
|
|
|
- permission: 'goods:manage',
|
|
|
- children: [
|
|
|
- {
|
|
|
- key: 'goods-list',
|
|
|
- label: '商品列表',
|
|
|
- path: '/admin/goods',
|
|
|
- permission: 'goods:manage'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'goods-categories',
|
|
|
- label: '商品分类',
|
|
|
- path: '/admin/goods-categories',
|
|
|
- permission: 'goods:manage'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'express-companies',
|
|
|
- label: '快递公司',
|
|
|
- path: '/admin/express-companies',
|
|
|
- permission: 'goods:manage'
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'orders',
|
|
|
- label: '订单管理',
|
|
|
- icon: <Truck className="h-4 w-4" />,
|
|
|
- permission: 'order:manage',
|
|
|
- children: [
|
|
|
- {
|
|
|
- key: 'orders-list',
|
|
|
- label: '订单列表',
|
|
|
- path: '/admin/orders',
|
|
|
- permission: 'order:manage'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'suppliers',
|
|
|
- label: '供应商管理',
|
|
|
- icon: <Building className="h-4 w-4" />,
|
|
|
- path: '/admin/suppliers',
|
|
|
- permission: 'supplier:manage'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'merchants',
|
|
|
- label: '商户管理',
|
|
|
- icon: <Building className="h-4 w-4" />,
|
|
|
- path: '/admin/merchants',
|
|
|
- permission: 'merchant:manage'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'agents',
|
|
|
- label: '代理商管理',
|
|
|
- icon: <UserCheck className="h-4 w-4" />,
|
|
|
- path: '/admin/agents',
|
|
|
- permission: 'agent:manage'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'delivery-addresses',
|
|
|
- label: '收货地址',
|
|
|
- icon: <MapPin className="h-4 w-4" />,
|
|
|
- path: '/admin/delivery-addresses',
|
|
|
- permission: 'user:manage'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'cards',
|
|
|
- label: '卡券管理',
|
|
|
- icon: <CreditCard className="h-4 w-4" />,
|
|
|
- permission: 'card:manage',
|
|
|
- children: [
|
|
|
- {
|
|
|
- key: 'user-cards',
|
|
|
- label: '用户卡管理',
|
|
|
- path: '/admin/user-cards',
|
|
|
- permission: 'card:manage'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'user-card-balance-records',
|
|
|
- label: '余额记录',
|
|
|
- path: '/admin/user-card-balance-records',
|
|
|
- permission: 'card:manage'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'settings',
|
|
|
- label: '系统设置',
|
|
|
- icon: <Settings className="h-4 w-4" />,
|
|
|
- path: '/admin/settings',
|
|
|
- permission: 'settings:manage'
|
|
|
+ path: '/tenant/analytics',
|
|
|
+ permission: 'tenant:analytics'
|
|
|
},
|
|
|
];
|
|
|
|
|
|
@@ -233,13 +101,13 @@ export const useMenu = () => {
|
|
|
key: 'profile',
|
|
|
label: '个人资料',
|
|
|
icon: <User className="mr-2 h-4 w-4" />,
|
|
|
- onClick: () => navigate('/admin/profile')
|
|
|
+ onClick: () => navigate('/tenant/profile')
|
|
|
},
|
|
|
{
|
|
|
key: 'settings',
|
|
|
label: '账户设置',
|
|
|
icon: <Settings className="mr-2 h-4 w-4" />,
|
|
|
- onClick: () => navigate('/admin/account-settings')
|
|
|
+ onClick: () => navigate('/tenant/account-settings')
|
|
|
},
|
|
|
{
|
|
|
type: 'separator',
|