feat(platform-web): show searched vehicle identity context

This commit is contained in:
lingniu
2026-07-04 02:35:55 +08:00
parent 337e9f3dac
commit 80bd726455
3 changed files with 7 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ export default function App() {
const [activeProtocol, setActiveProtocol] = useState(initialRoute.protocol ?? '');
const [linkIssueCount, setLinkIssueCount] = useState<number | null>(null);
const [currentVehicleStatus, setCurrentVehicleStatus] = useState<VehicleServiceStatus | undefined>();
const [currentVehicleLabel, setCurrentVehicleLabel] = useState('');
const refreshOpsHealth = useCallback((showError = true) => {
return api.opsHealth()
@@ -94,6 +95,7 @@ export default function App() {
const resolved = await api.vehicleResolve(new URLSearchParams({ keyword: lookupKey }));
const nextKey = resolved.resolved && resolved.vin ? resolved.vin : lookupKey;
setCurrentVehicleStatus(resolved.serviceStatus);
setCurrentVehicleLabel(resolved.resolved ? [resolved.plate, resolved.vin || nextKey].filter(Boolean).join(' / ') : lookupKey);
setActiveVin(nextKey);
setActiveProtocol(nextProtocol);
setActivePage('detail');
@@ -152,7 +154,7 @@ export default function App() {
};
return (
<AppShell activePage={activePage} linkIssueCount={linkIssueCount} currentVehicleStatus={currentVehicleStatus} onChange={navigatePage} onVehicleSearch={openVehicle}>
<AppShell activePage={activePage} linkIssueCount={linkIssueCount} currentVehicleStatus={currentVehicleStatus} currentVehicleLabel={currentVehicleLabel} onChange={navigatePage} onVehicleSearch={openVehicle}>
{pages[activePage]}
</AppShell>
);