Explorar o código

搜索样式+全局导出加载状态

yuhan hai 2 meses
pai
achega
b68bdfe0b8

+ 4 - 0
src/assets/less/interLock.css

@@ -193,6 +193,10 @@
   min-width: auto !important;
   width: 100%;
 }
+.iotmenu-content-container .table-page-search-wrapper .iotmenu-search-container .ant-btn-primary[disabled],
+.iotmenu-modal-box .table-page-search-wrapper .iotmenu-search-container .ant-btn-primary[disabled] {
+  color: #fff !important;
+}
 .iotmenu-content-container .table-page-search-wrapper .ant-form .ant-form-item .ant-form-item-label label,
 .iotmenu-modal-box .table-page-search-wrapper .ant-form .ant-form-item .ant-form-item-label label {
   color: #323233;

+ 3 - 0
src/assets/less/interLock.less

@@ -168,6 +168,9 @@
         min-width: auto !important;
         width: 100%;
       }
+      .ant-btn-primary[disabled]{
+        color: #fff !important;
+      }
     }
     .ant-form{
       .ant-form-item{

+ 12 - 1
src/mixins/JeecgListMixin.js

@@ -50,6 +50,11 @@ export const JeecgListMixin = {
       superQueryParams: '',
       /** 高级查询拼接方式 */
       superQueryMatchType: 'and',
+
+      /** IoT TPM相关 修改框架
+       *  导出时间过长时加个状态样式
+      */
+      exportBtnLoading: false,
     }
   },
   created() {
@@ -270,6 +275,9 @@ export const JeecgListMixin = {
       window.location.href = url;
     },
     handleExportXls(fileName){
+      // IoT TPM相关 修改框架
+      this.exportBtnLoading = true
+      console.log(this.exportBtnLoading)
       if(!fileName || typeof fileName != "string"){
         fileName = "导出文件"
       }
@@ -277,8 +285,11 @@ export const JeecgListMixin = {
       if(this.selectedRowKeys && this.selectedRowKeys.length>0){
         param['selections'] = this.selectedRowKeys.join(",")
       }
-      console.log("导出参数",param)
+      console.log("导出参数1",param)
       downFile(this.url.exportXlsUrl,param).then((data)=>{
+        // IoT TPM相关 修改框架
+        this.exportBtnLoading = false
+        console.log(this.exportBtnLoading)
         if (!data) {
           this.$message.warning("文件下载失败")
           return

+ 1 - 1
src/views/module_interLock/InterlockSummary/InterlockSummaryList.vue

@@ -28,7 +28,7 @@
           </div>
           <div v-if="selectData.interlockType === '1'" class="item-search">
             <!-- <j-dict-select-tag v-model="queryParam.interlockStatus" placeholder="联锁状态" dictCode="interlock_status" @change="searchQuery"/> -->
-            <a-select placeholder="联锁状态" v-model="queryParam.interlockStatus" allowClear :options="interlockOptions" @change="searchQuery" @blur="searchQuery"></a-select>
+            <a-select placeholder="联锁状态" v-model="queryParam.interlockStatus" allowClear :options="interlockOptions" @change="searchQuery"></a-select>
           </div>
           <div v-if="selectData.interlockType === '1'" class="item-search">
             <a-select placeholder="回路健康级别" v-model="queryParam.loopHealthLevel" allowClear :options="healthLevelOption" @change="searchQuery"></a-select>

+ 99 - 40
src/views/module_interLock/interlockHistoryData/InterlockHistoryList.vue

@@ -4,39 +4,39 @@
     <div class="table-page-search-wrapper">
         <div class="iotmenu-search-container">
           <div class="item-search">
-            <a-input placeholder="请输入联锁名称" v-model="queryParam.interlockname" allow-clear @change="searchQuery">
+            <a-input placeholder="联锁名称" v-model="queryParam.interlockname" allow-clear @change="searchQuery">
               <a-icon slot="prefix" type="search" />
             </a-input>
           </div>
           <div class="item-search">
-            <a-input placeholder="请输入联锁条件" v-model="queryParam.interlockConditionTag" allow-clear @change="searchQuery">
+            <a-input placeholder="联锁条件" v-model="queryParam.interlockConditionTag" allow-clear @change="searchQuery">
               <a-icon slot="prefix" type="search" />
             </a-input>
           </div>
           <div v-if="selectData.interlockType === '1'" class="item-search">
-            <a-select placeholder="请选择仪表状态" v-model="queryParam.instrumentStatus" allowClear :options="healthLevelOption" style="width: 100%;"></a-select>
+            <a-select placeholder="仪表状态" v-model="queryParam.instrumentStatus" allowClear :options="instrumentOptions" @change="searchQuery"></a-select>
           </div>
           <div v-if="selectData.interlockType === '1'" class="item-search">
-            <a-select placeholder="请选择控制系统状态" v-model="queryParam.controlSystemStatus" allowClear :options="healthLevelOption" style="width: 100%;"></a-select>
+            <a-select placeholder="控制系统状态" v-model="queryParam.controlSystemStatus" allowClear :options="controlSystemOptions" @change="searchQuery"></a-select>
           </div>
           <div v-if="selectData.interlockType === '1'" class="item-search">
-            <a-select placeholder="请选择旁路状态" v-model="queryParam.bypass" allowClear :options="healthLevelOption" style="width: 100%;"></a-select>
+            <a-select placeholder="旁路状态" v-model="queryParam.bypass" allowClear :options="bypassOptions" @change="searchQuery"></a-select>
           </div>
           <div v-if="selectData.interlockType === '1'" class="item-search">
-            <j-dict-select-tag v-model="queryParam.interlockStatus" placeholder="请选择联锁状态" dictCode="interlock_status" style="width: 100%;"/>
+            <a-select placeholder="联锁状态" v-model="queryParam.interlockStatus" allowClear :options="interlockOptions" @change="searchQuery"></a-select>
           </div>
           <div v-if="selectData.interlockType === '1'" class="item-search">
-            <a-select placeholder="请选择回路健康级别" v-model="queryParam.loopHealthLevel" allowClear :options="healthLevelOption" style="width: 100%;"></a-select>
+            <a-select placeholder="回路健康级别" v-model="queryParam.loopHealthLevel" allowClear :options="healthLevelOption" @change="searchQuery"></a-select>
           </div>
           <div class="item-search">
-            <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.beginTime"></j-date>
+            <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="开始时间" class="query-group-cust" v-model="queryParam.beginTime" @change="searchQuery"></j-date>
             <!-- <span class="query-group-split-cust"></span> -->
           </div>
           <div class="item-search">
-            <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.endTime"></j-date>
+            <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="结束时间" class="query-group-cust" v-model="queryParam.endTime" @change="searchQuery"></j-date>
           </div>
           <div class="item-search-btn">
-            <a-button type="primary" icon="download" v-has="'export:history'" @click="handleExportXls('历史数据')">导出</a-button>
+            <a-button type="primary" :icon="exportBtnLoading ? 'loading' : 'download'" v-has="'export:history'" @click="handleExportXls('历史数据')" :disabled="exportBtnLoading">导出</a-button>
           </div>
         </div>
 
@@ -291,7 +291,12 @@
         ],
         dictOptions:{},
         superFieldList:[],
-        mouseSummaryid: '',
+        // mouseSummaryid: '', // 用于合并单元格悬浮样式设置
+        // 当前系统默认值
+        instrumentOptions: [], // 仪表状态
+        controlSystemOptions: [], // 控制系统状态
+        bypassOptions: [], // 旁路状态
+        interlockOptions: [], // 联锁状态
       }
     },
     created() {
@@ -326,6 +331,57 @@
           }
         }
       },
+      // 获得当前系统设置的默认参数
+      getSystemDefaulOptions(){
+        getAction('/base/interlockBase/queryById', {id: this.selectData.id}).then((res) => {
+          console.log(res)
+          var result = res.result
+          if(result.bypassYes === '0'){
+            this.bypassOptions = [
+              { value: '0', title: result.bypassYesName },
+              { value: '1', title: result.bypassNoName },
+            ]
+          } else {
+            this.bypassOptions = [
+              { value: '0', title: result.bypassNoName },
+              { value: '1', title: result.bypassYesName },
+            ]
+          }
+          if(result.controlSystemStatusNormal === '0'){
+            this.controlSystemOptions = [
+              { value: '0', title: result.controlSystemStatusNormalName },
+              { value: '1', title: result.controlSystemStatusAbnormalName },
+            ]
+          } else {
+            this.controlSystemOptions = [
+              { value: '0', title: result.controlSystemStatusAbnormalName },
+              { value: '1', title: result.controlSystemStatusNormalName },
+            ]
+          }
+          if(result.instrumentStatusNormal === '0'){
+            this.instrumentOptions = [
+              { value: '0', title: result.instrumentStatusNormalName },
+              { value: '1', title: result.instrumentStatusAbnormalName },
+            ]
+          } else {
+            this.instrumentOptions = [
+              { value: '0', title: result.instrumentStatusAbnormalName },
+              { value: '1', title: result.instrumentStatusNormalName },
+            ]
+          }
+          if(result.interlockStatusTy === '0'){
+            this.interlockOptions = [
+              { value: '0', title: result.interlockStatusTyName },
+              { value: '1', title: result.interlockStatusWtyName },
+            ]
+          } else {
+            this.interlockOptions = [
+              { value: '0', title: result.interlockStatusWtyName },
+              { value: '1', title: result.interlockStatusTyName },
+            ]
+          }
+        })
+      },
       loadData(arg) {
         let that = this
         if(!this.url.list){
@@ -340,6 +396,7 @@
         this.loading = true;
         // 左右两边重置分别控制各自的,所以转换数据换到这里
         if (this.selectData.interlockType == 1) {
+          this.getSystemDefaulOptions()
           params.interlockApparatusId = ''
           params.interlockSystemId = this.selectData.id
         } else {
@@ -537,35 +594,37 @@
         fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
         this.superFieldList = fieldList
       },
-      handleExportXls(fileName){
-        if(!fileName || typeof fileName != "string"){
-          fileName = "导出文件"
-        }
-        let param = this.getQueryParams();
-        if(this.selectedRowKeys && this.selectedRowKeys.length>0){
-          param['selections'] = this.selectedRowKeys.join(",")
-        }
-        console.log("导出参数",param)
-        downFile(this.url.exportXlsUrl,param).then((data)=>{
-          if (!data) {
-            this.$message.warning("文件下载失败")
-            return
-          }
-          if (typeof window.navigator.msSaveBlob !== 'undefined') {
-            window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
-          }else{
-            let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
-            let link = document.createElement('a')
-            link.style.display = 'none'
-            link.href = url
-            link.setAttribute('download', fileName+'.xls')
-            document.body.appendChild(link)
-            link.click()
-            document.body.removeChild(link); //下载完成移除元素
-            window.URL.revokeObjectURL(url); //释放掉blob对象
-          }
-        })
-      },
+      // handleExportXls(fileName){
+      //   this.exportBtnLoading = true
+      //   if(!fileName || typeof fileName != "string"){
+      //     fileName = "导出文件"
+      //   }
+      //   let param = this.getQueryParams();
+      //   if(this.selectedRowKeys && this.selectedRowKeys.length>0){
+      //     param['selections'] = this.selectedRowKeys.join(",")
+      //   }
+      //   console.log("导出参数",param)
+      //   downFile(this.url.exportXlsUrl,param).then((data)=>{
+      //     this.exportBtnLoading = false
+      //     if (!data) {
+      //       this.$message.warning("文件下载失败")
+      //       return
+      //     }
+      //     if (typeof window.navigator.msSaveBlob !== 'undefined') {
+      //       window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
+      //     }else{
+      //       let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
+      //       let link = document.createElement('a')
+      //       link.style.display = 'none'
+      //       link.href = url
+      //       link.setAttribute('download', fileName+'.xls')
+      //       document.body.appendChild(link)
+      //       link.click()
+      //       document.body.removeChild(link); //下载完成移除元素
+      //       window.URL.revokeObjectURL(url); //释放掉blob对象
+      //     }
+      //   })
+      // },
     }
   }
 </script>

+ 3 - 3
src/views/module_interLock/interlockTimedReport/InterlockTimedReportList.vue

@@ -4,13 +4,13 @@
     <div class="table-page-search-wrapper">
       <div class="iotmenu-search-container">
         <div class="item-search">
-          <j-dict-select-tag placeholder="请选择报表类型" v-model="queryParam.reportType" dictCode="report_type"/>
+          <j-dict-select-tag placeholder="请选择报表类型" v-model="queryParam.reportType" dictCode="report_type" @change="searchQuery"/>
         </div>
         <div class="item-search">
-          <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.createTime_begin"></j-date>
+          <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.createTime_begin" @change="searchQuery"></j-date>
         </div>
         <div class="item-search">
-          <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.createTime_end"></j-date>
+          <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.createTime_end" @change="searchQuery"></j-date>
         </div>
       </div>
     </div>