feat(platform-web): keep protocol when opening vehicle rows
This commit is contained in:
@@ -82,8 +82,9 @@ export default function App() {
|
||||
replaceHash(page);
|
||||
};
|
||||
|
||||
const openVehicle = async (keyword: string) => {
|
||||
const openVehicle = async (keyword: string, protocol?: string) => {
|
||||
const lookupKey = keyword.trim();
|
||||
const nextProtocol = protocol?.trim() ?? '';
|
||||
if (!lookupKey) {
|
||||
return;
|
||||
}
|
||||
@@ -91,9 +92,9 @@ export default function App() {
|
||||
const resolved = await api.vehicleResolve(new URLSearchParams({ keyword: lookupKey }));
|
||||
const nextKey = resolved.resolved && resolved.vin ? resolved.vin : lookupKey;
|
||||
setActiveVin(nextKey);
|
||||
setActiveProtocol('');
|
||||
setActiveProtocol(nextProtocol);
|
||||
setActivePage('detail');
|
||||
replaceHash('detail', nextKey);
|
||||
replaceHash('detail', nextKey, nextProtocol);
|
||||
if (!resolved.resolved) {
|
||||
Toast.warning('未匹配到车辆身份,已打开问题排查视图');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user