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/OnlineRate.vue |   24 ++++++++----------------
 1 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/src/views/analysis/graph/OnlineRate.vue b/src/views/analysis/graph/OnlineRate.vue
index b1d220c..1b50852 100644
--- a/src/views/analysis/graph/OnlineRate.vue
+++ b/src/views/analysis/graph/OnlineRate.vue
@@ -1,23 +1,9 @@
 <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-form-item label="搴楅摵鍚嶅拰璁惧缂栧彿">
         <el-cascader 
             :options="options" 
@@ -48,7 +34,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>
 
@@ -67,6 +53,10 @@
   export default {
     data() {
       return {
+        button:{
+        // 灞曠ず鍥剧殑鎸夐挳
+        showChartButton:false,
+      },
         isNoData:false,
         loading:false,
         chartData: [],     //淇濆瓨鏌ヨ鐨勭粨鏋�
@@ -223,11 +213,13 @@
           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