From a3b1c4f4d569f6f721065be676f936dbd74e2bd9 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 29 Mar 2021 15:01:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9C=BA=E6=99=AF=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B):=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD=E6=A0=91=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E5=BA=94=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/automation/ApiAutomation.vue | 11 +++++++++-- .../components/api/definition/ApiDefinition.vue | 6 +++++- .../components/track/case/components/TestCaseEdit.vue | 5 ++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/frontend/src/business/components/api/automation/ApiAutomation.vue b/frontend/src/business/components/api/automation/ApiAutomation.vue index 18d4becb32..c56155f4c4 100644 --- a/frontend/src/business/components/api/automation/ApiAutomation.vue +++ b/frontend/src/business/components/api/automation/ApiAutomation.vue @@ -127,7 +127,6 @@ '$route'(to, from) { // 路由改变时,把接口定义界面中的 ctrl s 保存快捷键监听移除 if (to.path.indexOf('/api/automation') == -1) { if (this.$refs && this.$refs.autoScenarioConfig) { - // console.log(this.$refs.autoScenarioConfig); this.$refs.autoScenarioConfig.forEach(item => { item.removeListener(); }); @@ -189,7 +188,15 @@ let label = this.$t('api_test.automation.add_scenario'); let name = getUUID().substring(0, 8); this.activeName = name; - this.tabs.push({label: label, name: name, currentScenario: {apiScenarioModuleId: "root", id: getUUID()}}); + let currentScenario = { + apiScenarioModuleId: "root", id: getUUID(), + modulePath: "/" + this.$t("commons.module_title") + }; + if (this.nodeTree && this.nodeTree.length > 0) { + currentScenario.apiScenarioModuleId = this.nodeTree[0].id; + currentScenario.modulePath = this.nodeTree[0].path; + } + this.tabs.push({label: label, name: name, currentScenario: currentScenario}); } if (tab.name === 'edit') { let label = this.$t('api_test.automation.add_scenario'); diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index f1a4b12b1e..fdf74a00a1 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -296,8 +296,12 @@ } let api = { status: "Underway", method: "GET", userId: getCurrentUser().id, - url: "", protocol: this.currentProtocol, environmentId: "", moduleId: 'root', + url: "", protocol: this.currentProtocol, environmentId: "", moduleId: 'root', modulePath: "/" + this.$t("commons.module_title") }; + if (this.nodeTree && this.nodeTree.length > 0) { + api.moduleId = this.nodeTree[0].id; + api.modulePath = this.nodeTree[0].path; + } this.handleTabsEdit(this.$t('api_test.definition.request.title'), e, api); }, handleTabClose() { diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 21a57d13d2..1c3b739cf9 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -415,6 +415,10 @@ export default { }; }); }, 1000); + if(this.selectNode && this.selectNode.data){ + this.form.module = this.selectNode.data.id; + this.form.nodePath = this.selectNode.data.path; + } }, watch: { treeNodes() { @@ -738,7 +742,6 @@ export default { }*/ this.tableType='edit'; this.$emit("refresh",this.form); - console.log(response.data) this.form.id=response.data if (this.type === 'add' || this.type === 'copy') { param.id = response.data;