From 501fe437bf6027a48b325524d58418c36a6945b6 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 26 Nov 2021 13:56:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E9=A1=B5=E9=9D=A2tabs?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/definition/components/ApiConfig.vue | 2 ++ .../components/complete/EditCompleteHTTPApi.vue | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/api/definition/components/ApiConfig.vue b/frontend/src/business/components/api/definition/components/ApiConfig.vue index 476a53aed5..03cb9dc3bb 100644 --- a/frontend/src/business/components/api/definition/components/ApiConfig.vue +++ b/frontend/src/business/components/api/definition/components/ApiConfig.vue @@ -267,6 +267,8 @@ export default { this.$emit('saveApi', data); }); this.$store.state.apiMap.delete(this.currentApi.id); + this.responseCount = 0; + this.count = 0 }, handleSave() { if (this.$refs.httpApi) { 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 d47bbdfbd5..2c0b66d697 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue @@ -72,7 +72,7 @@ - + @@ -179,6 +179,7 @@ label: 'name', }, mockBaseUrl: "", + count: 0 } }, props: {moduleOptions: {}, request: {}, response: {}, basisData: {}, syncTabs: Array, projectId: String}, @@ -232,6 +233,14 @@ } } }, + 'httpForm.tags': { + handler(v, v1) { + this.count++; + if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1) && this.count > 1) { + this.apiMapStatus(); + } + } + }, syncTabs() { if (this.basisData && this.syncTabs && this.syncTabs.includes(this.basisData.id)) { // 标示接口在其他地方更新过,当前页面需要同步 @@ -337,6 +346,8 @@ if (valid) { this.setParameter(); this.$emit('saveApi', this.httpForm); + this.count = 0; + this.$store.state.apiMap.delete(this.httpForm.id); } else { return false; }