diff --git a/apps/frontend-react/src/layouts/AdminLayout.tsx b/apps/frontend-react/src/layouts/AdminLayout.tsx index 5e09b2be..14dd5194 100644 --- a/apps/frontend-react/src/layouts/AdminLayout.tsx +++ b/apps/frontend-react/src/layouts/AdminLayout.tsx @@ -1,10 +1,16 @@ import { + ApiOutlined, AuditOutlined, + BellOutlined, + CloudServerOutlined, DashboardOutlined, FileSearchOutlined, + LinkOutlined, + LogoutOutlined, MenuFoldOutlined, MenuUnfoldOutlined, OrderedListOutlined, + SafetyCertificateOutlined, SettingOutlined, ShopOutlined, TeamOutlined, @@ -39,23 +45,71 @@ export default function AdminLayout() { const expiresAt = getAdminTokenExpiresAt() const menuItems = useMemo(() => { - const items: MenuProps['items'] = [ + const operationItems: MenuProps['items'] = [ { key: '/admin/dashboard', icon: , label: '概览' }, { key: '/admin/orders', icon: , label: '订单' }, { key: '/admin/tasks', icon: , label: '任务' }, + { key: '/admin/cloudtentacles-records', icon: , label: '发货记录' }, + ] + + const items: MenuProps['items'] = [ + { + key: 'group-operation', + type: 'group', + label: '运营', + children: operationItems, + }, ] if (role === 'admin') { - items.splice(1, 0, { key: '/admin/users', icon: , label: '用户' }) items.push( - { key: '/admin/cloudtentacles-records', icon: , label: '发货记录' }, { - key: '/admin/platform-shops', - icon: , - label: '平台配置', + key: 'group-config', + type: 'group', + label: '配置', + children: [ + { key: '/admin/users', icon: , label: '后台用户' }, + { + key: '/admin/platform-shops', + icon: , + label: '平台配置', + children: [ + { + key: '/admin/platform-shops?tab=ninetyone', + icon: , + label: '91卡券', + }, + { + key: '/admin/platform-shops?tab=notifications', + icon: , + label: '内部通知', + }, + { + key: '/admin/platform-shops?tab=kuaishouEticket', + icon: , + label: '快手核销', + }, + { + key: '/admin/platform-shops?tab=kuaishouFeifei', + icon: , + label: 'feifei', + }, + { + key: '/admin/platform-shops?tab=cloudtentacles', + icon: , + label: 'cloudtentacles', + }, + ], + }, + { key: '/admin/platform-fulfillment', icon: , label: '履约配置' }, + ], + }, + { + key: 'group-system', + type: 'group', + label: '系统', + children: [{ key: '/admin/audit-logs', icon: , label: '审计日志' }], }, - { key: '/admin/platform-fulfillment', icon: , label: '履约配置' }, - { key: '/admin/audit-logs', icon: , label: '审计' }, ) } @@ -80,7 +134,8 @@ export default function AdminLayout() { window.localStorage.setItem(SIDEBAR_COLLAPSED_KEY, next ? '1' : '0') } - const selectedKey = resolveSelectedKey(location.pathname) + const selectedKey = resolveSelectedKey(location.pathname, location.search) + const defaultOpenKeys = collapsed ? [] : resolveDefaultOpenKeys(selectedKey) return ( @@ -91,32 +146,57 @@ export default function AdminLayout() { className="admin-sider" trigger={null} > -
- {collapsed ? 'OS' : '运营后台'} - {!collapsed ? 订单与交付管理 : null} +
+
+
+ {collapsed ? 'OS' : '运营后台'} + {!collapsed ? 订单与交付管理 : null} +
+
+ + {!collapsed ? ( +
+ {username} + {roleLabel(role)} + {expiresAt ? ( + + {formatAdminDateTime(expiresAt)} 到期 + + ) : null} +
+ ) : null} + + navigate(String(key))} + /> + +
+ +
- navigate(String(key))} - /> -