fix(测试用例): 修复选中一条用例时不显示更多操作按钮的问题

This commit is contained in:
shiziyuan9527 2020-09-27 14:31:58 +08:00
parent 5927f0fc2b
commit 233e4e2ff8
1 changed files with 4 additions and 24 deletions

View File

@ -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);
});
}
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();