From 214106f890ff4fc5754dd84220ea333015021607 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 19 Aug 2021 14:49:19 +0800 Subject: [PATCH] =?UTF-8?q?fix=20(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8C=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E7=9B=B8=E5=85=B3=E4=BC=98=E5=8C=96=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/EditCompleteContainer.vue | 31 ++++++++++++++-- .../components/case/ApiCaseItem.vue | 27 +++++++------- .../components/case/ApiCaseList.vue | 35 ++++++++++++------- .../complete/EditCompleteHTTPApi.vue | 10 ++++-- .../components/runtest/RunTestDubboPage.vue | 4 +-- .../components/runtest/RunTestHTTPPage.vue | 5 +-- .../components/runtest/RunTestSQLPage.vue | 4 +-- .../components/runtest/RunTestTCPPage.vue | 4 +-- frontend/src/store/index.js | 1 + 9 files changed, 78 insertions(+), 43 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue index ba09902f30..4d249e4052 100644 --- a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue +++ b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue @@ -89,6 +89,11 @@ @showExecResult="showExecResult" ref="trashCaseList"/> + + @@ -101,6 +106,8 @@ import MsRunTestDubboPage from "./runtest/RunTestDubboPage"; import MockConfig from "@/business/components/api/definition/components/mock/MockConfig"; import TcpMockConfig from "@/business/components/api/definition/components/mock/TcpMockConfig"; import ApiCaseSimpleList from "./list/ApiCaseSimpleList"; +import MsApiCaseList from "./case/ApiCaseList"; +import {getUUID} from "@/common/js/utils"; export default { name: "EditCompleteContainer", @@ -112,7 +119,8 @@ export default { MsRunTestDubboPage, MockConfig, TcpMockConfig, - ApiCaseSimpleList + ApiCaseSimpleList, + MsApiCaseList }, data() { return { @@ -122,7 +130,9 @@ export default { showMock: false, showTestCaseList: false, baseMockConfigData: {}, - loading: false + loading: false, + createCase: "", + api: {}, } }, props: { @@ -151,6 +161,15 @@ export default { watch: { showMock() { this.mockSetting(); + }, + '$store.state.currentApiCase.case'() { + if (this.$store.state.currentApiCase && this.$store.state.currentApiCase.api) { + this.refreshButtonActiveClass("testCase"); + } + }, + '$store.state.currentApiCase.mock'() { + this.mockSetting(); + this.refreshButtonActiveClass("mock"); } }, methods: { @@ -221,21 +240,29 @@ export default { this.showTestCaseList = true; this.showTest = false; this.showMock = false; + if (this.$store.state.currentApiCase && this.$store.state.currentApiCase.api) { + this.createCase = getUUID(); + this.api = this.$store.state.currentApiCase.api; + this.$refs.caseList.open(); + } } else if (tabType === "test") { this.showApiList = false; this.showTestCaseList = false; this.showTest = true; this.showMock = false; + this.$store.state.currentApiCase = undefined; } else if (tabType === "mock") { this.showApiList = false; this.showTestCaseList = false; this.showTest = false; this.showMock = true; + this.$store.state.currentApiCase = undefined; } else { this.showApiList = true; this.showTestCaseList = false; this.showTest = false; this.showMock = false; + this.$store.state.currentApiCase = undefined; } } }, diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 8f544c842e..38baf70b20 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -1,5 +1,5 @@