Просмотр исходного кода

[Mod 0000] 修改错报漏报历史数据表单

houzekong 2 месяцев назад
Родитель
Сommit
b17c3b2e5a
1 измененных файлов с 31 добавлено и 16 удалено
  1. 31 16
      src/views/analysis/warningAnalysis/reportAnalysis/index.vue

+ 31 - 16
src/views/analysis/warningAnalysis/reportAnalysis/index.vue

@@ -33,9 +33,6 @@
           <template #resetBefore>
           <template #resetBefore>
             <a-button type="default" class="ml-8px" preIcon="mdi:download" @click="onExportXls"> 导出 </a-button>
             <a-button type="default" class="ml-8px" preIcon="mdi:download" @click="onExportXls"> 导出 </a-button>
           </template>
           </template>
-          <template #form-goaf-select>
-            <a-select v-model:value="goafId" :options="goafOptions" placeholder="请选择" />
-          </template>
         </BasicTable>
         </BasicTable>
       </TabPane>
       </TabPane>
     </Tabs>
     </Tabs>
@@ -49,16 +46,17 @@
 <script setup lang="ts">
 <script setup lang="ts">
   import { ref } from 'vue';
   import { ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
   import { BasicTable } from '/@/components/Table';
-  import { Tabs, TabPane, message } from 'ant-design-vue';
+  import { Tabs, TabPane } from 'ant-design-vue';
   import { SvgIcon } from '/@/components/Icon';
   import { SvgIcon } from '/@/components/Icon';
   // 引入模拟数据
   // 引入模拟数据
   import { columns } from './reportAnalysis.data';
   import { columns } from './reportAnalysis.data';
   import { getProvinceAlarm, getProvinceAlarmHistory } from './report.api';
   import { getProvinceAlarm, getProvinceAlarmHistory } from './report.api';
   import { useInitForm } from '../../common/analysis';
   import { useInitForm } from '../../common/analysis';
   import { BasicModal } from '/@/components/Modal/index';
   import { BasicModal } from '/@/components/Modal/index';
-  import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
+  // import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
   // import { useIntervalFn } from '@vueuse/core';
   // import { useIntervalFn } from '@vueuse/core';
   import { useListPage } from '/@/hooks/system/useListPage';
   import { useListPage } from '/@/hooks/system/useListPage';
+  import dayjs from 'dayjs';
 
 
   // 激活的Tab页签
   // 激活的Tab页签
   const activeTab = ref('realtime');
   const activeTab = ref('realtime');
@@ -104,20 +102,13 @@
     },
     },
   });
   });
   const [registerRealtimeTable] = ctxRealtime;
   const [registerRealtimeTable] = ctxRealtime;
-  const { goafOptions, goafId, hiscode, resolveValue, registerModal, openModal, initGoafOptions, handleResolve } = useInitForm();
+  const { hiscode, resolveValue, registerModal, openModal, initGoafOptions, handleResolve } = useInitForm();
   // 注册历史数据表格
   // 注册历史数据表格
   const { tableContext, onExportXls } = useListPage({
   const { tableContext, onExportXls } = useListPage({
     tableProps: {
     tableProps: {
       columns,
       columns,
       // columns: historyColumns,
       // columns: historyColumns,
-      api: (params) => {
-        if (!goafId.value) {
-          message.info('请先选择煤矿及老空区');
-          return Promise.reject();
-        }
-        params.goafId = goafId.value;
-        return getProvinceAlarmHistory(params);
-      },
+      api: getProvinceAlarmHistory,
       formConfig: {
       formConfig: {
         model: { customField: hiscode },
         model: { customField: hiscode },
         labelWidth: 120,
         labelWidth: 120,
@@ -140,7 +131,32 @@
             colProps: { span: 6 },
             colProps: { span: 6 },
             rules: [],
             rules: [],
           },
           },
-          ...historicalFormSchema,
+          {
+            field: 'startTime',
+            label: '起始日期',
+            component: 'DatePicker',
+            componentProps: {
+              //日期格式化,页面上显示的值
+              format: 'YYYY-MM-DD',
+              //返回值格式化(绑定值的格式)
+              valueFormat: 'YYYY-MM-DD 00:00:00',
+            },
+            defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD'),
+            colProps: { span: 6 },
+          },
+          {
+            field: 'endTime',
+            label: '结束日期',
+            component: 'DatePicker',
+            componentProps: {
+              //日期格式化,页面上显示的值
+              format: 'YYYY-MM-DD',
+              //返回值格式化(绑定值的格式)
+              valueFormat: 'YYYY-MM-DD 23:59:59',
+            },
+            defaultValue: dayjs().format('YYYY-MM-DD'),
+            colProps: { span: 6 },
+          },
         ],
         ],
         showAdvancedButton: false,
         showAdvancedButton: false,
         schemaGroupNames: ['常规查询'],
         schemaGroupNames: ['常规查询'],
@@ -157,7 +173,6 @@
       name: '历史数据',
       name: '历史数据',
       params: {
       params: {
         alarmType: 'lateReport',
         alarmType: 'lateReport',
-        goafId,
       },
       },
     },
     },
   });
   });