fix(测试用例): 修复选中一条用例时不显示更多操作按钮的问题
This commit is contained in:
parent
5927f0fc2b
commit
233e4e2ff8
|
@ -334,14 +334,10 @@
|
|||
},
|
||||
handleSelectAll(selection) {
|
||||
if (selection.length > 0) {
|
||||
if (selection.length === 1) {
|
||||
this.selectRows.add(selection[0]);
|
||||
} else {
|
||||
this.tableData.forEach(item => {
|
||||
this.$set(item, "showMore", true);
|
||||
this.selectRows.add(item);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.selectRows.clear();
|
||||
this.tableData.forEach(row => {
|
||||
|
@ -350,11 +346,6 @@
|
|||
}
|
||||
},
|
||||
handleSelectionChange(selection, row) {
|
||||
// if (this.selectIds.has(row.id)) {
|
||||
// this.selectIds.delete(row.id);
|
||||
// } else {
|
||||
// this.selectIds.add(row.id);
|
||||
// }
|
||||
if (this.selectRows.has(row)) {
|
||||
this.$set(row, "showMore", false);
|
||||
this.selectRows.delete(row);
|
||||
|
@ -362,17 +353,6 @@
|
|||
this.$set(row, "showMore", true);
|
||||
this.selectRows.add(row);
|
||||
}
|
||||
|
||||
let arr = Array.from(this.selectRows);
|
||||
|
||||
// 选中1个以上的用例时显示更多操作
|
||||
if (this.selectRows.size === 1) {
|
||||
this.$set(arr[0], "showMore", false);
|
||||
} else if (this.selectRows.size === 2) {
|
||||
arr.forEach(row => {
|
||||
this.$set(row, "showMore", true);
|
||||
})
|
||||
}
|
||||
},
|
||||
importTestCase() {
|
||||
this.$refs.testCaseImport.open();
|
||||
|
|
Loading…
Reference in New Issue