From eb935ac81cfa4992629efb8494acbe02701e616a Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 13 十二月 2023 18:17:09 +0800
Subject: [PATCH] 堆叠折线图 主数据导出加入Loading

---
 Source/UBCS-WEB/src/components/Master/MasterTransfer.vue |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
index 08d4d34..98475f9 100644
--- a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
+++ b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
@@ -14,7 +14,7 @@
                                                                       style="width: 150px"></el-input> 锛堣緭鍏ラ〉鐮佹垨鑰呴〉闈㈣寖鍥达紝濡傦細1-10锛�</span>
       </div>
     </div>
-    <div style="text-align: center">
+    <div v-loading="isLoading" style="text-align: center">
       <el-transfer
         v-model="value"
         :data="data"
@@ -44,6 +44,7 @@
       pageExport: "",
       data: [],
       value: [],
+      isLoading: false,
       filterMethod(query, item) {
         return item.label.indexOf(query) > -1;
       },
@@ -156,6 +157,7 @@
         if (this.selectRow.length <= 0) {
           this.$message.warning('璇烽�夋嫨瑕佸鍑虹殑妯℃澘')
         } else {
+          this.isLoading = true;
           //宸查�夋嫨澶氶��
           const selectList = []
           //宸查�夋嫨灞炴��
@@ -178,6 +180,9 @@
             }).then(res => {
               this.handlerFile(res);
               this.escHandler();
+              this.isLoading = false;
+            }).catch(error => {
+              this.isLoading = false;
             })
           } else {
 
@@ -188,12 +193,15 @@
               // console.log('res',res)
               this.handlerFile(res);
               this.escHandler();
-
+              this.isLoading = false;
+            }).catch(error => {
+              this.isLoading = false;
             })
 
           }
         }
       } else if (this.radio === 1) {
+        this.isLoading = true;
         if (this.value <= 0) {
           this.tableHeadData.map(item => item.prop)
             .forEach((prop, index) => {
@@ -203,12 +211,18 @@
             if (res) {
               func.downloadFileByBlobHandler(res);
               this.escHandler();
+              this.isLoading = false;
             }
+          }).catch(error => {
+            this.isLoading = false;
           })
         } else {
           exportCode({codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: -1}).then(res => {
             this.handlerFile(res);
             this.escHandler();
+            this.isLoading = false;
+          }).catch(error => {
+            this.isLoading = false;
           })
         }
       } else if (this.radio === 2) {
@@ -237,6 +251,7 @@
           }
         }
         if (this.value >= 1) {
+          this.isLoading = true;
           exportCode({
             codeClassifyOid: this.codeClassifyOid, ...this.exportArr,
             limit: this.limit,
@@ -246,9 +261,12 @@
             // console.log('res',res)
             this.handlerFile(res);
             this.escHandler();
-
+            this.isLoading = false;
+          }).catch(error => {
+            this.isLoading = false;
           });
         } else {
+          this.isLoading = true;
           this.tableHeadData.map(item => item.prop)
             .forEach((prop, index) => {
               this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop;
@@ -259,10 +277,12 @@
             page: start,
             endPage: end
           }).then(res => {
-            // console.log('res', res)
+            this.isLoading = false;
             this.handlerFile(res);
             this.escHandler();
-          })
+          }).catch(error => {
+            this.isLoading = false;
+          });
         }
       }
     },

--
Gitblit v1.9.3