|
|
@@ -570,19 +570,18 @@ export default {
|
|
570
|
570
|
/** ${subTable.functionName}删除按钮操作 */
|
|
571
|
571
|
handleDelete${subClassName}() {
|
|
572
|
572
|
if (this.checked${subClassName}.length == 0) {
|
|
573
|
|
- this.$alert("请先选择要删除的${subTable.functionName}数据", "提示", { confirmButtonText: "确定", });
|
|
|
573
|
+ this.msgError("请先选择要删除的${subTable.functionName}数据");
|
|
574
|
574
|
} else {
|
|
575
|
|
- this.${subclassName}List.splice(this.checked${subClassName}[0].index - 1, 1);
|
|
|
575
|
+ const ${subclassName}List = this.${subclassName}List;
|
|
|
576
|
+ const checked${subClassName} = this.checked${subClassName};
|
|
|
577
|
+ this.${subclassName}List = ${subclassName}List.filter(function(item) {
|
|
|
578
|
+ return checked${subClassName}.indexOf(item.index) == -1
|
|
|
579
|
+ });
|
|
576
|
580
|
}
|
|
577
|
581
|
},
|
|
578
|
|
- /** 单选框选中数据 */
|
|
|
582
|
+ /** 复选框选中数据 */
|
|
579
|
583
|
handle${subClassName}SelectionChange(selection) {
|
|
580
|
|
- if (selection.length > 1) {
|
|
581
|
|
- this.$refs.${subclassName}.clearSelection();
|
|
582
|
|
- this.$refs.${subclassName}.toggleRowSelection(selection.pop());
|
|
583
|
|
- } else {
|
|
584
|
|
- this.checked${subClassName} = selection;
|
|
585
|
|
- }
|
|
|
584
|
+ this.checked${subClassName} = selection.map(item => item.index)
|
|
586
|
585
|
},
|
|
587
|
586
|
#end
|
|
588
|
587
|
/** 导出按钮操作 */
|