From c91d33e4ab58bdee9d4328adc2248495cc656c25 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期三, 18 八月 2021 19:15:03 +0800 Subject: [PATCH] update 优化 OSS 模块与上传组件 异常处理 --- ruoyi-ui/src/views/system/post/index.vue | 23 +++++++++-------------- 1 files changed, 9 insertions(+), 14 deletions(-) diff --git a/ruoyi-ui/src/views/system/post/index.vue b/ruoyi-ui/src/views/system/post/index.vue index 6532355..f5b77c7 100644 --- a/ruoyi-ui/src/views/system/post/index.vue +++ b/ruoyi-ui/src/views/system/post/index.vue @@ -74,6 +74,7 @@ plain icon="el-icon-download" size="mini" + :loading="exportLoading" @click="handleExport" v-hasPermi="['system:post:export']" >瀵煎嚭</el-button> @@ -112,7 +113,7 @@ </template> </el-table-column> </el-table> - + <pagination v-show="total>0" :total="total" @@ -155,7 +156,8 @@ </template> <script> -import { listPost, getPost, delPost, addPost, updatePost, exportPost } from "@/api/system/post"; +import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post"; +import { downLoadExcel } from "@/utils/download"; export default { name: "Post", @@ -163,6 +165,8 @@ return { // 閬僵灞� loading: true, + // 瀵煎嚭閬僵灞� + exportLoading: false, // 閫変腑鏁扮粍 ids: [], // 闈炲崟涓鐢� @@ -306,21 +310,12 @@ }).then(() => { this.getList(); this.msgSuccess("鍒犻櫎鎴愬姛"); - }) + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { - const queryParams = this.queryParams; - this.$confirm('鏄惁纭瀵煎嚭鎵�鏈夊矖浣嶆暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return exportPost(queryParams); - }).then(response => { - this.download(response.msg); - }) + downLoadExcel('/system/post/export', this.queryParams); } } }; -</script> \ No newline at end of file +</script> -- Gitblit v1.9.3