feat(platform): link raw frames to mileage evidence
This commit is contained in:
@@ -294,6 +294,15 @@ export function History({
|
||||
...(day ? { dateFrom: day, dateTo: nextDate(day) } : {})
|
||||
});
|
||||
};
|
||||
const openRawMileage = (row: RawFrameRow) => {
|
||||
if (!canOpenVehicle(row.vin)) return;
|
||||
const day = dateOnly(row.deviceTime || row.serverTime);
|
||||
onOpenMileage?.({
|
||||
keyword: row.vin,
|
||||
protocol: row.protocol,
|
||||
...(day ? { dateFrom: day, dateTo: nextDate(day) } : {})
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="vp-page">
|
||||
@@ -500,10 +509,11 @@ export function History({
|
||||
{ title: '入库时间', dataIndex: 'serverTime', width: 190 },
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
width: 280,
|
||||
render: (_: unknown, row: RawFrameRow) => (
|
||||
<Space>
|
||||
<Space wrap>
|
||||
<Button onClick={() => setSelectedRaw(row)}>字段</Button>
|
||||
<Button disabled={!canOpenVehicle(row.vin) || !onOpenMileage} onClick={() => openRawMileage(row)}>核对里程</Button>
|
||||
<Button disabled={!canOpenVehicle(row.vin)} onClick={() => onOpenVehicle(row.vin, row.protocol)}>车辆服务</Button>
|
||||
</Space>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user