refactor: 路由参数 from 改为fromPage
This commit is contained in:
@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
|
|||||||
const { ndmDevice, station } = toRefs(props);
|
const { ndmDevice, station } = toRefs(props);
|
||||||
|
|
||||||
const showPageHeader = computed(() => {
|
const showPageHeader = computed(() => {
|
||||||
return !!route.query['from'];
|
return !!route.query['fromPage'];
|
||||||
});
|
});
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
router.push({ path: `${route.query['from']}` });
|
router.push({ path: `${route.query['fromPage']}` });
|
||||||
};
|
};
|
||||||
|
|
||||||
const activeTabName = ref('当前诊断');
|
const activeTabName = ref('当前诊断');
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
|
|||||||
const { ndmDevice, station } = toRefs(props);
|
const { ndmDevice, station } = toRefs(props);
|
||||||
|
|
||||||
const showPageHeader = computed(() => {
|
const showPageHeader = computed(() => {
|
||||||
return !!route.query['from'];
|
return !!route.query['fromPage'];
|
||||||
});
|
});
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
router.push({ path: `${route.query['from']}` });
|
router.push({ path: `${route.query['fromPage']}` });
|
||||||
};
|
};
|
||||||
|
|
||||||
const activeTabName = ref('当前诊断');
|
const activeTabName = ref('当前诊断');
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
|
|||||||
const { ndmDevice, station } = toRefs(props);
|
const { ndmDevice, station } = toRefs(props);
|
||||||
|
|
||||||
const showPageHeader = computed(() => {
|
const showPageHeader = computed(() => {
|
||||||
return !!route.query['from'];
|
return !!route.query['fromPage'];
|
||||||
});
|
});
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
router.push({ path: `${route.query['from']}` });
|
router.push({ path: `${route.query['fromPage']}` });
|
||||||
};
|
};
|
||||||
|
|
||||||
const activeTabName = ref('当前诊断');
|
const activeTabName = ref('当前诊断');
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
|
|||||||
const { ndmDevice, station } = toRefs(props);
|
const { ndmDevice, station } = toRefs(props);
|
||||||
|
|
||||||
const showPageHeader = computed(() => {
|
const showPageHeader = computed(() => {
|
||||||
return !!route.query['from'];
|
return !!route.query['fromPage'];
|
||||||
});
|
});
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
router.push({ path: `${route.query['from']}` });
|
router.push({ path: `${route.query['fromPage']}` });
|
||||||
};
|
};
|
||||||
|
|
||||||
const activeTabName = ref('当前诊断');
|
const activeTabName = ref('当前诊断');
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
|
|||||||
const { ndmDevice, station } = toRefs(props);
|
const { ndmDevice, station } = toRefs(props);
|
||||||
|
|
||||||
const showPageHeader = computed(() => {
|
const showPageHeader = computed(() => {
|
||||||
return !!route.query['from'];
|
return !!route.query['fromPage'];
|
||||||
});
|
});
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
router.push({ path: `${route.query['from']}` });
|
router.push({ path: `${route.query['fromPage']}` });
|
||||||
};
|
};
|
||||||
|
|
||||||
const activeTabName = ref('当前诊断');
|
const activeTabName = ref('当前诊断');
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
|
|||||||
const { ndmDevice, station } = toRefs(props);
|
const { ndmDevice, station } = toRefs(props);
|
||||||
|
|
||||||
const showPageHeader = computed(() => {
|
const showPageHeader = computed(() => {
|
||||||
return !!route.query['from'];
|
return !!route.query['fromPage'];
|
||||||
});
|
});
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
router.push({ path: `${route.query['from']}` });
|
router.push({ path: `${route.query['fromPage']}` });
|
||||||
};
|
};
|
||||||
|
|
||||||
const activeTabName = ref('当前诊断');
|
const activeTabName = ref('当前诊断');
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
|
|||||||
const { ndmDevice, station } = toRefs(props);
|
const { ndmDevice, station } = toRefs(props);
|
||||||
|
|
||||||
const showPageHeader = computed(() => {
|
const showPageHeader = computed(() => {
|
||||||
return !!route.query['from'];
|
return !!route.query['fromPage'];
|
||||||
});
|
});
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
router.push({ path: `${route.query['from']}` });
|
router.push({ path: `${route.query['fromPage']}` });
|
||||||
};
|
};
|
||||||
|
|
||||||
const activeTabName = ref('当前诊断');
|
const activeTabName = ref('当前诊断');
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ const { debugModeEnabled } = storeToRefs(settingStore);
|
|||||||
const { ndmDevice, station } = toRefs(props);
|
const { ndmDevice, station } = toRefs(props);
|
||||||
|
|
||||||
const showPageHeader = computed(() => {
|
const showPageHeader = computed(() => {
|
||||||
return !!route.query['from'];
|
return !!route.query['fromPage'];
|
||||||
});
|
});
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
router.push({ path: `${route.query['from']}` });
|
router.push({ path: `${route.query['fromPage']}` });
|
||||||
};
|
};
|
||||||
|
|
||||||
const activeTabName = ref('当前诊断');
|
const activeTabName = ref('当前诊断');
|
||||||
|
|||||||
@@ -58,16 +58,16 @@ export const useDeviceSelection = () => {
|
|||||||
stationCode,
|
stationCode,
|
||||||
deviceType,
|
deviceType,
|
||||||
deviceDbId,
|
deviceDbId,
|
||||||
from: route.path,
|
fromPage: route.path,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const syncToRoute = () => {
|
const syncToRoute = () => {
|
||||||
const query = { ...route.query };
|
const query = { ...route.query };
|
||||||
// 当选中的设备发生变化时,删除from参数
|
// 当选中的设备发生变化时,删除fromPage参数
|
||||||
if (selectedDevice.value?.id && route.query.deviceDbId !== selectedDevice.value.id) {
|
if (selectedDevice.value?.id && route.query.deviceDbId !== selectedDevice.value.id) {
|
||||||
delete query['from'];
|
delete query['fromPage'];
|
||||||
}
|
}
|
||||||
if (selectedStationCode.value) {
|
if (selectedStationCode.value) {
|
||||||
query['stationCode'] = selectedStationCode.value;
|
query['stationCode'] = selectedStationCode.value;
|
||||||
|
|||||||
Reference in New Issue
Block a user