From 98b039123459e8a41fccad941c98067eba6a172d Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Thu, 27 Aug 2020 15:51:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=80=E9=94=AE=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E9=A1=B9=E7=9B=AE=E6=8A=A5=E9=94=99=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/test/ApiTestList.vue | 33 +++++++++++-------- .../components/api/test/OneClickOperation.vue | 9 ++--- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/frontend/src/business/components/api/test/ApiTestList.vue b/frontend/src/business/components/api/test/ApiTestList.vue index 4366a21153..b2050c22f0 100644 --- a/frontend/src/business/components/api/test/ApiTestList.vue +++ b/frontend/src/business/components/api/test/ApiTestList.vue @@ -128,23 +128,25 @@ export default { }, handleSelectAll(selection) { + this.selectIds.clear() + this.selectProjectNames.clear() + this.selectNames.clear() 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() + 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); diff --git a/frontend/src/business/components/api/test/OneClickOperation.vue b/frontend/src/business/components/api/test/OneClickOperation.vue index cc299f7879..adc2cbf317 100644 --- a/frontend/src/business/components/api/test/OneClickOperation.vue +++ b/frontend/src/business/components/api/test/OneClickOperation.vue @@ -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')