From c5ec9087da697506248ce9bf2f5b1bec891cd161 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 18 Nov 2021 15:08:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E4=BF=AE=E6=94=B9=E5=90=8E?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=9D=E5=AD=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/complete/BasisApi.vue | 33 +- .../complete/EditCompleteHTTPApi.vue | 51 +- .../components/complete/TCPBasicApi.vue | 36 +- .../track/case/components/TestCaseEdit.vue | 1509 +++++++++-------- 4 files changed, 797 insertions(+), 832 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/complete/BasisApi.vue b/frontend/src/business/components/api/definition/components/complete/BasisApi.vue index f884d06a7e..72254940a8 100644 --- a/frontend/src/business/components/api/definition/components/complete/BasisApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/BasisApi.vue @@ -96,50 +96,35 @@ 'basicForm.name': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'basicForm.moduleId': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'basicForm.status': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'basicForm.follows': { handler(v, v1) { if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1)) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'basicForm.description': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, @@ -176,8 +161,14 @@ } }, methods: { + apiMapStatus() { + this.$store.state.apiStatus.set("fromChange", true); + if (this.httpForm.id) { + this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus); + } + }, getMaintainerOptions() { - this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()},response => { + this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { this.maintainerOptions = response.data; }); }, diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue index aa26385fe9..d0ca420141 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue @@ -201,70 +201,49 @@ 'httpForm.name': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.httpForm.id) { - this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'httpForm.path': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.httpForm.id) { - this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'httpForm.userId': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.httpForm.id) { - this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'httpForm.moduleId': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.httpForm.id) { - this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'httpForm.status': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.httpForm.id) { - this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'httpForm.follows': { handler(v, v1) { if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1)) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.httpForm.id) { - this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'httpForm.description': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.httpForm.id) { - this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, @@ -325,16 +304,22 @@ } }, methods: { + apiMapStatus() { + this.$store.state.apiStatus.set("fromChange", true); + if (this.httpForm.id) { + this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus); + } + }, currentUser: () => { return getCurrentUser(); }, - openHis(){ - this.$refs.changeHistory.open(this.httpForm.id,["接口定义" , "接口定義" , "Api definition"]); + openHis() { + this.$refs.changeHistory.open(this.httpForm.id, ["接口定义", "接口定義", "Api definition"]); }, mockSetting() { - if(this.basisData.id){ - this.$store.state.currentApiCase={mock : getUUID()}; - this.$emit('changeTab','mock'); + if (this.basisData.id) { + this.$store.state.currentApiCase = {mock: getUUID()}; + this.$emit('changeTab', 'mock'); }else { this.$alert(this.$t('api_test.mock.create_error')); } diff --git a/frontend/src/business/components/api/definition/components/complete/TCPBasicApi.vue b/frontend/src/business/components/api/definition/components/complete/TCPBasicApi.vue index 4b68d7f834..e7a80586bb 100644 --- a/frontend/src/business/components/api/definition/components/complete/TCPBasicApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/TCPBasicApi.vue @@ -140,65 +140,53 @@ 'basicForm.name': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'basicForm.userId': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'basicForm.moduleId': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'basicForm.status': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'basicForm.follows': { handler(v, v1) { if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1)) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, 'basicForm.description': { handler(v, v1) { if (v && v1 && v !== v1) { - this.$store.state.apiStatus.set("fromChange", true); - if (this.basicForm.id) { - this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus); - } + this.apiMapStatus(); } } }, }, methods: { + apiMapStatus() { + this.$store.state.apiStatus.set("fromChange", true); + if (this.httpForm.id) { + this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus); + } + }, getMaintainerOptions() { this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => { this.maintainerOptions = response.data; diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 262a2a3601..451812e012 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -1,17 +1,23 @@ -