From 011cb75cc6e864d7c7f4535485b5e997d8ccf6fd Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Tue, 22 Feb 2022 14:30:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E5=9C=A8?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=97=B6=E5=8F=A6=E5=AD=98=E4=B8=BA=E6=96=B0?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=90=8E=E5=88=87=E6=8D=A2tab=E9=A1=B5?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=8A=BD=E5=B1=89=E4=B8=8D=E4=BC=9A=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010452 --user=宋天阳 【接口测试】接口test-另存为新用例后,切换tab页,用例不会关闭 https://www.tapd.cn/55049933/s/1107510 --- .../definition/components/EditCompleteContainer.vue | 5 +++++ .../api/definition/components/case/ApiCaseList.vue | 5 +++++ .../definition/components/mock/MockEditDrawer.vue | 12 ++++++++---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue index 67432a38a5..337bbd84d9 100644 --- a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue +++ b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue @@ -273,8 +273,13 @@ export default { this.reload(); }, changeTab(tabType) { + this.beforeChangeTab(); this.refreshButtonActiveClass(tabType); }, + beforeChangeTab(){ + //关闭接口用例弹窗 + this.$refs.caseList.close(); + }, redirectToTest(param) { this.refreshButtonActiveClass("test"); this.$nextTick(() => { diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue index 31e8694336..315d7a1917 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue @@ -132,6 +132,11 @@ export default { this.maintainerOptions = response.data; }); }, + close(){ + if(this.$refs.testCaseDrawer){ + this.$refs.testCaseDrawer.close(); + } + }, open(api, testCaseId) { this.api = api; // testCaseId 不为空则为用例编辑页面 diff --git a/frontend/src/business/components/api/definition/components/mock/MockEditDrawer.vue b/frontend/src/business/components/api/definition/components/mock/MockEditDrawer.vue index 75f16faf0b..b87d6f06de 100644 --- a/frontend/src/business/components/api/definition/components/mock/MockEditDrawer.vue +++ b/frontend/src/business/components/api/definition/components/mock/MockEditDrawer.vue @@ -32,7 +32,9 @@

{{ $t('api_test.mock.rsp_param') }}

- +{{$t('api_test.definition.request.post_script')}} + + +{{ $t('api_test.definition.request.post_script') }} + @@ -131,7 +133,7 @@ export default { }, computed: {}, methods: { - addPostScript(){ + addPostScript() { this.$refs.mockResponseParam.setUsePostScript(); }, uuid: function () { @@ -212,13 +214,15 @@ export default { } } this.showDrawer = true; - this.$refs.mockDrawer.setfullScreen(); + this.$nextTick(() => { + this.$refs.mockDrawer.setfullScreen(); + }); }, close() { this.showDrawer = false; }, saveMockExpectConfig() { - if(this.isTcp && this.$refs.tcpParam){ + if (this.isTcp && this.$refs.tcpParam) { this.$refs.tcpParam.saveData(); } let mockConfigId = this.mockConfigId;