feat(platform): link dashboard quality preview

This commit is contained in:
lingniu
2026-07-03 22:50:40 +08:00
parent ad76eb45e4
commit 3b29851c1e
2 changed files with 7 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ function formatLag(value?: number | null) {
return value == null ? '未接入' : value.toLocaleString();
}
export function Dashboard({ onOpenVehicle }: { onOpenVehicle: (vin: string) => void }) {
export function Dashboard({ onOpenVehicle, onOpenQuality }: { onOpenVehicle: (vin: string) => void; onOpenQuality: () => void }) {
const [summary, setSummary] = useState<DashboardSummary | null>(null);
const [vehicles, setVehicles] = useState<VehicleRow[]>([]);
const [coverage, setCoverage] = useState<VehicleCoverageRow[]>([]);
@@ -113,7 +113,11 @@ export function Dashboard({ onOpenVehicle }: { onOpenVehicle: (vin: string) => v
<Card title="实时积压" bordered style={{ marginTop: 16 }}>
<Typography.Text>Kafka {formatLag(summary?.kafkaLag)}</Typography.Text>
</Card>
<Card title="质量问题预览" bordered style={{ marginTop: 16 }}>
<Card
title={<Space><span></span><Button size="small" onClick={onOpenQuality}></Button></Space>}
bordered
style={{ marginTop: 16 }}
>
<Table
pagination={false}
rowKey={(row?: QualityIssueRow) => `${row?.protocol ?? ''}-${row?.issueType ?? ''}-${row?.lastSeen ?? ''}-${row?.detail ?? ''}`}