feat(platform): link quality issues to realtime status
This commit is contained in:
@@ -263,6 +263,7 @@ async function copyQualityShareURL() {
|
||||
|
||||
export function Quality({
|
||||
onOpenVehicle,
|
||||
onOpenRealtime,
|
||||
onOpenHistory,
|
||||
onOpenMileage,
|
||||
onHealthLoaded,
|
||||
@@ -270,6 +271,7 @@ export function Quality({
|
||||
initialFilters = {}
|
||||
}: {
|
||||
onOpenVehicle: (vin: string, protocol?: string) => void;
|
||||
onOpenRealtime?: (filters: Record<string, string>) => void;
|
||||
onOpenHistory?: (filters: Record<string, string>) => void;
|
||||
onOpenMileage?: (filters: Record<string, string>) => void;
|
||||
onHealthLoaded?: (health: OpsHealth) => void;
|
||||
@@ -365,6 +367,13 @@ export function Quality({
|
||||
...(dateTo ? { dateTo } : {})
|
||||
});
|
||||
};
|
||||
const openIssueRealtime = (row: QualityIssueRow) => {
|
||||
const lookup = qualityIssueVehicleLookup(row);
|
||||
onOpenRealtime?.({
|
||||
keyword: lookup.key,
|
||||
protocol: row.protocol
|
||||
});
|
||||
};
|
||||
const openIssueMileage = (row: QualityIssueRow) => {
|
||||
const lookup = qualityIssueVehicleLookup(row);
|
||||
const dateFrom = issueEvidenceDate(row.lastSeen);
|
||||
@@ -611,13 +620,14 @@ export function Quality({
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 330,
|
||||
width: 410,
|
||||
render: (_: unknown, row: QualityIssueRow) => {
|
||||
const lookup = qualityIssueVehicleLookup(row);
|
||||
return (
|
||||
<Space spacing={4}>
|
||||
<Space spacing={4} wrap>
|
||||
<Button size="small" icon={<IconCopy />} onClick={() => copyText(row.phone, '手机号')}>手机号</Button>
|
||||
<Button size="small" icon={<IconCopy />} onClick={() => copyText(row.sourceEndpoint, '来源')}>来源</Button>
|
||||
<Button size="small" disabled={!lookup.key || !onOpenRealtime} onClick={() => openIssueRealtime(row)}>实时状态</Button>
|
||||
<Button size="small" disabled={!lookup.key || !onOpenHistory} onClick={() => openIssueHistory(row)}>核对历史</Button>
|
||||
<Button size="small" disabled={!lookup.key || !onOpenMileage} onClick={() => openIssueMileage(row)}>核对里程</Button>
|
||||
<Button size="small" disabled={!lookup.key} onClick={() => onOpenVehicle(lookup.key, row.protocol)}>
|
||||
|
||||
Reference in New Issue
Block a user