import { IconBarChartVStroked, IconBox, IconChevronDown, IconChevronLeft, IconChevronRight, IconClock, IconClose, IconCopy, IconFilter, IconHelpCircle, IconHome, IconMore, IconRefresh, IconRoute, IconSearch } from '@douyinfe/semi-icons'; import { type CSSProperties, type FormEvent, type KeyboardEvent, type PointerEvent, useDeferredValue, useEffect, useMemo, useRef, useState } from 'react'; type DirectoryView = 'all' | 'online' | 'offline' | 'multi'; type VehicleStatus = 'online' | 'offline'; type ProtocolKind = 'JT/T 808' | 'GB/T 32960' | '宇通 MQTT'; type VehicleRecord = { plate: string; vin: string; brand: string; terminal: string; status: VehicleStatus; updatedAt: string; protocols: ProtocolKind[]; department: string; owner: string; customer: string; }; const vehicles: VehicleRecord[] = [ { plate: '粤AG18312', vin: 'LB9A32A24R0LS1426', brand: 'G7s', terminal: '13307795425', status: 'online', updatedAt: '07-03 20:12', protocols: ['JT/T 808', 'GB/T 32960'], department: '华南运营部', owner: '陈思远', customer: '羚牛示范车队' }, { plate: '川AHTW01', vin: 'LNXNEGRR7SR318212', brand: 'Hyundai', terminal: '暂无终端手机号', status: 'online', updatedAt: '07-03 20:12', protocols: ['GB/T 32960'], department: '西南交付部', owner: '王凌', customer: '川渝联合车队' }, { plate: '豫A88888', vin: 'LMRKH9AC2R1004087', brand: '宇通', terminal: '暂无终端手机号', status: 'online', updatedAt: '07-03 20:11', protocols: ['宇通 MQTT'], department: '中原运营部', owner: '刘真', customer: '宇通测试车队' }, { plate: '粤AFF7936', vin: 'LB9A32A24P0LS1230', brand: '广安车联', terminal: '13307795426', status: 'offline', updatedAt: '07-03 19:58', protocols: ['JT/T 808'], department: '华南运营部', owner: '陈思远', customer: '羚牛示范车队' } ]; const navigation = [ { key: 'monitor', label: '全局监控', icon: IconHome }, { key: 'vehicles', label: '车辆查询', icon: IconSearch, active: true }, { key: 'tracks', label: '轨迹回放', icon: IconRoute }, { key: 'history', label: '历史数据', icon: IconClock }, { key: 'statistics', label: '里程查询', icon: IconBarChartVStroked } ]; const governanceNavigation = [ { key: 'alerts', label: '事件中心', icon: IconClock }, { key: 'access', label: '接入管理', icon: IconBox }, { key: 'users', label: '账号管理', icon: IconMore } ]; const viewOptions: Array<{ key: DirectoryView; label: string }> = [ { key: 'all', label: '全部车辆' }, { key: 'online', label: '当前在线' }, { key: 'offline', label: '当前离线' }, { key: 'multi', label: '多源车辆' } ]; function ProtocolTag({ protocol }: { protocol: ProtocolKind }) { const tone = protocol === 'JT/T 808' ? 'cyan' : protocol === 'GB/T 32960' ? 'blue' : 'violet'; return {protocol}; } function StatusTag({ status }: { status: VehicleStatus }) { return {status === 'online' ? '在线' : '离线'}; } function Sidebar() { const navigate = (key: string) => { if (key !== 'vehicles') window.location.href = `/platform-design-lab.html#${key}`; }; return ( ); } function TopBar({ onHelp }: { onHelp: () => void }) { return (
车辆查询 按车牌或 VIN 查询车辆档案和实时遥测。
); } type CommandSurfaceProps = { keyword: string; view: DirectoryView; department: string; owner: string; customer: string; status: string; onKeywordChange: (value: string) => void; onViewChange: (view: DirectoryView) => void; onDepartmentChange: (value: string) => void; onOwnerChange: (value: string) => void; onCustomerChange: (value: string) => void; onStatusChange: (value: string) => void; onSubmit: (event: FormEvent) => void; }; function CommandSurface({ keyword, view, department, owner, customer, status, onKeywordChange, onViewChange, onDepartmentChange, onOwnerChange, onCustomerChange, onStatusChange, onSubmit }: CommandSurfaceProps) { return (
); } function MobileCommandSurface({ keyword, onKeywordChange, onSubmit, activeFilterCount, onOpenFilters, onBatch }: { keyword: string; onKeywordChange: (value: string) => void; onSubmit: (event: FormEvent) => void; activeFilterCount: number; onOpenFilters: () => void; onBatch: () => void; }) { return ( <>