feat(platform-web): carry detail source to analysis links

This commit is contained in:
lingniu
2026-07-04 01:31:50 +08:00
parent a12d86e6f4
commit 9886fe2481
3 changed files with 90 additions and 9 deletions

View File

@@ -103,24 +103,28 @@ export default function App() {
}
};
const openHistoryForVehicle = (vin: string) => {
const openHistoryForVehicle = (vin: string, protocol?: string) => {
const nextVin = vin.trim();
const nextProtocol = protocol?.trim() ?? activeProtocol;
if (!nextVin) {
return;
}
setAnalysisVin(nextVin);
setActiveProtocol(nextProtocol);
setActivePage('history');
replaceHash('history', nextVin, activeProtocol);
replaceHash('history', nextVin, nextProtocol);
};
const openMileageForVehicle = (vin: string) => {
const openMileageForVehicle = (vin: string, protocol?: string) => {
const nextVin = vin.trim();
const nextProtocol = protocol?.trim() ?? activeProtocol;
if (!nextVin) {
return;
}
setAnalysisVin(nextVin);
setActiveProtocol(nextProtocol);
setActivePage('mileage');
replaceHash('mileage', nextVin, activeProtocol);
replaceHash('mileage', nextVin, nextProtocol);
};
const updateVehicleDetailQuery = (keyword: string, protocol?: string) => {