|
|
@@ -69,15 +69,8 @@ const route = useRoute();
|
|
|
const { configs, fetchConfigs } = useInitConfigs();
|
|
|
const { updateEnhancedConfigs, updateData, data } = useInitPage('皮带巷智能管控');
|
|
|
const pageType = computed(() => {
|
|
|
- const queryType = route.query.pageType;
|
|
|
- if (queryType) {
|
|
|
- return queryType;
|
|
|
- } else {
|
|
|
- const isFireMonitorPath = window.location.href.includes('fireMonitor');
|
|
|
- const isEmergencyControlPath = window.location.href.includes('emergencyControl');
|
|
|
- const isSprayControlPath = window.location.href.includes('sprayControl');
|
|
|
- return isFireMonitorPath ? 'fireMonitor' : isEmergencyControlPath ? 'emergencyControl' : isSprayControlPath ? 'sprayControl' : 'fireMonitor';
|
|
|
- }
|
|
|
+ const currentType = route.params.type as string;
|
|
|
+ return currentType;
|
|
|
});
|
|
|
|
|
|
// 下拉框选项
|
|
|
@@ -263,11 +256,12 @@ function initInterval() {
|
|
|
}
|
|
|
|
|
|
watch(
|
|
|
- () => route.query.pageType,
|
|
|
+ // 监听动态路由参数 :type
|
|
|
+ () => route.params.type,
|
|
|
(newVal) => {
|
|
|
if (newVal) {
|
|
|
- console.log('切换页面:', newVal);
|
|
|
- refresh(); // 关键:切换菜单自动刷新
|
|
|
+ console.log('切换页面类型:', newVal);
|
|
|
+ refresh(); // 切换路由自动刷新
|
|
|
}
|
|
|
},
|
|
|
{ immediate: true }
|