From bf86e5979bfe85a9ea82d5d1d33c84c6562b06bf Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期二, 24 八月 2021 14:28:20 +0800 Subject: [PATCH] update 重构 将下载excel工具提取到全局 --- ruoyi-generator/src/main/resources/vm/vue/index.vue.vm | 22 ++++++++++------------ 1 files changed, 10 insertions(+), 12 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 9cde389..bf0fe5f 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> @@ -308,7 +308,6 @@ <script> import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"; -import { downLoadExcel } from "@/utils/download"; export default { name: "${BusinessName}", @@ -585,24 +584,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() { - downLoadExcel('/${moduleName}/${businessName}/export', this.queryParams); + this.downLoadExcel('/${moduleName}/${businessName}/export', this.queryParams); } } }; -- Gitblit v1.9.3