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

[Feat 0000] 数据质量页面增加历史数据查询功能

houzekong 1 день назад
Родитель
Сommit
a85c7e0bcd

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

@@ -8,6 +8,7 @@ enum Api {
   // 数据质量
   // 数据质量
   getDataQuaQueList = '/ventanaly-province/province/dataQuaQue/list',
   getDataQuaQueList = '/ventanaly-province/province/dataQuaQue/list',
   getMineDataQuality = '/ventanaly-province/province/mineData/getMineDataQuality',
   getMineDataQuality = '/ventanaly-province/province/mineData/getMineDataQuality',
+  getMineDataQualityHistory = '/modelreq/ventanaly-province/province/mineData/getMineDataQualityHistory',
   addDataQuaQue = '/ventanaly-province/province/dataQuaQue/add',
   addDataQuaQue = '/ventanaly-province/province/dataQuaQue/add',
   deleteDataQuaQue = '/ventanaly-province/province/dataQuaQue/delete',
   deleteDataQuaQue = '/ventanaly-province/province/dataQuaQue/delete',
   editDataQuaQue = '/ventanaly-province/province/dataQuaQue/edit',
   editDataQuaQue = '/ventanaly-province/province/dataQuaQue/edit',
@@ -54,6 +55,18 @@ export const getDataQuaQueList = (params) =>
     }
     }
   );
   );
 
 
