From cc3e90e0e96c40e289d4f734c79cf04ef6610091 Mon Sep 17 00:00:00 2001 From: lingniu Date: Sun, 5 Jul 2026 11:59:51 +0800 Subject: [PATCH] feat(platform): align navigation with vehicle monitoring workflows --- .../apps/web/src/layout/AppShell.tsx | 27 ++++++++++++------- .../apps/web/src/pages/Dashboard.tsx | 4 +-- .../apps/web/src/test/App.test.tsx | 20 +++++++++----- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/vehicle-data-platform/apps/web/src/layout/AppShell.tsx b/vehicle-data-platform/apps/web/src/layout/AppShell.tsx index ee800af3..718cc5bd 100644 --- a/vehicle-data-platform/apps/web/src/layout/AppShell.tsx +++ b/vehicle-data-platform/apps/web/src/layout/AppShell.tsx @@ -20,29 +20,36 @@ export type PageKey = 'dashboard' | 'vehicles' | 'map' | 'realtime' | 'detail' | const navGroups = [ { - title: '车辆服务', + title: '车辆监控', audience: '客户', - description: '以车辆为对象监控在线、位置和服务状态', + description: '实时看车在哪里、是否在线、是否异常', items: [ - { itemKey: 'dashboard', text: '车辆工作台', icon: }, - { itemKey: 'vehicles', text: '车辆中心', icon: }, + { itemKey: 'dashboard', text: '运营总览', icon: }, { itemKey: 'map', text: '实时地图', icon: }, - { itemKey: 'realtime', text: '实时监控', icon: }, + { itemKey: 'realtime', text: '实时监控', icon: } + ] + }, + { + title: '车辆资产', + audience: '客户', + description: '按 VIN、车牌、手机号管理车辆资产', + items: [ + { itemKey: 'vehicles', text: '车辆中心', icon: }, { itemKey: 'detail', text: '车辆档案', icon: } ] }, { - title: '数据交付', + title: '轨迹与统计', audience: '客户', - description: '轨迹、里程、历史数据和客户导出', + description: '按时间窗回放轨迹、核对里程、导出数据', items: [ { itemKey: 'history', text: '轨迹回放', icon: }, { itemKey: 'mileage', text: '里程统计', icon: }, - { itemKey: 'history-query', text: '数据导出', icon: } + { itemKey: 'history-query', text: '历史查询/导出', icon: } ] }, { - title: '告警闭环', + title: '告警通知', audience: '客户', description: '断链、离线、定位异常和通知升级', items: [ @@ -51,7 +58,7 @@ const navGroups = [ ] }, { - title: '平台运维', + title: '内部运维', audience: '内部', description: '客户主流程外查看接入链路和运行质量', items: [ diff --git a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx index 6a2560ca..0255173e 100644 --- a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx +++ b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx @@ -421,7 +421,7 @@ export function Dashboard({ title: '数据导出', value: `${formatCount(summary?.frameToday)} 今日数据`, detail: '按车辆、时间和字段裁剪查询历史位置与原始记录。', - action: '查询导出', + action: '历史查询/导出', onClick: () => onOpenHistory({ tab: 'raw', includeFields: 'true' }) } ]; @@ -1340,7 +1340,7 @@ export function Dashboard({ - + 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 e4e62cdc..0b5cdb7b 100644 --- a/vehicle-data-platform/apps/web/src/test/App.test.tsx +++ b/vehicle-data-platform/apps/web/src/test/App.test.tsx @@ -22,16 +22,18 @@ test('renders vehicle platform shell', () => { render(); expect(screen.getByText('车辆服务中台')).toBeInTheDocument(); expect(screen.getByText('地图监控 / 轨迹回放 / 告警通知')).toBeInTheDocument(); - expect(screen.getAllByText('车辆服务').length).toBeGreaterThanOrEqual(1); - expect(screen.getByText('以车辆为对象监控在线、位置和服务状态')).toBeInTheDocument(); - expect(screen.getAllByText('数据交付').length).toBeGreaterThanOrEqual(1); - expect(screen.getByText('轨迹、里程、历史数据和客户导出')).toBeInTheDocument(); - expect(screen.getByText('告警闭环')).toBeInTheDocument(); - expect(screen.getByText('平台运维')).toBeInTheDocument(); + expect(screen.getByText('车辆监控')).toBeInTheDocument(); + expect(screen.getByText('实时看车在哪里、是否在线、是否异常')).toBeInTheDocument(); + expect(screen.getByText('车辆资产')).toBeInTheDocument(); + expect(screen.getByText('按 VIN、车牌、手机号管理车辆资产')).toBeInTheDocument(); + expect(screen.getByText('轨迹与统计')).toBeInTheDocument(); + expect(screen.getByText('按时间窗回放轨迹、核对里程、导出数据')).toBeInTheDocument(); + expect(screen.getAllByText('告警通知').length).toBeGreaterThanOrEqual(1); + expect(screen.getByText('内部运维')).toBeInTheDocument(); expect(screen.getAllByText('客户').length).toBeGreaterThanOrEqual(3); expect(screen.getByText('内部')).toBeInTheDocument(); expect(screen.getByText('客户主流程外查看接入链路和运行质量')).toBeInTheDocument(); - expect(screen.getAllByText('车辆工作台').length).toBeGreaterThanOrEqual(1); + expect(screen.getAllByText('运营总览').length).toBeGreaterThanOrEqual(1); }); test('exposes AMap operations shortcuts when map key is configured', async () => { @@ -6278,6 +6280,10 @@ test('shows vehicle context when opening detail from sidebar navigation', async render(); + fireEvent.change(screen.getByPlaceholderText('搜索 VIN / 车牌 / 手机号'), { target: { value: 'LB9A32A24R0LS1426' } }); + fireEvent.click(screen.getByRole('button', { name: '查询车辆' })); + expect(await screen.findByText('粤AGQ8398 / LB9A32A24R0LS1426')).toBeInTheDocument(); + fireEvent.click(screen.getAllByText('车辆档案')[0]); expect(await screen.findByText('粤AGQ8398 / LB9A32A24R0LS1426')).toBeInTheDocument();