From 6246887b8618114409edf9093d31cd8e89e299fd Mon Sep 17 00:00:00 2001 From: lingniu Date: Mon, 6 Jul 2026 04:19:48 +0800 Subject: [PATCH] feat(platform): collapse advanced dashboard workbench --- .../apps/web/src/pages/Dashboard.tsx | 8 ++ .../apps/web/src/test/App.test.tsx | 83 +++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx index dae61a08..facf614b 100644 --- a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx +++ b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx @@ -2763,6 +2763,12 @@ export function Dashboard({ ) : null} +
+ + 客户进阶工作台 + 地图大屏、指挥台、车辆服务驾驶舱和态势分析默认收起;客户首页先回答车辆在哪里、时间窗怎么查、里程怎么核、数据怎么交付。 + +
+
+
diff --git a/vehicle-data-platform/apps/web/src/test/App.test.tsx b/vehicle-data-platform/apps/web/src/test/App.test.tsx index cbb51b67..6b950ee1 100644 --- a/vehicle-data-platform/apps/web/src/test/App.test.tsx +++ b/vehicle-data-platform/apps/web/src/test/App.test.tsx @@ -155,6 +155,89 @@ test('dashboard opens with a customer vehicle service path instead of protocol e expect(screen.getByRole('button', { name: '客户车辆服务路径 数据导出 数据能否交付 导出证据' })).toBeInTheDocument(); }); +test('dashboard keeps advanced customer workbench collapsed behind the service path', async () => { + window.history.replaceState(null, '', '/#/dashboard'); + vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => { + const path = String(input); + if (path.includes('/api/ops/health')) { + return { + ok: true, + json: async () => ({ + data: { + linkHealth: [], + kafkaLag: 0, + activeConnections: 15, + redisOnlineKeys: 92, + tdengineWritable: true, + mysqlWritable: true, + runtime: { requestTimeoutMs: 5000, amapWebJsConfigured: true, amapSecurityProxyEnabled: true, amapSecurityCodeExposed: false } + }, + traceId: 'trace-test', + timestamp: 1783094400000 + }) + } as Response; + } + if (path.includes('/api/dashboard/summary')) { + return { + ok: true, + json: async () => ({ + data: { + onlineVehicles: 92, + activeToday: 120, + frameToday: 21000, + issueVehicles: 7, + kafkaLag: 0, + protocols: [], + serviceStatuses: [], + linkHealth: [] + }, + traceId: 'trace-test', + timestamp: 1783094400000 + }) + } as Response; + } + if (path.includes('/api/vehicle-service/summary')) { + return { + ok: true, + json: async () => ({ + data: { + totalVehicles: 1033, + boundVehicles: 988, + onlineVehicles: 92, + singleSourceVehicles: 170, + multiSourceVehicles: 220, + noDataVehicles: 15, + identityRequiredVehicles: 9, + serviceStatuses: [], + protocols: [], + missingSources: [] + }, + traceId: 'trace-test', + timestamp: 1783094400000 + }) + } as Response; + } + return { + ok: true, + json: async () => ({ + data: { items: [], total: 0, limit: 8, offset: 0 }, + traceId: 'trace-test', + timestamp: 1783094400000 + }) + } as Response; + }); + + render(); + + expect(await screen.findByRole('heading', { name: '客户车辆服务路径' })).toBeInTheDocument(); + const summary = screen.getByText('客户进阶工作台'); + const details = summary.closest('details'); + expect(details).toBeInTheDocument(); + expect(details).not.toHaveAttribute('open'); + expect(within(details as HTMLElement).getByText('车辆服务指挥台')).toBeInTheDocument(); + expect(within(details as HTMLElement).getByText('车辆地图态势')).toBeInTheDocument(); +}); + test('topbar frames customer work as a vehicle service delivery strip', () => { vi.spyOn(globalThis, 'fetch').mockImplementation(async () => ({ ok: true,