From 0375fd319c9f3b08d255c814cb0f8521d8ec641b Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期三, 18 八月 2021 11:11:24 +0800 Subject: [PATCH] !78 同步dev分支 Merge pull request !78 from 疯狂的狮子Li/dev --- ruoyi-generator/src/main/resources/vm/vue/index.vue.vm | 39 +++++++++++++++------------------------ 1 files changed, 15 insertions(+), 24 deletions(-) diff --git a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm index 1fc2bcc..b4349c1 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -108,7 +108,7 @@ plain icon="el-icon-download" size="mini" - :loading="exportLoading" + :loading="exportLoading" @click="handleExport" v-hasPermi="['${moduleName}:${businessName}:export']" >瀵煎嚭</el-button> @@ -307,7 +307,8 @@ </template> <script> -import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}"; +import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"; +import { downLoadExcel } from "@/utils/download"; export default { name: "${BusinessName}", @@ -561,7 +562,9 @@ this.loading = false; this.getList(); this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + }).finally(() => { + this.loading = false; + }); }, #if($table.sub) /** ${subTable.functionName}搴忓彿 */ @@ -582,35 +585,23 @@ /** ${subTable.functionName}鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete${subClassName}() { if (this.checked${subClassName}.length == 0) { - this.$alert("璇峰厛閫夋嫨瑕佸垹闄ょ殑${subTable.functionName}鏁版嵁", "鎻愮ず", { confirmButtonText: "纭畾", }); + this.msgError("璇峰厛閫夋嫨瑕佸垹闄ょ殑${subTable.functionName}鏁版嵁"); } else { - this.${subclassName}List.splice(this.checked${subClassName}[0].index - 1, 1); + const ${subclassName}List = this.${subclassName}List; + const checked${subClassName} = this.checked${subClassName}; + this.${subclassName}List = ${subclassName}List.filter(function(item) { + return checked${subClassName}.indexOf(item.index) == -1 + }); } }, - /** 鍗曢�夋閫変腑鏁版嵁 */ + /** 澶嶉�夋閫変腑鏁版嵁 */ handle${subClassName}SelectionChange(selection) { - if (selection.length > 1) { - this.$refs.${subclassName}.clearSelection(); - this.$refs.${subclassName}.toggleRowSelection(selection.pop()); - } else { - this.checked${subClassName} = selection; - } + this.checked${subClassName} = selection.map(item => item.index) }, #end /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { - const queryParams = this.queryParams; - this.$confirm('鏄惁纭瀵煎嚭鎵�鏈�${functionName}鏁版嵁椤�?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(() => { - this.exportLoading = true; - return export${BusinessName}(queryParams); - }).then(response => { - this.download(response.msg); - this.exportLoading = false; - }).catch(() => {}); + downLoadExcel('/${moduleName}/${businessName}/export', this.queryParams); } } }; -- Gitblit v1.9.3