fix: 一键运行同一项目报错提示

This commit is contained in:
wenyann 2020-08-27 15:51:44 +08:00
parent d8094b3907
commit 98b0391234
2 changed files with 22 additions and 20 deletions

View File

@ -128,23 +128,25 @@ export default {
},
handleSelectAll(selection) {
if (selection.length > 0) {
this.tableData.forEach(item => {
this.selectIds.add(item.id);
this.selectProjectNames.add(item.projectName)
});
} else {
this.selectIds.clear()
this.selectProjectNames.clear()
this.selectNames.clear()
if (selection.length > 0) {
selection.forEach(s => {
this.selectIds.add(s.id)
this.selectProjectNames.add(s.projectName)
})
}
},
selectionChange(selection, row) {
if (this.selectIds.has(row.id)) {
this.selectIds.delete(row.id);
this.selectProjectNames.delete(row.projectName)
} else {
this.selectIds.add(row.id);
this.selectProjectNames.add(row.projectName)
selectionChange(selection) {
this.selectIds.clear()
this.selectProjectNames.clear()
this.selectNames.clear()
if (selection.length > 0) {
selection.forEach(s => {
this.selectIds.add(s.id)
this.selectProjectNames.add(s.projectName)
})
}
},
runTest() {
@ -200,6 +202,9 @@ export default {
this.$refs.apiCopy.open(test);
},
init() {
this.selectIds.clear()
this.selectProjectNames.clear()
this.selectNames.clear()
this.projectId = this.$route.params.projectId;
if (this.projectId && this.projectId !== "all") {
this.$store.commit('setProjectId', this.projectId);

View File

@ -74,17 +74,14 @@
},
checkedSaveAndRunTest() {
if (this.selectNames.has(this.ruleForm.testName)) {
this.selectIds.clear()
this.selectProjectNames.clear()
this.selectNames.clear()
this.$warning(this.$t('load_test.already_exists'));
this.oneClickOperationVisible = false;
this.$emit('refresh')
} else {
if (this.selectProjectNames.size > 1) {
this.selectIds.clear()
this.selectProjectNames.clear()
this.selectNames.clear()
/* console.log(this.selectIds)
console.log(this.selectNames)*/
this.$warning(this.$t('load_test.same_project_test'));
this.oneClickOperationVisible = false;
this.$emit('refresh')