소스 검색

Merge branch 'master' of http://git.jiayuepowertech.com:9022/JYDL/neim

hxf 1 년 전
부모
커밋
97f09eda74
1개의 변경된 파일60개의 추가작업 그리고 30개의 파일을 삭제
  1. 60 30
      neim-ui/src/views/statistical/windResources/index.vue

+ 60 - 30
neim-ui/src/views/statistical/windResources/index.vue

@@ -44,7 +44,7 @@
           </el-select>
         </div>
         <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small"
-                   @click="getListWindResources">搜索
+                   @click="seach">搜索
         </el-button>
       </div>
       <div class="mainBox">
@@ -124,6 +124,10 @@ export default {
         this.getListP()
       })
     },
+    seach(){
+      this.getListWindResources()
+      this.getListP()
+    },
     //年平均风速
     async getListWindResources() {
       const param = {
@@ -135,6 +139,9 @@ export default {
       if (!this.wsYearChart) {
         this.wsYearChart = this.$echarts.init(document.getElementById('wsYearChart'))
       }
+      if (!this.wpdYearChart) {
+        this.wpdYearChart = this.$echarts.init(document.getElementById('wpdYearChart'))
+      }
 
       // 调用showLoading方法
       this.wsYearChart.showLoading({
@@ -144,15 +151,23 @@ export default {
         maskColor: 'rgba(255, 255, 255, 0.2)',
         zlevel: 0,
       });
+      this.wpdYearChart.showLoading({
+        text: 'loading',
+        color: '#c23531',
+        textColor: '#000',
+        maskColor: 'rgba(255, 255, 255, 0.2)',
+        zlevel: 0,
+      });
       await listWindResources(param).then(async res => {
         //风功率密度数据
         this.wpdData = res.rows[1]
         this.wpdDisabled = false
         this.windResourcesData = res.rows[0]
-        this.drawWsYearInChart(this.windResourcesData)
-
+          this.drawWsYearInChart(this.windResourcesData)
+          this.drawWpdYearInChart(this.wpdData)
       }).catch(err => {
         this.wsYearChart.hideLoading();
+        this.wpdYearChart.hideLoading();
         this.$message.error('获取风速数据异常')
         console.log('获取风速数据异常:' + err)
       })
@@ -186,11 +201,20 @@ export default {
         endTime: new Date(this.endTime).getTime(),
         eqId: this.cftId,
       }
+      if (!this.pYearChart) {
+        this.pYearChart = this.$echarts.init(document.getElementById('pYearChart'))
+      }
+      this.pYearChart.showLoading({
+        text: 'loading',
+        color: '#c23531',
+        textColor: '#000',
+        maskColor: 'rgba(255, 255, 255, 0.2)',
+        zlevel: 0,
+      });
       listDensity(param).then(async res => {
-
         this.pData = res.rows
         this.airDisabled = false
-        // this.drawPYearInChart(this.pData)
+        this.drawPYearInChart(this.pData)
 
       }).catch(err => {
         this.pYearChart.hideLoading();
@@ -202,7 +226,9 @@ export default {
 
     //年平均风速曲线图
     drawWsYearInChart(data) {
-      this.wsYearChart = this.$echarts.init(document.getElementById('wsYearChart'))
+      if (!this.wsYearChart) {
+        this.wsYearChart = this.$echarts.init(document.getElementById('wsYearChart'))
+      }
       /*拼接曲线图的serise*/
       let serise = []
       let legend = []
@@ -297,7 +323,9 @@ export default {
     },
     //风功率密度图
     drawWpdYearInChart(data) {
-      this.wpdYearChart = this.$echarts.init(document.getElementById('wpdYearChart'))
+      if (!this.wpdYearChart) {
+        this.wpdYearChart = this.$echarts.init(document.getElementById('wpdYearChart'))
+      }
       /*拼接曲线图的serise*/
       let serise = []
       let legend = []
@@ -391,7 +419,9 @@ export default {
     },
     //空气密度图
     drawPYearInChart(data) {
-      this.pYearChart = this.$echarts.init(document.getElementById('pYearChart'))
+      if (!this.pYearChart) {
+        this.pYearChart = this.$echarts.init(document.getElementById('pYearChart'))
+      }
       /*拼接曲线图的serise*/
       let serise = []
       let legend = []
@@ -511,34 +541,34 @@ export default {
       } else if (this.activeName == 'second') {
         this.wpdYearChart = null
         this.$nextTick(() => {
-          if (!this.wpdYearChart) {
-            this.wpdYearChart = this.$echarts.init(document.getElementById('wpdYearChart'))
-          }
-          // 调用showLoading方法
-          this.wpdYearChart.showLoading({
-            text: 'loading',
-            color: '#c23531',
-            textColor: '#000',
-            maskColor: 'rgba(255, 255, 255, 0.2)',
-            zlevel: 0,
-          });
+        //   if (!this.wpdYearChart) {
+        //     this.wpdYearChart = this.$echarts.init(document.getElementById('wpdYearChart'))
+        //   }
+        //   // 调用showLoading方法
+        //   this.wpdYearChart.showLoading({
+        //     text: 'loading',
+        //     color: '#c23531',
+        //     textColor: '#000',
+        //     maskColor: 'rgba(255, 255, 255, 0.2)',
+        //     zlevel: 0,
+        //   });
           this.drawWpdYearInChart(this.wpdData)
           this.wpdYearChart.resize()
         })
       } else if (this.activeName == 'third') {
         this.pYearChart = null
         this.$nextTick(() => {
-          if (!this.pYearChart) {
-            this.pYearChart = this.$echarts.init(document.getElementById('pYearChart'))
-          }
-          // 调用showLoading方法
-          this.pYearChart.showLoading({
-            text: 'loading',
-            color: '#c23531',
-            textColor: '#000',
-            maskColor: 'rgba(255, 255, 255, 0.2)',
-            zlevel: 0,
-          });
+          // if (!this.pYearChart) {
+          //   this.pYearChart = this.$echarts.init(document.getElementById('pYearChart'))
+          // }
+          // // 调用showLoading方法
+          // this.pYearChart.showLoading({
+          //   text: 'loading',
+          //   color: '#c23531',
+          //   textColor: '#000',
+          //   maskColor: 'rgba(255, 255, 255, 0.2)',
+          //   zlevel: 0,
+          // });
           this.drawPYearInChart(this.pData)
           this.pYearChart.resize()
         })