feat(platform): link quality issues to raw evidence

This commit is contained in:
lingniu
2026-07-04 12:32:51 +08:00
parent a960d1fdab
commit bed79e164d
3 changed files with 111 additions and 2 deletions

View File

@@ -265,6 +265,7 @@ export function Quality({
onOpenVehicle,
onOpenRealtime,
onOpenHistory,
onOpenRaw,
onOpenMileage,
onHealthLoaded,
onFiltersChange,
@@ -273,6 +274,7 @@ export function Quality({
onOpenVehicle: (vin: string, protocol?: string) => void;
onOpenRealtime?: (filters: Record<string, string>) => void;
onOpenHistory?: (filters: Record<string, string>) => void;
onOpenRaw?: (filters: Record<string, string>) => void;
onOpenMileage?: (filters: Record<string, string>) => void;
onHealthLoaded?: (health: OpsHealth) => void;
onFiltersChange?: (filters: Record<string, string>) => void;
@@ -367,6 +369,18 @@ export function Quality({
...(dateTo ? { dateTo } : {})
});
};
const openIssueRaw = (row: QualityIssueRow) => {
const lookup = qualityIssueVehicleLookup(row);
const dateFrom = issueEvidenceDate(row.lastSeen);
const dateTo = nextDate(dateFrom);
onOpenRaw?.({
keyword: lookup.key,
protocol: row.protocol,
...(dateFrom ? { dateFrom } : {}),
...(dateTo ? { dateTo } : {}),
includeFields: 'true'
});
};
const openIssueRealtime = (row: QualityIssueRow) => {
const lookup = qualityIssueVehicleLookup(row);
onOpenRealtime?.({
@@ -620,7 +634,7 @@ export function Quality({
},
{
title: '操作',
width: 410,
width: 480,
render: (_: unknown, row: QualityIssueRow) => {
const lookup = qualityIssueVehicleLookup(row);
return (
@@ -629,6 +643,7 @@ export function Quality({
<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 || !onOpenRaw} onClick={() => openIssueRaw(row)}> RAW</Button>
<Button size="small" disabled={!lookup.key || !onOpenMileage} onClick={() => openIssueMileage(row)}></Button>
<Button size="small" disabled={!lookup.key} onClick={() => onOpenVehicle(lookup.key, row.protocol)}>
{lookup.label}