Explorar o código

[Mod 0000] 预警研判页面导出功能整改

houzekong hai 1 mes
pai
achega
cea4067c0a

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

@@ -95,7 +95,7 @@
     },
     exportConfig: {
       url: '/ventanaly-province/province/alarm/exportProvinceAlarmReal',
-      name: '自燃发火隐患分级',
+      name: '数据中断分析',
       params: {
         alarmType: 'lateReport',
       },

+ 42 - 29
src/views/analysis/warningAnalysis/sealRiskJudgeAnalysis/index.vue

@@ -15,7 +15,7 @@
         />
       </div>
       <!-- 实时数据表格 -->
-      <BasicTable @register="registerTable" :scroll="{ x: 'max-content' }" :style="{ padding: 0 }">
+      <BasicTable @register="registerRealtimeTable" :scroll="{ x: 'max-content' }" :style="{ padding: 0 }">
         <!-- 核心:判断record是否有有效数据,无则显示- -->
         <template #action="{ record }">
           <div class="action-buttons">
@@ -27,6 +27,9 @@
             </button>
           </div>
         </template>
+        <template #resetBefore>
+          <a-button type="default" class="ml-8px" preIcon="mdi:download" @click="onExportXlsTime"> 导出 </a-button>
+        </template>
         <template #empty>
           <!-- 无数据时显示-,样式居中对齐 -->
           <span class="empty-placeholder">-</span>
@@ -59,7 +62,7 @@
 
 <script setup lang="ts">
   import { ref } from 'vue';
-  import { BasicTable, useTable } from '/@/components/Table';
+  import { BasicTable } from '/@/components/Table';
   import { Tabs, TabPane } from 'ant-design-vue';
   import MiniBoard from '/@/components/Configurable/detail/MiniBoard.vue';
   import { SvgIcon } from '/@/components/Icon';
@@ -108,36 +111,46 @@
   };
 
   // 注册实时数据表格
-  const [registerTable] = useTable({
-    columns,
-    api: wrappedGetMineData,
-    formConfig: {
-      labelWidth: 120,
-      schemas: [
-        {
-          label: '煤矿名称',
-          field: 'deptId',
-          component: 'MineCascader', // 自定义组件名
-          colProps: { span: 6 },
-          rules: [],
-        },
-      ],
-      showAdvancedButton: false,
-      schemaGroupNames: ['常规查询'],
+  const { tableContext: ctxRealtime, onExportXls: onExportXlsTime } = useListPage({
+    tableProps: {
+      columns,
+      api: wrappedGetMineData,
+      formConfig: {
+        labelWidth: 120,
+        schemas: [
+          {
+            label: '煤矿名称',
+            field: 'deptId',
+            component: 'MineCascader', // 自定义组件名
+            colProps: { span: 6 },
+            rules: [],
+          },
+        ],
+        showAdvancedButton: false,
+        schemaGroupNames: ['常规查询'],
+      },
+      pagination: true,
+      striped: true,
+      useSearchForm: true,
+      bordered: true,
+      showIndexColumn: false,
+      actionColumn: {
+        width: 80,
+        title: '详情',
+        dataIndex: 'action',
+        slots: { customRender: 'action' },
+        fixed: undefined,
+      },
     },
-    pagination: true,
-    striped: true,
-    useSearchForm: true,
-    bordered: true,
-    showIndexColumn: false,
-    actionColumn: {
-      width: 80,
-      title: '详情',
-      dataIndex: 'action',
-      slots: { customRender: 'action' },
-      fixed: undefined,
+    exportConfig: {
+      url: '/ventanaly-province/province/alarm/exportProvinceAlarmReal',
+      name: '密闭爆炸危险性判定',
+      params: {
+        alarmType: 'explosionAlarm',
+      },
     },
   });
+  const [registerRealtimeTable] = ctxRealtime;
 
   // 注册历史数据表格
   const { tableContext, onExportXls } = useListPage({