feat(platform-web): keep protocol when opening vehicle rows
This commit is contained in:
@@ -32,7 +32,7 @@ function canOpenVehicle(vin?: string) {
|
||||
return Boolean(value && value !== 'unknown');
|
||||
}
|
||||
|
||||
export function Mileage({ initialVin, initialProtocol, onOpenVehicle }: { initialVin: string; initialProtocol?: string; onOpenVehicle: (vin: string) => void }) {
|
||||
export function Mileage({ initialVin, initialProtocol, onOpenVehicle }: { initialVin: string; initialProtocol?: string; onOpenVehicle: (vin: string, protocol?: string) => void }) {
|
||||
const [rows, setRows] = useState<DailyMileageRow[]>([]);
|
||||
const [summary, setSummary] = useState<MileageSummary>(emptySummary);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -134,7 +134,7 @@ export function Mileage({ initialVin, initialProtocol, onOpenVehicle }: { initia
|
||||
title: '操作',
|
||||
width: 110,
|
||||
render: (_: unknown, row: DailyMileageRow) => (
|
||||
<Button disabled={!canOpenVehicle(row.vin)} onClick={() => onOpenVehicle(row.vin)}>车辆服务</Button>
|
||||
<Button disabled={!canOpenVehicle(row.vin)} onClick={() => onOpenVehicle(row.vin, row.source)}>车辆服务</Button>
|
||||
)
|
||||
}
|
||||
]}
|
||||
|
||||
Reference in New Issue
Block a user