|
@@ -276,6 +276,38 @@ export default {
|
|
|
if (data.dat.length) {
|
|
if (data.dat.length) {
|
|
|
for (var j = 0; j < data.dat.length; j++) {
|
|
for (var j = 0; j < data.dat.length; j++) {
|
|
|
if(data.dat[j].result == '0'){
|
|
if(data.dat[j].result == '0'){
|
|
|
|
|
+ if (j == data.dat.length - 1) {
|
|
|
|
|
+ this.currPests = worm
|
|
|
|
|
+ this.currAtData = atData
|
|
|
|
|
+ this.currAhData = ahData
|
|
|
|
|
+ this.currWorm = worm
|
|
|
|
|
+ this.currKind = kind
|
|
|
|
|
+ this.chartLineInit(atData,ahData,worm[0],this.allPest[kind[0]])
|
|
|
|
|
+ this.chartsShow = true;
|
|
|
|
|
+ this.viewSwitch2 = this.allPest[kind[0]]
|
|
|
|
|
+ var drawPieChartData = [];
|
|
|
|
|
+ // 饼状图
|
|
|
|
|
+ for (var ss = 0; ss < worm.length; ss++) {
|
|
|
|
|
+ var currWormTotal = 0;
|
|
|
|
|
+ console.log(ss)
|
|
|
|
|
+ console.log(worm)
|
|
|
|
|
+ console.log(worm[ss])
|
|
|
|
|
+ for (var sss = 0; sss < worm[ss].length; sss++) {
|
|
|
|
|
+ currWormTotal += worm[ss][sss][1];
|
|
|
|
|
+ if (sss == worm[ss].length - 1) {
|
|
|
|
|
+ drawPieChartData.push({
|
|
|
|
|
+ name: this.allPest[kind[ss]],
|
|
|
|
|
+ key: ss,
|
|
|
|
|
+ y: currWormTotal
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ss == worm.length - 1) {
|
|
|
|
|
+ this.chartPieInit(drawPieChartData)
|
|
|
|
|
+ this.chartsShowA = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
var secondArr = [];
|
|
var secondArr = [];
|
|
@@ -294,6 +326,8 @@ export default {
|
|
|
worm[wormIndex] = [thirdlyArr];
|
|
worm[wormIndex] = [thirdlyArr];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(j);
|
|
|
|
|
+
|
|
|
if (j == data.dat.length - 1) {
|
|
if (j == data.dat.length - 1) {
|
|
|
this.currPests = worm
|
|
this.currPests = worm
|
|
|
this.currAtData = atData
|
|
this.currAtData = atData
|