Parcourir la source

添加导出loading

朱鑫波 il y a 3 ans
Parent
commit
e8f9216d1c
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      src/views/modules/Statistics/saleStatistics/index.vue

+ 4 - 1
src/views/modules/Statistics/saleStatistics/index.vue

@@ -373,7 +373,7 @@
             <a-col :xl="24">
                 <a-spin :spinning="signatureStatus">
                     <a-card title="项目消耗排行榜" style="width: 100%" :bordered="false">
-                        <a-button type="primary" @click="exportExcel" slot="extra">下载</a-button>
+                        <a-button type="primary" @click="exportExcel" slot="extra" :loading="downloadLoading">下载</a-button>
 
                         <a-table
                             bordered
@@ -475,6 +475,7 @@ export default {
                 },
             },
             accountList: [],
+            downloadLoading:false,
             active: 'cost',
             groupDisabled: false,
             timeShowEchartsStatus: true,
@@ -1126,6 +1127,7 @@ export default {
             })
         },
         exportExcel() {
+            this.downloadLoading = true
             let params = {}
             params.mediaId = this.mediaDimension === 'a' ? 1 : 2
             params.startTime = this.dateValue.length === 2 ? moment(this.dateValue[0]).format('YYYY-MM-DD') : null
@@ -1137,6 +1139,7 @@ export default {
                 let blob = new Blob([res], {
                     type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
                 })
+                this.downloadLoading = false
                 let downloadElement = document.createElement('a')
                 let href = window.URL.createObjectURL(blob) //创建下载的链接
                 downloadElement.href = href