From c3ae4e9e0276551b8c5c16d50bb180c40518970c Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 16 Dec 2020 10:31:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E5=9C=BA=E6=99=AF=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/automation/scenario/AddBasisScenario.vue | 8 ++++---- .../api/automation/scenario/ApiScenarioModule.vue | 2 +- .../api/definition/components/basis/AddBasisApi.vue | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/AddBasisScenario.vue b/frontend/src/business/components/api/automation/scenario/AddBasisScenario.vue index a64b89b5bb..da9c05c887 100644 --- a/frontend/src/business/components/api/automation/scenario/AddBasisScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/AddBasisScenario.vue @@ -83,8 +83,7 @@ }], }, } - } - , + }, methods: { saveScenario(saveAs) { this.$refs['scenarioForm'].validate((valid) => { @@ -95,7 +94,7 @@ this.visible = false; if (saveAs) { this.scenarioForm.request = JSON.stringify(this.scenarioForm.request); - this.$emit('saveAsEdit', this.httpForm); + this.$emit('saveAsEdit', this.scenarioForm); } else { this.$emit('refresh'); } @@ -109,7 +108,8 @@ this.scenarioForm.projectId = getCurrentProjectID(); this.scenarioForm.id = getUUID().substring(0, 8); this.scenarioForm.protocol = this.currentProtocol; - if (this.currentModule != null && this.currentModule != "newId") { + + if (this.currentModule && this.currentModule.id != "root") { this.scenarioForm.modulePath = this.currentModule.method !== undefined ? this.currentModule.method : null; this.scenarioForm.apiScenarioModuleId = this.currentModule.id; } diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue index dd5be5fb18..c480a08603 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -57,7 +57,7 @@ }, projectId: "", data: [], - currentModule: {}, + currentModule: undefined, } }, mounted() { diff --git a/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue b/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue index c276cbcecd..8e62d99f68 100644 --- a/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue +++ b/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue @@ -59,7 +59,7 @@ import MsDialogFooter from "../../../../common/components/MsDialogFooter"; import {WORKSPACE_ID} from '../../../../../../common/js/constants'; import {REQ_METHOD} from "../../model/JsonData"; - import {getCurrentProjectID, getCurrentUser, getUUID} from "../../../../../../common/js/utils"; + import {getCurrentProjectID, getCurrentUser} from "../../../../../../common/js/utils"; import {createComponent, Request} from "../jmeter/components"; export default { From 8fb6dad10358337a8b3e314acde7df9567cf0a26 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 16 Dec 2020 10:54:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?refactor:=20=E5=88=87=E6=8D=A2=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/head/ApiHeaderMenus.vue | 30 +++-------- .../components/common/head/ProjectMenu.vue | 28 ---------- .../components/common/head/ProjectSwitch.vue | 52 +++++++++++++++++++ .../components/common/head/SearchList.vue | 4 +- .../head/PerformanceHeaderMenus.vue | 32 ++++-------- .../track/head/TrackHeaderMenus.vue | 39 ++++++-------- 6 files changed, 87 insertions(+), 98 deletions(-) delete mode 100644 frontend/src/business/components/common/head/ProjectMenu.vue create mode 100644 frontend/src/business/components/common/head/ProjectSwitch.vue diff --git a/frontend/src/business/components/api/head/ApiHeaderMenus.vue b/frontend/src/business/components/api/head/ApiHeaderMenus.vue index 409e7409d4..73548443e6 100644 --- a/frontend/src/business/components/api/head/ApiHeaderMenus.vue +++ b/frontend/src/business/components/api/head/ApiHeaderMenus.vue @@ -1,25 +1,10 @@