feat(platform): link vehicle rows to quality evidence
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user