refactor: 路由参数 from 改为fromPage

This commit is contained in:
yangsy
2025-12-18 21:35:34 +08:00
parent fee9c5ef6c
commit d0b065d6ba
9 changed files with 19 additions and 19 deletions

View File

@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
const { ndmDevice, station } = toRefs(props);
const showPageHeader = computed(() => {
return !!route.query['from'];
return !!route.query['fromPage'];
});
const onBack = () => {
router.push({ path: `${route.query['from']}` });
router.push({ path: `${route.query['fromPage']}` });
};
const activeTabName = ref('当前诊断');

View File

@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
const { ndmDevice, station } = toRefs(props);
const showPageHeader = computed(() => {
return !!route.query['from'];
return !!route.query['fromPage'];
});
const onBack = () => {
router.push({ path: `${route.query['from']}` });
router.push({ path: `${route.query['fromPage']}` });
};
const activeTabName = ref('当前诊断');

View File

@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
const { ndmDevice, station } = toRefs(props);
const showPageHeader = computed(() => {
return !!route.query['from'];
return !!route.query['fromPage'];
});
const onBack = () => {
router.push({ path: `${route.query['from']}` });
router.push({ path: `${route.query['fromPage']}` });
};
const activeTabName = ref('当前诊断');

View File

@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
const { ndmDevice, station } = toRefs(props);
const showPageHeader = computed(() => {
return !!route.query['from'];
return !!route.query['fromPage'];
});
const onBack = () => {
router.push({ path: `${route.query['from']}` });
router.push({ path: `${route.query['fromPage']}` });
};
const activeTabName = ref('当前诊断');

View File

@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
const { ndmDevice, station } = toRefs(props);
const showPageHeader = computed(() => {
return !!route.query['from'];
return !!route.query['fromPage'];
});
const onBack = () => {
router.push({ path: `${route.query['from']}` });
router.push({ path: `${route.query['fromPage']}` });
};
const activeTabName = ref('当前诊断');

View File

@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
const { ndmDevice, station } = toRefs(props);
const showPageHeader = computed(() => {
return !!route.query['from'];
return !!route.query['fromPage'];
});
const onBack = () => {
router.push({ path: `${route.query['from']}` });
router.push({ path: `${route.query['fromPage']}` });
};
const activeTabName = ref('当前诊断');

View File

@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
const { ndmDevice, station } = toRefs(props);
const showPageHeader = computed(() => {
return !!route.query['from'];
return !!route.query['fromPage'];
});
const onBack = () => {
router.push({ path: `${route.query['from']}` });
router.push({ path: `${route.query['fromPage']}` });
};
const activeTabName = ref('当前诊断');

View File

@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
const { ndmDevice, station } = toRefs(props);
const showPageHeader = computed(() => {
return !!route.query['from'];
return !!route.query['fromPage'];
});
const onBack = () => {
router.push({ path: `${route.query['from']}` });
router.push({ path: `${route.query['fromPage']}` });
};
const activeTabName = ref('当前诊断');

View File

@@ -58,16 +58,16 @@ export const useDeviceSelection = () => {
stationCode,
deviceType,
deviceDbId,
from: route.path,
fromPage: route.path,
},
});
};
const syncToRoute = () => {
const query = { ...route.query };
// 当选中的设备发生变化时删除from参数
// 当选中的设备发生变化时删除fromPage参数
if (selectedDevice.value?.id && route.query.deviceDbId !== selectedDevice.value.id) {
delete query['from'];
delete query['fromPage'];
}
if (selectedStationCode.value) {
query['stationCode'] = selectedStationCode.value;