diff --git a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx index ebdf2d2a..378dc350 100644 --- a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx +++ b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx @@ -1,7 +1,7 @@ import { Button, Card, Col, Form, Row, Select, Space, Spin, Table, Tag, Toast, Typography } from '@douyinfe/semi-ui'; import { useEffect, useState } from 'react'; import { api } from '../api/client'; -import type { DashboardSummary, LinkHealth, ProtocolStat, RealtimeLocationRow, VehicleCoverageRow, VehicleRow } from '../api/types'; +import type { DashboardSummary, LinkHealth, ProtocolStat, QualityIssueRow, RealtimeLocationRow, VehicleCoverageRow, VehicleRow } from '../api/types'; import { PageHeader } from '../components/PageHeader'; import { StatusTag } from '../components/StatusTag'; @@ -20,6 +20,7 @@ export function Dashboard({ onOpenVehicle }: { onOpenVehicle: (vin: string) => v const [vehicles, setVehicles] = useState([]); const [coverage, setCoverage] = useState([]); const [locations, setLocations] = useState([]); + const [qualityIssues, setQualityIssues] = useState([]); const [loading, setLoading] = useState(true); const [coverageLoading, setCoverageLoading] = useState(false); @@ -41,13 +42,15 @@ export function Dashboard({ onOpenVehicle }: { onOpenVehicle: (vin: string) => v api.dashboardSummary(), api.vehicles(new URLSearchParams({ limit: '5' })), api.vehicleCoverage(new URLSearchParams({ limit: '8' })), - api.realtimeLocations(new URLSearchParams({ limit: '8' })) + api.realtimeLocations(new URLSearchParams({ limit: '8' })), + api.qualityIssues(new URLSearchParams({ limit: '5' })) ]) - .then(([nextSummary, vehiclePage, coveragePage, locationPage]) => { + .then(([nextSummary, vehiclePage, coveragePage, locationPage, qualityPage]) => { setSummary(nextSummary); setVehicles(vehiclePage.items); setCoverage(coveragePage.items); setLocations(locationPage.items); + setQualityIssues(qualityPage.items); }) .catch((error: Error) => Toast.error(error.message)) .finally(() => setLoading(false)); @@ -110,6 +113,22 @@ export function Dashboard({ onOpenVehicle }: { onOpenVehicle: (vin: string) => v Kafka 当前消费积压:{formatLag(summary?.kafkaLag)} + + `${row?.protocol ?? ''}-${row?.issueType ?? ''}-${row?.lastSeen ?? ''}-${row?.detail ?? ''}`} + dataSource={qualityIssues} + columns={[ + { title: 'VIN', dataIndex: 'vin', width: 160 }, + { title: '车牌', dataIndex: 'plate', width: 110 }, + { title: '来源', dataIndex: 'protocol', width: 110 }, + { title: '问题', dataIndex: 'issueType', width: 140 }, + { title: '级别', width: 90, render: (_: unknown, row: QualityIssueRow) => {row.severity} }, + { title: '最后时间', dataIndex: 'lastSeen', width: 170 }, + { title: '说明', dataIndex: 'detail' } + ]} + /> +
loadCoverage(values as Record)} style={{ marginBottom: 12 }}>