feat(platform): show vehicle archive completeness

This commit is contained in:
lingniu
2026-07-04 09:33:45 +08:00
parent d4ff7d8b83
commit 817e5324f6
2 changed files with 16 additions and 0 deletions

View File

@@ -34,6 +34,12 @@ function sourceEvidenceText(row: VehicleCoverageRow) {
return `${row.onlineSourceCount}/${row.sourceCount} 来源在线`;
}
function vehicleArchiveCompleteness(row: VehicleCoverageRow) {
const fields = [row.vin, row.plate, row.phone, row.oem];
const completed = fields.filter((item) => Boolean(String(item ?? '').trim())).length;
return { completed, total: fields.length, label: `${completed}/${fields.length}` };
}
const coverageLabel: Record<string, string> = {
single: '单源',
multi: '多源'
@@ -226,6 +232,14 @@ export function Vehicles({
{ title: '车牌', dataIndex: 'plate', width: 120 },
{ title: '手机号', dataIndex: 'phone', width: 130 },
{ title: 'OEM', dataIndex: 'oem', width: 120 },
{
title: '档案完整度',
width: 120,
render: (_: unknown, row: VehicleCoverageRow) => {
const archive = vehicleArchiveCompleteness(row);
return <Tag color={archive.completed === archive.total ? 'green' : 'orange'}>{archive.label}</Tag>;
}
},
{
title: '车辆服务状态',
width: 130,

View File

@@ -660,6 +660,8 @@ test('shows vehicle service result summary on vehicle list filters', async () =>
expect(screen.getByRole('button', { name: '维护身份绑定 9' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '确认平台转发 4' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '补齐 YUTONG_MQTT 来源 181' })).toBeInTheDocument();
expect(screen.getByText('档案完整度')).toBeInTheDocument();
expect(screen.getByText('4/4')).toBeInTheDocument();
expect(screen.getByText('VIN-MULTI-001')).toBeInTheDocument();
expect(screen.getAllByText('来源证据').length).toBeGreaterThanOrEqual(1);
expect(screen.getByText('GB32960 在线')).toBeInTheDocument();