From b384b127e0e3c535ff7c41bb3f96963fa3b0e929 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Tue, 7 Jul 2026 19:26:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=B9=B3=E5=8F=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BE=A7=E6=A0=8F=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layouts/AdminLayout.tsx | 57 ++----------------- 1 file changed, 4 insertions(+), 53 deletions(-) diff --git a/apps/frontend-react/src/layouts/AdminLayout.tsx b/apps/frontend-react/src/layouts/AdminLayout.tsx index 3c91d3df..35539cc8 100644 --- a/apps/frontend-react/src/layouts/AdminLayout.tsx +++ b/apps/frontend-react/src/layouts/AdminLayout.tsx @@ -1,16 +1,11 @@ import { - ApiOutlined, AuditOutlined, - BellOutlined, - CloudServerOutlined, DashboardOutlined, FileSearchOutlined, - LinkOutlined, LogoutOutlined, MenuFoldOutlined, MenuUnfoldOutlined, OrderedListOutlined, - SafetyCertificateOutlined, SettingOutlined, ShopOutlined, TeamOutlined, @@ -69,38 +64,7 @@ export default function AdminLayout() { 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-shops', icon: , label: '平台配置' }, { key: '/admin/platform-fulfillment', icon: , label: '履约配置' }, ], }, @@ -134,8 +98,7 @@ export default function AdminLayout() { window.localStorage.setItem(SIDEBAR_COLLAPSED_KEY, next ? '1' : '0') } - const selectedKey = resolveSelectedKey(location.pathname, location.search) - const defaultOpenKeys = collapsed ? [] : resolveDefaultOpenKeys(selectedKey) + const selectedKey = resolveSelectedKey(location.pathname) return ( @@ -176,7 +139,6 @@ export default function AdminLayout() { mode="inline" inlineIndent={16} selectedKeys={[selectedKey]} - defaultOpenKeys={defaultOpenKeys} items={menuItems} className="admin-menu" onClick={({ key }) => navigate(String(key))} @@ -216,24 +178,13 @@ export default function AdminLayout() { ) } -function resolveSelectedKey(pathname: string, search = '') { +function resolveSelectedKey(pathname: string) { if (pathname.startsWith('/admin/orders')) return '/admin/orders' if (pathname.startsWith('/admin/tasks')) return '/admin/tasks' - if (pathname === '/admin/platform-shops') { - const tab = new URLSearchParams(search).get('tab') || 'ninetyone' - return `/admin/platform-shops?tab=${tab}` - } + if (pathname === '/admin/platform-shops') return '/admin/platform-shops' return pathname } -function resolveDefaultOpenKeys(selectedKey: string) { - if (selectedKey.startsWith('/admin/platform-shops')) { - return ['/admin/platform-shops'] - } - - return [] -} - function roleLabel(role: string) { if (role === 'admin') return '管理员' if (role === 'operator') return '普通运营'