Procházet zdrojové kódy

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

hongrunxia před 2 měsíci
rodič
revize
2a738ab35a

+ 2 - 1
src/views/vent/gas/gasAnalysis/gasAnalysis.api.ts

@@ -3,6 +3,7 @@ import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
     gasReportLogList = '/safety/gasDayReport/gasReportLogList',//瓦斯巡检统计分析查询列表
+    exportGasInsFx='/safety/gasDayReport/exportGasInsFx'
     
 
 }
@@ -11,7 +12,7 @@ enum Api {
  * 下载文件目录
  * @param params
  */
-export const zipdownload = (params) => defHttp.post({ url: Api.zipdownload, params, responseType: 'blob' },{ joinParamsToUrl: true });
+export const exportGasInsFx = (params) => defHttp.get({ url: Api.exportGasInsFx, params, responseType: 'blob' },{ joinParamsToUrl: true });
 /**
  * 瓦斯巡检统计分析查询列表
  * @param params

+ 7 - 0
src/views/vent/gas/gasAnalysis/gasAnalysis.data.ts

@@ -67,6 +67,13 @@ export const columns: BasicColumn[] = [
         key: 'totalLossDay',
         align: 'center',
     },
+    {
+        title: '操作',
+        dataIndex: 'action',
+        width: 120,
+        align: 'center',
+        slots: { customRender: 'action' },
+    },
 ];
 //分页参数
 export const pagination = {

+ 36 - 2
src/views/vent/gas/gasAnalysis/index.vue

@@ -14,7 +14,7 @@
                     <a-col :span="20">
                         <a-button type="primary" preIcon="ant-design:search-outlined" @click="getSearch">查询</a-button>
                         <a-button preIcon="ant-design:sync-outlined" style="margin: 0px 15px" @click="getReset">重置</a-button>
-                        <a-button type="primary" preIcon="ant-design:download-outlined">导出</a-button>
+                        <!-- <a-button type="primary" preIcon="ant-design:download-outlined" @click="downLoadFx">导出</a-button> -->
                     </a-col>
                 </a-row>
             </div>
@@ -90,6 +90,10 @@
                             <div :style="contentStyle">{{ text[2] }}</div>
                         </template>
                     </template>
+                    <template #action="{ record }">
+                    <a class="table-action-link" @click="downLoadFx(record)">导出</a>
+                   
+                </template>
                 </a-table>
             </div>
             <div class="echart-area">
@@ -114,7 +118,8 @@ import customHeader from '/@/components/vent/customHeader.vue';
 import echartBox from './components/echartBox.vue'
 import dayjs from 'dayjs';
 import { columns, pagination, } from './gasAnalysis.data'
-import { gasReportLogList } from './gasAnalysis.api'
+import { gasReportLogList,exportGasInsFx } from './gasAnalysis.api'
+import { message } from 'ant-design-vue';
 
 
 let searchTime = ref(dayjs().format('YYYY-MM-DD'))//dayjs().format('YYYY-MM-DD HH:mm:ss')
@@ -204,6 +209,35 @@ let getReset = () => {
     searchTime.value = dayjs().format('YYYY-MM-DD')
     gasReportLogLists()
 }
+//导出
+async function downLoadFx(record){
+    let res=await exportGasInsFx({id:record.id})
+    if (res) {
+            let filename = `${new Date().getTime()}.xlsx`;
+            downFilePublic(res, filename);
+            message.success('导出成功')
+        }
+} 
+// 下载公用方法
+function downFilePublic(content, fileName) {
+    const blob = new Blob([content], { type: 'application/xlsx;charset=UTF-8' }); // 构造一个blob对象来处理数据
+    // 对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性
+    // IE10以上支持blob但是依然不支持download
+    if ('download' in document.createElement('a')) {
+        // 支持a标签download的浏览器
+        const link = document.createElement('a'); // 创建a标签
+        link.download = fileName; // a标签添加属性
+        link.style.display = 'none';
+        link.href = URL.createObjectURL(blob);
+        document.body.appendChild(link);
+        link.click(); // 执行下载
+        URL.revokeObjectURL(link.href); // 释放url
+        document.body.removeChild(link); // 释放标签
+    } else {
+        // 其他浏览器
+        navigator.msSaveBlob(blob, fileName);
+    }
+}
 onMounted(() => {
     gasReportLogLists()
 })

+ 1 - 0
src/views/vent/monitorManager/comment/comment.api.ts

@@ -6,6 +6,7 @@ enum Api {
   input = '/safety/ventanalyDeviceInfo/input',
   sysList = '/safety/ventanalyManageSystem/list',
   sysInput = '/safety/ventanalyManageSystem/input',
+ 
 }
 
 /**

+ 14 - 3
src/views/vent/monitorManager/comment/gaspatrolTable.vue

@@ -31,8 +31,8 @@
           </div>
         </a-col>
         <a-col :span="4">
-          <a-button type="primary" preIcon="ant-design:search-outlined" style="margin-left: 10px">查询</a-button>
-          <a-button preIcon="ant-design:sync-outlined" style="margin: 0px 15px">重置</a-button>
+          <a-button type="primary" preIcon="ant-design:search-outlined" style="margin-left: 10px" @click="getSearch">查询</a-button>
+          <a-button preIcon="ant-design:sync-outlined" style="margin: 0px 15px" @click="getReset">重置</a-button>
         </a-col>
       </a-row>
     </div>
@@ -87,7 +87,7 @@
   ]);
   let Columns = ref<any[]>(gaspatrolColumnsOne);
   let gaspatrolTableData = ref<any[]>([]);
-  let $emit = defineEmits(['addressInput', 'userInput', 'insTypeChange', 'classChange']);
+  let $emit = defineEmits(['addressInput', 'userInput', 'insTypeChange', 'classChange','getSearch']);
   //巡检类型选项切换
   let insTypeChange = (val) => {
     searchData.insType = val;
@@ -113,6 +113,17 @@
     searchData.userName = val.target.value;
     $emit('userInput', searchData.userName);
   };
+  //查询
+  let getSearch=()=>{
+    $emit('getSearch',);
+  }
+  //重置
+  let getReset=()=>{
+    searchData.address=''
+    searchData.class=''
+    searchData.insType=''
+    searchData.userName=''
+  }
   watch(
     () => props.tableData,
     (newV, oldV) => {

+ 7 - 1
src/views/vent/monitorManager/deviceMonitor/components/device/device.api.ts

@@ -13,7 +13,8 @@ enum Api {
   getHistoryData = '/monitor/history/getHistoryData',
   safetyDeviceList = '/monitor/codeDict',
   exportXlsUrl = '/monitor/exportXls',
-  queryNowGasInsInfo='/safety/gasDayReport/queryNowGasInsInfo'//查询当前各班瓦斯巡检信息
+  queryNowGasInsInfo='/safety/gasDayReport/queryNowGasInsInfo',//查询当前各班瓦斯巡检信息
+   queryNowGasSta='/safety/gasDayReport/queryNowGasSta'
 }
 /**
  * 列表接口
@@ -40,3 +41,8 @@ export const safetyDeviceList = (params) => defHttp.post({ url: Api.safetyDevice
 export const queryNowGasInsInfo = (params) => defHttp.post({ url: Api.queryNowGasInsInfo, params });
 
 export const getExportUrl = Api.exportXlsUrl;
+/**
+ * 列表接口
+ * @param params
+ */
+export const queryNowGasSta = (params) => defHttp.post({ url: Api.queryNowGasSta, params });

+ 14 - 2
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -194,7 +194,7 @@
             <template v-else-if="deviceType.startsWith('gaspatrol') && activeKey == '1'">
               <gaspatrolTable :addressData="addressData" :personData="personData" :instypeData="instypeData"
                 :classData="classData" :tableData="gaspatrolData" @addressInput="addressInput" @userInput="userInput"
-                @insTypeChange="insTypeChange" @classChange="classChange"></gaspatrolTable>
+                @insTypeChange="insTypeChange" @classChange="classChange" @getSearch="getSearch"></gaspatrolTable>
             </template>
             <template v-else>
               <!-- 工作面echarts图标 -->
@@ -365,7 +365,7 @@
 <script setup lang="ts">
 import { ref, onMounted, onUnmounted, ComponentOptions, shallowRef, reactive, defineProps, watch } from 'vue';
 import { SendOutlined, FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons-vue';
-import { list, getDeviceList, getDeviceTypeList, devPosition, getDepartmentInfo, getExportUrl, queryNowGasInsInfo, } from './device.api';
+import { list, getDeviceList, getDeviceTypeList, devPosition, getDepartmentInfo, getExportUrl, queryNowGasInsInfo,queryNowGasSta } from './device.api';
 import AlarmHistoryTable from '../../../comment/AlarmHistoryTable.vue';
 import HistoryTable from '../../../comment/HistoryTable.vue';
 import HandlerHistoryTable from '../../../comment/HandlerHistoryTable.vue';
@@ -797,11 +797,23 @@ let userInput = (param) => {
 //巡检类型选项切换
 let insTypeChange = (param) => {
   instypeData.value = param
+ 
 }
 //巡检班次选项切换
 let classChange = (param) => {
   classData.value = param
 }
+//查询巡检弹窗信息
+async function getSearch(){
+  if(!instypeData.value){
+    message.warning('请选择巡检类型!')
+  }else if(!classData.value){
+    message.warning('请选择巡检班次!');
+  }else {
+    let res=await queryNowGasSta({insType:instypeData.value,class:classData.value})
+    console.log(res,'巡检弹窗信息')
+  }
+}
 
 
 function goDetail(record?) {