瀏覽代碼

增加loading

zy 1 年之前
父節點
當前提交
0dbb86db64

+ 5 - 2
neim-ui/src/views/statistical/airDensity/index.vue

@@ -38,7 +38,7 @@
           </el-select>
         </div>
 
-        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getListAirDensity">
+        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getListAirDensity" :loading="btuLoading">
           搜索
         </el-button>
       </div>
@@ -65,6 +65,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading:true,
       dataTime: [new Date(new Date().getFullYear(), new Date().getMonth() - 1, 1).getTime(), new Date(new Date().getFullYear(), new Date().getMonth(), 1)],
       cftId: '',
       uid: '1',
@@ -121,6 +122,7 @@ export default {
       }
     },
     async getListAirDensity() {
+      this.btuLoading=true
       const param = {
         startTime: new Date(this.dataTime[0]).getTime(),
         endTime: new Date(this.dataTime[1]).getTime(),
@@ -151,9 +153,10 @@ export default {
         }
         this.airData = res.rows[0]
         this.drawAirDensityInChart(this.airData)
-
+        this.btuLoading = false
       }).catch(err => {
         this.airChart.hideLoading();
+        this.btuLoading = false
         this.$message.error('获取空气密度数据异常')
         console.log('获取空气密度数据异常:' + err)
       })

+ 5 - 2
neim-ui/src/views/statistical/shear/index.vue

@@ -37,7 +37,7 @@
             </el-option>
           </el-select>
         </div>
-        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getListShear">搜索
+        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getListShear" :loading="btuLoading">搜索
         </el-button>
       </div>
       <div class="mainBox">
@@ -64,6 +64,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading:true,
       dataTime: [new Date(new Date().getFullYear(), new Date().getMonth() - 11, 1).getTime(), new Date(new Date().getFullYear(), new Date().getMonth(), 1)],
       // dateTime:new Date(new Date().getFullYear(),0).getTime(),
       cftId: '',
@@ -101,6 +102,7 @@ export default {
       })
     },
     async getListShear() {
+      this.btuLoading = true
       const param = {
         startTime: new Date(this.dataTime[0]).getTime(),
         endTime: new Date(this.dataTime[1]).getTime(),
@@ -129,9 +131,10 @@ export default {
         }
         this.shearData = res.rows[0]
         this.drawShearInChart(this.shearData)
-
+        this.btuLoading = false
       }).catch(err => {
         this.shearChart.hideLoading();
+        this.btuLoading = false
         this.$message.error('获取风速数据异常')
         console.log('获取风速数据异常:' + err)
       })

+ 16 - 12
neim-ui/src/views/statistical/statisticsWs/index.vue

@@ -16,16 +16,16 @@
           </el-select>
         </div>
         <div class="conditionTwo">
-        <span>时间:</span>
-        <el-date-picker
-          v-model="dataTime"
-          type="monthrange"
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-        >
-        </el-date-picker>
-      </div>
+          <span>时间:</span>
+          <el-date-picker
+            v-model="dataTime"
+            type="monthrange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+          >
+          </el-date-picker>
+        </div>
         <div class="conditionTwo">
           <span>时间维度:</span>
           <el-select v-model="uid" placeholder="请选择">
@@ -49,7 +49,8 @@
             </el-option>
           </el-select>
         </div>
-        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getListWs">搜索
+        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getListWs"
+                   :loading="btuLoading">搜索
         </el-button>
       </div>
       <div class="mainBox">
@@ -79,6 +80,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading: true,
       dataTime: [],
       cftId: '',
       uid: '1',
@@ -123,6 +125,7 @@ export default {
       })
     },
     async getListWs() {
+      this.btuLoading = true
       const param = {
         startTime: new Date(this.dataTime[0]).getTime(),
         endTime: new Date(this.dataTime[1]).getTime(),
@@ -157,9 +160,10 @@ export default {
         }
         this.wsData = res.rows[0]
         this.drawWsInChart(this.wsData)
-
+        this.btuLoading = false
       }).catch(err => {
         this.wsChart.hideLoading();
+        this.btuLoading = false
         this.$message.error('获取风速数据异常')
         console.log('获取风速数据异常:' + err)
       })

+ 5 - 2
neim-ui/src/views/statistical/turIntensity/index.vue

