From fe569fe75a0adb79362dd68a87daa3a501e1e67f Mon Sep 17 00:00:00 2001 From: yml2213 Date: Tue, 18 Aug 2026 09:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E5=AE=A2=E6=9C=8D=E6=8E=A5?= =?UTF-8?q?=E5=8D=95=E5=B9=B3=E5=8F=B0=E5=8F=AF=E8=A7=81=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/admin/AdminWorkerPlatformPage.tsx | 33 +++++++++++-------- .../pages/admin/panels/WorkOrdersPanel.tsx | 5 ++- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/apps/frontend/src/pages/admin/AdminWorkerPlatformPage.tsx b/apps/frontend/src/pages/admin/AdminWorkerPlatformPage.tsx index 349e9df9..4be3a2b1 100644 --- a/apps/frontend/src/pages/admin/AdminWorkerPlatformPage.tsx +++ b/apps/frontend/src/pages/admin/AdminWorkerPlatformPage.tsx @@ -17,8 +17,11 @@ import WorkOrdersPanel from './panels/WorkOrdersPanel' export default function AdminWorkerPlatformPage() { const [searchParams] = useSearchParams() const [activeTab, setActiveTab] = useState(() => loadActiveTab(searchParams.get('tab'))) - const isAdmin = getAdminRole() === 'admin' - const visibleActiveTab = !isAdmin && activeTab === 'notifications' ? 'orders' : activeTab + const role = getAdminRole() + const isAdmin = role === 'admin' + const isSupport = role === 'support' + const visibleActiveTab = + isSupport || (!isAdmin && activeTab === 'notifications') ? 'orders' : activeTab useEffect(() => { const tab = searchParams.get('tab') @@ -40,17 +43,21 @@ export default function AdminWorkerPlatformPage() { destroyOnHidden={false} activeKey={visibleActiveTab} onChange={changeTab} - items={[ - { key: 'orders', label: '接单工单', children: }, - { key: 'rules', label: '物品规则', children: }, - { key: 'categories', label: '分类', children: }, - { key: 'workers', label: '打手', children: }, - { key: 'finance', label: '资金', children: }, - { key: 'levels', label: '等级权限', children: }, - ...(isAdmin - ? [{ key: 'notifications', label: '通知配置', children: }] - : []), - ]} + items={ + isSupport + ? [{ key: 'orders', label: '接单工单', children: }] + : [ + { key: 'orders', label: '接单工单', children: }, + { key: 'rules', label: '物品规则', children: }, + { key: 'categories', label: '分类', children: }, + { key: 'workers', label: '打手', children: }, + { key: 'finance', label: '资金', children: }, + { key: 'levels', label: '等级权限', children: }, + ...(isAdmin + ? [{ key: 'notifications', label: '通知配置', children: }] + : []), + ] + } /> ) diff --git a/apps/frontend/src/pages/admin/panels/WorkOrdersPanel.tsx b/apps/frontend/src/pages/admin/panels/WorkOrdersPanel.tsx index d2f5c1c5..0968b67f 100644 --- a/apps/frontend/src/pages/admin/panels/WorkOrdersPanel.tsx +++ b/apps/frontend/src/pages/admin/panels/WorkOrdersPanel.tsx @@ -125,6 +125,7 @@ export default function WorkOrdersPanel() { const [searchParams, setSearchParams] = useSearchParams() const queryClient = useQueryClient() const canEditRequirementFields = hasAdminRole('operator') + const canViewStatistics = hasAdminRole('operator') const [statuses, setStatuses] = useState([]) const [targetWorkOrderId, setTargetWorkOrderId] = useState() const [keyword, setKeyword] = useState('') @@ -965,7 +966,9 @@ export default function WorkOrdersPanel() { - + {canViewStatistics ? ( + + ) : null}