Quellcode durchsuchen

Merge branch 'master' of http://39.97.59.228:8013/hrx/goaf-monitoring-system

lxh vor 3 Monaten
Ursprung
Commit
74cf0e6c4e
24 geänderte Dateien mit 320 neuen und 345 gelöschten Zeilen
  1. 26 20
      src/components/Form/src/jeecg/components/MineCascader/MineCascader.vue
  2. 1 1
      src/components/Table/src/hooks/useDataSource.ts
  3. 1 0
      src/components/Table/src/types/table.ts
  4. 2 2
      src/main.ts
  5. 8 22
      src/store/modules/mine.ts
  6. 7 4
      src/views/analysis/warningAnalysis/airLeakStatus/airLeak.api.ts
  7. 16 13
      src/views/analysis/warningAnalysis/airLeakStatus/index.vue
  8. 1 1
      src/views/analysis/warningAnalysis/autoFireAnalysis/autoFireAnalysis.data.ts
  9. 25 19
      src/views/analysis/warningAnalysis/autoFireAnalysis/index.vue
  10. 57 60
      src/views/analysis/warningAnalysis/connectAnalysis/index.vue
  11. 1 1
      src/views/analysis/warningAnalysis/fireAreaJudgeAnalysis/fireAreaJudgeAnalysis.data.ts
  12. 25 19
      src/views/analysis/warningAnalysis/fireAreaJudgeAnalysis/index.vue
  13. 12 7
      src/views/analysis/warningAnalysis/overlimitAlarm/index.vue
  14. 2 2
      src/views/analysis/warningAnalysis/pressureDiffAnalysis/index.vue
  15. 17 11
      src/views/analysis/warningAnalysis/sealRiskJudgeAnalysis/index.vue
  16. 1 1
      src/views/analysis/warningAnalysis/sealRiskJudgeAnalysis/sealRiskJudgeAnalysis.data.ts
  17. 2 4
      src/views/dashboard/SealedGoaf/index.vue
  18. 1 0
      src/views/dashboard/SealedGoaf/sealedGoaf.api.ts
  19. 1 2
      src/views/dashboard/basicInfo/dataQuality/components/DataQualityModal.vue
  20. 49 56
      src/views/dashboard/basicInfo/dataQuality/index.vue
  21. 2 2
      src/views/dashboard/basicInfo/minesInfo/index.vue
  22. 42 21
      src/views/monitor/sealedMonitor/hooks/form.ts
  23. 14 63
      src/views/monitor/sealedMonitor/index.vue
  24. 7 14
      src/views/monitor/sealedMonitor/monitor.data.ts

+ 26 - 20
src/components/Form/src/jeecg/components/MineCascader/MineCascader.vue

@@ -1,8 +1,8 @@
 <template>
-  <a-cascader
+  <Cascader
     :value="innerValue"
     :options="getDepartTree"
-    :placeholder="placeholder"
+    placeholder="全部"
     :field-names="{
       label: 'departName',
       value: 'id',
@@ -16,20 +16,22 @@
     <template #displayRender="{ labels }">
       {{ labels[labels.length - 1] }}
     </template>
-  </a-cascader>
+  </Cascader>
   <!-- <a-input>{{ shownText }}</a-input> -->
 </template>
 
 <script lang="ts">
   import { last } from 'lodash';
-  import { defineComponent, computed, onUnmounted } from 'vue';
+  import { defineComponent, onUnmounted, h, ref } from 'vue';
   // import { useMessage } from '/@/hooks/web/useMessage';
   import { propTypes } from '/@/utils/propTypes';
-  import { useMineStore } from '/@/store/modules/mine';
+  import { useMineDepartmentStore } from '/@/store/modules/mine';
   import { storeToRefs } from 'pinia';
