|
|
@@ -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 => {
|