正在显示
1 个修改的文件
包含
8 行增加
和
9 行删除
| @@ -573,19 +573,18 @@ export default { | @@ -573,19 +573,18 @@ export default { | ||
| 573 | /** ${subTable.functionName}删除按钮操作 */ | 573 | /** ${subTable.functionName}删除按钮操作 */ |
| 574 | handleDelete${subClassName}() { | 574 | handleDelete${subClassName}() { |
| 575 | if (this.checked${subClassName}.length == 0) { | 575 | if (this.checked${subClassName}.length == 0) { |
| 576 | - this.$alert("请先选择要删除的${subTable.functionName}数据", "提示", { confirmButtonText: "确定", }); | 576 | + this.msgError("请先选择要删除的${subTable.functionName}数据"); |
| 577 | } else { | 577 | } else { |
| 578 | - this.${subclassName}List.splice(this.checked${subClassName}[0].index - 1, 1); | 578 | + const ${subclassName}List = this.${subclassName}List; |
| 579 | + const checked${subClassName} = this.checked${subClassName}; | ||
| 580 | + this.${subclassName}List = ${subclassName}List.filter(function(item) { | ||
| 581 | + return checked${subClassName}.indexOf(item.index) == -1 | ||
| 582 | + }); | ||
| 579 | } | 583 | } |
| 580 | }, | 584 | }, |
| 581 | - /** 单选框选中数据 */ | 585 | + /** 复选框选中数据 */ |
| 582 | handle${subClassName}SelectionChange(selection) { | 586 | handle${subClassName}SelectionChange(selection) { |
| 583 | - if (selection.length > 1) { | ||
| 584 | - this.$refs.${subclassName}.clearSelection(); | ||
| 585 | - this.$refs.${subclassName}.toggleRowSelection(selection.pop()); | ||
| 586 | - } else { | ||
| 587 | - this.checked${subClassName} = selection; | ||
| 588 | - } | 587 | + this.checked${subClassName} = selection.map(item => item.index) |
| 589 | }, | 588 | }, |
| 590 | #end | 589 | #end |
| 591 | /** 导出按钮操作 */ | 590 | /** 导出按钮操作 */ |
-
请 注册 或 登录 后发表评论