From f02743bde53161ba58fde2a27aaa80ce1498f0a7 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 13 Aug 2021 14:50:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E4=B8=BB?= =?UTF-8?q?=E5=AD=90=E8=A1=A8=E5=A4=9A=E9=80=89=E8=A1=8C=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/vm/vue/index.vue.vm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 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 caaf9e10..6f21c317 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']" >导出 @@ -573,19 +573,18 @@ export default { /** ${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 /** 导出按钮操作 */