feat(platform): link vehicle rows to quality evidence

This commit is contained in:
lingniu
2026-07-04 12:01:28 +08:00
parent fb6d8c323a
commit 276da59194
3 changed files with 117 additions and 3 deletions

View File

@@ -177,10 +177,12 @@ async function copyVehicleShareURL() {
export function Vehicles({
onOpenVehicle,
onOpenQuality,
onFiltersChange,
initialFilters = {}
}: {
onOpenVehicle: (vin: string, protocol?: string) => void;
onOpenQuality?: (filters: Record<string, string>) => void;
onFiltersChange?: (filters: Record<string, string>) => void;
initialFilters?: Record<string, string>;
}) {
@@ -415,9 +417,18 @@ export function Vehicles({
{ title: '在线', width: 90, render: (_: unknown, row: VehicleCoverageRow) => <StatusTag status={row.online ? 'ok' : 'offline'} /> },
{ title: '最后在线', dataIndex: 'lastSeen', width: 170 },
{ title: '绑定', width: 90, render: (_: unknown, row: VehicleCoverageRow) => <Tag color={row.bindingStatus === 'bound' ? 'green' : 'orange'}>{row.bindingStatus === 'bound' ? '已绑定' : '未绑定'}</Tag> },
{ title: '操作', width: 110, render: (_: unknown, row: VehicleCoverageRow) => <Button onClick={() => onOpenVehicle(row.vin, filters.protocol)}></Button> }
{
title: '操作',
width: 190,
render: (_: unknown, row: VehicleCoverageRow) => (
<Space>
<Button onClick={() => onOpenVehicle(row.vin, filters.protocol)}></Button>
<Button disabled={!row.vin || !onOpenQuality} onClick={() => onOpenQuality?.({ keyword: row.vin, ...(filters.protocol ? { protocol: filters.protocol } : {}) })}></Button>
</Space>
)
}
],
[filters, onOpenVehicle]
[filters, onOpenQuality, onOpenVehicle]
);
return (