소스 검색

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

bobo04052021@163.com 4 달 전
부모
커밋
beb78d1afa

+ 85 - 92
src/views/dashboard/SealedGoaf/configurable.data.sealedGoaf.ts

@@ -3,7 +3,7 @@ import type { Config } from '@/components/Configurable/types';
 export const testConfigSealedGoaf: Config[] = [
   // 1. 矿井状况
   {
-    deviceType: 'goafsInfo',
+    deviceType: 'goafs_info',
     moduleName: '矿井状况',
     pageType: 'sealed_goaf',
     moduleData: {
@@ -90,20 +90,20 @@ export const testConfigSealedGoaf: Config[] = [
           layout: 'label-top',
           items: [
             {
-              label: '正在生产',
-              value: '210',
+              label: '${productionStatusData[0].name}',
+              value: '${productionStatusData[0].num}',
             },
             {
-              label: '正在建设',
-              value: '27',
+              label: '${productionStatusData[1].name}',
+              value: '${productionStatusData[1].num}',
             },
             {
-              label: '停产',
-              value: '17',
+              label: '${productionStatusData[2].name}',
+              value: '${productionStatusData[2].num}',
             },
             {
-              label: '停工',
-              value: '1',
+              label: '${productionStatusData[3].name}',
+              value: '${productionStatusData[3].num}',
             },
           ],
         },
@@ -123,7 +123,7 @@ export const testConfigSealedGoaf: Config[] = [
   },
   // 3. 煤层自燃倾向性
   {
-    deviceType: 'deviceInfo',
+    deviceType: 'coalSeam_fire',
     moduleName: '煤层自燃倾向性',
     pageType: 'sealed_goaf',
     moduleData: {
@@ -160,7 +160,7 @@ export const testConfigSealedGoaf: Config[] = [
           legend: { show: false, formatter: '{b}:{c}\n{d}%' },
           xAxis: [{ show: false }],
           yAxis: [{ show: false, name: '风量', position: 'left' }],
-          series: [{ readFrom: 'piechart', xprop: 'pos', yprop: 'val', label: '' }],
+          series: [{ readFrom: 'coalSeamFireData', xprop: 'coalSeamLevel', yprop: 'num', label: '' }],
         },
       ],
       gallery: [],
@@ -169,13 +169,6 @@ export const testConfigSealedGoaf: Config[] = [
       list: [],
       complex_list: [],
       preset: [],
-      mock: {
-        piechart: [
-          { pos: 'Ⅰ类容易自燃', val: 50 },
-          { pos: 'Ⅱ类自燃', val: 80 },
-          { pos: 'Ⅲ类不易自燃', val: 40 },
-        ],
-      },
     },
     showStyle: {
       size: 'width:440px;height:200px;',
@@ -359,7 +352,7 @@ export const testConfigSealedGoaf: Config[] = [
   },
   // 5. 密闭情况总览
   {
-    deviceType: '',
+    deviceType: 'sealed_info',
     moduleName: '密闭情况总览',
     pageType: 'sealed_goaf',
     moduleData: {
@@ -528,7 +521,7 @@ export const testConfigSealedGoaf: Config[] = [
   },
   // 6. 采空区密闭预警分析
   {
-    deviceType: 'goafMonitoring',
+    deviceType: 'goafmonitoring',
     moduleName: '采空区密闭预警分析',
     pageType: 'sealed_goaf',
     moduleData: {
@@ -536,7 +529,7 @@ export const testConfigSealedGoaf: Config[] = [
         show: true,
         readFrom: '',
         selector: {
-          show: true,
+          show: false,
           value: '${pos}',
         },
         slot: {
@@ -596,27 +589,27 @@ export const testConfigSealedGoaf: Config[] = [
         {
           type: 'A',
           // parser: 'json',
-          readFrom: 'tableArray',
+          readFrom: 'goafAlarmData',
           columns: [
             {
               name: ' ',
-              prop: 'index',
+              prop: 'managementName',
             },
             {
               name: '低风险',
-              prop: 'dfx',
+              prop: 'alarm1',
             },
             {
               name: '一般风险',
-              prop: 'ybfx',
+              prop: 'alarm2',
             },
             {
               name: '较高风险',
-              prop: 'jgfx',
+              prop: 'alarm3',
             },
             {
               name: '高风险',
-              prop: 'gfx',
+              prop: 'alarm4',
             },
           ],
         },
@@ -624,68 +617,68 @@ export const testConfigSealedGoaf: Config[] = [
       list: [],
       complex_list: [],
       preset: [],
-      mock: {
-        goafMonitoring: [
-          {
-            pos: '自燃',
-            boardArray: [
-              {
-                label: '低风险',
-                value: '210',
-              },
-              {
-                label: '一般风险',
-                value: '27',
-              },
-              {
-                label: '较高风险',
-                value: '17',
-              },
-              {
-                label: '高风险',
-                value: '1',
-              },
-            ],
-            tableArray: [
-              {
-                index: '执法一处',
-                dfx: '50',
-                ybfx: '20',
-                jgfx: '0',
-                gfx: '0',
-              },
-              {
-                index: '执法二处',
-                dfx: '50',
-                ybfx: '20',
-                jgfx: '0',
-                gfx: '0',
-              },
-              {
-                index: '执法三处',
-                dfx: '50',
-                ybfx: '20',
-                jgfx: '0',
-                gfx: '0',
-              },
-              {
-                index: '执法四处',
-                dfx: '50',
-                ybfx: '20',
-                jgfx: '0',
-                gfx: '0',
-              },
-              {
-                index: '执法五处',
-                dfx: '50',
-                ybfx: '20',
-                jgfx: '0',
-                gfx: '0',
-              },
-            ],
-          },
-        ],
-      },
+      // mock: {
+      //   goafMonitoring: [
+      //     {
+      //       pos: '自燃',
+      //       boardArray: [
+      //         {
+      //           label: '低风险',
+      //           value: '210',
+      //         },
+      //         {
+      //           label: '一般风险',
+      //           value: '27',
+      //         },
+      //         {
+      //           label: '较高风险',
+      //           value: '17',
+      //         },
+      //         {
+      //           label: '高风险',
+      //           value: '1',
+      //         },
+      //       ],
+      //       tableArray: [
+      //         {
+      //           managementName: '执法一处',
+      //           dfx: '50',
+      //           ybfx: '20',
+      //           jgfx: '0',
+      //           gfx: '0',
+      //         },
+      //         {
+      //           managementName: '执法二处',
+      //           dfx: '50',
+      //           ybfx: '20',
+      //           jgfx: '0',
+      //           gfx: '0',
+      //         },
+      //         {
+      //           managementName: '执法三处',
+      //           dfx: '50',
+      //           ybfx: '20',
+      //           jgfx: '0',
+      //           gfx: '0',
+      //         },
+      //         {
+      //           managementName: '执法四处',
+      //           dfx: '50',
+      //           ybfx: '20',
+      //           jgfx: '0',
+      //           gfx: '0',
+      //         },
+      //         {
+      //           managementName: '执法五处',
+      //           dfx: '50',
+      //           ybfx: '20',
+      //           jgfx: '0',
+      //           gfx: '0',
+      //         },
+      //       ],
+      //     },
+      //   ],
+      // },
     },
     showStyle: {
       size: 'width:440px;height:280px;',
@@ -695,7 +688,7 @@ export const testConfigSealedGoaf: Config[] = [
   },
   // 7. 当日报警情况统计
   {
-    deviceType: 'RealtimeMonitor',
+    deviceType: 'realtime_monitor',
     moduleName: '当日报警情况统计',
     pageType: 'sealed_goaf',
     moduleData: {
@@ -732,8 +725,8 @@ export const testConfigSealedGoaf: Config[] = [
           layout: 'val-top',
           items: [
             {
-              label: 'CO超限',
-              value: '210',
+              label: '${overLimitData[0].alarmDesc}',
+              value: '${overLimitData[0].num}',
             },
             {
               label: 'CH4超限',

+ 32 - 6
src/views/dashboard/SealedGoaf/index.vue

@@ -15,22 +15,48 @@
   </div>
 </template>
 <script lang="ts" setup>
-  import { computed, onMounted, onUnmounted } from 'vue';
+  import { computed, onMounted, onUnmounted, ref } from 'vue';
   import { useInitConfigs, useInitPage } from '@/components/Configurable/hooks/useInit';
   import { testConfigSealedGoaf } from './configurable.data.sealedGoaf';
+  import { getCoalSeamFireNum, getMineProductionStatusNum, getOverLimitNum, getGoafAlarmNum, getGoafAlarmLevel } from './sealedGoaf.api'
   import ModulePrimary from '/@/components/Configurable/ModulePrimary.vue';
   import { useGlobSetting } from '/@/hooks/setting';
 
   const { title = '省局采空区密闭监测与分析系统' } = useGlobSetting();
-  const { data } = useInitPage(title);
+  const { data, updateData } = useInitPage(title);
 
   const cfgs = computed(() => configs.value);
   const { configs, fetchConfigs } = useInitConfigs();
+  const mineData = ref({}); // 所有数据汇总
 
-  onMounted(() => {
-    fetchConfigs('sealed_goaf').then(() => {
-      configs.value = testConfigSealedGoaf;
-    });
+  onMounted(async () => {
+    try {
+      // 1. 先获取基础配置(若有接口获取配置则保留,否则直接用本地testConfigSealedGoaf)
+      await fetchConfigs('sealed_goaf');
+      
+      // 2. 异步获取所有接口数据(并行请求提升性能)
+      const [coalSeamFireData, productionStatusData, overLimitData, goafAlarmData, goafAlarmLevel] = await Promise.all([
+        getCoalSeamFireNum(), // 煤层自燃倾向数据
+        getMineProductionStatusNum(), // 当日生产状态数据
+        getOverLimitNum(), // 超限数据(可按需处理)
+        getGoafAlarmNum({mineCode:'100008'}), // 执法处风险统计
+        getGoafAlarmLevel({mineCode:'100008'}),
+      ]);
+
+      // 3. 把接口数据赋值给响应式变量(备用)
+      mineData.value = { coalSeamFireData, productionStatusData, overLimitData, goafAlarmData, goafAlarmLevel };
+      console.log(mineData.value)
+
+
+      // 7. 赋值更新后的配置到configs(触发组件重新渲染)
+      configs.value = [...testConfigSealedGoaf]; // 解构触发响应式更新
+      
+      // 8. 更新页面数据
+      updateData(mineData.value);
+
+    } catch (error) {
+      console.error('数据获取/配置更新失败:', error);
+    }
   });
 
   // 数据处理函数

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

@@ -0,0 +1,47 @@
+import { defHttp } from '/@/utils/http/axios';
+
+enum Api {
+  getCoalSeamFireNum = '/province/homeData/getCoalSeamFireNum',
+  getMineProductionStatusNum  = '/province/homeData/getMineProductionStatusNum',
+  getOverLimitNum = '/province/homeData/getOverLimitNum',
+  getGoafAlarmNum = '/province/homeData/getGoafAlarmNum',
+  getGoafAlarmLevel = '/province/homeData/getGoafAlarmLevel',
+
+//   getCoalSeamFireNum = '/datahome/province/homeData/getCoalSeamFireNum',
+//   getMineProductionStatusNum  = '/datahome/province/homeData/getMineProductionStatusNum',
+//   getOverLimitNum = '/datahome/province/homeData/getOverLimitNum',
+//   getGoafAlarmNum = '/datahome/province/homeData/getGoafAlarmNum',
+//   getGoafAlarmLevel = '/datahome/province/homeData/getGoafAlarmLevel',
+}
+
+// 查询煤层自燃倾向数量统计
+export const getCoalSeamFireNum = () =>
+  defHttp.post({
+    url: Api.getCoalSeamFireNum,
+  });
+
+// 查询矿井生成状态统计
+export const getMineProductionStatusNum = () =>
+  defHttp.post({
+    url: Api.getMineProductionStatusNum,
+  });
+
+// 查询采空区超限数量统计
+export const getOverLimitNum = () =>
+  defHttp.post({
+    url: Api.getOverLimitNum,
+  });
+
+// 执法处风险统计
+export const getGoafAlarmNum = (params) =>
+  defHttp.post({
+    url: Api.getGoafAlarmNum,
+    params
+  });
+
+// 根据矿编码查询矿下采空区风险等级
+export const getGoafAlarmLevel = (params) =>
+  defHttp.post({
+    url: Api.getGoafAlarmLevel,
+    params
+  });

+ 69 - 0
src/views/dashboard/basicInfo/basicInfo.api.ts

@@ -1,11 +1,80 @@
 import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
+  // 矿山信息
+  getMineData = '/ventanaly-province/province/mineData/getMineData',
+  // 接入统计
   getGoafAccessCount = '/ventanaly-province/province/mineData/getGoafAccessCount',
+  // 数据质量
+  getDataQuaQueList  = '/ventanaly-province/province/dataQuaQue/list',
+  addDataQuaQue = '/ventanaly-province/province/dataQuaQue/add',
+  deleteDataQuaQue = '/ventanaly-province/province/dataQuaQue/delete',
+  editDataQuaQue = '/ventanaly-province/province/dataQuaQue/edit',
+  // 密闭统计
+  getClosedAccessCount = '/ventanaly-province/province/mineData/getZFCGoafAccessCount'
 }
+// 矿山信息
+
+export const getMineData = (params) => 
+  defHttp.post({ 
+    headers: { 'Content-Type': 'x-www-form-urlencoded' },
+    url: Api.getMineData, 
+    params
+  });
 
 // 接入统计
 export const getGoafAccessCount = () =>
   defHttp.get({
     url: Api.getGoafAccessCount,
   });
+
+// 数据质量相关接口
+
+/**
+ * 分页列表查询
+ * @param params
+ */
+export const getDataQuaQueList = (params) =>
+  defHttp.get({
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+    url: Api.getDataQuaQueList,
+    params
+  });
+
+
+/**
+ * 新增质量问题
+ * @param params
+ */
+export const addDataQuaQue = (params) => 
+  defHttp.post({ 
+    url: Api.addDataQuaQue, 
+    params 
+  });
+
+/**
+ * 通过id删除质量问题
+ * @param params
+ */
+export const deleteDataQuaQue = (params) => 
+  defHttp.delete({ 
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+    url: Api.deleteDataQuaQue, 
+    params 
+  });
+
+/**
+ * 编辑质量问题
+ * @param params
+ */
+export const editDataQuaQue = (params) => 
+  defHttp.post({ 
+    url: Api.editDataQuaQue, 
+    params 
+  });
+
+  // 密闭统计
+export const getClosedAccessCount = () =>
+  defHttp.get({
+    url: Api.getClosedAccessCount,
+  });

+ 45 - 130
src/views/dashboard/basicInfo/closedStatistics/closed.data.ts

@@ -9,79 +9,99 @@ export function getClosedStatisticsColumns(): BasicColumn[] {
   return [
     {
       title: '序号',
-      dataIndex: 'id',
+      dataIndex: 'code',
       align: 'center',
     },
     {
       title: '区域',
-      dataIndex: 'region',
+      dataIndex: 'name',
       align: 'center',
     //   width: 80,
     },
     {
       title: '密闭总数',
-      dataIndex: 'closedTotal',
+      dataIndex: 'mbStatusNum',
       align: 'center',
     },
     {
       title: '正常生产',
-      dataIndex: 'normalProduce',
+      dataIndex: 'mbStatusNum0',
       align: 'center',
     },
     {
-      title: '正常建设',
-      dataIndex: 'normalBuild',
+      title: '拟建矿井',
+      dataIndex: 'mbStatusNum1',
       align: 'center',
     },
     {
-      title: '拟建矿井',
-      dataIndex: 'toRetireMine',
+      title: '正常建设',
+      dataIndex: 'mbStatusNum2',
       align: 'center',
     },
     {
       title: '自行停产',
-      dataIndex: 'selfStopProduce',
+      dataIndex: 'mbStatusNum3',
       align: 'center',
     },
     {
-      title: '自行停建',
-      dataIndex: 'selfStopBuild',
+      title: '正在关闭',
+      dataIndex: 'mbStatusNum4',
+      align: 'center',
+    },
+    {
+      title: '责令停产',
+      dataIndex: 'mbStatusNum5',
+      align: 'center',
+    },
+    {
+      title: '责令停止',
+      dataIndex: 'mbStatusNum6',
       align: 'center',
     },
     {
-      title: '责令停止整顿',
-      dataIndex: 'orderStopRectify',
+      title: '已关闭',
+      dataIndex: 'mbStatusNum7',
       align: 'center',
     },
     {
-      title: '责令停止建设',
-      dataIndex: 'orderStopBuild',
+      title: '长期停产',
+      dataIndex: 'mbStatusNum8',
+      align: 'center',
+    },
+    {
+      title: '长期停建',
+      dataIndex: 'mbStatusNum9',
       align: 'center',
     },
     {
       title: '停产整改',
-      dataIndex: 'stopProduceRectify',
+      dataIndex: 'mbStatusNum10',
       align: 'center',
     },
+    {
+      title: '长期停建(失联)',
+      dataIndex: 'mbStatusNum11',
+      align: 'center',
+      width: 140,
+    },
     {
       title: '停建整改',
-      dataIndex: 'stopBuildRectify',
+      dataIndex: 'mbStatusNum12',
       align: 'center',
     },
     {
-      title: '长期停产',
-      dataIndex: 'longTermStopProduce',
+      title: '自行停建',
+      dataIndex: 'mbStatusNum13',
       align: 'center',
     },
     {
-      title: '长期停建',
-      dataIndex: 'longTermStopBuild',
+      title: '正在关闭',
+      dataIndex: 'mbStatusNum14',
       align: 'center',
     },
     {
-      title: '长期停建(失联)',
-      dataIndex: 'longTermClose',
-      width: 180,
+      title: '其他',
+      dataIndex: 'mbStatusNumQt',
       align: 'center',
     },
     {
@@ -92,109 +112,4 @@ export function getClosedStatisticsColumns(): BasicColumn[] {
       customRender: () => h(EyeOutlined, { style: { cursor: 'pointer' }, onClick: () => alert('查看详情') }),
     },
   ];
-}
-
-export const tableMockData = [
-    {
-        id: '101',
-        region: '执法一处',
-        closedTotal: 140,
-        normalProduce: 10,
-        normalBuild: 10,
-        toRetireMine: 10,
-        selfStopProduce: 10,
-        selfStopBuild: 10,
-        orderStopRectify: 10,
-        orderStopBuild: 10,
-        stopProduceRectify: 10,
-        stopBuildRectify: 10,
-        longTermStopProduce: 10,
-        longTermStopBuild: 10,
-        longTermClose: 10,
-    },
-    {
-        id: '102',
-        region: '执法二处',
-        closedTotal: 140,
-        normalProduce: 10,
-        normalBuild: 10,
-        toRetireMine: 10,
-        selfStopProduce: 10,
-        selfStopBuild: 10,
-        orderStopRectify: 10,
-        orderStopBuild: 10,
-        stopProduceRectify: 10,
-        stopBuildRectify: 10,
-        longTermStopProduce: 10,
-        longTermStopBuild: 10,
-        longTermClose: 10,
-    },
-    {
-        id: '103',
-        region: '执法三处',
-        closedTotal: 140,
-        normalProduce: 10,
-        normalBuild: 10,
-        toRetireMine: 10,
-        selfStopProduce: 10,
-        selfStopBuild: 10,
-        orderStopRectify: 10,
-        orderStopBuild: 10,
-        stopProduceRectify: 10,
-        stopBuildRectify: 10,
-        longTermStopProduce: 10,
-        longTermStopBuild: 10,
-        longTermClose: 10,
-    },
-    {
-        id: '104',
-        region: '执法四处',
-        closedTotal: 140,
-        normalProduce: 10,
-        normalBuild: 10,
-        toRetireMine: 10,
-        selfStopProduce: 10,
-        selfStopBuild: 10,
-        orderStopRectify: 10,
-        orderStopBuild: 10,
-        stopProduceRectify: 10,
-        stopBuildRectify: 10,
-        longTermStopProduce: 10,
-        longTermStopBuild: 10,
-        longTermClose: 10,
-    },
-    {
-        id: '105',
-        region: '执法五处',
-        closedTotal: 140,
-        normalProduce: 10,
-        normalBuild: 10,
-        toRetireMine: 10,
-        selfStopProduce: 10,
-        selfStopBuild: 10,
-        orderStopRectify: 10,
-        orderStopBuild: 10,
-        stopProduceRectify: 10,
-        stopBuildRectify: 10,
-        longTermStopProduce: 10,
-        longTermStopBuild: 10,
-        longTermClose: 10,
-    },
-    {
-        id: '107',
-        region: '执法七处',
-        closedTotal: 140,
-        normalProduce: 10,
-        normalBuild: 10,
-        toRetireMine: 10,
-        selfStopProduce: 10,
-        selfStopBuild: 10,
-        orderStopRectify: 10,
-        orderStopBuild: 10,
-        stopProduceRectify: 10,
-        stopBuildRectify: 10,
-        longTermStopProduce: 10,
-        longTermStopBuild: 10,
-        longTermClose: 10,
-    },
-]
+}

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

@@ -13,17 +13,16 @@
 <script lang="ts">
 import { defineComponent } from 'vue';
 import { BasicTable, useTable } from '/@/components/Table';
-import { getClosedStatisticsColumns, tableMockData } from './closed.data';
+import { getClosedStatisticsColumns } from './closed.data';
 // 引入接口(后续替换为真实接口)
-// import { mineClosedStatisticsApi } from '/@/api/mine/basicInfo';
+import { getClosedAccessCount } from '../basicInfo.api';
 
 export default defineComponent({
   components: { BasicTable },
   setup() {
     // 注册表格
     const [registerTable] = useTable({
-    //   api: mineClosedStatisticsApi, // 密闭统计接口
-    dataSource: tableMockData,
+      api: getClosedAccessCount, // 密闭统计接口
       columns: getClosedStatisticsColumns(),
       pagination: false, // 无分页
       showIndexColumn: false, // 关闭默认序号列,使用自定义序号列

+ 11 - 16
src/views/dashboard/basicInfo/dataQuality/components/DataQualityModal.vue

@@ -16,18 +16,11 @@
       <div class="que-status">
         <div>矿井状态:</div>
         <div>
-          <span :class="getStatusClass(currentRecord?.mineLinkStatus || mockFormdData.mineLinkStatus)" class="status-dot">
-            {{ getStatusText(currentRecord?.mineLinkStatus || mockFormdData.mineLinkStatus) }}
+          <span :class="getStatusClass(currentRecord?.mineLinkStatus)" class="status-dot">
+            {{ getStatusText(currentRecord?.mineLinkStatus) }}
           </span>
         </div>
       </div>
-      <!-- 动态渲染topFormSchema字段(查看模式) -->
-      <!-- <div class="mine-info">
-        <div class="mine-field" v-for="schema in topFormSchema" :key="schema.field">
-          <span class="que-label">{{ schema.label }}:</span>
-          <span class="que-value">{{ currentRecord?.[schema.field] || mockFormdData[schema.field] }}</span>
-        </div>
-      </div> -->
       <div 
         class="que-item" 
         v-for="(item, index) in queList" 
@@ -119,7 +112,7 @@
 <script setup lang="ts">
 import { ref, computed, unref } from 'vue';
 import { BasicModal, useModalInner } from '/@/components/Modal';
-import { mockFormdData, formSchema, topFormSchema } from '../dataQuality.data';
+import { formSchema, topFormSchema } from '../dataQuality.data';
 import { Button as AButton, Select } from 'ant-design-vue';
 import { Input } from 'ant-design-vue';
 import { DatePicker } from 'ant-design-vue';
@@ -196,8 +189,9 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
   } else {
     // 编辑/查看模式:使用传入数据或默认数据
     const rawData = currentRecord.value?.queJson 
-      ? JSON.parse(JSON.stringify(currentRecord.value.queJson))
-      : JSON.parse(JSON.stringify(mockFormdData.queJson));
+      ? JSON.parse(currentRecord.value.queJson)
+      : [];
+    console.log(rawData);
     
     // 转换日期格式:字符串 -> dayjs对象(供DatePicker使用)
     queList.value = rawData.map((item: any) => ({
@@ -252,11 +246,12 @@ async function handleSubmit() {
     // 构造完整提交数据
     const result = {
       ...currentRecord.value,
-      queJson: submitData,
+      queJson: JSON.stringify(submitData),
       // 新增模式自动设置为未解决
-      isOk: mode.value === 'add' ? '未解决' : currentRecord.value.isOk,
-      // 新增时补充当前时间作为处理时间
-      handleTime: mode.value === 'add' ? dayjs().format('YYYY-MM-DD HH:mm:ss') : currentRecord.value.handleTime,
+      isOk: mode.value === 'add' ? false : currentRecord.value.isOk,
+      createTime: mode.value === 'add' ? dayjs().format('YYYY-MM-DD HH:mm:ss') : '',
+      // 当前时间作为更新时间
+      updateTime: mode.value === 'add' ? dayjs().format('YYYY-MM-DD HH:mm:ss') : currentRecord.value.handleTime,
     };
     emit('success', result);
     closeModal();

+ 25 - 67
src/views/dashboard/basicInfo/dataQuality/dataQuality.data.ts

@@ -2,6 +2,22 @@ import { BasicColumn, FormSchema } from '/@/components/Table';
 import { h } from 'vue';
 import { Tag } from 'ant-design-vue';
 
+// 新增:解析queJson并拼接orderNum+queCon的辅助函数
+const formatQueJson = (queJsonStr: string) => {
+  // 空值处理
+  if (!queJsonStr) return '无质量问题';
+  try {
+    const queList = JSON.parse(queJsonStr);
+    // 非数组格式处理
+    if (!Array.isArray(queList)) return '问题格式异常';
+    // 拼接orderNum + queCon,多个问题用分号分隔
+    return queList.map(item => `${item.orderNum || ''}:${item.queCon || ''}`).join('; ');
+  } catch (error) {
+    console.error('解析质量问题JSON失败:', error);
+    return '问题数据解析失败';
+  }
+};
+
 /** 表格列配置 */
 export const columns: BasicColumn[] = [
   {
@@ -39,12 +55,14 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '质量问题详情',
-    dataIndex: 'qualityIssue',
+    dataIndex: 'queJson',
     width: 400,
     ellipsis: true,
     customRender: ({ record, text }) => {
+      // 核心修改:使用辅助函数格式化显示文本
+      const displayText = formatQueJson(text);
       return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px' } }, [
-        h('span', { style: { flex: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, text),
+        h('span', { style: { flex: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, displayText),
         h(
           'button',
           {
@@ -59,7 +77,7 @@ export const columns: BasicColumn[] = [
           [
             h('div', {
             style: {
-              background: `url('/src/assets/images/basicInfo/dataQuality/icon-view.svg')`,
+              background: `url('/@/assets/images/basicInfo/dataQuality/icon-view.svg')`,
               width: '16px',
               height: '16px',
               backgroundSize: 'contain',
@@ -84,11 +102,12 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '处理时间',
-    dataIndex: 'handleTime',
+    dataIndex: 'updateTime',
     width: 180,
   },
 ];
 
+// 以下原有代码不变...
 /** 查询表单配置 */
 export const searchFormSchema: FormSchema[] = [
   {
@@ -112,8 +131,8 @@ export const mineOptions = [
 ];
 // 模拟煤矿在线状态选项数据
 export const mineLinkStatusOptions = [
-  { label: '在线', value: '01' },
-  { label: '离线', value: '02' },
+  { label: '在线', value: '1' },
+  { label: '离线', value: '0' },
 ];
 export const topFormSchema = [
   {
@@ -177,64 +196,3 @@ export const formSchema  = [
     required: true,
   },
 ];
-
-/** 模拟表单修改数据 */
-export const mockFormdData =
-  {
-    id: '13213132132132',
-    mineCode: '100001',
-    mineName: '神东集团布尔台煤矿',
-    mineNameAbbr: '布尔台矿',
-    mineProStatus: '0',
-    mineLinkStatus: '1',
-    isOk: false,
-    queJson: [
-      {
-        orderNum: '1',
-        goafName: '12241采煤工作面',
-        queCon: '无数据',
-        startTime: '2025-12-16 12:19:20',
-        endTime: '2025-12-16 15:19:20',
-        param: 'CO,CO2',
-      },
-      {
-        orderNum: '2',
-        goafName: '12241采煤工作面',
-        queCon: '数据长时间无变化',
-        startTime: '2025-12-16 12:19:20',
-        endTime: '2025-12-16 15:19:20',
-        param: 'CO,CO2',
-      },
-    ],
-  }
-
-/** 模拟已解决数据 */
-export const unresolvedData = [
-  {
-    id: '1',
-    mineName: '府谷县后安能源有限公司古城一号煤矿',
-    mineNameAbbr: '古城一号煤矿',
-    mineProStatus: '正常生产矿井',
-    mineLinkStatus: '在线',
-    qualityIssue: '<ZZZ工作面采空区密闭监测>存在问题:数据无变化;',
-    isOk: '未解决',
-    handleTime: '2025-11-17 18:04:09',
-    handleResult: '数据已修复',
-    remark: '重新启动数据采集设备后恢复正常',
-  },
-]
-/** 模拟已解决数据 */
-export const resolvedData = [
-  {
-    id: '3',
-    mineName: '府谷县后安能源有限公司古城一号煤矿',
-    mineNameAbbr: '古城一号煤矿',
-    mineProStatus: '正常生产矿井',
-    mineLinkStatus: '在线',
-    qualityIssue: '<ZZZ工作面采空区密闭监测>存在问题:数据无变化;',
-    isOk: '已解决',
-    handleTime: '2025-11-17 18:04:09',
-    handleResult: '数据已修复',
-    remark: '重新启动数据采集设备后恢复正常',
-  },
-];

+ 64 - 62
src/views/dashboard/basicInfo/dataQuality/index.vue

@@ -14,7 +14,7 @@
             <button @click="handleOpenModal(record, 'edit')" class="action-btn">
               <SvgIcon name="edit" />
             </button>
-            <button @click="handleGoToPage(record, '/basicInfo/accessStatistics')" class="action-btn">
+            <button @click="handleDeleteRecord(record)" class="action-btn">
               <SvgIcon name="delete" />
             </button>
             <button @click="handleGoToPage(record, '/basicInfo/accessStatistics')" class="action-btn">
@@ -43,40 +43,40 @@
 </template>
 
 <script setup lang="ts">
-  import { ref, reactive } from 'vue';
+  import { ref, reactive, watch } from 'vue';
   import { useRouter } from 'vue-router';
-  import { BasicTable, useTable, TableAction } from '/@/components/Table';
+  import { BasicTable, useTable } from '/@/components/Table';
   import { BasicForm, useForm } from '/@/components/Form/index';
   import { useModal } from '/@/components/Modal';
   import { Tabs, TabPane } from 'ant-design-vue';
   import DataQualityModal from './components/DataQualityModal.vue';
   import { SvgIcon } from '/@/components/Icon';
-  import { columns, searchFormSchema, unresolvedData, resolvedData } from './dataQuality.data';
-
+  import { columns, searchFormSchema } from './dataQuality.data';;
+  import {getDataQuaQueList, addDataQuaQue, deleteDataQuaQue, editDataQuaQue } from '../basicInfo.api';
   // 路由实例
   const router = useRouter();
   // 响应式数据
   const activeKey = ref('unresolved'); // 激活的Tab键
   const searchModel = reactive({}); // 搜索表单模型
-
-  // 原始数据源(深拷贝避免修改原数据)
-  const originUnresolved = JSON.parse(JSON.stringify(unresolvedData));
-  const originResolved = JSON.parse(JSON.stringify(resolvedData));
-
-  // 为每条记录添加查看详情事件
-  originUnresolved.forEach((item) => {
-    item.onViewDetail = (record: any) => {
-      handleOpenModal(record, 'view');
-    };
-  });
-  originResolved.forEach((item) => {
-    item.onViewDetail = (record: any) => {
-      handleOpenModal(record, 'view');
-    };
-  });
+  const pageMode = ref('add');
+
+  // // 原始数据源(深拷贝避免修改原数据)
+  // const originUnresolved = JSON.parse(JSON.stringify(unresolvedData));
+  // const originResolved = JSON.parse(JSON.stringify(resolvedData));
+
+  // // 为每条记录添加查看详情事件
+  // originUnresolved.forEach((item) => {
+  //   item.onViewDetail = (record: any) => {
+  //     handleOpenModal(record, 'view');
+  //   };
+  // });
+  // originResolved.forEach((item) => {
+  //   item.onViewDetail = (record: any) => {
+  //     handleOpenModal(record, 'view');
+  //   };
+  // });
   // 筛选后的数据源
-  const filteredUnresolved = ref([...originUnresolved]);
-  const filteredResolved = ref([...originResolved]);
+  // const filteredResolved = ref([...originResolved]);
 
   // 搜索表单注册
   const [registerSearchForm] = useForm({
@@ -87,7 +87,8 @@
 
   // 未解决表格注册
   const [registerUnresolvedTable, { reload: reloadUnresolved }] = useTable({
-    dataSource: filteredUnresolved.value,
+    api: getQuaQueListByTab(),
+    // dataSource: filteredUnresolved.value,
     columns,
     pagination: false,
     striped: true,
@@ -106,7 +107,7 @@
 
   // 已解决表格注册
   const [registerResolvedTable, { reload: reloadResolved }] = useTable({
-    dataSource: filteredResolved.value,
+    api: getQuaQueListByTab(),
     columns,
     pagination: false,
     striped: true,
@@ -127,61 +128,53 @@
   // 弹框注册
   const [registerModal, { openModal }] = useModal();
 
-  // 搜索筛选处理函数
+   /**
+   * 根据标签获取表格数据(已解决/未解决)
+   * @param result 弹框数据
+   */
+  function getQuaQueListByTab() {
+    return async (params: any) => {
+      const isOk = activeKey.value === 'resolved' ? true : false;
+      return await getDataQuaQueList({ ...params, isOk: isOk });
+    };
+  };
+   /**
+   * 表单搜索函数
+   * @param values 表单数据
+   */
   function handleSearch(values: any) {
-    // 筛选未解决数据
-    // filteredUnresolved.value = originUnresolved.filter((item) => {
-    //   return (
-    //     (values.mineName ? item.mineName.includes(values.mineName) : true) &&
-    //     (values.mineNameAbbr ? item.mineNameAbbr.includes(values.mineNameAbbr) : true)
-    //   );
-    // });
-
-    // // 筛选已解决数据
-    // filteredResolved.value = originResolved.filter((item) => {
-    //   return (
-    //     (values.mineName ? item.mineName.includes(values.mineName) : true) &&
-    //     (values.mineNameAbbr ? item.mineNameAbbr.includes(values.mineNameAbbr) : true)
-    //   );
-    // });
 
     // 刷新表格
     reloadUnresolved();
     reloadResolved();
   }
 
-  // 打开弹框(处理/查看)函数
+   /**
+   * 打开弹框函数
+   * @param result 弹框数据
+   */
   function handleOpenModal(record: any, mode: 'view' | 'edit' | 'add' = 'view') {
+    pageMode.value = mode;
     openModal(true, {
       record,
       mode,
     });
   }
 
-  // 弹框提交成功处理函数
+  /**
+   * 弹框结果处理函数
+   * @param result 弹框数据
+   */
   function handleModalSuccess(result: any) {
-    // 从原未解决数据中移除该记录
-    // const unresolvedIndex = originUnresolved.findIndex((item) => item.id === result.id);
-    // if (unresolvedIndex > -1) {
-    //   originUnresolved.splice(unresolvedIndex, 1);
-    // }
-
-    // // 从筛选后的未解决数据中移除
-    // const filteredUnresolvedIndex = filteredUnresolved.value.findIndex((item) => item.id === result.id);
-    // if (filteredUnresolvedIndex > -1) {
-    //   filteredUnresolved.value.splice(filteredUnresolvedIndex, 1);
-    // }
-
-    // // 添加到已解决数据中
-    // originResolved.push(result);
-    // filteredResolved.value.push(result);
-
+    if(pageMode.value === 'add') {
+      console.log(result);
+      addDataQuaQue(result);
+    }else if(pageMode.value === 'edit') {
+      editDataQuaQue(result);
+    }
     // 刷新表格
     reloadUnresolved();
     reloadResolved();
-
-    // 切换到已解决Tab
-    activeKey.value = 'resolved';
   }
   /**
    * 通用页面跳转方法
@@ -198,6 +191,15 @@
       // }
     });
   }
+
+  /**
+   * 删除记录方法
+   * @param record 当前行数据
+   */
+  function handleDeleteRecord(record: any) {
+    deleteDataQuaQue({id: record.id});
+    reloadUnresolved();
+  }
 </script>
 
 <style scoped lang="less">

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

@@ -20,13 +20,15 @@
   import { BasicTable, useTable } from '/@/components/Table';
   import { columns, searchFormSchema, minesData } from './minesInfo.data';
   import { SvgIcon } from '/@/components/Icon';
+  import { getMineData } from '../basicInfo.api'
 
   // 路由实例
   const router = useRouter();
   // 注册表格并获取相关方法
   const [registerTable] = useTable({
     title: '矿山信息表格',
-    dataSource: minesData,
+    api: getMineData, // 密闭统计接口
+    // dataSource: minesData,
     columns,
     formConfig: {
       labelWidth: 120,

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

@@ -6,11 +6,11 @@ import { Tag } from 'ant-design-vue';
 export const columns: BasicColumn[] = [
   {
     title: '煤矿编号',
-    dataIndex: 'orderNo',
+    dataIndex: 'mineCode',
   },
   {
     title: '所属执法处',
-    dataIndex: 'enforcement',
+    dataIndex: 'managementName',
   },
   {
     title: '煤矿名称',
@@ -22,9 +22,9 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '生产状态',
-    dataIndex: 'productStatus',
+    dataIndex: 'productionStatus',
     customRender: ({ record }) => {
-      const status = record.productStatus;
+      const status = record.productionStatus;
       const enable = ~~status === 0;
       const color = enable ? 'green' : 'red';
       const text = enable ? '启用' : '停用';
@@ -37,11 +37,11 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '接入状态',
-    dataIndex: 'connectStatus',
+    dataIndex: 'accessStatus',
   },
   {
     title: '在线状态',
-    dataIndex: 'onlineStatus',
+    dataIndex: 'status',
   },
   {
     title: '应接数量',
@@ -49,11 +49,11 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '已接数量',
-    dataIndex: 'yijieNum',
+    dataIndex: 'accessGoafNum',
   },
   {
     title: '未接数量',
-    dataIndex: 'weijieNum',
+    dataIndex: 'notAccessGoafNum',
   },
 ];
 
@@ -73,7 +73,7 @@ export const searchFormSchema: FormSchema[] = [
     groupName: '常规查询',
   },
   {
-    field: 'productStatus',
+    field: 'productionStatus',
     label: '生产状态',
     component: 'Select',
     componentProps: {
@@ -101,7 +101,7 @@ export const searchFormSchema: FormSchema[] = [
   },
 
   {
-    field: 'onlineStatus',
+    field: 'status',
     label: '在线状态',
     component: 'Select',
     componentProps: {
@@ -144,29 +144,29 @@ export const searchFormSchema: FormSchema[] = [
 
 export const minesData = [
   {
-    orderNo: '61082400879',
-    enforcement: '执法二处',
+    mineCode: '61082400879',
+    managementName: '执法二处',
     mineName: '府谷县能源有限公司古城一号煤矿',
     mineNameAbbr: '府谷县一号煤矿',
-    productStatus: '0',
+    productionStatus: '0',
     riskLevel: '0',
-    connectStatus: '0',
-    onlineStatus: '0',
+    accessStatus: '0',
+    status: '0',
     yingjieNum: '0',
-    yijieNum: '0',
-    weijieNum: '0',
+    accessGoafNum: '0',
+    notAccessGoafNum: '0',
   },
   {
-    orderNo: '61082400878',
-    enforcement: '执法二处',
+    mineCode: '61082400878',
+    managementName: '执法二处',
     mineName: '府谷县能源有限公司古城二号煤矿',
     mineNameAbbr: '府谷县二号煤矿',
-    productStatus: '0',
+    productionStatus: '0',
     riskLevel: '0',
-    connectStatus: '0',
-    onlineStatus: '0',
+    accessStatus: '0',
+    status: '0',
     yingjieNum: '0',
-    yijieNum: '0',
-    weijieNum: '0',
+    accessGoafNum: '0',
+    notAccessGoafNum: '0',
   },
 ];