feat(platform): resolve vehicle identity before navigation
This commit is contained in:
@@ -37,13 +37,22 @@ export default function App() {
|
||||
return () => window.clearInterval(timer);
|
||||
}, [refreshOpsHealth]);
|
||||
|
||||
const openVehicle = (vin: string) => {
|
||||
const nextVin = vin.trim();
|
||||
if (!nextVin) {
|
||||
const openVehicle = async (keyword: string) => {
|
||||
const lookupKey = keyword.trim();
|
||||
if (!lookupKey) {
|
||||
return;
|
||||
}
|
||||
setActiveVin(nextVin);
|
||||
setActivePage('detail');
|
||||
try {
|
||||
const resolved = await api.vehicleResolve(new URLSearchParams({ keyword: lookupKey }));
|
||||
const nextKey = resolved.resolved && resolved.vin ? resolved.vin : lookupKey;
|
||||
setActiveVin(nextKey);
|
||||
setActivePage('detail');
|
||||
if (!resolved.resolved) {
|
||||
Toast.warning('未匹配到车辆身份,已打开问题排查视图');
|
||||
}
|
||||
} catch (error) {
|
||||
Toast.error(error instanceof Error ? error.message : '车辆查询失败');
|
||||
}
|
||||
};
|
||||
|
||||
const openHistoryForVehicle = (vin: string) => {
|
||||
|
||||
Reference in New Issue
Block a user