Guoxiaohuan 5 năm trước cách đây
mục cha
commit
3bf3a90d0a

+ 3 - 1
src/views/evaluate/evEnergySavingRate.vue

@@ -9,7 +9,9 @@ export default {
     return {};
   },
   mounted() {
-    this.pie(this.energySavingRate || 0, "#box3", ["#00D6B9", "#D5F6F2"]);
+    this.$nextTick(function() {
+      this.pie(this.energySavingRate, "#box3", ["#00D6B9", "#D5F6F2"]);
+    });
   },
   props: ["energySavingRate"],
   methods: {

+ 3 - 1
src/views/evaluate/evImplementationRate.vue

@@ -10,7 +10,9 @@ export default {
   },
   props: ["chillerExecuteRate"],
   mounted() {
-    this.pie(this.chillerExecuteRate || 0, "#box2", ["#FFBA6B", "#FEE9D2"]);
+    this.$nextTick(function() {
+      this.pie(this.chillerExecuteRate, "#box2", ["#FFBA6B", "#FEE9D2"]);
+    });
   },
   methods: {
     pie(pieData, box, colors) {

+ 3 - 1
src/views/evaluate/evSatisfactionRate.vue

@@ -10,7 +10,9 @@ export default {
   },
   props: ["tindoorFillRate"],
   mounted() {
-    this.pie(this.tindoorFillRate || 0, "#box1", ["#0091FF", "#E1F2FF"]);
+    this.$nextTick(function() {
+      this.pie(this.tindoorFillRate, "#box1", ["#0091FF", "#E1F2FF"]);
+    });
   },
   methods: {
     pie(pieData, box, colors) {

+ 28 - 8
src/views/evaluate/index.vue

@@ -31,7 +31,7 @@
           <p class="ev-top Micbold">室内温度满足率</p>
           <div class="ev-bottom">
             <div class="ev-bottom-left">
-              <ev-satisfaction-rate :tindoorFillRate="tindoorFillRate"></ev-satisfaction-rate>
+              <ev-satisfaction-rate v-if="tindoorFillRate" :tindoorFillRate="tindoorFillRate"></ev-satisfaction-rate>
             </div>
             <div class="ev-bottom-right MicrYaHei">
               <p>
@@ -51,7 +51,7 @@
           <p class="ev-top">节能率</p>
           <div class="ev-bottom">
             <div class="ev-bottom-left">
-              <ev-energy-saving-rate :energySavingRate="energySavingRate"></ev-energy-saving-rate>
+              <ev-energy-saving-rate v-if="energySavingRate" :energySavingRate="energySavingRate"></ev-energy-saving-rate>
             </div>
             <div class="ev-bottom-right">
               <p>
@@ -66,7 +66,10 @@
           <p class="ev-top">策略执行率</p>
           <div class="ev-bottom">
             <div class="ev-bottom-left">
-              <ev-implementation-rate :chillerExecuteRate="chillerExecuteRate"></ev-implementation-rate>
+              <ev-implementation-rate
+                v-if="chillerExecuteRate"
+                :chillerExecuteRate="chillerExecuteRate"
+              ></ev-implementation-rate>
             </div>
             <div class="ev-bottom-right">
               <p>
@@ -168,13 +171,30 @@ export default {
       };
       runDataQury(null, { getParams }).then(res => {
         if (res.result == "success") {
-          this.tindoorFillRate = res.tindoorFillRate; //室内温度满足率
-          this.energySavingRate = res.energySavingRate; //节能率
-          this.chillerExecuteRate = res.chillerExecuteRate; //略执行率
-          this.energySaving = res.energySaving; //节能量
+          this.tindoorFillRate = res.tindoorFillRate
+            ? res.tindoorFillRate.toFixed(1)
+            : 0; //室内温度满足率
+          console.log("室内温度满足率", this.tindoorFillRate);
+          this.energySavingRate = res.energySavingRate
+            ? res.energySavingRate.toFixed(1)
+            : 0; //节能率
+          console.log("节能率", this.energySavingRate);
+          this.chillerExecuteRate = res.chillerExecuteRate
+            ? res.chillerExecuteRate.toFixed(1)
+            : 0; //略执行率
+          console.log("略执行率", this.chillerExecuteRate);
+          this.energySaving = res.energySaving
+            ? res.energySaving.toFixed(0)
+            : 0; //节能量
+          console.log("节能量", this.energySaving);
           this.isExecutedNum = res.isExecutedNum; //已执行数量
+          console.log("已执行数量", this.isExecutedNum);
           this.allReceivedNum = res.allReceivedNum; //共收到数量
-          this.tindoorOverrunDegree = res.tindoorOverrunDegree; //超限程度
+          console.log("共收到数量", this.allReceivedNum);
+          this.tindoorOverrunDegree = res.tindoorOverrunDegree
+            ? res.tindoorOverrunDegree.toFixed(1)
+            : 0; //超限程度
+          console.log("超限程度", this.tindoorOverrunDegree);
           this.energyDataList = res.dataList;
         }
       });