@@ -37,7 +37,7 @@
             </el-option>
           </el-select>
         </div>
-        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getListTurbulence">
+        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getListTurbulence" :loading="btuLoading">
           搜索
         </el-button>
       </div>
@@ -65,6 +65,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading:true,
       dataTime: [new Date(new Date().getFullYear(), new Date().getMonth() - 11, 1).getTime(), new Date(new Date().getFullYear(), new Date().getMonth(), 1)],
       cftId: '',
       value: '',
@@ -104,6 +105,7 @@ export default {
       })
     },
     async getListTurbulence() {
+      this.btuLoading = true
       const param = {
         startTime: new Date(this.dataTime[0]).getTime(),
         endTime: new Date(this.dataTime[1]).getTime(),
@@ -133,9 +135,10 @@ export default {
         }
         this.turData = res.rows[0]
         this.drawTurInChart(this.turData)
-
+        this.btuLoading = false
       }).catch(err => {
         this.turChart.hideLoading();
+        this.btuLoading = false
         this.$message.error('获取湍流数据异常')
         console.log('获取湍流数据异常:' + err)
       })

+ 5 - 1
neim-ui/src/views/statistical/windResources/index.vue

@@ -43,7 +43,7 @@
             </el-option>
           </el-select>
         </div>
-        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small"
+        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" :loading="btuLoading"
                    @click="seach">搜索
         </el-button>
       </div>
@@ -77,6 +77,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading: true,
       startTime: new Date(new Date().getFullYear() - 1, 0),
       endTime: new Date(new Date().getFullYear(), 0),
       cftId: '',
@@ -130,6 +131,7 @@ export default {
     },
     //年平均风速
     async getListWindResources() {
+      this.btuLoading = true
       const param = {
         startTime: new Date(this.startTime).getTime(),
         endTime: new Date(this.endTime).getTime(),
@@ -165,9 +167,11 @@ export default {
         this.windResourcesData = res.rows[0]
           this.drawWsYearInChart(this.windResourcesData)
           this.drawWpdYearInChart(this.wpdData)
+        this.btuLoading = false
       }).catch(err => {
         this.wsYearChart.hideLoading();
         this.wpdYearChart.hideLoading();
+        this.btuLoading = false
         this.$message.error('获取风速数据异常')
         console.log('获取风速数据异常:' + err)
       })

+ 5 - 2
neim-ui/src/views/statistical/windpowerDensity/index.vue

@@ -50,7 +50,7 @@
             </el-option>
           </el-select>
         </div>
-        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getListWpd">搜索
+        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getListWpd" :loading="btuLoading">搜索
         </el-button>
       </div>
       <div class="mainBox">
@@ -78,6 +78,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading:true,
       dataTime: [new Date(new Date().getFullYear(), new Date().getMonth() - 1, 1).getTime(), new Date(new Date().getFullYear(), new Date().getMonth(), 1)],
       cftId: '',
       uid: '1',
@@ -117,6 +118,7 @@ export default {
       })
     },
     async getListWpd() {
+      this.btuLoading = true
       const param = {
         startTime: new Date(this.dataTime[0]).getTime(),
         endTime: new Date(this.dataTime[1]).getTime(),
@@ -146,9 +148,10 @@ export default {
         }
         this.wpdData = res.rows[0]
         this.drawWpdInChart(this.wpdData)
-
+        this.btuLoading = false
       }).catch(err => {
         this.wpdChart.hideLoading();
+        this.btuLoading = false
         this.$message.error('获取风速数据异常')
         console.log('获取风速数据异常:' + err)
       })

+ 9 - 5
neim-ui/src/views/windResources/airDensity/index.vue

@@ -24,7 +24,8 @@
           end-placeholder="结束日期">
         </el-date-picker>
       </div>
-      <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="seachTPAndAirdensity">
+      <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="seachTPAndAirdensity"
+                 :loading="btuLoading">
         搜索
       </el-button>
     </div>
@@ -75,6 +76,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading: true,
       cftId: '',
       startDateAndEndDate: [],
       tableData: [],
