From d11628fe57af2f135d34795fe6176a44575fc72d Mon Sep 17 00:00:00 2001 From: yml2213 Date: Tue, 7 Jul 2026 19:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=8E=E5=8F=B0=E4=BE=A7?= =?UTF-8?q?=E8=BE=B9=E5=AF=BC=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layouts/AdminLayout.tsx | 154 ++++++++++++++---- apps/frontend-react/src/styles/main.css | 105 +++++++++++- 2 files changed, 223 insertions(+), 36 deletions(-) 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))} - /> -