From 585fb0bbd4a7bc7f8f333ecba7c5fecd2ee5cbc2 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期四, 28 三月 2024 09:46:44 +0800
Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/vue_mdc_430 into develop

---
 src/views/mdc/base/modules/deviceLog/LogInfo.vue |  144 +++++++++++++++++++++++++++++------------------
 1 files changed, 88 insertions(+), 56 deletions(-)

diff --git a/src/views/mdc/base/modules/deviceLog/LogInfo.vue b/src/views/mdc/base/modules/deviceLog/LogInfo.vue
index 3c48337..9ccf664 100644
--- a/src/views/mdc/base/modules/deviceLog/LogInfo.vue
+++ b/src/views/mdc/base/modules/deviceLog/LogInfo.vue
@@ -4,27 +4,34 @@
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
-          <a-col :md="6" :sm="6">
+          <a-col :md="4" :sm="4">
             <a-form-item label="璁惧缂栧彿">
-              <a-input placeholder="杈撳叆璁惧缂栧彿鏌ヨ" :readOnly="readOnly" v-model="queryParams.equipmentId"></a-input>
+              <a-input placeholder="璇烽�夋嫨璁惧" :readOnly="readOnly" v-model="queryParams.equipmentId"></a-input>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="6">
             <a-form-item label="璁惧鍚嶇О">
-              <a-input placeholder="杈撳叆璁惧鍚嶇О鏌ヨ" :readOnly="readOnly" v-model="queryParams.equipmentName"></a-input>
+              <a-input placeholder="璇烽�夋嫨璁惧" :readOnly="readOnly" v-model="queryParams.equipmentName"></a-input>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="6">
+          <a-col :md="4" :sm="4">
             <a-form-item label="鏃ユ湡">
-              <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" @change="dataChange" format='YYYY-MM-DD'/>
+              <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" @change="dataChange"
+                             format='YYYY-MM-DD'/>
             </a-form-item>
-          </a-col>
-          <a-col :md="3" :sm="3">
-            <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
           </a-col>
           <a-col :md="2" :sm="2" :xs="2">
-            <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
+            <a-space>
+              <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
+            </a-space>
           </a-col>
+          <!--<a-col :md="3" :sm="3">-->
+            <!--<a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>-->
+          <!--</a-col>-->
+          <!--<a-col :md="2" :sm="2" :xs="2">-->
+            <!--<a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>-->
+          <!--</a-col>-->
         </a-row>
       </a-form>
     </div>
@@ -60,9 +67,9 @@
                             <span v-if="item.status == 23"
                                   :style='{display: "inline-block",width:item.dateProportion,  height: "100%", background: "#19FE01",position:"absolute",bottom:"0"}'></span>
                           </div>
-                          <div  v-if="item.status == 22" style="z-index: 999;"
-                                :style='{display: "inline-block",left:item.left,width:item.dateProportion,  height: "100%",position:"absolute"}'
-                                v-for="item in waring">
+                          <div v-if="item.status == 22" style="z-index: 999;"
+                               :style='{display: "inline-block",left:item.left,width:item.dateProportion,  height: "100%",position:"absolute"}'
+                               v-for="item in waring">
                             <span
                               :style='{display: "inline-block",width:"100%", left:0, height: "68%", background: "#FD0008",position:"absolute",bottom:"0"}'></span>
                           </div>
@@ -150,9 +157,9 @@
         </a-tabs>
       </div>
     </div>
-    <work-chart-model ref="workChartModel"></work-chart-model>
+    <work-chart-model ref="workChartModel" :collectTime="this.queryParams.collectTime"
+                      :equipment="this.equipment"></work-chart-model>
     <work-history-model ref="workHistoryModel"></work-history-model>
-
   </div>
 </template>
 
