From 6d908c9eb706506aa73ed2500d0cea96d44cba9b Mon Sep 17 00:00:00 2001 From: wenyann Date: Thu, 13 May 2021 19:12:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=BA=E6=99=AF=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=A1=B9=E7=9B=AE=E5=90=8D=E6=94=B9=E6=88=90?= =?UTF-8?q?=E8=B7=A8=E9=A1=B9=E7=9B=AE=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/scenario/component/ApiComponent.vue | 14 ++++++++++---- .../scenario/component/ApiScenarioComponent.vue | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue index 2fc6e2f559..d4c6f9c59d 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue @@ -214,16 +214,19 @@ }, isCustomizeReq() { if (this.request.referenced == undefined || this.request.referenced === 'Created') { - return true + return true; } return false; }, isDeletedOrRef() { if (this.request.referenced != undefined && this.request.referenced === 'Deleted' || this.request.referenced === 'REF') { - return true + return true; } return false; }, + projectId() { + return this.$store.state.projectId; + }, }, methods: { getEnvironments() { @@ -351,8 +354,11 @@ }) }, getProjectName(id) { - const project = this.projectList.find(p => p.id === id); - return project ? project.name : ""; + if (this.projectId !== id) { + const project = this.projectList.find(p => p.id === id); + return project ? project.name : ""; + } + } } } diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue index af47b66f4f..bef0594fbd 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue @@ -98,10 +98,13 @@ computed: { isDeletedOrRef() { if (this.scenario.referenced != undefined && this.scenario.referenced === 'Deleted' || this.scenario.referenced === 'REF') { - return true + return true; } return false; - } + }, + projectId() { + return this.$store.state.projectId; + }, }, methods: { remove() { @@ -155,8 +158,11 @@ } }, getProjectName(id) { - const project = this.projectList.find(p => p.id === id); - return project ? project.name : ""; + if (this.projectId !== id) { + const project = this.projectList.find(p => p.id === id); + return project ? project.name : ""; + } + } } }