+export const getMineDataQualityHistory = (params) =>
+  defHttp.post(
+    {
+      // headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+      url: Api.getMineDataQualityHistory,
+      params,
+    },
+    {
+      joinParamsToUrl: true,
+    }
+  );
+
 /**
 /**
  * 新增质量问题
  * 新增质量问题
  * @param params
  * @param params

+ 63 - 0
src/views/dashboard/basicInfo/dataQuality/dataQuality.data.ts

@@ -1,3 +1,4 @@
+import dayjs from 'dayjs';
 import { BasicColumn, FormSchema } from '/@/components/Table';
 import { BasicColumn, FormSchema } from '/@/components/Table';
 // import { h } from 'vue';
 // import { h } from 'vue';
 // import { Ref } from 'vue';
 // import { Ref } from 'vue';
@@ -115,6 +116,30 @@ export const columns: BasicColumn[] = [
   // },
   // },
 ];
 ];
 
 
+// 3. 生成表格列(支持传入动态映射)
+export const historyColumns: BasicColumn[] = [
+  {
+    title: '煤矿名称',
+    dataIndex: 'mineName',
+    width: 250,
+  },
+  {
+    title: '错误信息',
+    dataIndex: 'errorContent',
+    width: 200,
+  },
+  {
+    title: '起始时间',
+    dataIndex: 'startTime',
+    width: 200,
+  },
+  {
+    title: '结束时间',
+    dataIndex: 'endTime',
+    width: 200,
+  },
+];
+
 // 4. 查询表单配置(下拉框改为动态options)
 // 4. 查询表单配置(下拉框改为动态options)
 export const searchFormSchema: FormSchema[] = [
 export const searchFormSchema: FormSchema[] = [
   {
   {
@@ -151,6 +176,44 @@ export const searchFormSchema: FormSchema[] = [
   },
   },
 ];
 ];
 
 
+// 4. 查询表单配置(下拉框改为动态options)
+export const historySearchFormSchema: FormSchema[] = [
+  {
+    field: 'deptId',
+    label: '煤矿名称',
+    component: 'MineCascader',
+    colProps: { span: 6 },
+    groupName: '常规查询',
+  },
+  {
+    field: 'startTime',
+    label: '起始日期',
+    component: 'DatePicker',
+    componentProps: {
+      showTime: true,
+      //日期格式化,页面上显示的值
+      format: 'YYYY-MM-DD HH:mm:ss',
+      //返回值格式化(绑定值的格式)
+      valueFormat: 'YYYY-MM-DD HH:mm:ss',
+    },
+    defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD 00:00:00'),
+    colProps: { span: 6 },
+  },
+  {
+    field: 'endTime',
+    label: '结束日期',
+    component: 'DatePicker',
+    componentProps: {
+      //日期格式化,页面上显示的值
+      format: 'YYYY-MM-DD HH:mm:ss',
+      //返回值格式化(绑定值的格式)
+      valueFormat: 'YYYY-MM-DD HH:mm:ss',
+    },
+    defaultValue: dayjs().format('YYYY-MM-DD 23:59:59'),
+    colProps: { span: 6 },
+  },
+];
+
 export const topFormSchema: FormSchema[] = [
 export const topFormSchema: FormSchema[] = [
   {
   {
     field: 'deptId',
     field: 'deptId',

+ 28 - 20
src/views/dashboard/basicInfo/dataQuality/index.vue

@@ -2,10 +2,10 @@
 <template>
 <template>
   <!-- Tab标签页 -->
   <!-- Tab标签页 -->
   <Tabs v-model:activeKey="activeKey" class="common-page-tabs" type="line" @change="handleTabChange">
   <Tabs v-model:activeKey="activeKey" class="common-page-tabs" type="line" @change="handleTabChange">
-    <TabPane key="unresolved" tab="未解决">
+    <TabPane key="unresolved" tab="实时分析">
       <BasicTable style="padding: 0" @register="registerUnresolvedTable">
       <BasicTable style="padding: 0" @register="registerUnresolvedTable">
         <template #resetBefore>
         <template #resetBefore>
-          <a-button type="primary" class="ml-8px" preIcon="mdi:page-next-outline" @click="handleOpenModal({}, 'add')"> 新增问题 </a-button>
+          <!-- <a-button type="primary" class="ml-8px" preIcon="mdi:page-next-outline" @click="handleOpenModal({}, 'add')"> 新增问题 </a-button> -->
           <a-button type="default" class="ml-8px" preIcon="mdi:download" @click="handleOpenExportModal('unresolved')"> 导出 </a-button>
           <a-button type="default" class="ml-8px" preIcon="mdi:download" @click="handleOpenExportModal('unresolved')"> 导出 </a-button>
         </template>
         </template>
         <template #queJson="{ record }">
         <template #queJson="{ record }">
@@ -18,11 +18,10 @@
             </button>
             </button>
           </div>
           </div>
         </template>
         </template>
-        <template #action="{ record }">
+        <!-- <template #action="{ record }">
           <button @click="handleOpenModal(record, 'edit')" class="action-btn" title="编辑该问题">
           <button @click="handleOpenModal(record, 'edit')" class="action-btn" title="编辑该问题">
             <SvgIcon name="edit" />
             <SvgIcon name="edit" />
           </button>
           </button>
-          <!-- 删除按钮 -->
           <Popconfirm
           <Popconfirm
             title="删除确认"
             title="删除确认"
             description="是否确认删除?"
             description="是否确认删除?"
@@ -52,10 +51,10 @@
           <button @click="handleGoToPage(record)" class="action-btn" title="监测详情">
           <button @click="handleGoToPage(record)" class="action-btn" title="监测详情">
             <SvgIcon name="database" />
             <SvgIcon name="database" />
           </button>
           </button>
-        </template>
+        </template> -->
       </BasicTable>
       </BasicTable>
     </TabPane>
     </TabPane>
-    <TabPane key="resolved" tab="已解决">
+    <TabPane key="resolved" tab="历史数据">
       <BasicTable style="padding: 0" @register="registerResolvedTable">
       <BasicTable style="padding: 0" @register="registerResolvedTable">
         <template #resetBefore>
         <template #resetBefore>
           <a-button type="default" class="ml-8px" preIcon="mdi:download" @click="handleOpenExportModal('resolved')"> 导出 </a-button>
           <a-button type="default" class="ml-8px" preIcon="mdi:download" @click="handleOpenExportModal('resolved')"> 导出 </a-button>
@@ -121,12 +120,12 @@
   import { ref, nextTick, computed, onMounted, reactive } from 'vue';
   import { ref, nextTick, computed, onMounted, reactive } from 'vue';
   import { BasicTable } from '/@/components/Table';
   import { BasicTable } from '/@/components/Table';
   import { useModal } from '/@/components/Modal';
   import { useModal } from '/@/components/Modal';
-  import { Tabs, TabPane, Popconfirm, message, Modal, DatePicker } from 'ant-design-vue';
+  import { Tabs, TabPane, message, Modal, DatePicker } from 'ant-design-vue';
   import type { FormInstance } from 'ant-design-vue/es/form';
   import type { FormInstance } from 'ant-design-vue/es/form';
   import DataQualityModal from './components/DataQualityModal.vue';
   import DataQualityModal from './components/DataQualityModal.vue';
   import { SvgIcon } from '/@/components/Icon';
   import { SvgIcon } from '/@/components/Icon';
-  import { columns, searchFormSchema, exportFormSchema } from './dataQuality.data';
-  import { getDataQuaQueList, addDataQuaQue, deleteDataQuaQue, editDataQuaQue } from '../basicInfo.api';
+  import { columns, searchFormSchema, exportFormSchema, historyColumns, historySearchFormSchema } from './dataQuality.data';
+  import { getDataQuaQueList, addDataQuaQue, deleteDataQuaQue, editDataQuaQue, getMineDataQualityHistory } from '../basicInfo.api';
   import { findNode } from '/@/utils/helper/treeHelper';
   import { findNode } from '/@/utils/helper/treeHelper';
   import { useMineDepartmentStore } from '/@/store/modules/mine';
   import { useMineDepartmentStore } from '/@/store/modules/mine';
   // import { getDictItemsByCode } from '/@/utils/dict';
   // import { getDictItemsByCode } from '/@/utils/dict';
@@ -198,15 +197,20 @@
       indexColumnProps: {
       indexColumnProps: {
         title: '序号',
         title: '序号',
       },
       },
-      actionColumn: {
-        width: 200,
-        title: '操作',
-        dataIndex: 'action',
-        slots: { customRender: 'action' },
-      },
+      showActionColumn: false,
+      // actionColumn: {
+      //   width: 200,
+      //   title: '操作',
+      //   dataIndex: 'action',
+      //   slots: { customRender: 'action' },
+      // },
       immediate: false, // 先不立即加载,等状态数据获取后再加载
       immediate: false, // 先不立即加载,等状态数据获取后再加载
     },
     },
-    exportConfig: exportConfig.value,
+    exportConfig: {
+      url: '/province/mineData/exportMineDataQuality',
+      name: '数据质量问题反馈',
+      params: {},
+    },
   });
   });
 
 
   const [registerUnresolvedTable, { reload: reloadUnresolved }] = tableContextA;
   const [registerUnresolvedTable, { reload: reloadUnresolved }] = tableContextA;
@@ -215,13 +219,13 @@
   const { tableContext: tableContextB, onExportXls: onExportXlsB } = useListPage({
   const { tableContext: tableContextB, onExportXls: onExportXlsB } = useListPage({
     tableProps: {
     tableProps: {
       api: async (params: any) => {
       api: async (params: any) => {
-        return await getDataQuaQueList({ ...params, isOk: true });
+        return await getMineDataQualityHistory({ ...params, isOk: true });
       },
       },
-      columns: columns,
+      columns: historyColumns,
       formConfig: {
       formConfig: {
         autoSearch: true,
         autoSearch: true,
         labelWidth: 120,
         labelWidth: 120,
-        schemas: searchFormSchema,
+        schemas: historySearchFormSchema,
         showAdvancedButton: false,
         showAdvancedButton: false,
         schemaGroupNames: ['常规查询'],
         schemaGroupNames: ['常规查询'],
       },
       },
@@ -241,7 +245,11 @@
       // },
       // },
       immediate: false, // 先不立即加载
       immediate: false, // 先不立即加载
     },
     },
-    exportConfig: exportConfig.value,
+    exportConfig: {
+      url: '/province/mineData/exportMineDataQualityHistory',
+      name: '数据质量历史数据',
+      params: {},
+    },
   });
   });
 
 
   const [registerResolvedTable, { reload: reloadResolved }] = tableContextB;
   const [registerResolvedTable, { reload: reloadResolved }] = tableContextB;