+  import { Cascader } from 'ant-design-vue';
 
   export default defineComponent({
     name: 'MineCascader',
+    components: { Cascader },
     props: {
       value: propTypes.string.def(''),
       placeholder: propTypes.string.def('全部'),
@@ -38,25 +40,24 @@
       showSearch: propTypes.bool.def(true),
       allowClear: propTypes.bool.def(true),
       changeOnSelect: propTypes.bool.def(true),
-      resetOnDestroy: propTypes.bool.def(true),
+      // clearOnDestroy: propTypes.bool.def(false),
     },
     emits: ['change', 'update:value'],
     setup(props, { emit }) {
       // const { createMessage } = useMessage();
-      const mineStore = useMineStore();
-      const { getDepartPath, getDepartTree, getDepartId, getMineCode } = storeToRefs(mineStore);
+      const mineStore = useMineDepartmentStore();
+      const { getDepartTree, getMineCode } = storeToRefs(mineStore);
 
-      if (props.resetOnDestroy) {
-        const rawID = getDepartId.value;
-        onUnmounted(() => {
-          mineStore.clearDepart();
-          mineStore.setDepartById(rawID);
-        });
-      }
+      // if (props.clearOnDestroy) {
+      //   const raw = getDepartId.value;
+      //   onUnmounted(() => {
+      //     mineStore.setDepartById(raw);
+      //   });
+      // }
 
       if (props.rootId) {
-        mineStore.filterDepartTree((e) => e.id === props.rootId);
         mineStore.clearDepart();
+        mineStore.filterDepartTree((e) => e.parentId === props.rootId);
 
         onUnmounted(() => {
           mineStore.restoreDepartTree();
@@ -64,7 +65,8 @@
       }
 
       // const shownText = computed(() => getDepart.value.departName || '-');
-      const innerValue = computed(() => getDepartPath.value.map((e) => e.id));
+      const innerValue = ref<string[]>([]);
+      // const innerValue = computed(() => getDepartPath.value.map((e) => e.id));
       const options = getDepartTree;
 
       /**
@@ -72,22 +74,26 @@
        * @param e
        */
       function handleChange(value: any[]) {
-        console.log('debug change', value, getMineCode.value);
+        innerValue.value = value;
         mineStore.setDepartById(last(value));
-        console.log('debug aftter', value, getMineCode.value);
 
         const val = getMineCode.value;
         emit('update:value', val);
         emit('change', val);
       }
 
-      handleChange([getDepartId.value]);
+      handleChange([]);
+
+      onUnmounted(() => {
+        mineStore.clearDepart();
+      });
 
       return {
         innerValue,
         options,
         getDepartTree,
         handleChange,
+        h,
       };
     },
   });

+ 1 - 1
src/components/Table/src/hooks/useDataSource.ts

@@ -221,7 +221,7 @@ export function useDataSource(
     const { api, searchInfo, defSort, fetchSetting, beforeFetch, afterFetch, useSearchForm, pagination } = unref(propsRef);
     if (!api || !isFunction(api)) return;
     try {
-      setLoading(true);
+      opt && !opt.silence && setLoading(true);
       const { pageField, sizeField, listField, totalField } = Object.assign({}, FETCH_SETTING, fetchSetting);
       let pageParams: Recordable = {};
 

+ 1 - 0
src/components/Table/src/types/table.ts

@@ -75,6 +75,7 @@ export interface FetchParams {
   page?: number;
   sortInfo?: Recordable;
   filterInfo?: Recordable;
+  silence?: boolean;
 }
 
 export interface GetColumnsParams {

+ 2 - 2
src/main.ts

@@ -18,7 +18,7 @@ import { registerGlobComp } from '/@/components/registerGlobComp';
 import { registerThirdComp } from '/@/settings/registerThirdComp';
 import { useSso } from '/@/hooks/web/useSso';
 import { useAppStoreWithOut } from '@/store/modules/app';
-import { useMineStore } from './store/modules/mine';
+import { useMineDepartmentStore } from './store/modules/mine';
 
 // 程序入口
 async function main() {
@@ -118,6 +118,6 @@ function setupProps(props?: MainAppProps) {
   const appStore = useAppStoreWithOut();
   appStore.setMainAppProps(props);
 
-  const mineStore = useMineStore();
+  const mineStore = useMineDepartmentStore();
   mineStore.fetchDepartTree();
 }

+ 8 - 22
src/store/modules/mine.ts

@@ -4,7 +4,7 @@ import { ref, computed } from 'vue';
 import { getEnfMineTree } from '/@/api/sys/menu';
 import { getUserMinePermissionData } from '/@/components/Form/src/jeecg/components/MineCascader/mineData.api';
 import { findNode, findNodeAll, findPath, listToTree, treeToList } from '/@/utils/helper/treeHelper';
-import { isArray, isEmpty, isNil } from 'lodash';
+import { isArray } from 'lodash';
 
 export interface MineDepartment {
   /** 唯一标识 */
@@ -27,15 +27,12 @@ const DEFAULT_CONFIG = {
   children: 'childDepart',
 };
 
-export const useMineStore = defineStore('mine-store', () => {
+export const useMineDepartmentStore = defineStore('mine-department-store', () => {
   // ==================== State 定义 ====================
 
   /** 当前选中的部门,可能是执法处、区或者具体到矿井 */
   const depart = ref<MineDepartment>();
 
-  /** 当前选中的部门ID,可能为空 */
-  const departId = ref<string>();
-
   /** 组织树(经过过滤等处理后的树) */
   const departTree = ref<MineDepartment[]>([]);
 
@@ -55,7 +52,7 @@ export const useMineStore = defineStore('mine-store', () => {
 
   /** 获取当前选中的部门在组织树中的访问路径 */
   const getDepartPath = computed(() => {
-    return findPath(departTree.value, (item) => item.id === departId.value, DEFAULT_CONFIG) || [];
+    return findPath(departTree.value, (item) => item.id === getDepartId.value, DEFAULT_CONFIG) || [];
   });
 
   /**
@@ -65,7 +62,7 @@ export const useMineStore = defineStore('mine-store', () => {
    * - 如果未选择任何节点,返回空字符串
    */
   const getMineCode = computed(() => {
-    const target = departId.value ? [depart.value] : departTree.value;
+    const target = getDepartId.value ? [depart.value] : departTree.value;
     const list = treeToList(target, DEFAULT_CONFIG);
 
     if (isArray(list)) {
@@ -84,9 +81,8 @@ export const useMineStore = defineStore('mine-store', () => {
    * @param dep - 部门对象
    */
   function setDepart(dep: MineDepartment) {
-    if (isNil(dep) || isEmpty(dep)) return;
+    // if (isNil(dep) || isEmpty(dep)) return;
     depart.value = dep;
-    departId.value = dep.id;
   }
 
   /**
@@ -98,16 +94,6 @@ export const useMineStore = defineStore('mine-store', () => {
     setDepart(node);
   }
 
-  /**
-   * 设置组织树并保存原始数据副本
-   * @param tree - 组织树数据
-   */
-  function setDepartTree(tree: MineDepartment[] = []) {
-    departTree.value = tree;
-    // 深拷贝保存原始数据,用于过滤后恢复
-    rawTree.value = JSON.parse(JSON.stringify(tree));
-  }
-
   /**
    * 获取组织树数据(异步)
    * 从两个接口获取数据:
@@ -132,7 +118,9 @@ export const useMineStore = defineStore('mine-store', () => {
       // 合并数据并转换为树形结构
       const tree = listToTree([...r1, ...r2], DEFAULT_CONFIG);
 
-      setDepartTree(tree);
+      departTree.value = tree;
+      // 深拷贝保存原始数据,用于过滤后恢复
+      rawTree.value = JSON.parse(JSON.stringify(tree));
 
       // 如果需要自动选中第一个叶子节点(矿井),可以取消注释以下代码
       /*
@@ -178,7 +166,6 @@ export const useMineStore = defineStore('mine-store', () => {
    */
   function clearDepart() {
     depart.value = undefined;
-    departId.value = undefined;
   }
 
   // ==================== 暴露的属性和方法 ====================
@@ -186,7 +173,6 @@ export const useMineStore = defineStore('mine-store', () => {
   return {
     // --- State(可修改)---
     depart,
-    departId,
     departTree,
     rawTree,
 

+ 7 - 4
src/views/analysis/warningAnalysis/airLeakStatus/airLeak.api.ts

@@ -20,10 +20,13 @@ export const getProvinceAlarmNum = (params) =>
   );
 //查询煤矿列表
 export const getMineData = (params) =>
-  defHttp.post({
-    url: Api.getMineData,
-    params,
-  });
+  defHttp.post(
+    {
+      url: Api.getMineData,
+      params,
+    },
+    { joinParamsToUrl: true }
+  );
 //查询密闭列表
 export const getGoafData = (params) =>
   defHttp.post(

+ 16 - 13
src/views/analysis/warningAnalysis/airLeakStatus/index.vue

@@ -80,6 +80,7 @@ const visibleModal = ref(false);
 const visibleresolveModal = ref(false);
 const resolveValue = ref('');
 const resolveId = ref('');
+const mineCodeList = ref('');
 //煤矿列表数据
 const deviceOptions = ref([]);
 const goafOptions = ref([]);
@@ -105,7 +106,7 @@ const [registerTable] = useTable({
     schemas: [
       {
         label: '煤矿名称',
-        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        field: 'mineCodeList', // 对应组件的value.mineCode(最终传给Table的查询参数)
         component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
       },
@@ -119,7 +120,7 @@ const [registerTable] = useTable({
   bordered: true,
   showIndexColumn: false,
   actionColumn: {
-    width: 120,
+    width: 80,
     title: '操作',
     dataIndex: 'action',
     slots: { customRender: 'action' },
@@ -242,17 +243,17 @@ const openModal = (record, type) => {
     historyModalRef.value?.showModal(record);
   }
 };
-async function fetchAlarmData(id) {
-  const params = {
-    // 填写所需参数
-    alarmType: 'leakageAlarm',
-    mineId: id,
-    pageNo: 1,
-    pageSize: 50,
-  };
-  const result = await getProvinceAlarm(params);
-  minesData.value = result.records;
-}
+// async function fetchAlarmData(id) {
+//   const params = {
+//     // 填写所需参数
+//     alarmType: 'leakageAlarm',
+//     mineCodeList: id,
+//     pageNo: 1,
+//     pageSize: 50,
+//   };
+//   const result = await getProvinceAlarm(params);
+//   minesData.value = result.records;
+// }
 async function getAlarmTotalData() {
   const params = {
     alarmType: 'leakageAlarm',
@@ -278,6 +279,8 @@ const getMineDataList = async () => {
       value: item['mineCode'],
     };
   });
+  mineCodeList.value = deviceOptions.value.map((item) => item.value).join(',');
+  // fetchAlarmData(mineCodeList.value);
 };
 const getGoafDataList = async (mineId) => {
   const params = {

+ 1 - 1
src/views/analysis/warningAnalysis/autoFireAnalysis/autoFireAnalysis.data.ts

@@ -39,7 +39,7 @@ export const columns: BasicColumn[] = [
   {
     title: '煤矿名称',
     dataIndex: 'mineName',
-    width: 100,
+    width: 200,
   },
   {
     title: '密闭名称',

+ 25 - 19
src/views/analysis/warningAnalysis/autoFireAnalysis/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="monitoring-page">
     <!-- 新增Tabs组件区分实时/历史数据 -->
-    <Tabs v-model:activeKey="activeTab" type="line" style="margin-bottom: 16px">
+    <Tabs v-model:activeKey="activeTab" type="line" class="common-page-tabs">
       <TabPane tab="实时监测" key="realtime">
         <div class="board-info">
           <MiniBoard
@@ -19,8 +19,8 @@
           <template #action="{ record }">
             <div class="action-buttons">
               <!-- 操作按钮 -->
-              <button @click="openModal(record, 'detail')" class="action-btn detail-btn" title="操作">
-                <span class="action-text">详情</span>
+              <button @click="openModal(record, 'resolved')" class="action-btn resolved-btn" title="已解决">
+                <span class="action-text">解决</span>
               </button>
             </div>
           </template>
@@ -42,14 +42,15 @@
     </Tabs>
     <!-- 弹窗组件 -->
     <a-modal
-      style="top: 30%; left: 170px"
-      v-model:visible="visibleModal"
-      :width="450"
-      title="实时监测数据"
-      @ok="handleOkEdit"
+      style="height: 400px"
+      v-model:visible="visibleresolveModal"
+      :width="600"
+      centered
+      title="密闭漏风处理情况"
+      @ok="handleOkEdit()"
       @cancel="handleCancelEdit"
     >
-      <a-table></a-table>
+      <a-textarea style="width: 90%; margin-left: 20px; margin-right: 20px" v-model:value="resolveValue" placeholder="请输入解决情况" :rows="4" />
     </a-modal>
   </div>
 </template>
@@ -71,6 +72,8 @@ const deviceOptions = ref([]);
 const goafOptions = ref([]);
 const mineCode = ref('');
 const goafId = ref('');
+const visibleresolveModal = ref(false); //解决弹窗状态
+const resolveValue = ref('');
 const boardData = ref([
   {
     label: '存在风险情况数量',
@@ -104,7 +107,7 @@ const [registerTable] = useTable({
     schemas: [
       {
         label: '煤矿名称',
-        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        field: 'mineCodeList', // 对应组件的value.mineCode(最终传给Table的查询参数)
         component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
         rules: [],
@@ -118,13 +121,13 @@ const [registerTable] = useTable({
   useSearchForm: true,
   bordered: true,
   showIndexColumn: false,
-  // actionColumn: {
-  //   width: 60,
-  //   title: '操作',
-  //   dataIndex: 'action',
-  //   slots: { customRender: 'action' },
-  //   fixed: undefined,
-  // },
+  actionColumn: {
+    width: 80,
+    title: '操作',
+    dataIndex: 'action',
+    slots: { customRender: 'action' },
+    fixed: undefined,
+  },
 });
 
 // 注册历史数据表格
@@ -231,6 +234,9 @@ const openModal = (record, type) => {
   if (type === 'realtime') {
     // 可向实时弹窗传递当前记录数据
     realtimeModalRef.value?.showModal(record);
+  } else if (type === 'resolved') {
+    visibleresolveModal.value = true;
+    record.isResolved = resolveValue.value || '';
   } else if (type === 'detail') {
     visibleModal.value = true;
   } else {
@@ -239,10 +245,10 @@ const openModal = (record, type) => {
   }
 };
 const handleOkEdit = () => {
-  visibleModal.value = false;
+  visibleresolveModal.value = false;
 };
 const handleCancelEdit = () => {
-  visibleModal.value = false;
+  visibleresolveModal.value = false;
 };
 async function fetchAlarmData(id) {
   const params = {

+ 57 - 60
src/views/analysis/warningAnalysis/connectAnalysis/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="connectAnalysis">
     <div class="filter-area">
-      <Row style="width:100%">
+      <Row style="width: 100%">
         <Col :span="6">
           <div class="filter-section param-section">
             <span class="filter-label">煤矿名称:</span>
@@ -73,16 +73,15 @@
 import { computed, ref, onMounted, watchEffect } from 'vue';
 import dayjs from 'dayjs';
 // import { treeData, historicalMockChartData } from './connectAnalysis.data'; // 引入模拟数据
-import { Select, SelectOption, Row, Col, DatePicker, Button, message, Input, } from 'ant-design-vue';
+import { Select, SelectOption, Row, Col, DatePicker, Button, message, Input } from 'ant-design-vue';
 // import { BasicTree } from '/@/components/Tree/index';
 import CustomChart from '/@/components/Configurable/detail/CustomChart.vue';
-import MineCascader from '@/components/Form/src/jeecg/components/MineCascader/MineCascader.vue'
-import { getGoafHistory, getGoafList } from './connectAnalysis.api'
-import { storeToRefs } from 'pinia';
-import { useMineStore } from '/@/store/modules/mine';
+import MineCascader from '@/components/Form/src/jeecg/components/MineCascader/MineCascader.vue';
+import { getGoafHistory, getGoafList } from './connectAnalysis.api';
+// import { storeToRefs } from 'pinia';
+// import { useMineDepartmentStore } from '/@/store/modules/mine';
 import { useRouter } from 'vue-router';
 
-
 // 组件注册
 const RangePicker: any = DatePicker.RangePicker;
 const { currentRoute } = useRouter();
@@ -99,54 +98,24 @@ const isChartGenerated = ref(false); // 是否已点击生成
 const goafId = ref('')//采空区id
 const goafOption = ref<any[]>([])//采空区列表
 const filteredData = ref<any[]>([])//曲线数据
-const mineStore = useMineStore();
-const { getDepartPath, getDepartTree, getDepartId, getMineCode } = storeToRefs(mineStore);
+// const mineStore = useMineStore();
+// const { getDepartPath, getDepartTree, getDepartId, getMineCode } = storeToRefs(mineStore);
 // const innerValue = computed(() => getDepartPath.value.map((e) => e.fax));
 const innerValue = ref('')
 
-
-// Tree Key 与参数名映射(关键:关联树形节点和实际参数)
-const treeKeyToParamMap = computed(() => ({
-  '0-0-0': 'coVal',
-  '0-0-1': 'ch4Val',
-  '0-0-2': 'c2h4Val',
-  '0-0-3': 'c2h2Val',
-  '0-0-4': 'co2Val',
-  '0-0-5': 'o2Val',
-  '1-1-0': 'sourcePressure',
-  // '1-1-1': 'outerPressure',
-  // '1-1-2': 'pressureDiff',
-  '2-2': 'temperature',
-}));
-// 参数标签映射(图表系列名称)
-const paramLabelMap = computed(() => ({
-  coVal: 'CO浓度(ppm)',
-  ch4Val: 'CH4浓度(%)',
-  c2h4Val: 'C2H4浓度(ppm)',
-  c2h2Val: 'C2H2浓度(ppm)',
-  co2Val: 'CO2浓度(%)',
-  o2Val: 'O2浓度(%)',
-  sourcePressure: '压力(kPa)',
-  temperature: '温度(℃)',
-  // 'innerPressure': '内压力(kPa)',
-  // 'outerPressure': '外压力(kPa)',
-  // 'pressureDiff': '压差(kPa)',
-  // 'temperature': '温度(℃)',
-}));
-// 参数颜色映射
-const paramColorMap = computed(() => ({
-  coVal: '#f5222d', // 红色
-  ch4Val: '#1890ff', // 蓝色
-  c2h4Val: '#faad14', // 橙色
-  c2h2Val: '#52c41a', // 绿色
-  co2Val: '#722ed1', // 紫色
-  o2Val: '#13c2c2', // 青色
-  sourcePressure: '#ff4d4f', // 浅红
-  // 'outerPressure': '#40a9ff',// 浅蓝
-  // 'pressureDiff': '#fa8c16', // 浅橙
-  temperature: '#9254de', // 浅紫
-}));
-
+// // Tree Key 与参数名映射(关键:关联树形节点和实际参数)
+//   const treeKeyToParamMap = computed(() => ({
+//     '0-0-0': 'CO',
+//     '0-0-1': 'CH4',
+//     '0-0-2': 'C2H4',
+//     '0-0-3': 'C2H2',
+//     '0-0-4': 'CO2',
+//     '0-0-5': 'O2',
+//     '1-1-0': 'innerPressure',
+//     '1-1-1': 'outerPressure',
+//     '1-1-2': 'pressureDiff',
+//     '2-2': 'temperature',
+//   }));
 //  // 树形选择事件处理
 //   const handleTreeCheck = (checkedKeys) => {
 //     checkedTreeKeys.value = checkedKeys;
@@ -172,21 +141,49 @@ function changeTime(val) {
   dateRange.value[1] = val[1]
 }
 
+
+// 参数颜色映射
+const paramColorMap = computed(() => ({
+  CO: '#f5222d', // 红色
+  CH4: '#1890ff', // 蓝色
+  C2H4: '#faad14', // 橙色
+  C2H2: '#52c41a', // 绿色
+  CO2: '#722ed1', // 紫色
+  O2: '#13c2c2', // 青色
+  innerPressure: '#ff4d4f', // 浅红
+  outerPressure: '#40a9ff', // 浅蓝
+  pressureDiff: '#fa8c16', // 浅橙
+  temperature: '#9254de', // 浅紫
+}));
+
+// 参数标签映射(图表系列名称)
+const paramLabelMap = computed(() => ({
+  CO: 'CO浓度(ppm)',
+  CH4: 'CH4浓度(%)',
+  C2H4: 'C2H4浓度(ppm)',
+  C2H2: 'C2H2浓度(ppm)',
+  CO2: 'CO2浓度(%)',
+  O2: 'O2浓度(%)',
+  innerPressure: '内压力(kPa)',
+  outerPressure: '外压力(kPa)',
+  pressureDiff: '压差(kPa)',
+  temperature: '温度(℃)',
+}));
 // 生成折线图核心逻辑
 async function generateChart() {
   // showTree.value = false
   //获取采空区历史数据列表
-  let startTime = dateRange.value[0].format('YYYY-MM-DD HH:mm:ss')
-  let endTime = dateRange.value[1].format('YYYY-MM-DD HH:mm:ss')
-  let res = await getGoafHistory({ pageNo: 1, pageSize: 100, startTime: startTime, endTime: endTime, goafId: goafId.value })
+  let startTime = dateRange.value[0].format('YYYY-MM-DD HH:mm:ss');
+  let endTime = dateRange.value[1].format('YYYY-MM-DD HH:mm:ss');
+  let res = await getGoafHistory({ pageNo: 1, pageSize: 100, startTime: startTime, endTime: endTime, goafId: goafId.value });
   if (res && res.records) {
-    filteredData.value = res.records
-    isChartGenerated.value = false
+    filteredData.value = res.records;
+    isChartGenerated.value = false;
   } else {
-    filteredData.value.length = 0
+    filteredData.value.length = 0;
     isChartGenerated.value = true;
   }
-  console.log(filteredData.value, 'filteredData')
+  console.log(filteredData.value, 'filteredData');
 
   // 2. 构建图表数据结构(适配 CustomChart 的 line 类型)
   const timeMap = new Map();
@@ -209,7 +206,7 @@ async function generateChart() {
     return dayjs(a.time).valueOf() - dayjs(b.time).valueOf();
   });
   generatedChartData.value = chartData;
-  console.log(generatedChartData.value, 'generatedChartData')
+  console.log(generatedChartData.value, 'generatedChartData');
 
   // 3. 构建图表配置(折线图类型,完善适配逻辑)
   generatedChartConfig.value = {

+ 1 - 1
src/views/analysis/warningAnalysis/fireAreaJudgeAnalysis/fireAreaJudgeAnalysis.data.ts

@@ -39,7 +39,7 @@ export const columns: BasicColumn[] = [
   {
     title: '煤矿名称',
     dataIndex: 'mineName',
-    width: 200,
+    width: 160,
   },
   {
     title: '密闭名称',

+ 25 - 19
src/views/analysis/warningAnalysis/fireAreaJudgeAnalysis/index.vue

@@ -18,9 +18,9 @@
       <BasicTable @register="registerTable" :scroll="{ x: 'max-content' }" :style="{ padding: 0 }">
         <template #action="{ record }">
           <div class="action-buttons">
-            <!-- 操作按钮 -->
-            <button @click="openModal(record, 'detail')" class="action-btn detail-btn" title="操作">
-              <span class="action-text">详情</span>
+            <!-- 已解决按钮 -->
+            <button @click="openModal(record, 'resolved')" class="action-btn resolved-btn" title="已解决">
+              <span class="action-text">解决</span>
             </button>
           </div>
         </template>
@@ -42,14 +42,15 @@
   </Tabs>
   <!-- 弹窗组件 -->
   <a-modal
-    style="top: 30%; left: 170px"
-    v-model:visible="visibleModal"
-    :width="450"
-    title="实时监测数据"
-    @ok="handleOkEdit"
+    style="height: 400px"
+    v-model:visible="visibleresolveModal"
+    :width="600"
+    centered
+    title="密闭漏风处理情况"
+    @ok="handleOkEdit()"
     @cancel="handleCancelEdit"
   >
-    <a-table></a-table>
+    <a-textarea style="width: 90%; margin-left: 20px; margin-right: 20px" v-model:value="resolveValue" placeholder="请输入解决情况" :rows="4" />
   </a-modal>
 </template>
 
@@ -70,6 +71,8 @@ const deviceOptions = ref([]);
 const goafOptions = ref([]);
 const mineCode = ref('');
 const goafId = ref('');
+const visibleresolveModal = ref(false);
+const resolveValue = ref('');
 const boardData = ref([
   {
     label: '采空区数量',
@@ -95,7 +98,7 @@ const [registerTable] = useTable({
     schemas: [
       {
         label: '煤矿名称',
-        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        field: 'mineCodeList', // 对应组件的value.mineCode(最终传给Table的查询参数)
         component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
         rules: [],
@@ -109,13 +112,13 @@ const [registerTable] = useTable({
   useSearchForm: true,
   bordered: true,
   showIndexColumn: false,
-  // actionColumn: {
-  //   width: 120,
-  //   title: '详情',
-  //   dataIndex: 'action',
-  //   slots: { customRender: 'action' },
-  //   fixed: undefined,
-  // },
+  actionColumn: {
+    width: 80,
+    title: '详情',
+    dataIndex: 'action',
+    slots: { customRender: 'action' },
+    fixed: undefined,
+  },
 });
 
 // 注册历史数据表格
@@ -222,6 +225,9 @@ const openModal = (record, type) => {
   if (type === 'realtime') {
     // 可向实时弹窗传递当前记录数据
     realtimeModalRef.value?.showModal(record);
+  } else if (type === 'resolved') {
+    visibleresolveModal.value = true;
+    record.isResolved = resolveValue.value || '';
   } else if (type === 'detail') {
     visibleModal.value = true;
   } else {
@@ -230,10 +236,10 @@ const openModal = (record, type) => {
   }
 };
 const handleOkEdit = () => {
-  visibleModal.value = false;
+  visibleresolveModal.value = false;
 };
 const handleCancelEdit = () => {
-  visibleModal.value = false;
+  visibleresolveModal.value = false;
 };
 async function fetchAlarmData(id) {
   const params = {

+ 12 - 7
src/views/analysis/warningAnalysis/overlimitAlarm/index.vue

@@ -19,8 +19,8 @@
         <template #action="{ record }">
           <div class="action-buttons">
             <!-- 操作按钮 -->
-            <button @click="openModal(record, 'detail')" class="action-btn detail-btn" title="操作">
-              <span class="action-text">详情</span>
+            <button @click="openModal(record, 'resolved')" class="action-btn detail-btn" title="已解决">
+              <span class="action-text">解决</span>
             </button>
           </div>
         </template>
@@ -71,6 +71,8 @@ const deviceOptions = ref([]);
 const goafOptions = ref([]);
 const mineCode = ref('');
 const goafId = ref('');
+const visibleresolveModal = ref(false);
+const resolveValue = ref('');
 const boardData = ref([
   {
     label: '存在风险情况数量',
@@ -104,7 +106,7 @@ const [registerTable] = useTable({
     schemas: [
       {
         label: '煤矿名称',
-        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        field: 'mineCodeList', // 对应组件的value.mineCode(最终传给Table的查询参数)
         component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
         rules: [],
@@ -119,8 +121,8 @@ const [registerTable] = useTable({
   bordered: true,
   showIndexColumn: false,
   actionColumn: {
-    width: 120,
-    title: '详情',
+    width: 80,
+    title: '操作',
     dataIndex: 'action',
     slots: { customRender: 'action' },
     fixed: undefined,
@@ -231,6 +233,9 @@ const openModal = (record, type) => {
   if (type === 'realtime') {
     // 可向实时弹窗传递当前记录数据
     realtimeModalRef.value?.showModal(record);
+  } else if (type === 'resolved') {
+    visibleresolveModal.value = true;
+    record.isResolved = resolveValue.value || '';
   } else if (type === 'detail') {
     visibleModal.value = true;
   } else {
@@ -239,10 +244,10 @@ const openModal = (record, type) => {
   }
 };
 const handleOkEdit = () => {
-  visibleModal.value = false;
+  visibleresolveModal.value = false;
 };
 const handleCancelEdit = () => {
-  visibleModal.value = false;
+  visibleresolveModal.value = false;
 };
 async function fetchAlarmData(id) {
   const params = {

+ 2 - 2
src/views/analysis/warningAnalysis/pressureDiffAnalysis/index.vue

@@ -122,7 +122,7 @@ const [registerTable] = useTable({
     schemas: [
       {
         label: '煤矿名称',
-        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        field: 'mineCodeList', // 对应组件的value.mineCode(最终传给Table的查询参数)
         component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
         rules: [],
@@ -137,7 +137,7 @@ const [registerTable] = useTable({
   bordered: true,
   showIndexColumn: false,
   actionColumn: {
-    width: 120,
+    width: 80,
     title: '操作',
     dataIndex: 'action',
     slots: { customRender: 'action' },

+ 17 - 11
src/views/analysis/warningAnalysis/sealRiskJudgeAnalysis/index.vue

@@ -18,8 +18,8 @@
       <BasicTable @register="registerTable" :scroll="{ x: 'max-content' }" :style="{ padding: 0 }">
         <!-- 核心:判断record是否有有效数据,无则显示- -->
         <template #action="{ record }">
-          <button @click="openModal(record, 'detail')" class="action-btn detail-btn" title="操作">
-            <span class="action-text">详情</span>
+          <button @click="openModal(record, 'resolved')" class="action-btn detail-btn" title="已解决">
+            <span class="action-text">解决</span>
           </button>
         </template>
         <template #empty>
@@ -73,6 +73,8 @@ const deviceOptions = ref([]);
 const goafOptions = ref([]);
 const mineCode = ref('');
 const goafId = ref('');
+const visibleresolveModal = ref(false);
+const resolveValue = ref('');
 const boardData = ref([
   {
     label: '采空区数量',
@@ -106,7 +108,7 @@ const [registerTable] = useTable({
     schemas: [
       {
         label: '煤矿名称',
-        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        field: 'mineCodeList', // 对应组件的value.mineCode(最终传给Table的查询参数)
         component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
         rules: [],
@@ -120,12 +122,13 @@ const [registerTable] = useTable({
   useSearchForm: true,
   bordered: true,
   showIndexColumn: false,
-  // actionColumn: {
-  //   width: 60,
-  //   title: '操作',
-  //   dataIndex: 'action',
-  //   slots: { customRender: 'action' },
-  // },
+  actionColumn: {
+    width: 80,
+    title: '操作',
+    dataIndex: 'action',
+    slots: { customRender: 'action' },
+    fixed: undefined,
+  },
 });
 
 // 注册历史数据表格
@@ -232,6 +235,9 @@ const openModal = (record, type) => {
   if (type === 'realtime') {
     // 可向实时弹窗传递当前记录数据
     realtimeModalRef.value?.showModal(record);
+  } else if (type === 'resolved') {
+    visibleresolveModal.value = true;
+    record.isResolved = resolveValue.value || '';
   } else if (type === 'detail') {
     visibleModal.value = true;
   } else {
@@ -240,10 +246,10 @@ const openModal = (record, type) => {
   }
 };
 const handleOkEdit = () => {
-  visibleModal.value = false;
+  visibleresolveModal.value = false;
 };
 const handleCancelEdit = () => {
-  visibleModal.value = false;
+  visibleresolveModal.value = false;
 };
 async function fetchAlarmData(id) {
   const params = {

+ 1 - 1
src/views/analysis/warningAnalysis/sealRiskJudgeAnalysis/sealRiskJudgeAnalysis.data.ts

@@ -39,7 +39,7 @@ export const columns: BasicColumn[] = [
   {
     title: '煤矿名称',
     dataIndex: 'mineName',
-    width: 200,
+    width: 160,
   },
   {
     title: '密闭名称',

+ 2 - 4
src/views/dashboard/SealedGoaf/index.vue

@@ -45,13 +45,11 @@
 
       // 3. 把接口数据赋值给响应式变量(备用)
       mineData.value = { coalSeamFireData, productionStatusData, overLimitData, goafAlarmData, goafAlarmLevel };
-      console.log(mineData.value)
 
-
-      // 7. 赋值更新后的配置到configs(触发组件重新渲染)
+      // 4. 赋值更新后的配置到configs(触发组件重新渲染)
       configs.value = [...testConfigSealedGoaf]; // 解构触发响应式更新
       
-      // 8. 更新页面数据
+      // 5. 更新页面数据
       updateData(mineData.value);
 
     } catch (error) {

+ 1 - 0
src/views/dashboard/SealedGoaf/sealedGoaf.api.ts

@@ -42,6 +42,7 @@ export const getGoafAlarmNum = (params) =>
 // 根据矿编码查询矿下采空区风险等级
 export const getGoafAlarmLevel = (params) =>
   defHttp.post({
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
     url: Api.getGoafAlarmLevel,
     params
   });

+ 1 - 2
src/views/dashboard/basicInfo/dataQuality/components/DataQualityModal.vue

@@ -51,13 +51,12 @@
     <!-- 编辑/新增模式 -->
     <div v-else class="edit-container">
       <!-- 动态渲染topFormSchema字段(编辑/新增模式) -->
-      <div class="mine-base-info">
+      <div class="mine-base-info" v-if="mode === 'add'">
         <div class="form-item" v-for="schema in topFormSchema" :key="schema.field">
           <div class="form-label">{{ schema.label }}:</div>
           <component 
             :is="getComponent(schema.component)"
             v-model:value="currentRecord[schema.field]" 
-            :disabled="mode === 'edit' && schema.field === 'mineCode'" 
             v-bind="schema.componentProps"
             :placeholder="`请输入${schema.label}`"
             style="width: 100%"

+ 49 - 56
src/views/dashboard/basicInfo/dataQuality/index.vue

@@ -88,26 +88,22 @@
 <script setup lang="ts">
   import { ref, nextTick, computed, onMounted } from 'vue';
   import { useRouter } from 'vue-router';
-  import { BasicTable, useTable, BasicColumn, FormSchema  } from '/@/components/Table';
+  import { BasicTable, useTable } from '/@/components/Table';
   import { useModal } from '/@/components/Modal';
   import { Tabs, TabPane, Popconfirm, message } from 'ant-design-vue';
   import DataQualityModal from './components/DataQualityModal.vue';
   import { SvgIcon } from '/@/components/Icon';
-  import { 
-    getColumns, 
-    getSearchFormSchema, 
-    type ProductionStatusMap,
-  } from './dataQuality.data';
+  import { getColumns, getSearchFormSchema, type ProductionStatusMap } from './dataQuality.data';
   import { getDataQuaQueList, addDataQuaQue, deleteDataQuaQue, editDataQuaQue } from '../basicInfo.api';
   import { findNode } from '/@/utils/helper/treeHelper';
-  import { useMineStore } from '/@/store/modules/mine';
+  import { useMineDepartmentStore } from '/@/store/modules/mine';
   import { getDictItemsByCode } from '/@/utils/dict';
-  import dayjs from 'dayjs'; 
+  import dayjs from 'dayjs';
   import * as XLSX from 'xlsx';
   // 路由实例
   const router = useRouter();
   // 实例化矿井Store
-  const mineStore = useMineStore();
+  const mineStore = useMineDepartmentStore();
   // 响应式数据
   const activeKey = ref('unresolved'); // 激活的Tab键
   const pageMode = ref('add');
@@ -121,7 +117,8 @@
   // 3. 颜色分配规则(可根据业务灵活调整)
   const getStatusColor = (statusText: string) => {
     if (statusText.includes('正常生产')) return 'green'; // 正常生产 → 绿色
-    if (statusText.includes('拟建矿井')) return 'blue';   // 拟建矿井 → 蓝色
+    if (statusText.includes('拟建矿井'))
+      return 'blue'; // 拟建矿井 → 蓝色
     else return 'red'; // 停产/停建/关闭/整改/责令 → 红色
   };
 
@@ -135,12 +132,12 @@
       // 生成动态映射和下拉选项
       const statusMap: ProductionStatusMap = {};
       const statusOptions: { label: string; value: string | number }[] = [];
-      
+
       statusList.forEach((item) => {
         const value = item.value; // 接口返回的value(数字/字符串)
         const label = item.text || item.label; // 接口返回的文本
         const color = getStatusColor(label); // 按规则分配颜色
-        
+
         // 填充映射表
         statusMap[value] = { label, value, color };
         // 填充下拉选项
@@ -152,7 +149,7 @@
       dynamicProductionStatusOptions.value = statusOptions;
 
       // 刷新表格(确保表格使用最新的映射)
-      await safeReloadActiveTable(); 
+      await safeReloadActiveTable();
     } catch (error) {
       console.error('获取生产状态列表失败:', error);
       message.error('生产状态数据加载失败');
@@ -171,7 +168,7 @@
     columns: columns, // 绑定动态列
     formConfig: {
       labelWidth: 120,
-      schemas: searchFormSchema.value, 
+      schemas: searchFormSchema.value,
       showAdvancedButton: false,
       schemaGroupNames: ['常规查询'],
     },
@@ -237,7 +234,7 @@
       console.error('解析质量问题JSON失败:', error);
       return '问题数据解析失败';
     }
-  };
+  }
 
   // 安全重载当前激活的表格
   async function safeReloadActiveTable() {
@@ -256,39 +253,39 @@
       }
     }
   }
-  // 按需重载双表格(仅在「标记已解决」等跨Tab操作时用
-  async function reloadBothTableSafely() {
-    await nextTick();
-    // 未解决表格:await + try/catch 捕获异步错误
-    try {
-      await reloadUnresolved(); 
-    } catch (e) {
-      console.warn('未解决表格暂未就绪,跳过重载:', e);
-    }
-    // 已解决表格:同理,一个报错不影响另一个
-    try {
-      await reloadResolved(); 
-    } catch (e) {
-      console.warn('已解决表格暂未就绪,跳过重载:', e);
-    }
-  }
+  // 按需重载双表格(先注释掉
+  // async function reloadBothTableSafely() {
+  //   await nextTick();
+  //   // 未解决表格:await + try/catch 捕获异步错误
+  //   try {
+  //     await reloadUnresolved();
+  //   } catch (e) {
+  //     console.warn('未解决表格暂未就绪,跳过重载:', e);
+  //   }
+  //   // 已解决表格:同理,一个报错不影响另一个
+  //   try {
+  //     await reloadResolved();
+  //   } catch (e) {
+  //     console.warn('已解决表格暂未就绪,跳过重载:', e);
+  //   }
+  // }
 
   // tabs切换事件
   async function handleTabChange(key: string) {
     activeKey.value = key;
     await safeReloadActiveTable();
-  };
+  }
 
   /**
    * 根据标签获取表格数据(已解决/未解决)
    * @param result 弹框数据
    */
-  function getQuaQueListByTab() {
-    return async (params: any) => {
-      const isOk = activeKey.value === 'resolved' ? true : false;
-      return await getDataQuaQueList({ ...params, isOk: isOk });
-    };
-  }
+  // function getQuaQueListByTab() {
+  //   return async (params: any) => {
+  //     const isOk = activeKey.value === 'resolved' ? true : false;
+  //     return await getDataQuaQueList({ ...params, isOk: isOk });
+  //   };
+  // }
 
   /**
    * 打开弹框函数
@@ -310,24 +307,20 @@
       } else if (pageMode.value === 'edit') {
         await editDataQuaQue(result);
       }
-      await safeReloadActiveTable(); 
+      await safeReloadActiveTable();
     } catch (error) {
-      console.log('操作失败:', error);
+      console.error('操作失败:', error);
     }
   }
   /**
- * 通用页面跳转方法
- * @param record 当前行数据
- * @param path 目标路径(树形结构所在页面的路由地址)
- */
+   * 通用页面跳转方法
+   * @param record 当前行数据
+   * @param path 目标路径(树形结构所在页面的路由地址)
+   */
   async function handleGoToPage(record: any) {
     try {
       const mineCode = record.mineCode;
-      const targetNode = findNode(
-        mineStore.getMineTree,
-        (item) => item.id === mineCode,
-        { id: 'id', pid: 'parentId', children: 'childDepart' }
-      );
+      const targetNode = findNode(mineStore.getDepartTree, (item) => item.id === mineCode, { id: 'id', pid: 'parentId', children: 'childDepart' });
 
       let minePath = '';
       if (targetNode) {
@@ -338,7 +331,7 @@
       }
 
       // 跳转页面(可携带拼接后的矿名/路径等参数)
-      router.push({ path: `/sealed/${minePath}`, query: {} });
+      router.push({ path: `/sealed/${minePath}`, query: { mineCode } });
     } catch (error) {
       console.error('矿节点定位失败:', error);
       message.error('矿节点定位失败,请稍后重试');
@@ -368,7 +361,7 @@
     try {
       await deleteDataQuaQue({ id: record.id });
       await nextTick();
-      await safeReloadActiveTable(); 
+      await safeReloadActiveTable();
     } catch (error) {
       console.error('删除失败:', error);
     }
@@ -382,12 +375,12 @@
     const copyRecord = {
       ...record,
       isOk: true,
-      updateTime: dayjs().format('YYYY-MM-DD HH:mm:ss')
+      updateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
     };
     try {
       await editDataQuaQue(copyRecord);
-      await safeReloadActiveTable(); 
-    }catch (error) {
+      await safeReloadActiveTable();
+    } catch (error) {
       console.error('操作失败:', error);
     }
   }
@@ -440,7 +433,7 @@
     let hideLoading: () => void = () => {};
     try {
       hideLoading = message.loading('正在导出数据,请稍候...');
-      
+
       const unresolvedList = await getAllUnresolvedData();
       const resolvedList = await getAllResolvedData();
 
@@ -469,7 +462,7 @@
   // ========== 初始化:先获取状态数据,再加载表格 ==========
   onMounted(async () => {
     await fetchProductionStatus(); // 先获取动态状态数据
-    await safeReloadActiveTable(); 
+    await safeReloadActiveTable();
   });
 </script>
 

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

@@ -2,7 +2,7 @@
 <template>
   <BasicTable @register="registerTable">
     <template #action="{ record }">
-      <button @click="handleGoToPage(record, `/sealed/${record.areaId}`)" class="action-btn">
+      <button @click="handleGoToPageQuery(record, `/sealed/${record.areaId}`)" class="action-btn">
         <SvgIcon name="data" />
       </button>
       <button @click="handleGoToPage(record, '/basicInfo/accessStatistics')" class="action-btn">
@@ -128,7 +128,7 @@
     const mineCode = record.mineCode
     router.push({
       path,
-      query: { mineCode : mineCode},
+      query: { mineCode },
     });
   }
 

+ 42 - 21
src/views/monitor/sealedMonitor/hooks/form.ts

@@ -1,44 +1,65 @@
 import { last } from 'lodash';
-import { ref, computed } from 'vue';
+import { ref } from 'vue';
 import { useRoute } from 'vue-router';
 import { getGoafSelectOption } from '../monitor.api';
-import { useMineStore } from '/@/store/modules/mine';
-import { findNodeAll, findPath } from '/@/utils/helper/treeHelper';
+import { useMineDepartmentStore } from '/@/store/modules/mine';
+import { historicalFormSchema, searchFormSchema } from '../monitor.data';
+import { FormSchema } from '/@/components/Form';
 
 export function useInitForm() {
-  const config = {
-    id: 'id',
-    pid: 'parentId',
-    children: 'childDepart',
-  };
+  const mineStore = useMineDepartmentStore();
   const route = useRoute();
-  const mineStroe = useMineStore();
-  const mineCodes = ref<string[]>([]);
-  const getMineTree = computed(() => {
-    const id = last(route.fullPath.split('/'));
-    return findNodeAll(mineStroe.mineTree, (item) => item.id === id, config);
-  });
-  const paths = findPath(getMineTree.value, (item) => item.isLeaf, config);
-
-  mineCodes.value = paths.map((e) => e.id);
+  const id = last(route.fullPath.split('/'));
 
   // 采空区选择器
   const goafId = ref('');
   const goafOptions = ref<any[]>([]);
 
   function initGoafOptions() {
-    getGoafSelectOption({ mineCode: last(mineCodes.value) }).then(({ options, defaultValue }) => {
+    getGoafSelectOption({ mineCode: mineStore.getMineCode }).then(({ options, defaultValue }) => {
       goafOptions.value = options;
       goafId.value = defaultValue;
     });
   }
   initGoafOptions();
 
+  const realtimeSchemas: FormSchema[] = [
+    {
+      field: 'mineCodeList',
+      label: '煤矿名称',
+      component: 'MineCascader',
+      colProps: { span: 6 },
+      componentProps: {
+        resetOnDestroy: true,
+        rootId: id,
+      },
+    },
+    ...searchFormSchema,
+  ];
+
+  const historySchemas: FormSchema[] = [
+    {
+      field: 'mineCodeList',
+      label: '煤矿名称',
+      component: 'MineCascader',
+      colProps: { span: 6 },
+      required: true,
+      componentProps: {
+        resetOnDestroy: true,
+        rootId: id,
+        onChange() {
+          initGoafOptions();
+        },
+      },
+    },
+    ...historicalFormSchema,
+  ];
+
   return {
-    goafId,
+    historySchemas,
+    realtimeSchemas,
     goafOptions,
-    mineCodes,
-    getMineTree,
+    goafId,
     initGoafOptions,
   };
 }

+ 14 - 63
src/views/monitor/sealedMonitor/index.vue

@@ -5,23 +5,6 @@
     <TabPane tab="实时数据监测" key="realtime">
       <!-- 实时数据表格 -->
       <BasicTable style="padding: 0" @register="registerRealtimeTable">
-        <template #form-mine-cascader>
-          <a-cascader
-            v-model:value="mineCodes"
-            :options="getMineTree"
-            :field-names="{
-              label: 'departName',
-              value: 'id',
-              children: 'childDepart',
-            }"
-            show-search
-            @change="initGoafOptions"
-          >
-            <template #displayRender="{ labels }">
-              {{ labels[labels.length - 1] }}
-            </template>
-          </a-cascader>
-        </template>
         <template #action="{ record }">
           <button @click="openModal(record)" class="action-btn">
             <SvgIcon name="details" />
@@ -33,23 +16,6 @@
     <TabPane tab="历史数据监测" key="history">
       <!-- 历史数据表格 -->
       <BasicTable style="padding: 0" @register="registerHistoryTable">
-        <template #form-mine-cascader>
-          <a-cascader
-            v-model:value="mineCodes"
-            :options="getMineTree"
-            :field-names="{
-              label: 'departName',
-              value: 'id',
-              children: 'childDepart',
-            }"
-            show-search
-            @change="initGoafOptions"
-          >
-            <template #displayRender="{ labels }">
-              {{ labels[labels.length - 1] }}
-            </template>
-          </a-cascader>
-        </template>
         <template #form-goaf-select>
           <a-select v-model:value="goafId" :options="goafOptions" placeholder="请选择" />
         </template>
@@ -74,15 +40,14 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
-  import { Tabs, TabPane } from 'ant-design-vue';
+  import { Tabs, TabPane, message } from 'ant-design-vue';
   // 引入模拟数据
-  import { columns, searchFormSchema, historicalColumns, historicalFormSchema } from './monitor.data';
+  import { columns, historicalColumns } from './monitor.data';
   import RealtimeDetailsModal from './components/RealtimeDetailsModal.vue';
   // import HistoricalDetailsModal from './components/HistoricalDetailsModal.vue';
   import { SvgIcon } from '/@/components/Icon';
   import { getGoafData, getGoafHistory } from './monitor.api';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { last } from 'lodash-es';
   import { useModal } from '/@/components/Modal';
   import { useIntervalFn } from '@vueuse/core';
   import { useInitForm } from './hooks/form';
@@ -91,55 +56,41 @@
   // 激活的Tab页签
 
   // 处理矿名选择器相关的逻辑
-  const { goafId, goafOptions, mineCodes, getMineTree, initGoafOptions } = useInitForm();
+  const { realtimeSchemas, historySchemas, goafOptions, goafId } = useInitForm();
   const activeTab = ref('realtime');
 
   // 注册实时数据表格
   const { tableContext: ctxRealtime } = useListPage({
     tableProps: {
-      // api: getGoafData,
-      // beforeFetch(params) {
-      //   params.mineCode = last(mineCodes.value);
-      // },
+      api: getGoafData,
       columns,
       formConfig: {
-        schemas: searchFormSchema,
+        schemas: realtimeSchemas,
         schemaGroupNames: ['常规查询'],
-        submitFunc: () => reloadRealtimeTable(true),
       },
       showIndexColumn: false,
       scroll: { x: 'max-content' },
     },
     pagination: false,
   });
-  const [registerRealtimeTable, { setTableData, setLoading }] = ctxRealtime;
-
-  function reloadRealtimeTable(showLoading: boolean = false) {
-    if (showLoading) {
-      setLoading(true);
-    }
-    return getGoafData({ mineCode: last(mineCodes.value) })
-      .then((res) => {
-        setTableData(res);
-      })
-      .finally(() => {
-        setLoading(false);
-      });
-  }
+  const [registerRealtimeTable, { reload }] = ctxRealtime;
 
-  reloadRealtimeTable();
-  const { pause, resume } = useIntervalFn(reloadRealtimeTable, 10000);
+  const { pause, resume } = useIntervalFn(() => reload({ silence: true }), 10000);
 
   // 注册历史数据表格
   const { tableContext: ctxHistory, onExportXls } = useListPage({
     tableProps: {
-      api: getGoafHistory,
-      beforeFetch(params) {
+      api: (params) => {
+        if (!goafId.value) {
+          message.info('请先选择煤矿及采空区');
+          return Promise.reject();
+        }
         params.goafId = goafId.value;
+        return getGoafHistory(params);
       },
       columns: historicalColumns,
       formConfig: {
-        schemas: historicalFormSchema, // 使用历史数据的搜索配置
+        schemas: historySchemas, // 使用历史数据的搜索配置
         schemaGroupNames: ['常规查询'],
       },
       useSearchForm: true,

+ 7 - 14
src/views/monitor/sealedMonitor/monitor.data.ts

@@ -118,13 +118,6 @@ export const columns: BasicColumn[] = [
 ];
 
 export const searchFormSchema: FormSchema[] = [
-  {
-    field: 'mineCode',
-    label: '煤矿名称',
-    component: 'MineCascader',
-    slot: 'mine-cascader',
-    colProps: { span: 6 },
-  },
   {
     field: 'mineNameAbbr',
     label: '煤矿简称',
@@ -395,13 +388,13 @@ export const historicalColumns: BasicColumn[] = [
 ];
 
 export const historicalFormSchema: FormSchema[] = [
-  {
-    field: 'mineCode',
-    label: '煤矿名称',
-    component: 'MineCascader',
-    slot: 'mine-cascader',
-    colProps: { span: 6 },
-  },
+  // {
+  //   field: 'mineCode',
+  //   label: '煤矿名称',
+  //   component: 'MineCascader',
+  //   slot: 'mine-cascader',
+  //   colProps: { span: 6 },
+  // },
   // {
   //   field: 'mineNameAbbr',
   //   label: '煤矿简称',