feat(platform): show archive gaps per vehicle
This commit is contained in:
@@ -40,6 +40,15 @@ function vehicleArchiveCompleteness(row: VehicleCoverageRow) {
|
||||
return { completed, total: fields.length, label: `${completed}/${fields.length}` };
|
||||
}
|
||||
|
||||
function vehicleArchiveMissingLabels(row: VehicleCoverageRow) {
|
||||
return [
|
||||
{ value: row.vin, label: '缺VIN' },
|
||||
{ value: row.plate, label: '缺车牌' },
|
||||
{ value: row.phone, label: '缺手机号' },
|
||||
{ value: row.oem, label: '缺OEM' }
|
||||
].filter((item) => !String(item.value ?? '').trim()).map((item) => item.label);
|
||||
}
|
||||
|
||||
const coverageLabel: Record<string, string> = {
|
||||
single: '单源',
|
||||
multi: '多源'
|
||||
@@ -265,10 +274,18 @@ export function Vehicles({
|
||||
{ title: 'OEM', dataIndex: 'oem', width: 120 },
|
||||
{
|
||||
title: '档案完整度',
|
||||
width: 120,
|
||||
width: 190,
|
||||
render: (_: unknown, row: VehicleCoverageRow) => {
|
||||
const archive = vehicleArchiveCompleteness(row);
|
||||
return <Tag color={archive.completed === archive.total ? 'green' : 'orange'}>{archive.label}</Tag>;
|
||||
const missingLabels = vehicleArchiveMissingLabels(row);
|
||||
return (
|
||||
<Space spacing={4} wrap>
|
||||
<Tag color={archive.completed === archive.total ? 'green' : 'orange'}>{archive.label}</Tag>
|
||||
{missingLabels.map((label) => (
|
||||
<Tag key={label} color="orange">{label}</Tag>
|
||||
))}
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user