Browse Source

'动作查询'

蒋珅 1 year ago
parent
commit
f18522bf4f
3 changed files with 46 additions and 13 deletions
  1. 2 2
      src/api/index.js
  2. 43 10
      src/components/search/action.vue
  3. 1 1
      src/components/warning/warningCard.vue

+ 2 - 2
src/api/index.js

@@ -436,10 +436,10 @@ const getEvaluationData = (id) => {
     });
 };
 
-const getControlStatistics = (startTs, endTs) => {
+const getControlStatistics = (startTs, endTs,stationId) => {
     return request({
         baseURL: process.env.VUE_APP_API,
-        url: `/control-record/control-statistics?startTs=${startTs}&endTs=${endTs}`,
+        url: `/control-record/control-statistics?startTs=${startTs}&endTs=${endTs}&stationId=${stationId}`,
         method: "get",
     });
 }

+ 43 - 10
src/components/search/action.vue

@@ -111,33 +111,47 @@
                   align="center"
                 >
                 </el-table-column>
+                 <el-table-column
+                  prop="statusChanged"
+                  label="状态转换"
+                  width="160"
+                  align="center"
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="statusChangeInterval"
+                  label="状态转换时间(s)"
+                  width="160"
+                  align="center"
+                >
+                </el-table-column>
               </el-table>
-              <div class="titleinfoall" v-if="showControlStatistics">
+              <div class="titleinfoall" >
                 <div class="titleinfo">
-                  <span class="showTitle fontSty1">启动次数:</span>
+                  <span class="showTitle fontSty1">启动:</span>
                   <span class="showvalue">
-                    {{ controlStatisticsInfo.startCount }}
+                   {{controlStatisticsInfo.startSuccessCount }}/{{ controlStatisticsInfo.startCount}}
                   </span>
                   <span class="showTitle fontSty">次</span>
                 </div>
                 <div class="titleinfo">
-                  <span class="showTitle fontSty1">停机次数:</span>
+                  <span class="showTitle fontSty1">停机:</span>
                   <span class="showvalue">
-                    {{ controlStatisticsInfo.stopCount }}
+                    {{controlStatisticsInfo.stopSuccessCount}}/{{ controlStatisticsInfo.stopCount }}
                   </span>
                   <span class="showTitle fontSty">次</span>
                 </div>
                 <div class="titleinfo">
-                  <span class="showTitle fontSty1">维护次数:</span>
+                  <span class="showTitle fontSty1">维护:</span>
                   <span class="showvalue">
-                    {{ controlStatisticsInfo.maintenanceCount }}
+                    {{controlStatisticsInfo.maintenanceSuccessCount }}/{{ controlStatisticsInfo.maintenanceCount}}
                   </span>
                   <span class="showTitle fontSty">次</span>
                 </div>
                 <div class="titleinfo">
-                  <span class="showTitle fontSty1">解除维护次数:</span>
+                  <span class="showTitle fontSty1">解除维护:</span>
                   <span class="showvalue">
-                    {{ controlStatisticsInfo.unMaintenanceCount }}
+                    {{controlStatisticsInfo.unMaintenanceSuccessCount }}/{{ controlStatisticsInfo.unMaintenanceCount}}
                   </span>
                   <span class="showTitle fontSty">次</span>
                 </div>
@@ -271,6 +285,7 @@ export default {
   mounted() {},
   data() {
     return {
+      statname:"",
       currentPage: 20,
       filterText: "",
       pageIndex: 1,
@@ -344,6 +359,7 @@ export default {
           obj.stationId = item.id;
           obj.children = [];
           this.showData[0].children.push(obj);
+          console.log(123,obj.stationId);
         }
       });
       this.datas = this.$store.state.windturbinelist
@@ -358,9 +374,12 @@ export default {
       }
     },
     handleChange(value) {
+      console.log(111,value);
+      this.statname=value.stationId
       this.chooseStation = value;
       this.pageIndex = 1;
       this.getControlRecord(value);
+      this.getControlStatistics()
     },
     closed() {
       this.pageIndex = 1;
@@ -406,21 +425,28 @@ export default {
       this.controlStatisticsInfo = {};
       const stTs = this.timeValue[0];
       const endTs = this.timeValue[1];
+      const stationId=this.statname
       api
         .getControlStatistics(
           new Date(stTs).getTime(),
-          new Date(endTs).getTime()
+          new Date(endTs).getTime(),
+          stationId
         )
         .then((res) => {
           this.showControlStatistics = true;
+          console.log(999,res);
           this.controlStatisticsInfo = {
             advanceTime: res.data.advanceTime,
             maintenanceCount: res.data.maintenanceCount,
+            maintenanceSuccessCount:res.data.maintenanceSuccessCount,
             powerGeneration: res.data.powerGeneration,
             powerSaving: res.data.powerSaving,
             startCount: res.data.startCount,
+            startSuccessCount:res.data.startSuccessCount,
+            stopSuccessCount:res.data.stopSuccessCount,
             stopCount: res.data.stopCount,
             unMaintenanceCount: res.data.unMaintenanceCount,
+            unMaintenanceSuccessCount: res.data.unMaintenanceSuccessCount,
             maintenanceTime: res.data.maintenanceTime,
           };
         });
@@ -454,14 +480,21 @@ export default {
               Lock: "挂牌",
               UnLock: "取消挂牌",
             };
+            // console.log(666,res);
             res.data.dataList.forEach((item) => {
               item.time = dayjs(item.time).format("MM-DD HH:mm:ss");
               item.result = this.controlErorCodes[item.errorCode];
               item.controls = types[item.controlType];
               item.showName = item.windturbineId;
+              if(item.statusChanged=='true'){
+                 item.statusChanged='成功'
+              }else{
+                item.statusChanged='失败'
+              }
             });
             this.total = res.data.total;
             this.recordData = res.data.dataList;
+            console.log(666,res.data.dataList);
           }
         });
     },

+ 1 - 1
src/components/warning/warningCard.vue

@@ -227,7 +227,7 @@ export default {
           }
         }
       });
-      console.log('996',this.values);
+      // console.log('996',this.values);
     },
     // 返回音频文件路径
     getSound(fileName) {