@@ -167,7 +174,7 @@
   import { getAction } from '@/api/manage'
   // import {mapActions} from 'vuex'
   export default {
-    components: {
+     components: {
       LogList,
       WorkLogList,
       AlarmLogList,
@@ -177,17 +184,17 @@
     props: { equement: {} },
     data() {
       return {
-        readOnly:true,
+        readOnly: true,
         defaultId: '',
         defaultName: '',
         middleTime: '',
-        queryParam:{},
+        queryParam: {},
         queryParams: {
-          collectTime:undefined,
+          collectTime: undefined
         },
-        loadingstayus:false,
-        loadingrunStatus:false,
-        loadingwarnStatus:false,
+        loadingstayus: false,
+        loadingrunStatus: false,
+        loadingwarnStatus: false,
         normal: [],
         waring: [],
         normalList: [],
@@ -201,7 +208,7 @@
           getEquipmentByPid: '/mdc/mdcEquipment/getEquipmentByPid',
           list: '/mdc/mdcEquipmentRunningSection/logList'
         },
-        ProStartId:''
+        ProStartId: ''
       }
     },
     methods: {
@@ -224,27 +231,27 @@
       tabChange(val) {
         this.activeKey = val
       },
-      disabledDate(current){
+      disabledDate(current) {
         //Can not slect days before today and today
-        return current && current > moment().subtract('days', 0);
+        return current && current > moment().subtract('days', 0)
       },
       queryChart() {
         // this.normal = []
         // this.waring = []
-        this.loadingstayus = true;
-        this.loadingrunStatus = true;
+        this.loadingstayus = true
+        this.loadingrunStatus = true
         this.loadingwarnStatus = true
         getAction(this.url.list, this.queryParams).then((res) => {
           this.normalList = []
           this.waringList = []
           this.runList = []
-          this.loadingstayus = false;
-          this.loadingrunStatus = false;
+          this.loadingstayus = false
+          this.loadingrunStatus = false
           this.loadingwarnStatus = false
           this.normal = []
           this.waring = []
           if (res.success) {
-            if(res.result != null){
+            if (res.result != null) {
               for (let i = 0; i < res.result.length; i++) {
                 this.normalList.push(res.result[i])
                 if ('22' == res.result[i].status) {
@@ -254,11 +261,11 @@
                   res.result[i].left = leftTmp / 86400 * 100 + '%'
                   this.waring.push(res.result[i])
 
-                }else if('3' == res.result[i].status){
+                } else if ('3' == res.result[i].status) {
                   this.runList.push(res.result[i])
                   res.result[i].dateProportion = res.result[i].duration / 86400 * 100 + '%'
                   this.normal.push(res.result[i])
-                }else{
+                } else {
                   res.result[i].dateProportion = res.result[i].duration / 86400 * 100 + '%'
                   this.normal.push(res.result[i])
                   // console.log(this.normal)
@@ -325,17 +332,21 @@
       },
       searchQuery() {
         // console.log(this.queryParams.collectTime)
-        if(this.queryParams.collectTime != undefined){
-          this.queryParams.collectTimeStr = this.queryParams.collectTime.format('YYYY-MM-DD')
-          this.queryChart()
-        }else{
-          this.$message.warning("璇烽�夋嫨鏃堕棿")
+        this.queryParams.collectTimeStr = this.queryParams.collectTime.format('YYYY-MM-DD')
+        if (!this.queryParams.equipmentId || !this.queryParams.equipmentName) {
+          this.$notification.warning({
+            message: '娑堟伅',
+            description: '璇烽�夋嫨璁惧'
+          })
+          return false
         }
-
+        this.queryChart()
         // this.queryList()
       },
       searchReset() {
-        this.queryParams = {}
+        this.queryParams = {
+          collectTime : moment()
+      }
         // this.queryList()
         this.equipment = {}
         this.queryChart()
@@ -344,20 +355,29 @@
         // this.onClearSelected()
       },
       openWorkChart() {
-        if(!this.equipment.equipmentId){
-          this.$message.warning("璇烽�夋嫨璁惧杩涜鏌ヨ")
-        }else{
+        if (!this.equipment.equipmentId) {
+          // this.$message.warning("璇烽�夋嫨璁惧杩涜鏌ヨ")
+          this.$notification.warning({
+            message: '娑堟伅',
+            description: '璇烽�夋嫨璁惧杩涜鏌ヨ'
+          })
+        } else {
+          // 鍒ゆ柇鏄惁鐐瑰嚮璁惧鏃ュ織琛ㄦ牸琛岀殑鏁版嵁锛屾鏃朵负鐐瑰嚮琛ㄦ牸鏁版嵁涓篺alse
+          this.$refs.workChartModel.isClicklogListRow = false
           this.$refs.workChartModel.add(this.equipment)
           this.$refs.workChartModel.title = '宸ヤ綔鏇茬嚎'
         }
-
       },
       openHistoryChart() {
         // console.log(this.equipment);
-        if(!this.equipment.equipmentId){
-          this.$message.warning("璇烽�夋嫨璁惧杩涜鏌ヨ")
+        if (!this.equipment.equipmentId) {
+          // this.$message.warning("璇烽�夋嫨璁惧杩涜鏌ヨ")
+          this.$notification.warning({
+            message: '娑堟伅',
+            description: '璇烽�夋嫨璁惧杩涜鏌ヨ'
+          })
           // console.log(1111)
-        } else{
+        } else {
           this.$refs.workHistoryModel.add(this.equipment)
           this.$refs.workHistoryModel.title = '鍘嗗彶鏃ュ織'
         }
@@ -368,9 +388,13 @@
         this.searchQuery()
       },
       dataAfter() {
-        if((this.queryParams.collectTime).format('YYYY-MM-DD') ==  moment().format('YYYY-MM-DD')){
-          this.$message.warning("璇烽�夋嫨浠婂ぉ浠ュ強浠婂ぉ涔嬪墠鐨勬棩鏈燂紒锛�")
-        }else{
+        if ((this.queryParams.collectTime).format('YYYY-MM-DD') == moment().format('YYYY-MM-DD')) {
+          // this.$message.warning("璇烽�夋嫨浠婂ぉ浠ュ強浠婂ぉ涔嬪墠鐨勬棩鏈燂紒锛�")
+          this.$notification.warning({
+            message: '娑堟伅',
+            description: '璇烽�夋嫨浠婂ぉ浠ュ強浠婂ぉ涔嬪墠鐨勬棩鏈燂紒锛�'
+          })
+        } else {
           this.queryParams.collectTime = moment(this.queryParams.collectTime.add(1, 'd'), 'YYYY-MM-DD')
           this.searchQuery()
         }
@@ -389,10 +413,19 @@
               this.queryParams = {}
               // this.queryList()
               this.equipment = {}
-              _this.$message.warning('璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒')
+              // _this.$message.warning('璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒')
+              _this.$notification.warning({
+                message: '娑堟伅',
+                description: '璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒'
+              })
             }
-          }else{
-            this.$message.warning(res.message)
+          } else {
+            // this.$message.warning(res.message)
+            _this.$notification.warning({
+              message: '娑堟伅',
+              description: res.message
+            })
+
           }
         })
       }
@@ -400,14 +433,12 @@
     created() {
       this.queryParams.collectTime = moment()
       this.queryParams.collectTimeStr = this.queryParams.collectTime.format('YYYY-MM-DD')
-      this.initEquipment();
+      this.initEquipment()
       // this.queryTreeData();
-    },
-    mounted() {
-
     },
     watch: {
       equement(val) {
+        console.log('閫氳繃watch瑙﹀彂')
         if (val && val.equipmentId) {
           this.$set(this.queryParams, 'equipmentName', val.equipmentName)
           this.$set(this.queryParams, 'equipmentId', val.equipmentId)
@@ -462,7 +493,8 @@
   #mdcLogShow > div {
     flex: 1;
   }
+
   /*.mdcLogShowOne{*/
-    /*position: absolute;*/
+  /*position: absolute;*/
   /*}*/
 </style>

--
Gitblit v1.9.3