feat(platform): link quality issues to realtime status

This commit is contained in:
lingniu
2026-07-04 12:10:28 +08:00
parent 4ef71c37f2
commit 2465bd7f16
3 changed files with 100 additions and 3 deletions

View File

@@ -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)}>