Browse Source

优化水用量分析页面

duanxiaoduan 1 year ago
parent
commit
5cf2dfb96b
1 changed files with 22 additions and 2 deletions
  1. 22 2
      src/views/report/queryWater/index.vue

+ 22 - 2
src/views/report/queryWater/index.vue

@@ -376,7 +376,22 @@ export default {
           this.chart_data4.line =0
           this.total = 0
         }
-        this.getChart5Parm.parammaps.date = response.data.data2[0]
+        if(response.data.data1 == null){
+          this.chart_data4.data_name = []
+        }
+        if(response.data.data2 == null ){
+          this.chart_data4.xdata = []
+          this.getChart5Parm.parammaps.date = ''
+        }else{
+          this.getChart5Parm.parammaps.date = response.data.data2[0]
+        }
+        if(response.data.data3 == null){
+          this.chart_data4.data1 = []
+        }
+        if(response.data.all == null ){
+          this.total = 0
+        }
+
         console.log(this.chart_data4,'chart_data4')
         this.roadChart4(this.chart_data4)
         this.getChart5()
@@ -448,7 +463,12 @@ export default {
             xdata:[]
           }
         }
-        this.getChart7Parm.parammaps.date = response.data.chart_data.months[0]
+        if(response.data.chart_data.months){
+          this.getChart7Parm.parammaps.date = response.data.chart_data.months[0]
+        }else{
+          this.getChart7Parm.parammaps.date = ''
+        }
+        
         this.roadChart6(this.chart_data6)
         this.getChart7()
       })