3
0

5 Коммиты 573215393f ... 7999a37955

Автор SHA1 Сообщение Дата
  houzekong 7999a37955 [Fix 0000] 修复部分页面异步操作报错及全局矿名更新错误的问题 1 месяц назад
  houzekong 3f6b7e93a8 [Pref 0000] 地图层级管理及交互优化 1 месяц назад
  houzekong 68870c5f5f [Feat 0000] 全系页面跳转功能更新 1 месяц назад
  houzekong f3169846af [Mod 0000] 修改组织树结构 1 месяц назад
  houzekong 5e49267626 [Mod 0000] 为地图添加更多固定标点位置信息 1 месяц назад
27 измененных файлов с 253 добавлено и 216 удалено
  1. 22 3
      src/api/sys/map.ts
  2. 5 2
      src/api/sys/menu.ts
  3. 2 2
      src/components/Configurable/hooks/helper.ts
  4. 106 77
      src/layouts/default/feature/SimpleMap.vue
  5. 2 2
      src/layouts/default/feature/components/LeafPopup.vue
  6. 6 13
      src/layouts/default/header/index.vue
  7. 3 1
      src/store/modules/mine.ts
  8. 18 0
      src/utils/index.ts
  9. 8 10
      src/views/analysis/warningAnalysis/airLeakStatus/index.vue
  10. 8 10
      src/views/analysis/warningAnalysis/autoFireAnalysis/index.vue
  11. 8 10
      src/views/analysis/warningAnalysis/autoFireOutAnalysis/index.vue
  12. 1 0
      src/views/analysis/warningAnalysis/connectAnalysis/AnalysisChart.vue
  13. 8 10
      src/views/analysis/warningAnalysis/fireAreaJudgeAnalysis/index.vue
  14. 9 10
      src/views/analysis/warningAnalysis/overlimitAlarm/index.vue
  15. 8 10
      src/views/analysis/warningAnalysis/overlimitAlarmOut/index.vue
  16. 8 10
      src/views/analysis/warningAnalysis/pressureDiffAnalysis/index.vue
  17. 3 3
      src/views/analysis/warningAnalysis/reportAnalysis/index.vue
  18. 8 10
      src/views/analysis/warningAnalysis/sealRiskJudgeAnalysis/index.vue
  19. 3 5
      src/views/dashboard/basicInfo/accessStatistics/index.vue
  20. 2 3
      src/views/dashboard/basicInfo/closedStatistics/index.vue
  21. 1 1
      src/views/dashboard/basicInfo/dataQuality/dataQuality.data.ts
  22. 2 4
      src/views/dashboard/basicInfo/dataQuality/index.vue
  23. 3 3
      src/views/dashboard/basicInfo/minesInfo/index.vue
  24. 1 1
      src/views/dashboard/basicInfo/minesInfo/minesInfo.data.ts
  25. 2 4
      src/views/dashboard/basicInfo/problemReport/index.vue
  26. 0 5
      src/views/monitor/sealedMonitor/hooks/form.ts
  27. 6 7
      src/views/monitor/sealedMonitor/index.vue

+ 22 - 3
src/api/sys/map.ts

@@ -64,6 +64,27 @@ export function getGeoJSON(params: any) {
   };
 
   const positionPresets = new Map([
+    [
+      '陕西局',
+      {
+        x: '35.83317',
+        y: '109.425873',
+      },
+    ],
+    [
+      '地方监管',
+      {
+        x: '35.83317',
+        y: '109.425873',
+      },
+    ],
+    [
+      '陕西省(集团)',
+      {
+        x: '35.83317',
+        y: '109.425873',
+      },
+    ],
     [
       '执法一处',
       {
@@ -155,7 +176,7 @@ export function getGeoJSON(params: any) {
         element.latitude = parseFloat(element.latitude);
         element.fillColor = getAlarmColor(element.alarmLevel);
         // 地图缩放等级
-        element.zoom = 1;
+        element.zoom = 8;
 
         map.set(element.deptId, element);
       }
@@ -223,8 +244,6 @@ export function getGeoJSON(params: any) {
       })),
     };
 
-    console.log('debug rrr', markers);
-
     return [geojson, records, markers];
   });
 }

+ 5 - 2
src/api/sys/menu.ts

@@ -9,7 +9,7 @@ import { getFormattedText } from '/@/components/Configurable/hooks/helper';
 // import { listToTree } from '/@/utils/helper/treeHelper';
 import { MineDepartment, useMineDepartmentStore } from '/@/store/modules/mine';
 import { AppRouteRecordRaw } from '/@/router/types';
