diff --git a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx index f3370217..7d668791 100644 --- a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx +++ b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx @@ -1547,6 +1547,42 @@ export function Dashboard({ onClick: () => onOpenQuality(highPriorityIssue?.issueType ? { issueType: highPriorityIssue.issueType } : {}) } ]; + const onlineVehicleCount = serviceSummary?.onlineVehicles ?? summary?.onlineVehicles ?? 0; + const missingLocationCount = Math.max(onlineVehicleCount - commandLocatedCount, 0); + const vehiclePriorityQueue = [ + { + title: '告警待处理', + value: `${formatCount(summary?.issueVehicles)} 辆`, + detail: highPriorityIssue ? `${qualityIssueLabel(highPriorityIssue.issueType)} / ${priorityIssueVehicleLabel(highPriorityIssue)}` : '暂无高优先级告警,保持日常巡检。', + action: '告警事件', + color: (summary?.issueVehicles ?? 0) > 0 ? 'orange' as const : 'green' as const, + onClick: () => onOpenQuality(highPriorityIssue?.issueType ? { issueType: highPriorityIssue.issueType } : {}) + }, + { + title: '无有效定位', + value: `${missingLocationCount.toLocaleString()} 辆`, + detail: '在线车辆缺少有效坐标时,客户无法完成地图看车和轨迹复盘。', + action: '打开地图', + color: missingLocationCount > 0 ? 'orange' as const : 'green' as const, + onClick: () => onOpenMap({ online: 'online' }) + }, + { + title: '身份未绑定', + value: `${formatCount(serviceSummary?.identityRequiredVehicles)} 辆`, + detail: '已有数据但无法归并到 VIN,会影响车辆服务、统计和导出。', + action: '维护绑定', + color: (serviceSummary?.identityRequiredVehicles ?? 0) > 0 ? 'orange' as const : 'green' as const, + onClick: () => onOpenVehicles({ serviceStatus: 'identity_required' }) + }, + { + title: '暂无数据', + value: `${formatCount(serviceSummary?.noDataVehicles)} 辆`, + detail: '车辆没有形成实时、轨迹或历史证据,优先确认平台转发。', + action: '车辆列表', + color: (serviceSummary?.noDataVehicles ?? 0) > 0 ? 'red' as const : 'green' as const, + onClick: () => onOpenVehicles({ serviceStatus: 'no_data' }) + } + ]; const customerNextActions = [ { level: (summary?.issueVehicles ?? 0) > 0 ? '优先' : '巡检', @@ -1842,6 +1878,31 @@ export function Dashboard({ ))} +
+
+
+ 车辆运营优先级队列 + 先处理影响客户看车、查轨迹、算里程和收通知的问题车辆。 +
+ 按车辆问题排序 +
+
+ {vehiclePriorityQueue.map((item) => ( + + ))} +
+
今日先处理 diff --git a/vehicle-data-platform/apps/web/src/styles/global.css b/vehicle-data-platform/apps/web/src/styles/global.css index 2c5b342c..2ca162cb 100644 --- a/vehicle-data-platform/apps/web/src/styles/global.css +++ b/vehicle-data-platform/apps/web/src/styles/global.css @@ -672,6 +672,82 @@ body { line-height: 18px; } +.vp-vehicle-priority-queue { + padding: 12px; + border: 1px solid rgba(255, 127, 0, 0.2); + border-radius: var(--vp-radius); + background: #fffaf3; + display: grid; + gap: 10px; +} + +.vp-vehicle-priority-queue-head { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; +} + +.vp-vehicle-priority-queue-head > div { + display: grid; + gap: 2px; +} + +.vp-vehicle-priority-queue-head .semi-typography-secondary { + font-size: 12px; + line-height: 18px; +} + +.vp-vehicle-priority-queue-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 8px; +} + +.vp-vehicle-priority-queue-item { + min-height: 118px; + padding: 10px 12px; + border: 1px solid rgba(255, 127, 0, 0.2); + border-radius: 8px; + background: #fff; + color: inherit; + cursor: pointer; + font: inherit; + text-align: left; + display: grid; + gap: 7px; + align-content: start; +} + +.vp-vehicle-priority-queue-item:hover, +.vp-vehicle-priority-queue-item:focus-visible { + border-color: rgba(255, 127, 0, 0.48); + box-shadow: 0 0 0 3px rgba(255, 127, 0, 0.08); + outline: none; +} + +.vp-vehicle-priority-queue-item strong { + color: var(--vp-text); + font-size: 18px; + line-height: 24px; + font-weight: 700; +} + +.vp-vehicle-priority-queue-item span { + color: var(--vp-text-muted); + font-size: 12px; + line-height: 18px; + word-break: break-word; +} + +.vp-vehicle-priority-queue-item em { + color: var(--vp-primary); + font-size: 12px; + font-style: normal; + font-weight: 700; + line-height: 18px; +} + .vp-fleet-next-actions { display: grid; gap: 9px; @@ -8237,6 +8313,7 @@ button.vp-realtime-command-item:focus-visible { .vp-customer-cockpit-actions, .vp-customer-vehicle-monitor, .vp-customer-vehicle-monitor-grid, + .vp-vehicle-priority-queue-grid, .vp-customer-cockpit .semi-card-body, .vp-customer-cockpit-metrics, .vp-customer-cockpit-trust, 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 dec9052f..f44a9ddc 100644 --- a/vehicle-data-platform/apps/web/src/test/App.test.tsx +++ b/vehicle-data-platform/apps/web/src/test/App.test.tsx @@ -829,6 +829,12 @@ test('dashboard exposes vehicle data center capability matrix', async () => { expect(screen.getByRole('button', { name: '客户问题处理台 轨迹能不能回放 打开轨迹回放' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: '客户问题处理台 需要导出哪些证据 查询历史导出' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: '客户问题处理台 哪些车需要通知处理 查看告警事件' })).toBeInTheDocument(); + expect(screen.getByText('车辆运营优先级队列')).toBeInTheDocument(); + expect(screen.getByText('先处理影响客户看车、查轨迹、算里程和收通知的问题车辆。')).toBeInTheDocument(); + expect(screen.getByRole('button', { name: '车辆运营优先级队列 告警待处理 7 辆 告警事件' })).toBeInTheDocument(); + expect(screen.getByRole('button', { name: '车辆运营优先级队列 无有效定位 208 辆 打开地图' })).toBeInTheDocument(); + expect(screen.getByRole('button', { name: '车辆运营优先级队列 身份未绑定 9 辆 维护绑定' })).toBeInTheDocument(); + expect(screen.getByRole('button', { name: '车辆运营优先级队列 暂无数据 461 辆 车辆列表' })).toBeInTheDocument(); expect(screen.getByText('今日先处理')).toBeInTheDocument(); expect(screen.getByRole('button', { name: '车辆运营建议 先处理告警车辆 进入告警' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: '车辆运营建议 选择一辆车复盘 车辆中心' })).toBeInTheDocument();