Pārlūkot izejas kodu

一些跳转问题

zhangsijie 1 gadu atpakaļ
vecāks
revīzija
f4b628006e
1 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  1. 7 2
      minggao/src/page/home/newHome/deviceHome.vue

+ 7 - 2
minggao/src/page/home/newHome/deviceHome.vue

@@ -517,7 +517,9 @@ export default {
         this.pestTypeList.push(newArray);
         this.pestTypeBar.push(res.data.data);
         if (index != this.activeIndex) return
-        this.initCharByIndex(this.activeIndex, 'count');
+        if (this.pestTypeBar.length > this.activeIndex) {
+          this.initCharByIndex(this.activeIndex, 'count');
+        }
       })
     },
     // 获取虫害图片数据
@@ -570,7 +572,10 @@ export default {
           value: res.data.data.day.pestName[0]
         });
         if (index != this.activeIndex) return
-        this.initCharByIndex(this.activeIndex, 'pestDate');
+
+        if (this.pestLineDate.length > this.activeIndex) {
+          this.initCharByIndex(this.activeIndex, 'pestDate');
+        }
         // let xData = [];
         // let yData = [];
         // res.data.data.day.countInfo.forEach(pest => {