feat(platform): summarize missing vehicle sources
This commit is contained in:
@@ -120,6 +120,7 @@ export function Dashboard({ onOpenVehicle, onOpenQuality, onOpenVehicles }: { on
|
||||
{ label: '暂无来源车辆', value: formatCount(serviceSummary?.noDataVehicles), filters: { serviceStatus: 'no_data' } },
|
||||
{ label: '身份未绑定', value: formatCount(serviceSummary?.identityRequiredVehicles), filters: { serviceStatus: 'identity_required' } }
|
||||
];
|
||||
const missingSourceCounts = new Map((serviceSummary?.missingSources ?? []).map((item) => [item.protocol, item.count]));
|
||||
|
||||
return (
|
||||
<div className="vp-page">
|
||||
@@ -175,6 +176,24 @@ export function Dashboard({ onOpenVehicle, onOpenQuality, onOpenVehicles }: { on
|
||||
{
|
||||
title: '在线率',
|
||||
render: (_: unknown, row: ProtocolStat) => `${Math.round((row.online / row.total) * 100)}%`
|
||||
},
|
||||
{
|
||||
title: '缺失车辆',
|
||||
render: (_: unknown, row: ProtocolStat) => {
|
||||
const missingCount = missingSourceCounts.get(row.protocol);
|
||||
if (missingCount == null) {
|
||||
return '-';
|
||||
}
|
||||
return (
|
||||
<Button
|
||||
aria-label={`查看缺 ${row.protocol}`}
|
||||
size="small"
|
||||
onClick={() => loadCoverage({ missingProtocol: row.protocol })}
|
||||
>
|
||||
{formatCount(missingCount)}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
}
|
||||
]}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user