From 562c26f061f364727c3db54d71b53c922f1f9c30 Mon Sep 17 00:00:00 2001 From: lingniu Date: Fri, 3 Jul 2026 23:41:49 +0800 Subject: [PATCH] feat(platform): show vehicle-level latest dashboard --- .../apps/web/src/pages/Dashboard.tsx | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx index bcf34fa7..c76279d0 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, QualityIssueRow, VehicleCoverageRow, VehicleRealtimeRow, VehicleRow } from '../api/types'; +import type { DashboardSummary, LinkHealth, ProtocolStat, QualityIssueRow, VehicleCoverageRow, VehicleRealtimeRow } from '../api/types'; import { PageHeader } from '../components/PageHeader'; import { StatusTag } from '../components/StatusTag'; @@ -17,7 +17,6 @@ function formatLag(value?: number | null) { export function Dashboard({ onOpenVehicle, onOpenQuality }: { onOpenVehicle: (vin: string) => void; onOpenQuality: () => void }) { const [summary, setSummary] = useState(null); - const [vehicles, setVehicles] = useState([]); const [coverage, setCoverage] = useState([]); const [locations, setLocations] = useState([]); const [qualityIssues, setQualityIssues] = useState([]); @@ -40,14 +39,12 @@ export function Dashboard({ onOpenVehicle, onOpenQuality }: { onOpenVehicle: (vi useEffect(() => { Promise.all([ api.dashboardSummary(), - api.vehicles(new URLSearchParams({ limit: '5' })), api.vehicleCoverage(new URLSearchParams({ limit: '8' })), api.vehicleRealtime(new URLSearchParams({ limit: '8' })), api.qualityIssues(new URLSearchParams({ limit: '5' })) ]) - .then(([nextSummary, vehiclePage, coveragePage, locationPage, qualityPage]) => { + .then(([nextSummary, coveragePage, locationPage, qualityPage]) => { setSummary(nextSummary); - setVehicles(vehiclePage.items); setCoverage(coveragePage.items); setLocations(locationPage.items); setQualityIssues(qualityPage.items); @@ -201,12 +198,21 @@ export function Dashboard({ onOpenVehicle, onOpenQuality }: { onOpenVehicle: (vi ( + + {row.protocols.map((protocol) => {protocol})} + + ) + }, + { title: '最后时间', dataIndex: 'lastSeen' }, + { title: '操作', width: 110, render: (_: unknown, row: VehicleRealtimeRow) => } ]} />