-import { cloneDeep } from 'lodash';
+import { cloneDeep } from 'lodash-es';
 
 enum Api {
   GetMenuList = '/sys/permission/getUserPermissionByToken',
@@ -79,7 +79,10 @@ export const getMenuList: () => Promise<getMenuListResultModel> = () => {
       menu: processStaticRoutes(cloneDeep(__STATIC_ROUTES__), mineStore).map((route) => {
         if (route.meta?.generation && route.children && route.children.length) {
           const template = route.children[0];
-          route.children = generateStaticSealedMonitorRoute(template, mineStore.getDepartTree);
+          route.children = generateStaticSealedMonitorRoute(
+            template,
+            mineStore.getRoot?.isLeaf ? mineStore.getDepartTree : mineStore.getRoot?.childDepart || []
+          );
         }
         return route;
       }),

+ 2 - 2
src/components/Configurable/hooks/helper.ts

@@ -1,6 +1,6 @@
 import { get, isNil } from 'lodash-es';
 import { openWindow } from '/@/utils';
-import { router } from '/@/router';
+import { advancedRoutePush } from '/@/utils';
 
 /** 根据配置中的 formatter 将文本格式并返回 */
 export function getFormattedText(data: any, formatter: string = '', trans?: Record<string, string>, defaultValue?: any): string {
@@ -56,6 +56,6 @@ export function redirectTo(path?: string) {
   if (path.endsWith('#')) {
     openWindow(path.slice(0, -1));
   } else {
-    router.push(path);
+    advancedRoutePush(path);
   }
 }

+ 106 - 77
src/layouts/default/feature/SimpleMap.vue

@@ -1,7 +1,7 @@
 <template>
   <div ref="mapContainer" class="map-container"></div>
   <div v-if="!isTopLevel" class="map-reset-btn">
-    <Button :loading="mapLoading" type="primary" @click="revertStack">返回上级</Button>
+    <Button :loading="mapLoading" type="primary" @click="revertStack">返回上级{{ historyStack.length }}</Button>
   </div>
 </template>
 
@@ -15,7 +15,7 @@
   // import type vjmap3d from 'vjmap3d';
   import { getGeoJSON, getShanxiGeoJSON } from '/@/api/sys/map';
   import { useMineDepartmentStore } from '/@/store/modules/mine';
-  import { find, get, last } from 'lodash-es';
+  import { get, last } from 'lodash-es';
   // import { env } from '/@/views/system/cadFile/env';
   import { StatusColorEnum } from '/@/enums/jeecgEnum';
   import { generateSimplePopup } from './hooks/popup';
@@ -23,6 +23,7 @@
   import { getGoafList } from '/@/views/system/cadFile/cad.api';
   import LeafPopup from './components/LeafPopup.vue';
   import { watchTriggerable } from '@vueuse/core';
+  import { findPath, listToTree } from '/@/utils/helper/treeHelper';
   // import { useGlobSetting } from '/@/hooks/setting';
 
   const props = defineProps<{
@@ -31,14 +32,19 @@
 
   const appStore = useAppStore();
   const mineStore = useMineDepartmentStore();
-  // const globSetting = useGlobSetting();
+  const mapContainer = ref<HTMLElement>();
+  const mapLoading = ref(false);
+
+  // 设置地图中当前的参数以供其他页面使用
   appStore.setSimpleMapParams({ deptId: mineStore.getRootId, isLeaf: mineStore.getRoot?.isLeaf });
-  // const route = useRoute();
 
-  const mapContainer = ref<HTMLElement>();
   // let svc = new vjmap.Service(env.serviceUrl, env.accessToken);
-  let map: vjmap.Map;
   // let app: vjmap3d.App;
+  let map: vjmap.Map;
+  // 标记单位集合,用来为后续计算历史记录提供支持
+  let markerCollection = [];
+  // CAD是否可见
+  let cadOpened: boolean;
 
   const GEO_LAYER_ID = 'geojson-layer';
   const GEO_BORDER_ID = 'geoline-layer';
@@ -48,13 +54,18 @@
     id: mineStore.getRootId!,
     name: '根节点',
     parentId: null,
-    longitude: 108.367283,
-    latitude: 36.024691,
+    longitude: 109.425873,
+    latitude: 35.83317,
     zoom: 6,
     isLeaf: false,
   };
+  const DEFAULT_TREE_CONFIG = {
+    id: 'id',
+    pid: 'parentId',
+  };
 
-  const historyStack = ref([DEFAULT_NODE]); // 用于存储历史节点的栈,实现返回上一级功能
+  // 用于存储历史节点的栈,实现返回上一级功能
+  const historyStack = ref([DEFAULT_NODE]);
   const isTopLevel = computed(() => historyStack.value.length === 1);
 
   /** 根据GeoJSON文件绘制省市边界和填充色到地图上,其将作为一个新图层 */
@@ -79,7 +90,7 @@
     map.hoverFeatureState(GEO_LAYER_ID);
   }
 
-  /** 根据标记点信息绘制两个图层,一个圆标点图层和一个文本标点图层 */
+  /** 根据标记点信息绘制两个图层,一个圆标点图层和一个文本标点图层,添加标记点注记及点击事件处理逻辑 */
   function initMapMarker(map: vjmap.Map, markers) {
     // 绘制背景圆圈
     const circles = new vjmap.Circle({
@@ -121,9 +132,14 @@
     symbols.addTo(map);
 
     circles.clickLayer((e) => {
-      if (e.defaultPrevented) return; //  如果事件之前阻止了,则不再执行了
-      historyStack.value.push(get(e, 'features[0].properties', DEFAULT_NODE));
-      markerClickHandler();
+      if (e.defaultPrevented) return;
+      const node = get(e, 'features[0].properties', DEFAULT_NODE);
+      // 用户从地图点到矿节点需要显示详情框,不需要走set-watch的路线重新初始化地图
+      if (node.isLeaf) {
+        laefNodeClickHandler(node);
+      } else {
+        mineStore.setDepartById(node.id);
+      }
       e.preventDefault(); // 阻止之后的事件执行
     });
   }
@@ -146,61 +162,76 @@
     return map;
   }
 
-  /** 标记点点击后,如果不是叶节点那么聚焦到下一级,如果已经是叶节点了则显示该节点的CAD地图 */
+  /** 标记点点击事件处理,如果不是叶节点那么聚焦到下一级 */
   function markerClickHandler() {
     const node: any = last(historyStack.value);
     if (!node) return;
+    if (node.isLeaf) return;
 
-    // 避免依赖isLeaf的首页进入矿端模式
     appStore.setSimpleMapParams({ deptId: node.id, isLeaf: false });
 
     // 标点点击后,如果是叶节点需要显示详情框,点击标题后进CAD图
-    if (!node.isLeaf) {
-      map.setFilter(CIRCLE_LAYER_ID, ['==', node.id, ['get', 'parentId']]);
-      map.setFilter(SYMBOL_LAYER_ID, ['==', node.id, ['get', 'parentId']]);
-      map.setFilter(GEO_LAYER_ID, ['in', node.id, ['get', 'deptIds']]);
-      map.setFilter(GEO_BORDER_ID, ['in', node.id, ['get', 'deptIds']]);
-
-      map.flyTo({
-        center: [node.longitude, node.latitude],
-        zoom: node.zoom,
-      });
-    } else {
-      const popup = new vjmap.Popup({ maxWidth: '1000' });
-      const app = createApp(LeafPopup, {
-        node,
-        callback() {
-          toggleCADMap(true, node).then(() => {
-            appStore.setSimpleMapParams({ deptId: node.id, isLeaf: true });
-            // 将历史栈推一个进去,因为用户要点击返回上一级时需要
-            historyStack.value.push(node);
-          });
-        },
-      });
-      const el = document.createElement('div');
-      app.mount(el);
-      // 将历史栈拉一个出来,因为点击后页面上并没有钻入下一级
-      historyStack.value.pop();
-
-      popup.setLngLat([node.longitude, node.latitude]).setDOMContent(el).addTo(map);
-    }
+    map.setFilter(CIRCLE_LAYER_ID, ['==', node.id, ['get', 'parentId']]);
+    map.setFilter(SYMBOL_LAYER_ID, ['==', node.id, ['get', 'parentId']]);
+    map.setFilter(GEO_LAYER_ID, ['in', node.id, ['get', 'deptIds']]);
+    map.setFilter(GEO_BORDER_ID, ['in', node.id, ['get', 'deptIds']]);
+
+    map.flyTo({
+      center: [node.longitude, node.latitude],
+      zoom: node.zoom,
+    });
   }
 
-  /** 返回上一级操作,如果存在CAD地图,则切换至底图地图,否则回退历史记录栈 */
-  async function revertStack() {
-    if (historyStack.value.length === 1) return;
-    historyStack.value.pop()!;
+  /** 叶节点标记点击事件处理,叶节点需要显示该节点的详情框 */
+  function laefNodeClickHandler(node: any) {
+    if (!node) return;
+    if (!node.isLeaf) return;
 
-    toggleCADMap(false).then(() => {
-      markerClickHandler();
+    // 避免依赖isLeaf的首页进入矿端模式
+    appStore.setSimpleMapParams({ deptId: node.id, isLeaf: false });
+    // 这里推出去一个是因为点击到矿端之后不需要再下钻,那么历史栈应该保持在上一层以确保返回上一级可用
+    // 待到用户确实点击了详情框标题后在推一项历史可保证历史栈的正确
+    // historyStack.value.pop();
+
+    const popup = new vjmap.Popup({ maxWidth: '1000' });
+    const app = createApp(LeafPopup, {
+      node,
+      callback() {
+        // 切换显示CAD图
+        toggleCADMap(true, node).then(() => {
+          appStore.setSimpleMapParams({ deptId: node.id, isLeaf: true });
+          historyStack.value.push(node);
+        });
+      },
+    });
+    const el = document.createElement('div');
+    app.mount(el);
+
+    popup.setLngLat([node.longitude, node.latitude]).setDOMContent(el).addTo(map);
+    map.flyTo({
+      center: [node.longitude, node.latitude + 0.2],
+      zoom: node.zoom,
     });
   }
 
-  const mapLoading = ref(false);
-  let cadOpened: boolean;
-  /** 切换CAD地图和瓦片地图的显示,通过重新初始化进行切换,避免出现动画异常和多个DOM节点 */
+  /** 返回上一级操作,如果存在CAD底图,则切换至地图,否则回退历史记录栈 */
+  async function revertStack() {
+    if (isTopLevel.value) return;
+    historyStack.value.pop();
+
+    // 用户点击返回后绝对不可能停留在CAD底图上,因此这里不区分
+    const id = last(historyStack.value)!.id;
+    if (id === mineStore.getDepartId) {
+      trigger();
+    } else {
+      mineStore.setDepartById(id);
+    }
+  }
+
+  /** 切换CAD底图和瓦片地图底图的显示,通过重新初始化进行切换,避免出现动画异常和多个DOM节点 */
   async function toggleCADMap(visiable: boolean, data?: any) {
-    if (cadOpened === visiable) return;
+    // CAD底图不显示的时候无需再次初始化地图,显示时需要根据data来切换不同图纸
+    if (cadOpened === visiable && visiable === false) return;
 
     cadOpened = visiable;
     mapLoading.value = true;
@@ -229,14 +260,15 @@
         const [m, res] = await Promise.all([
           initMap(mapContainer.value!),
           props.slience
-            ? getShanxiGeoJSON().then((r) => [r, {}, []])
+            ? getShanxiGeoJSON().then((r) => [r, [], []])
             : getGeoJSON({
                 deptId: mineStore.getRootId,
                 pageSize: 9999,
               }),
         ]);
-        const [geojson, __, markers] = res;
+        const [geojson, records, markers] = res;
         // hide();
+        markerCollection = listToTree(records, DEFAULT_TREE_CONFIG);
         map = m;
 
         initMapGeoJSON(map, geojson);
@@ -247,39 +279,36 @@
     }
   }
 
-  // 监听全局部门变化,因为部门可能是叶部门所以也负责切换地图
+  // 监听全局矿井ID的方法,同时也是负责初始化地图的方法
+  // 两种方式触发watch,一种是点击全局矿井选择器
+  // 如果全局矿井选择了非矿端,需要显示地图并根据全局矿井ID设置好历史记录
+  // 如果是选择了矿端的页面,需要设置历史记录并显示矿端CAD图纸
+  // 另一种方式是点击地图上的标记点,普通标点下钻到下一级,矿端标点不走watch的逻辑
   const { trigger } = watchTriggerable(
     () => mineStore.getDepartId,
     async (id) => {
-      if (props.slience) {
-        return toggleCADMap(mineStore.getRoot?.isLeaf || false);
-      } else {
-        await toggleCADMap(mineStore.getDepart?.isLeaf || mineStore.getRoot?.isLeaf || false);
-
-        const { source } = map.getLayer(CIRCLE_LAYER_ID) as any;
-        const { features } = map.getSourceData(source);
-        const element = find(features, (e) => e.id === id)?.properties;
-
-        if (!element) {
-          historyStack.value = [DEFAULT_NODE];
-        } else {
-          historyStack.value.push(element);
-        }
-        markerClickHandler();
-      }
+      if (!mapContainer.value) return;
+
+      // 如果是静默模式就简单展示默认地图/图纸即可
+      if (props.slience) return toggleCADMap(mineStore.getRoot?.isLeaf || false);
+
+      // 先判断显示什么图纸,若是矿端显示CAD图纸
+      await toggleCADMap(mineStore.getDepart?.isLeaf || false, mineStore.getDepart);
+
+      // 不论是不是矿端,历史记录都是一样的,用户点击返回上一级都能正常返回
+      historyStack.value = findPath(markerCollection, (n) => n.id === id) as any[];
+
+      // 此外如果是非矿端那么模拟触发地图点击事件
+      markerClickHandler();
     }
   );
 
   onMounted(() => {
     trigger();
-    // toggleCADMap(mineStore.getRoot?.isLeaf || false).then(() => {
-    //   triggerWatch();
-    // });
   });
 
   onUnmounted(() => {
     map?.remove();
-    // app?.destroy();
   });
 </script>
 

+ 2 - 2
src/layouts/default/feature/components/LeafPopup.vue

@@ -90,10 +90,10 @@
   const alarmLevelColor = ref([StatusColorEnum.red, StatusColorEnum.blue, StatusColorEnum.gold, StatusColorEnum.purple, StatusColorEnum.red]);
 
   const coalSeamList = computed(() => {
-    return JSON.parse(props.node.coalSeamList);
+    return props.node.coalSeamList;
   });
   const goafDataList = computed(() => {
-    return JSON.parse(props.node.goafDataList);
+    return props.node.goafDataList;
   });
 </script>
 <style lang="less">

+ 6 - 13
src/layouts/default/header/index.vue

@@ -9,7 +9,7 @@
 
     <!-- menu start -->
     <div :class="`${prefixCls}-menu`">
-      <MineCascader v-model:value="deptId" :changeOnSelect="true" :initFromStore="true" @change="setGlobDept">
+      <MineCascader v-model:value="getDepartId" :changeOnSelect="true" :initFromStore="true" @change="setDepartById">
         <template #clearIcon>X</template>
       </MineCascader>
     </div>
@@ -67,8 +67,9 @@
   import { useUserStore } from '/@/store/modules/user';
   import { useI18n } from '/@/hooks/web/useI18n';
   import MineCascader from '/@/components/Form/src/jeecg/components/MineCascader/MineCascader.vue';
-  import { useAppStore } from '/@/store/modules/app';
+  // import { useAppStore } from '/@/store/modules/app';
   import { useMineDepartmentStore } from '/@/store/modules/mine';
+  import { storeToRefs } from 'pinia';
 
   const { t } = useI18n();
 
@@ -167,16 +168,8 @@
         showLoginSelect();
       });
 
-      const appStore = useAppStore();
       const mineStore = useMineDepartmentStore();
-      const deptId = ref('');
-      function setGlobDept(deptId: string) {
-        mineStore.setDepartById(deptId);
-        appStore.setSimpleMapParams({
-          deptId: mineStore.getDepartId || mineStore.getRootId,
-          isLeaf: mineStore.getDepart?.isLeaf || mineStore.getRoot?.isLeaf,
-        });
-      }
+      const { getDepartId } = storeToRefs(mineStore);
 
       return {
         prefixCls,
@@ -197,8 +190,8 @@
         loginSelectRef,
         title,
         t,
-        deptId,
-        setGlobDept,
+        getDepartId,
+        setDepartById: mineStore.setDepartById,
       };
     },
   });

