From 60076cbbe1da6cc8ed3a4ebb8f67e92ea9be9e4a Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期二, 15 八月 2023 16:02:58 +0800
Subject: [PATCH] 设置按钮的加载效果

---
 src/views/analysis/graph/ExceedingRate.vue |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/src/views/analysis/graph/ExceedingRate.vue b/src/views/analysis/graph/ExceedingRate.vue
index 0dd1fac..4ef5a7f 100644
--- a/src/views/analysis/graph/ExceedingRate.vue
+++ b/src/views/analysis/graph/ExceedingRate.vue
@@ -1,22 +1,11 @@
 <template>
   <div>
     <el-container>
-      <!-- <el-header style="text-align:right; font-size:15px ">
-         <i class="el-icon-s-data" style="font-size: 15px;color:rgb(226,207,207);margin-right:10px;"></i>
-        <span style="color:rgb(226,207,207);">鏁版嵁瓒呮爣鐜�</span>
-     </el-header> -->
 
       <el-main>
         <el-form :inline="true" :model="form" class="demo-form-inline">
           <el-form-item label="搴楅摵鍚嶅拰璁惧缂栧彿">
-            <!-- <el-select class="checkbox" v-model="devId" placeholder="璇烽�夋嫨璁惧缂栧彿">
-          <el-option
-            v-for="item in options"
-            :key="item.label"
-            :label="item.label"
-            :value="item.label">
-          </el-option>
-        </el-select> -->
+
             <el-cascader
               :options="options"
               :show-all-levels="false"
@@ -49,7 +38,7 @@
           </el-form-item>
 
           <el-form-item>
-            <el-button type="primary" @click="fetchData">灞曠ず鍥�</el-button>
+            <el-button type="primary" :loading="button.showChartButton" @click="fetchData">灞曠ず鍥�</el-button>
           </el-form-item>
         </el-form>
 
@@ -68,6 +57,10 @@
 export default {
   data() {
     return {
+      button:{
+        // 灞曠ず鍥剧殑鎸夐挳
+        showChartButton:false,
+      },
       isNoData:false,
       loading: false,
       chartData: [], //淇濆瓨鏌ヨ鐨勭粨鏋�
@@ -254,12 +247,14 @@
         params['end'] = this.end;
       }
       this.loading = true;
+      this.button.showChartButton = true
       axiosInstanceInstance
         .get('/data/id', { params: params })
         .then((response) => {
           
           this.chartData = response.data.data;
           this.loading = false;
+          this.button.showChartButton = false
           if(response.data.data.length==0){
           alert('璇ユ椂娈垫棤鏁版嵁')
           this.isNoData = true

--
Gitblit v1.9.3