fix(接口测试): 修复报告批量删除时展示数量与选中数量不一致的问题
This commit is contained in:
parent
5b7dda9825
commit
9e09d24323
|
@ -126,6 +126,7 @@ export default {
|
||||||
let data = response.data;
|
let data = response.data;
|
||||||
this.total = data.itemCount;
|
this.total = data.itemCount;
|
||||||
this.tableData = data.listObject;
|
this.tableData = data.listObject;
|
||||||
|
this.selectRows.clear();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
|
@ -171,28 +172,13 @@ export default {
|
||||||
this.$set(row, "showMore", true);
|
this.$set(row, "showMore", true);
|
||||||
this.selectRows.add(row);
|
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);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handleSelectAll(selection) {
|
handleSelectAll(selection) {
|
||||||
if (selection.length > 0) {
|
if (selection.length > 0) {
|
||||||
if (selection.length === 1) {
|
|
||||||
this.selectRows.add(selection[0]);
|
|
||||||
} else {
|
|
||||||
this.tableData.forEach(item => {
|
this.tableData.forEach(item => {
|
||||||
this.$set(item, "showMore", true);
|
this.$set(item, "showMore", true);
|
||||||
this.selectRows.add(item);
|
this.selectRows.add(item);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.selectRows.clear();
|
this.selectRows.clear();
|
||||||
this.tableData.forEach(row => {
|
this.tableData.forEach(row => {
|
||||||
|
|
|
@ -222,28 +222,13 @@ export default {
|
||||||
this.$set(row, "showMore", true);
|
this.$set(row, "showMore", true);
|
||||||
this.selectRows.add(row);
|
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);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handleSelectAll(selection) {
|
handleSelectAll(selection) {
|
||||||
if (selection.length > 0) {
|
if (selection.length > 0) {
|
||||||
if (selection.length === 1) {
|
|
||||||
this.selectRows.add(selection[0]);
|
|
||||||
} else {
|
|
||||||
this.tableData.forEach(item => {
|
this.tableData.forEach(item => {
|
||||||
this.$set(item, "showMore", true);
|
this.$set(item, "showMore", true);
|
||||||
this.selectRows.add(item);
|
this.selectRows.add(item);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.selectRows.clear();
|
this.selectRows.clear();
|
||||||
this.tableData.forEach(row => {
|
this.tableData.forEach(row => {
|
||||||
|
|
Loading…
Reference in New Issue