diff --git a/vehicle-data-platform/apps/web/src/pages/Vehicles.tsx b/vehicle-data-platform/apps/web/src/pages/Vehicles.tsx index b3f83ca7..bac9784d 100644 --- a/vehicle-data-platform/apps/web/src/pages/Vehicles.tsx +++ b/vehicle-data-platform/apps/web/src/pages/Vehicles.tsx @@ -189,23 +189,51 @@ export function Vehicles({ } return items; }, [pagination.total, summary]); - const actionQueue = useMemo; color: 'orange' | 'red' }>>(() => { - const items: Array<{ label: string; count: number; filters: Record; color: 'orange' | 'red' }> = []; + const actionQueue = useMemo; color: 'orange' | 'red'; priority: 'P0' | 'P1'; detail: string }>>(() => { + const items: Array<{ label: string; count: number; filters: Record; color: 'orange' | 'red'; priority: 'P0' | 'P1'; detail: string }> = []; const unboundCount = summary?.unboundVehicles ?? 0; if (unboundCount > 0) { - items.push({ label: '维护身份绑定', count: unboundCount, filters: { bindingStatus: 'unbound' }, color: 'orange' }); + items.push({ + label: '维护身份绑定', + count: unboundCount, + filters: { bindingStatus: 'unbound' }, + color: 'orange', + priority: 'P0', + detail: '已有数据但无法归并到 VIN,先补绑定再看跨来源服务。' + }); } const noDataCount = summary?.noDataVehicles ?? 0; if (noDataCount > 0) { - items.push({ label: '确认平台转发', count: noDataCount, filters: { serviceStatus: 'no_data' }, color: 'orange' }); + items.push({ + label: '确认平台转发', + count: noDataCount, + filters: { serviceStatus: 'no_data' }, + color: 'orange', + priority: 'P0', + detail: '车辆没有任何来源证据,优先确认平台转发、端口和订阅配置。' + }); } const archiveIncompleteCount = summary?.archiveIncompleteVehicles ?? 0; if (archiveIncompleteCount > 0) { - items.push({ label: '完善车辆档案', count: archiveIncompleteCount, filters: { archiveStatus: 'incomplete' }, color: 'orange' }); + items.push({ + label: '完善车辆档案', + count: archiveIncompleteCount, + filters: { archiveStatus: 'incomplete' }, + color: 'orange', + priority: 'P1', + detail: '车辆缺少车牌、手机号或 OEM 等基础档案,影响后续运营查询和治理。' + }); } for (const field of summary?.archiveMissingFields ?? []) { if (field.count <= 0) continue; - items.push({ label: `补齐${field.title}`, count: field.count, filters: { archiveMissing: field.field }, color: 'orange' }); + items.push({ + label: `补齐${field.title}`, + count: field.count, + filters: { archiveMissing: field.field }, + color: 'orange', + priority: 'P1', + detail: `${field.title}会影响车辆档案检索、绑定确认和运营侧筛选。` + }); } for (const source of summary?.missingSources ?? []) { if (source.count <= 0) continue; @@ -213,7 +241,9 @@ export function Vehicles({ label: `补齐 ${source.protocol} 来源`, count: source.count, filters: { missingProtocol: source.protocol }, - color: 'orange' + color: 'orange', + priority: 'P1', + detail: `${source.protocol} 来源缺失会降低跨来源定位、里程和实时判断可信度。` }); } return items; @@ -438,13 +468,22 @@ export function Vehicles({ {actionQueue.length > 0 ? ( - +
{actionQueue.map((item) => ( - +
+
+ + {item.priority} + {item.label} {item.count.toLocaleString()} + +
{item.detail}
+
+ +
))} - +
) : 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 12adae1e..df3651aa 100644 --- a/vehicle-data-platform/apps/web/src/test/App.test.tsx +++ b/vehicle-data-platform/apps/web/src/test/App.test.tsx @@ -685,6 +685,12 @@ test('shows vehicle service result summary on vehicle list filters', async () => expect(screen.getByText('档案不完整')).toBeInTheDocument(); expect(screen.getAllByText('缺手机号').length).toBeGreaterThanOrEqual(2); expect(screen.getByText('处置队列')).toBeInTheDocument(); + expect(screen.getAllByText('P0').length).toBeGreaterThanOrEqual(2); + expect(screen.getAllByText('P1').length).toBeGreaterThanOrEqual(2); + expect(screen.getByText('已有数据但无法归并到 VIN,先补绑定再看跨来源服务。')).toBeInTheDocument(); + expect(screen.getByText('车辆没有任何来源证据,优先确认平台转发、端口和订阅配置。')).toBeInTheDocument(); + expect(screen.getByText('缺手机号会影响车辆档案检索、绑定确认和运营侧筛选。')).toBeInTheDocument(); + expect(screen.getByText('YUTONG_MQTT 来源缺失会降低跨来源定位、里程和实时判断可信度。')).toBeInTheDocument(); expect(screen.getByRole('button', { name: '维护身份绑定 9' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: '确认平台转发 4' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: '补齐缺手机号 7' })).toBeInTheDocument();