Parcourir la source

fix:优化下载加载效果

xiexaing il y a 1 an
Parent
commit
5d9812de86
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      src/views/education/archives/fileDownload.vue

+ 5 - 1
src/views/education/archives/fileDownload.vue

@@ -12,7 +12,7 @@
         </el-table-column>
         <el-table-column fixed="right" label="操作" width="100" align="center">
           <template slot-scope="scope">
-            <el-button type="text" size="small" @click="handleDown(scope.row)"
+            <el-button type="text" size="small" :loading="scope.row.loading" @click="handleDown(scope.row)"
               >下载</el-button
             >
           </template>
@@ -93,6 +93,7 @@ export default {
         type: "warning",
       })
         .then(() => {
+          this.$set(row, 'loading', true)
           this.$api
             .userdangAndatadownload({
               userIds: this.userList,
@@ -102,6 +103,9 @@ export default {
               this.$message.success("操作成功,正在下载");
               if (!isDownRecord) this.handleDownFlieName(res.msg, row.name)
               this.$store.dispatch("downloadlist", true);
+            })
+            .finally(() => {
+              this.$set(row, 'loading', false)
             });
         })
         .catch(() => {});