فهرست منبع

Merge branch 'historical_route' into 'dev'

当车辆温度数组为空时数组前移。

See merge request new-business/drp-web!536
黄梓星 1 سال پیش
والد
کامیت
1693521a2b
1فایلهای تغییر یافته به همراه7 افزوده شده و 7 حذف شده
  1. 7 7
      src/views/WMS/historical-route/index.vue

+ 7 - 7
src/views/WMS/historical-route/index.vue

@@ -263,18 +263,18 @@
                 }
                 this.option.series.push(boxForm);
                 this.option.legend.data.push(boxForm.name);
-                console.log(this.option.series, 'this.option.series');
               }
+              console.log(this.option.series, 'this.option.series');
             }
             // 如果车辆温度数组为空,则其它数组前移一位
-            for (;;) {
+            for (let i = 1;;) {
               if (this.option.series[0].data.length == 0) {
-                for (let i = 0; i < this.option.series.length - 1; i++) {
-                  this.option.series[i] = this.option.series[i + 1];
-                  this.option.legend.data[i] = this.option.legend.data[i + 1];
+                for (let j = 0; j < this.option.series.length - i; j++) {
+                  this.option.series[j] = this.option.series[j + 1];
+                  this.option.legend.data[j] = this.option.legend.data[j + 1];
                 }
-                this.option.series[this.option.series.length - 1] = '';
-                this.option.legend.data[this.option.series.length - 1] = '';
+                this.option.series[this.option.series.length - i] = '';
+                this.option.legend.data[this.option.series.length - i++] = '';
               }
               if (this.option.series[0].data.length != 0) {
                 break;