zhulizhen vor 5 Jahren
Ursprung
Commit
5cd590fb58
2 geänderte Dateien mit 99 neuen und 3 gelöschten Zeilen
  1. 50 2
      src/views/evaluate/evSnapshotsDialog.vue
  2. 49 1
      src/views/strategy/animationBox.vue

+ 50 - 2
src/views/evaluate/evSnapshotsDialog.vue

@@ -163,7 +163,9 @@ export default {
       dataY3: [],
       loadY1: [],
       loadY2: [],
-      loadY3: []
+      loadY3: [],
+      dataY1Min:'',
+      dataY1Max:''
     };
   },
   mounted() {
@@ -175,6 +177,28 @@ export default {
     }
   },
   methods: {
+    getMax(arr) {
+            var max = arr[0]
+            for (var i = 0; i < arr.length; i++) {
+                if (max < arr[i]) {
+                    max = arr[i]
+                }
+            }
+            return max
+        },
+        getMin(arr) {
+            var min = arr[0]
+            for (var i = 0; i < arr.length; i++) {
+                if (arr[i] == '') {
+                    arr.splice(arr[i], 1)
+                }
+                if (min > arr[i]) {
+                    min = arr[i]
+                }
+            }
+
+            return min
+        },
     getQuickData() {
       let params = {
         getParams: {
@@ -199,8 +223,29 @@ export default {
         this.dataY3.push(el.maxTindoor);
         this.loadY1.push(el.nowPlantLoad?(el.nowPlantLoad=='-9999'?undefined:el.nowPlantLoad):undefined);
         this.loadY2.push(el.predictedLoadUpLimit?(el.predictedLoadUpLimit=='-9999'?undefined:el.predictedLoadUpLimit):undefined);
-        this.loadY3.push(el.redictedLoadDownLimit?(el.redictedLoadDownLimit == '-9999'?undefined:el.redictedLoadDownLimit):undefined);
+        this.loadY3.push(el.redictedLoadDownLimit?(el.redictedLoadDownLimit == '-9999'?undefined:el.redictedLoadDownLimit):undefined);  
       });
+      let arr = []
+      arr = arr
+          .concat(this.dataY1)
+          .concat(this.dataY2)
+          .concat(this.dataY3)
+      this.dataY1Min = this.getMin(arr)
+      this.dataY1Max = this.getMax(arr)
+      let minG = parseInt(this.dataY1Min % 10),
+          minS = parseInt((this.dataY1Min % 100) / 10),
+          maxG = parseInt(this.dataY1Max % 10),
+          maxS = parseInt((this.dataY1Max % 100) / 10)
+      if (minG > 5) {
+          this.dataY1Min = String(minS) + '5'
+      } else if (minG <= 5) {
+          this.dataY1Min = String(minS) + '0'
+      }
+      if (maxG > 5) {
+          this.dataY1Max = String(maxS + 1) + '0'
+      } else if (maxG <= 5) {
+          this.dataY1Max = String(maxS) + '0'
+      }
       this.drawSnapshotssLeft();
       this.drawSnapshotssRight();
     },
@@ -232,6 +277,9 @@ export default {
         },
         yAxis: {
           type: "value",
+          min: Number(this.dataY1Min),
+          max: Number(this.dataY1Max),
+          interval: 5,
           axisLabel:{formatter:'{value}  ℃'}
         },
         series: [

+ 49 - 1
src/views/strategy/animationBox.vue

@@ -70,7 +70,9 @@ export default {
             loadX: [],
             loadY1: [],
             loadY2: [],
-            loadY3: []
+            loadY3: [],
+            dataY1Min:'',
+            dataY1Max:''
         }
     },
     components: { bomBox },
@@ -85,6 +87,28 @@ export default {
         }
     },
     methods: {
+        getMax(arr) {
+            var max = arr[0]
+            for (var i = 0; i < arr.length; i++) {
+                if (max < arr[i]) {
+                    max = arr[i]
+                }
+            }
+            return max
+        },
+        getMin(arr) {
+            var min = arr[0]
+            for (var i = 0; i < arr.length; i++) {
+                if (arr[i] == '') {
+                    arr.splice(arr[i], 1)
+                }
+                if (min > arr[i]) {
+                    min = arr[i]
+                }
+            }
+
+            return min
+        },
         getData() {
             this.chillerHourList.forEach(el => {
                 el.value = el.time.slice(0, 2) + ':' + el.time.slice(2, 4)
@@ -96,6 +120,27 @@ export default {
                 this.loadY1.push(el.nowPlantLoad == '-9999' ? undefined : el.nowPlantLoad)
                 this.loadY2.push(el.predictedLoadUpLimit != '-9999' ? el.predictedLoadUpLimit : undefined)
                 this.loadY3.push(el.redictedLoadDownLimit != '-9999' ? el.redictedLoadDownLimit : undefined)
+                let arr = []
+                arr = arr
+                    .concat(this.dataY1)
+                    .concat(this.dataY2)
+                    .concat(this.dataY3)
+                this.dataY1Min = this.getMin(arr)
+                this.dataY1Max = this.getMax(arr)
+                let minG = parseInt(this.dataY1Min % 10),
+                    minS = parseInt((this.dataY1Min % 100) / 10),
+                    maxG = parseInt(this.dataY1Max % 10),
+                    maxS = parseInt((this.dataY1Max % 100) / 10)
+                if (minG > 5) {
+                    this.dataY1Min = String(minS) + '5'
+                } else if (minG <= 5) {
+                    this.dataY1Min = String(minS) + '0'
+                }
+                if (maxG > 5) {
+                    this.dataY1Max = String(maxS + 1) + '0'
+                } else if (maxG <= 5) {
+                    this.dataY1Max = String(maxS) + '0'
+                }
             })
         },
         drawLeft() {
@@ -124,6 +169,9 @@ export default {
                 },
                 yAxis: {
                     type: 'value',
+                    min: Number(this.dataY1Min),
+                    max: Number(this.dataY1Max),
+                    interval: 5,
                     axisLabel: { formatter: '{value}  ℃' }
                 },
                 series: [