@@ -143,6 +145,7 @@ export default {
       }
     },
     seachTPAndAirdensity() {
+      this.btuLoading = true
       this.tableLoading = true
       var param = {
         startTime: new Date(this.dataTime[0]).getTime(),
@@ -191,8 +194,9 @@ export default {
           this.TPChart.hideLoading();
           this.tableLoading = false
         }
-
+        this.btuLoading = false
       }).catch(err => {
+        this.btuLoading = false
         this.TPChart.hideLoading();
         this.$message.error('查询失败')
         console.log('获取风况数据异常:' + err)
@@ -248,7 +252,7 @@ export default {
           name: '温度(°C)',
           alignTicks: true,
           axisLine: {
-            show:true
+            show: true
           }
           // max: 50,
           // interval: 10,
@@ -266,10 +270,10 @@ export default {
           alignTicks: true,
           name: '压强(hpa)',
           axisLine: {
-            show:true
+            show: true
           },
           splitLine: {
-            show:true,
+            show: true,
             lineStyle: {
               type: 'dotted'
             }

+ 5 - 1
neim-ui/src/views/windResources/turIntensity/index.vue

@@ -38,7 +38,7 @@
             </el-option>
           </el-select>
         </div>
-        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getTurbulence">搜索
+        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getTurbulence" :loading="btuLoading">搜索
         </el-button>
       </div>
       <div class="mainBox">
@@ -68,6 +68,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading:true,
       dataTime: [new Date(new Date().toLocaleDateString()).getTime() - 168 * 60 * 60 * 1000, new Date(new Date().toLocaleDateString()).getTime()],
       options: [],
       allOptions: [],
@@ -133,6 +134,7 @@ export default {
   },
   methods: {
     getTurbulence() {
+      this.btuLoading = true
       const param =
         {
           startTime: new Date(this.dataTime[0]).getTime(),
@@ -185,8 +187,10 @@ export default {
           return bHeight - aHeight
         })
         this.drawTunInChart(this.turData)
+        this.btuLoading = false
         this.$message.success('查询成功')
       }).catch(err => {
+        this.btuLoading = false
         this.tunInChart.hideLoading();
         this.$message.error('查询失败')
         console.log('获取湍流数据异常:' + err)

+ 5 - 1
neim-ui/src/views/windResources/windCondition/index.vue

@@ -36,7 +36,7 @@
           </el-option>
         </el-select>
       </div>
-      <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getData">搜索
+      <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getData" :loading="btuLoading">搜索
       </el-button>
     </div>
     <div class="mainBox">
@@ -114,6 +114,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading:true,
       height: "10",
       charts: null,
       dataTime: [new Date(new Date().toLocaleDateString()).getTime() - 168 * 60 * 60 * 1000, new Date(new Date().toLocaleDateString()).getTime()],
@@ -230,6 +231,7 @@ export default {
       }
     },
     getData() {
+      this.btuLoading = true
       let param = {
         startTime: new Date(this.dataTime[0]).getTime(),
         endTime: new Date(this.dataTime[1]).getTime() - 1,
@@ -266,9 +268,11 @@ export default {
         }
         this.drawChart(res.data.AverageWindSpeed, res.data.WindPowerDensity)
         this.$message.success("查询成功")
+        this.btuLoading = false
       }).catch(err => {
         this.charts.hideLoading();
         this.$message.error('查询失败')
+        this.btuLoading = false
         console.log('获取风况数据异常:' + err)
       })
     },

+ 4 - 1
neim-ui/src/views/windResources/windRose/index.vue

@@ -37,7 +37,7 @@
             </el-option>
           </el-select>
         </div>
-        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="seachWindRose">搜索
+        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="seachWindRose" :loading="btuLoading">搜索
         </el-button>
       </div>
       <div class="mainBox">
@@ -65,6 +65,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading:true,
       height: "",
       loading: false,
       activeName: 'first',
@@ -129,6 +130,7 @@ export default {
   methods: {
     /*查询三个玫瑰图*/
     seachWindRose() {
+      this.btuLoading = true
       var param = {
         startTime: new Date(this.dataTime[0]).getTime(),
         endTime: new Date(this.dataTime[1]).getTime() - 1,
@@ -186,6 +188,7 @@ export default {
         this.$message.error('查询湍流玫瑰图异常')
         console.log("查询湍流玫瑰图异常:" + err)
       })
+      this.btuLoading = false
     },
     /*切换测风塔找到它对应的层高*/
     changeCft() {

+ 2 - 2
neim-ui/src/views/windResources/windShear/index.vue

@@ -95,7 +95,7 @@ export default {
   name: "index",
   data() {
     return {
-      btuLoading: false,
+      btuLoading: true,
       tableLoading: false,
       shearChart: null,
       cftId: '',
@@ -303,7 +303,7 @@ export default {
       let data = this.startDateAndEndDate.find(w => w.value == this.cftId)
       this.getDataTime(this.cftId)
       this.changeHeight(data)
-      // this.getWindShear()
+      this.getWindShear()
     },
     getDataTime(cftId) {
       this.dataTime = [new Date(new Date().toLocaleDateString()).getTime() - 168 * 60 * 60 * 1000, new Date(new Date().toLocaleDateString()).getTime()]

+ 5 - 1
neim-ui/src/views/windResources/windSpeedCurve/index.vue

@@ -38,7 +38,7 @@
             </el-option>
           </el-select>
         </div>
-        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getCharts">搜索
+        <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" :loading="btuLoading" @click="getCharts">搜索
         </el-button>
       </div>
       <div class="mainBox">
@@ -71,6 +71,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading: true,
       dataTime: [new Date(new Date().toLocaleDateString()).getTime() - 168 * 60 * 60 * 1000, new Date(new Date().toLocaleDateString()).getTime()],
       height: null,
       options: [],
@@ -151,6 +152,7 @@ export default {
     },
     /*搜索,默认搜索风速的曲线图*/
     async getCharts() {
+      this.btuLoading = true
       const param =
         {
           startTime: new Date(this.dataTime[0]).getTime(),
@@ -209,7 +211,9 @@ export default {
         //曲线图
         this.wdData = res.data.wd[0]
         this.drawWdChart(this.wdData, this.timeData)
+        this.btuLoading = false
       }).catch(err => {
+        this.btuLoading = false
         this.wsChart.hideLoading();
         this.wdChart.hideLoading();
         this.$message.error('获取风速数据异常')

+ 11 - 4
neim-ui/src/views/windResources/wsFrequency/index.vue

@@ -35,7 +35,7 @@
           </el-option>
         </el-select>
       </div>
-      <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getData">搜索
+      <el-button class="seachBtu" type="primary" plain icon="el-icon-search" size="small" @click="getData" :loading="btuLoading">搜索
       </el-button>
     </div>
     <div class="mainBox">
@@ -63,6 +63,7 @@ export default {
   name: "index",
   data() {
     return {
+      btuLoading:true,
       frequeryChart: null,
       dataTime: [new Date(new Date().toLocaleDateString()).getTime() - 168 * 60 * 60 * 1000, new Date(new Date().toLocaleDateString()).getTime()],
       height: "10",
@@ -144,6 +145,7 @@ export default {
       }
     },
     getData() {
+      this.btuLoading = true
       var param = {
         startTime: new Date(this.dataTime[0]).getTime(),
         endTime: new Date(this.dataTime[1]).getTime() - 1,
@@ -178,7 +180,9 @@ export default {
             wsFrequery.push([wsFreData[j].ws, wsFreData[j].cont])
           }
           this.drawFrequeryChart(parameter, wsFrequery)
+          this.btuLoading = false
         } else {
+          this.btuLoading = false
           this.$message.warning('此时间段测风塔没有数据')
           this.frequeryChart.hideLoading();
         }
@@ -229,8 +233,10 @@ export default {
         xAxis: {
           name: '风速区间 [x-0.5,x+0.5)',
           type: 'category',
-          axisLabel: {interval: 1},
-          axisTick: {alignWithLabel: true},
+          axisLabel: {
+            // interval: 1
+          },
+          // axisTick: {alignWithLabel: true},
           nameLocation: 'center',
           nameGap: 25,
           data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
@@ -260,6 +266,7 @@ export default {
         series: [{
           name: '风速频率(%)',
           type: 'bar',
+          // barWidth: '98%',
           smooth: false,
           symbol: 'none', // 这句就是去掉点的
           data: ws
@@ -308,7 +315,7 @@ export default {
 }
 
 #frequeryChart {
-  width: 100%;
+  width: 95%;
   height: calc(71vh);
 }