{{ $t('test_track.plan_view.mock_info') }}
{{ $t('api_test.definition.request.req_param') }}
@@ -204,9 +203,7 @@ export default { }, saveAsCase() { //用于触发创建操作 - this.createCase = getUUID(); - this.$refs.caseList.open(); - this.loaded = false; + this.$store.state.currentApiCase = {case: getUUID(), api: this.api}; }, saveAsApi() { let data = {}; diff --git a/frontend/src/business/components/api/definition/components/runtest/RunTestSQLPage.vue b/frontend/src/business/components/api/definition/components/runtest/RunTestSQLPage.vue index a4f3f3cd7b..7fc5dba408 100644 --- a/frontend/src/business/components/api/definition/components/runtest/RunTestSQLPage.vue +++ b/frontend/src/business/components/api/definition/components/runtest/RunTestSQLPage.vue @@ -163,9 +163,7 @@ export default { return bodyUploadFiles; }, saveAsCase() { - this.createCase = getUUID(); - this.$refs.caseList.open(); - this.loaded = false; + this.$store.state.currentApiCase = {case: getUUID(), api: this.api}; }, saveAsApi() { let data = {}; diff --git a/frontend/src/business/components/api/definition/components/runtest/RunTestTCPPage.vue b/frontend/src/business/components/api/definition/components/runtest/RunTestTCPPage.vue index 8662fc58c6..c5eb37a54d 100644 --- a/frontend/src/business/components/api/definition/components/runtest/RunTestTCPPage.vue +++ b/frontend/src/business/components/api/definition/components/runtest/RunTestTCPPage.vue @@ -194,9 +194,7 @@ export default { return bodyUploadFiles; }, saveAsCase() { - this.createCase = getUUID(); - this.$refs.caseList.open(); - this.loaded = false; + this.$store.state.currentApiCase = {case: getUUID(), api: this.api}; }, saveAsApi() { let data = {}; diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index d1f5e7cb9b..a4e0c85e3a 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -24,6 +24,7 @@ const state = { useEnvironment: "", testPlanViewSelectNode: {}, selectStep: {}, + currentApiCase: {}, } const store = new Vuex.Store({