+ 3 - 1
src/store/modules/mine.ts

@@ -110,7 +110,9 @@ export const useMineDepartmentStore = defineStore('mine-department-store', () =>
       );
 
       root.value = res;
-      departTree.value = res.isLeaf ? [res] : res.childDepart;
+      depart.value = res;
+      departTree.value = [res];
+      // departTree.value = res.isLeaf ? [res] : res.childDepart;
       // 深拷贝保存原始数据,用于过滤后恢复
       // rawTree.value = JSON.parse(JSON.stringify(tree));
 

+ 18 - 0
src/utils/index.ts

@@ -6,6 +6,9 @@ import { unref } from 'vue';
 import { isObject, isFunction, isString } from '/@/utils/is';
 import Big from 'big.js';
 import dayjs from 'dayjs';
+import { router } from '../router';
+import { useMineDepartmentStore } from '../store/modules/mine';
+import QueryString from 'qs';
 // 代码逻辑说明: 【VUEN-656】配置外部网址打不开,原因是带了#号,需要替换一下
 export const URL_HASH_TAB = `__AGWE4H__HASH__TAG__PWHRG__`;
 
@@ -76,6 +79,21 @@ export function openWindow(url: string, opt?: { target?: TargetContext | string;
   window.open(url, target, feature.join(','));
 }
 
+export function advancedRoutePush(path: string): Promise<any>;
+export function advancedRoutePush(params: { path?: string; query?: any; name?: string }): Promise<any>;
+export function advancedRoutePush(params: { path?: string; query?: any; name?: string } | string) {
+  let query;
+  if (typeof params === 'string') {
+    query = QueryString.parse(params);
+  } else {
+    query = params.query;
+  }
+  if (query && query.deptId) {
+    useMineDepartmentStore().setDepartById(query.deptId);
+  }
+  return router.push(params);
+}
+
 // dynamic use hook props
 export function getDynamicProps<T, U>(props: T): Partial<U> {
   const ret: Recordable = {};

+ 8 - 10
src/views/analysis/warningAnalysis/airLeakStatus/index.vue

@@ -59,7 +59,7 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
-  import { Tabs, TabPane, message } from 'ant-design-vue';
+  import { Tabs, TabPane } from 'ant-design-vue';
   import MiniBoard from '/@/components/Configurable/detail/MiniBoard.vue';
   import { SvgIcon } from '/@/components/Icon';
   // 引入模拟数据
@@ -70,7 +70,7 @@
   import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
   // import { useIntervalFn } from '@vueuse/core';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { useRouter } from 'vue-router';
+  import { advancedRoutePush } from '/@/utils';
 
   // 激活的Tab页签
   const activeTab = ref('realtime');
@@ -131,16 +131,15 @@
   const { tableContext, onExportXls } = useListPage({
     tableProps: {
       columns,
-      api: (params) => {
+      api: async (params) => {
         if (!goafId.value) {
-          message.info('请先选择煤矿及老空区');
-          return Promise.reject();
+          await initGoafOptions(params.deptId);
         }
         params.goafId = goafId.value;
         return getProvinceAlarmHistory(params);
       },
       formConfig: {
-        model: { customField: hiscode },
+        model: { deptId: hiscode },
         labelWidth: 120,
         schemas: [
           // {
@@ -171,10 +170,10 @@
           // },
           {
             label: '煤矿名称',
-            field: 'customField',
+            field: 'deptId',
             component: 'MineCascader', // 自定义组件名
             componentProps: {
-              initFromStore: false,
+              initFromStore: true,
               syncToStore: false,
               changeOnSelect: false,
               onChange: (e) => {
@@ -222,14 +221,13 @@
     boardData.value[0].value = result.alarmLevel1 + result.alarmLevel2;
   }
 
-  const router = useRouter();
   /**
    * 通用页面跳转方法
    * @param record 当前行数据
    * @param path 目标路径
    */
   function handleGoToPageQuery(record: any, path: string) {
-    router.push({
+    advancedRoutePush({
       path,
       query: { deptId: record.deptId, goafId: record.goafId, filter: 'sourcePressure' },
     });

+ 8 - 10
src/views/analysis/warningAnalysis/autoFireAnalysis/index.vue

@@ -63,7 +63,7 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
-  import { Tabs, TabPane, message } from 'ant-design-vue';
+  import { Tabs, TabPane } from 'ant-design-vue';
   import MiniBoard from '/@/components/Configurable/detail/MiniBoard.vue';
   import { SvgIcon } from '/@/components/Icon';
   // 引入模拟数据
@@ -74,7 +74,7 @@
   import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
   // import { useIntervalFn } from '@vueuse/core';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { useRouter } from 'vue-router';
+  import { advancedRoutePush } from '/@/utils';
 
   // 激活的Tab页签
   const activeTab = ref('realtime');
@@ -154,16 +154,15 @@
     tableProps: {
       columns,
       // columns: historyColumns,
-      api: (params) => {
+      api: async (params) => {
         if (!goafId.value) {
-          message.info('请先选择煤矿及老空区');
-          return Promise.reject();
+          await initGoafOptions(params.deptId);
         }
         params.goafId = goafId.value;
         return getProvinceAlarmHistory(params);
       },
       formConfig: {
-        model: { customField: hiscode },
+        model: { deptId: hiscode },
         labelWidth: 120,
         schemas: [
           // {
@@ -194,10 +193,10 @@
           // },
           {
             label: '煤矿名称',
-            field: 'customField',
+            field: 'deptId',
             component: 'MineCascader', // 自定义组件名
             componentProps: {
-              initFromStore: false,
+              initFromStore: true,
               syncToStore: false,
               changeOnSelect: false,
               onChange: (e) => {
@@ -247,14 +246,13 @@
     boardData.value[0].value = result.alarmLevel1 + result.alarmLevel2 + result.alarmLevel3 + result.alarmLevel4;
   }
 
-  const router = useRouter();
   /**
    * 通用页面跳转方法
    * @param record 当前行数据
    * @param path 目标路径
    */
   function handleGoToPageQuery(record: any, path: string) {
-    router.push({
+    advancedRoutePush({
       path,
       query: { deptId: record.deptId, goafId: record.goafId, filter: 'coVal,co2Val,ch4Val,c2h2Val,c2h4Val,o2Val,temperature' },
     });

+ 8 - 10
src/views/analysis/warningAnalysis/autoFireOutAnalysis/index.vue

@@ -63,7 +63,7 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
-  import { Tabs, TabPane, message } from 'ant-design-vue';
+  import { Tabs, TabPane } from 'ant-design-vue';
   import MiniBoard from '/@/components/Configurable/detail/MiniBoard.vue';
   import { SvgIcon } from '/@/components/Icon';
   // 引入模拟数据
@@ -74,7 +74,7 @@
   import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
   // import { useIntervalFn } from '@vueuse/core';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { useRouter } from 'vue-router';
+  import { advancedRoutePush } from '/@/utils';
 
   // 激活的Tab页签
   const activeTab = ref('realtime');
@@ -154,16 +154,15 @@
     tableProps: {
       columns,
       // columns: historyColumns,
-      api: (params) => {
+      api: async (params) => {
         if (!goafId.value) {
-          message.info('请先选择煤矿及老空区');
-          return Promise.reject();
+          await initGoafOptions(params.deptId);
         }
         params.goafId = goafId.value;
         return getProvinceAlarmHistory(params);
       },
       formConfig: {
-        model: { customField: hiscode },
+        model: { deptId: hiscode },
         labelWidth: 120,
         schemas: [
           // {
@@ -194,10 +193,10 @@
           // },
           {
             label: '煤矿名称',
-            field: 'customField',
+            field: 'deptId',
             component: 'MineCascader', // 自定义组件名
             componentProps: {
-              initFromStore: false,
+              initFromStore: true,
               syncToStore: false,
               changeOnSelect: false,
               onChange: (e) => {
@@ -247,14 +246,13 @@
     boardData.value[0].value = result.alarmLevel1 + result.alarmLevel2 + result.alarmLevel3 + result.alarmLevel4;
   }
 
-  const router = useRouter();
   /**
    * 通用页面跳转方法
    * @param record 当前行数据
    * @param path 目标路径
    */
   function handleGoToPageQuery(record: any, path: string) {
-    router.push({
+    advancedRoutePush({
       path,
       query: { deptId: record.deptId, goafId: record.goafId, filterout: 'ch4ValOut,coValOut,o2ValOut,temperatureOut' },
     });

+ 1 - 0
src/views/analysis/warningAnalysis/connectAnalysis/AnalysisChart.vue

@@ -173,6 +173,7 @@
       startTime: startTime,
       endTime: endTime,
       goafId: goafId.value,
+      deptId: innerValue.value,
       ...(props.requestParams || {}),
     });
     if (res) {

+ 8 - 10
src/views/analysis/warningAnalysis/fireAreaJudgeAnalysis/index.vue

@@ -61,7 +61,7 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
-  import { Tabs, TabPane, message } from 'ant-design-vue';
+  import { Tabs, TabPane } from 'ant-design-vue';
   import MiniBoard from '/@/components/Configurable/detail/MiniBoard.vue';
   import { SvgIcon } from '/@/components/Icon';
   // 引入模拟数据
@@ -72,7 +72,7 @@
   import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
   // import { useIntervalFn } from '@vueuse/core';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { useRouter } from 'vue-router';
+  import { advancedRoutePush } from '/@/utils';
 
   // 激活的Tab页签
   const activeTab = ref('realtime');
@@ -145,16 +145,15 @@
     tableProps: {
       columns,
       // columns: historyColumns,
-      api: (params) => {
+      api: async (params) => {
         if (!goafId.value) {
-          message.info('请先选择煤矿及老空区');
-          return Promise.reject();
+          await initGoafOptions(params.deptId);
         }
         params.goafId = goafId.value;
         return getProvinceAlarmHistory(params);
       },
       formConfig: {
-        model: { customField: hiscode },
+        model: { deptId: hiscode },
         labelWidth: 120,
         schemas: [
           // {
@@ -185,10 +184,10 @@
           // },
           {
             label: '煤矿名称',
-            field: 'customField',
+            field: 'deptId',
             component: 'MineCascader', // 自定义组件名
             componentProps: {
-              initFromStore: false,
+              initFromStore: true,
               syncToStore: false,
               changeOnSelect: false,
               onChange: (e) => {
@@ -236,14 +235,13 @@
     boardData.value[0].value = result.alarmLevel1 + result.alarmLevel2 + result.alarmLevel3 + result.alarmLevel4 + result.alarmLevel5;
   }
 
-  const router = useRouter();
   /**
    * 通用页面跳转方法
    * @param record 当前行数据
    * @param path 目标路径
    */
   function handleGoToPageQuery(record: any, path: string) {
-    router.push({
+    advancedRoutePush({
       path,
       query: { deptId: record.deptId, goafId: record.goafId, filter: 'coVal,c2h2Val,c2h4Val,o2Val' },
     });

+ 9 - 10
src/views/analysis/warningAnalysis/overlimitAlarm/index.vue

@@ -61,7 +61,7 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
-  import { Tabs, TabPane, message } from 'ant-design-vue';
+  import { Tabs, TabPane } from 'ant-design-vue';
   // import MiniBoard from '/@/components/Configurable/detail/MiniBoard.vue';
   import { SvgIcon } from '/@/components/Icon';
   // 引入模拟数据
@@ -72,7 +72,8 @@
   import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
   // import { useIntervalFn } from '@vueuse/core';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { useRoute, useRouter } from 'vue-router';
+  import { useRoute } from 'vue-router';
+  import { advancedRoutePush } from '/@/utils';
 
   const route = useRoute();
   // 激活的Tab页签
@@ -147,16 +148,15 @@
     tableProps: {
       columns,
       // columns: historyColumns,
-      api: (params) => {
+      api: async (params) => {
         if (!goafId.value) {
-          message.info('请先选择煤矿及老空区');
-          return Promise.reject();
+          await initGoafOptions(params.deptId);
         }
         params.goafId = goafId.value;
         return getProvinceAlarmHistory(params);
       },
       formConfig: {
-        model: { customField: hiscode },
+        model: { deptId: hiscode },
         labelWidth: 120,
         schemas: [
           // {
@@ -187,10 +187,10 @@
           // },
           {
             label: '煤矿名称',
-            field: 'customField',
+            field: 'deptId',
             component: 'MineCascader', // 自定义组件名
             componentProps: {
-              initFromStore: false,
+              initFromStore: true,
               syncToStore: false,
               changeOnSelect: false,
               onChange: (e) => {
@@ -240,14 +240,13 @@
     boardData.value[0].value = result.alarmLevel1 + result.alarmLevel2 + result.alarmLevel3 + result.alarmLevel4;
   }
 
-  const router = useRouter();
   /**
    * 通用页面跳转方法
    * @param record 当前行数据
    * @param path 目标路径
    */
   function handleGoToPageQuery(record: any, path: string) {
-    router.push({
+    advancedRoutePush({
       path,
       query: { deptId: record.deptId, goafId: record.goafId, filter: 'coVal,co2Val,ch4Val,c2h2Val,c2h4Val,o2Val,temperature' },
     });

+ 8 - 10
src/views/analysis/warningAnalysis/overlimitAlarmOut/index.vue

@@ -61,7 +61,7 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
-  import { Tabs, TabPane, message } from 'ant-design-vue';
+  import { Tabs, TabPane } from 'ant-design-vue';
   // import MiniBoard from '/@/components/Configurable/detail/MiniBoard.vue';
   import { SvgIcon } from '/@/components/Icon';
   // 引入模拟数据
@@ -72,7 +72,7 @@
   import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
   // import { useIntervalFn } from '@vueuse/core';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { useRouter } from 'vue-router';
+  import { advancedRoutePush } from '/@/utils';
 
   // 激活的Tab页签
   const activeTab = ref('realtime');
@@ -145,16 +145,15 @@
     tableProps: {
       columns,
       // columns: historyColumns,
-      api: (params) => {
+      api: async (params) => {
         if (!goafId.value) {
-          message.info('请先选择煤矿及老空区');
-          return Promise.reject();
+          await initGoafOptions(params.deptId);
         }
         params.goafId = goafId.value;
         return getProvinceAlarmHistory(params);
       },
       formConfig: {
-        model: { customField: hiscode },
+        model: { deptId: hiscode },
         labelWidth: 120,
         schemas: [
           // {
@@ -185,10 +184,10 @@
           // },
           {
             label: '煤矿名称',
-            field: 'customField',
+            field: 'deptId',
             component: 'MineCascader', // 自定义组件名
             componentProps: {
-              initFromStore: false,
+              initFromStore: true,
               syncToStore: false,
               changeOnSelect: false,
               onChange: (e) => {
@@ -238,14 +237,13 @@
     boardData.value[0].value = result.alarmLevel1 + result.alarmLevel2 + result.alarmLevel3 + result.alarmLevel4;
   }
 
-  const router = useRouter();
   /**
    * 通用页面跳转方法
    * @param record 当前行数据
    * @param path 目标路径
    */
   function handleGoToPageQuery(record: any, path: string) {
-    router.push({
+    advancedRoutePush({
       path,
       query: { deptId: record.deptId, goafId: record.goafId, filterout: 'coValOut,o2ValOut,temperatureOut' },
     });

+ 8 - 10
src/views/analysis/warningAnalysis/pressureDiffAnalysis/index.vue

@@ -76,7 +76,7 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
-  import { Tabs, TabPane, message } from 'ant-design-vue';
+  import { Tabs, TabPane } from 'ant-design-vue';
   import MiniBoard from '/@/components/Configurable/detail/MiniBoard.vue';
   import { SvgIcon } from '/@/components/Icon';
   // 引入模拟数据
@@ -87,7 +87,7 @@
   import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
   // import { useIntervalFn } from '@vueuse/core';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { useRouter } from 'vue-router';
+  import { advancedRoutePush } from '/@/utils';
 
   // 激活的Tab页签
   const activeTab = ref('realtime');
@@ -168,16 +168,15 @@
     tableProps: {
       columns,
       // columns: historyColumns,
-      api: (params) => {
+      api: async (params) => {
         if (!goafId.value) {
-          message.info('请先选择煤矿及老空区');
-          return Promise.reject();
+          await initGoafOptions(params.deptId);
         }
         params.goafId = goafId.value;
         return getProvinceAlarmHistory(params);
       },
       formConfig: {
-        model: { customField: hiscode },
+        model: { deptId: hiscode },
         labelWidth: 120,
         schemas: [
           // {
@@ -208,10 +207,10 @@
           // },
           {
             label: '煤矿名称',
-            field: 'customField',
+            field: 'deptId',
             component: 'MineCascader', // 自定义组件名
             componentProps: {
-              initFromStore: false,
+              initFromStore: true,
               syncToStore: false,
               changeOnSelect: false,
               onChange: (e) => {
@@ -261,14 +260,13 @@
     boardData.value[0].value = result.alarmLevel1 + result.alarmLevel2 + result.alarmLevel3 + result.alarmLevel4;
   }
 
-  const router = useRouter();
   /**
    * 通用页面跳转方法
    * @param record 当前行数据
    * @param path 目标路径
    */
   function handleGoToPageQuery(record: any, path: string) {
-    router.push({
+    advancedRoutePush({
       path,
       query: { deptId: record.deptId, goafId: record.goafId, filter: 'sourcePressure' },
     });

+ 3 - 3
src/views/analysis/warningAnalysis/reportAnalysis/index.vue

@@ -117,15 +117,15 @@
       // columns: historyColumns,
       api: getProvinceAlarmHistory,
       formConfig: {
-        model: { customField: hiscode },
+        model: { deptId: hiscode },
         labelWidth: 120,
         schemas: [
           {
             label: '煤矿名称',
-            field: 'customField',
+            field: 'deptId',
             component: 'MineCascader', // 自定义组件名
             componentProps: {
-              initFromStore: false,
+              initFromStore: true,
               syncToStore: false,
               changeOnSelect: false,
               onChange: (e) => {

+ 8 - 10
src/views/analysis/warningAnalysis/sealRiskJudgeAnalysis/index.vue

@@ -60,7 +60,7 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import { BasicTable, useTable } from '/@/components/Table';
-  import { Tabs, TabPane, message } from 'ant-design-vue';
+  import { Tabs, TabPane } from 'ant-design-vue';
   import MiniBoard from '/@/components/Configurable/detail/MiniBoard.vue';
   import { SvgIcon } from '/@/components/Icon';
   // 引入模拟数据
@@ -72,7 +72,7 @@
   import { useInitForm } from '../../common/analysis';
   import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { useRouter } from 'vue-router';
+  import { advancedRoutePush } from '/@/utils';
 
   // 激活的Tab页签
   const activeTab = ref('realtime');
@@ -144,16 +144,15 @@
     tableProps: {
       columns,
       // columns: historyColumns,
-      api: (params) => {
+      api: async (params) => {
         if (!goafId.value) {
-          message.info('请先选择煤矿及老空区');
-          return Promise.reject();
+          await initGoafOptions(params.deptId);
         }
         params.goafId = goafId.value;
         return getProvinceAlarmHistory(params);
       },
       formConfig: {
-        model: { customField: hiscode },
+        model: { deptId: hiscode },
         labelWidth: 120,
         schemas: [
           // {
@@ -184,10 +183,10 @@
           // },
           {
             label: '煤矿名称',
-            field: 'customField',
+            field: 'deptId',
             component: 'MineCascader', // 自定义组件名
             componentProps: {
-              initFromStore: false,
+              initFromStore: true,
               syncToStore: false,
               changeOnSelect: false,
               onChange: (e) => {
@@ -246,14 +245,13 @@
     boardData.value[0].value = result.alarmLevel1 + result.alarmLevel2 + result.alarmLevel3 + result.alarmLevel4;
   }
 
-  const router = useRouter();
   /**
    * 通用页面跳转方法
    * @param record 当前行数据
    * @param path 目标路径
    */
   function handleGoToPageQuery(record: any, path: string) {
-    router.push({
+    advancedRoutePush({
       path,
       query: { deptId: record.deptId, goafId: record.goafId, filter: 'coVal,ch4Val,c2h2Val,c2h4Val,o2Val' },
     });

+ 3 - 5
src/views/dashboard/basicInfo/accessStatistics/index.vue

@@ -15,12 +15,11 @@
   import { accessStatisticsColumns } from './access.data';
   import { getGoafAccessCount } from '../basicInfo.api';
   import type { BasicColumn } from '/@/components/Table/src/types/table';
-  import { useRouter } from 'vue-router';
   import SvgIcon from '/@/components/Icon/src/SvgIcon.vue';
   import { ref, watch } from 'vue';
   import { useMineDepartmentStore } from '/@/store/modules/mine';
+  import { advancedRoutePush } from '/@/utils';
 
-  const router = useRouter();
   const deptId = ref();
 
   // 封装接口调用,获取数据后手动添加「总计」行
@@ -104,10 +103,9 @@
    * @param path 目标路径
    */
   function handleGoToPageQuery(record: any, path: string) {
-    const deptId = record.deptId;
-    router.push({
+    advancedRoutePush({
       path,
-      query: { deptId },
+      query: { deptId: record.deptId },
     });
   }
 

+ 2 - 3
src/views/dashboard/basicInfo/closedStatistics/index.vue

@@ -12,16 +12,15 @@
 </template>
 
 <script setup lang="ts">
-  import { useRouter } from 'vue-router';
   import { BasicTable, useTable } from '/@/components/Table';
   import { dataColumns } from './closed.data';
   import { getClosedAccessCount } from '../basicInfo.api';
   import { SvgIcon } from '/@/components/Icon';
   import { useMineDepartmentStore } from '/@/store/modules/mine';
   import { ref, watch } from 'vue';
+  import { advancedRoutePush } from '/@/utils';
 
   // 路由实例
-  const router = useRouter();
   const mineStore = useMineDepartmentStore();
   const deptId = ref();
 
@@ -56,7 +55,7 @@
    */
   function handleGoToPage(record: any, path: string) {
     // 跳转时携带当前煤矿的编号作为参数(根据实际需求调整携带的参数)
-    router.push({
+    advancedRoutePush({
       path,
       // query: {
       //   orderNo: record.orderNo, // 煤矿编号

+ 1 - 1
src/views/dashboard/basicInfo/dataQuality/dataQuality.data.ts

@@ -158,7 +158,7 @@ export const topFormSchema: FormSchema[] = [
     component: 'MineCascader',
     componentProps: {
       changeOnSelect: false,
-      initFromStore: false,
+      initFromStore: true,
       syncToStore: false,
     },
     required: true,

+ 2 - 4
src/views/dashboard/basicInfo/dataQuality/index.vue

@@ -119,7 +119,6 @@
 
 <script setup lang="ts">
   import { ref, nextTick, computed, onMounted, reactive } from 'vue';
-  import { useRouter } from 'vue-router';
   import { BasicTable } from '/@/components/Table';
   import { useModal } from '/@/components/Modal';
   import { Tabs, TabPane, Popconfirm, message, Modal, DatePicker } from 'ant-design-vue';
@@ -133,9 +132,8 @@
   // import { getDictItemsByCode } from '/@/utils/dict';
   import dayjs, { Dayjs } from 'dayjs';
   import { useListPage } from '/@/hooks/system/useListPage';
+  import { advancedRoutePush } from '/@/utils/index.js';
 
-  // 路由实例
-  const router = useRouter();
   // 实例化矿井Store
   const mineStore = useMineDepartmentStore();
   // 响应式数据
@@ -427,7 +425,7 @@
       }
 
       // 跳转页面(可携带拼接后的矿名/路径等参数)
-      router.push({ path: `/sealed/${minePath}`, query: { id: targetNode.id } });
+      advancedRoutePush({ path: `/sealed/${minePath}`, query: { deptId: targetNode.id } });
     } catch (error) {
       console.error('矿节点定位失败:', error);
       message.error('矿节点定位失败,请稍后重试');

+ 3 - 3
src/views/dashboard/basicInfo/minesInfo/index.vue

@@ -29,7 +29,7 @@
 </template>
 
 <script setup lang="ts">
-  import { useRouter, useRoute } from 'vue-router';
+  import { useRoute } from 'vue-router';
   import { BasicTable } from '/@/components/Table';
   import { SvgIcon } from '/@/components/Icon';
   // 引入动态列/表单配置函数 + 类型
@@ -37,11 +37,11 @@
   import { getMineData } from '../basicInfo.api';
   // 引入字典获取方法
   import { useListPage } from '/@/hooks/system/useListPage';
+  import { advancedRoutePush } from '/@/utils';
   // import { useIntervalFn } from '@vueuse/core';
   // import { useModal } from '/@/components/Modal';
 
   // 路由实例
-  const router = useRouter();
   const route = useRoute();
 
   // ========== 表格注册 ==========
@@ -80,7 +80,7 @@
    */
   function handleGoToPageQuery(record: any, path: string) {
     const deptId = record.deptId;
-    router.push({
+    advancedRoutePush({
       path,
       query: { deptId },
     });

+ 1 - 1
src/views/dashboard/basicInfo/minesInfo/minesInfo.data.ts

@@ -132,7 +132,7 @@ export const searchFormSchema: FormSchema[] = [
     component: 'MineCascader',
     colProps: { span: 6 },
     componentProps: {
-      initFromStore: false,
+      initFromStore: true,
       syncToStore: false,
     },
   },

+ 2 - 4
src/views/dashboard/basicInfo/problemReport/index.vue

@@ -154,7 +154,6 @@
 
 <script setup lang="ts">
   import { ref, nextTick, computed, onMounted, reactive } from 'vue';
-  import { useRouter } from 'vue-router';
   import { BasicTable } from '/@/components/Table';
   import { useModal } from '/@/components/Modal';
   import { Tabs, TabPane, Popconfirm, message, Modal, DatePicker } from 'ant-design-vue';
@@ -170,9 +169,8 @@
   import { useListPage } from '/@/hooks/system/useListPage';
   import { useInitForm } from '/@/views/analysis/warningAnalysis/connectAnalysis/hooks/form';
   import MineCascader from '@/components/Form/src/jeecg/components/MineCascader/MineCascader.vue';
+  import { advancedRoutePush } from '/@/utils/index.js';
 
-  // 路由实例
-  const router = useRouter();
   // 实例化矿井Store
   const mineStore = useMineDepartmentStore();
 
@@ -488,7 +486,7 @@
       }
 
       // 跳转页面(可携带拼接后的矿名/路径等参数)
-      router.push({ path: `/sealed/${minePath}`, query: { id: targetNode.id } });
+      advancedRoutePush({ path: `/sealed/${minePath}`, query: { deptId: targetNode.id } });
     } catch (error) {
       console.error('矿节点定位失败:', error);
       message.error('矿节点定位失败,请稍后重试');

+ 0 - 5
src/views/monitor/sealedMonitor/hooks/form.ts

@@ -22,11 +22,6 @@ export function useInitForm() {
         'id'
       );
 
-  if (hiscode) {
-    // mineStore.setDepartById(code as string);
-    initGoafOptions(hiscode);
-  }
-
   // 采空区选择器
   const goafId = ref('');
   const goafOptions = ref<any[]>([]);

+ 6 - 7
src/views/monitor/sealedMonitor/index.vue

@@ -48,7 +48,7 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
-  import { Tabs, TabPane, message } from 'ant-design-vue';
+  import { Tabs, TabPane } from 'ant-design-vue';
   // 引入模拟数据
   import { columns, historicalColumns, historicalFormSchema, searchFormSchema } from './monitor.data';
   import HistoricalDetailsModal from './components/HistoricalDetailsModal.vue';
@@ -59,13 +59,14 @@
   import { useIntervalFn } from '@vueuse/core';
   import { useInitForm } from './hooks/form';
   import { modalDetailsData } from './monitor.data';
-  import { useRouter } from 'vue-router';
+  import { advancedRoutePush } from '/@/utils';
   // import { getGoafList } from '../../system/algorithm/algorithm.api';
 
   // 激活的Tab页签
 
   // 处理矿名选择器相关的逻辑
   const { departId, goafOptions, goafId, rawcode, hiscode, route, initGoafOptions } = useInitForm();
+
   const activeTab = ref('realtime');
   const tableQueryParams = ref({}); // 存储表格查询参数的响应式变量
 
@@ -118,10 +119,9 @@
   // 注册历史数据表格
   const { tableContext: ctxHistory, onExportXls } = useListPage({
     tableProps: {
-      api: (params) => {
+      api: async (params) => {
         if (!goafId.value) {
-          message.info('请先选择煤矿及老空区');
-          return Promise.reject();
+          await initGoafOptions(departId);
         }
         params.goafId = goafId.value;
         return getGoafHistory(params);
@@ -187,14 +187,13 @@
     pause();
   };
 
-  const router = useRouter();
   /**
    * 通用页面跳转方法
    * @param record 当前行数据
    * @param path 目标路径
    */
   function handleGoToPageQuery(record: any, path: string) {
-    router.push({
+    advancedRoutePush({
       path,
       query: { deptId: record.deptId, goafId: record.goafId },
     });