fix: 场景步骤展示项目名改成跨项目的

This commit is contained in:
wenyann 2021-05-13 19:12:30 +08:00 committed by 刘瑞斌
parent d9dbae7dab
commit 6d908c9eb7
2 changed files with 20 additions and 8 deletions

View File

@ -214,16 +214,19 @@
}, },
isCustomizeReq() { isCustomizeReq() {
if (this.request.referenced == undefined || this.request.referenced === 'Created') { if (this.request.referenced == undefined || this.request.referenced === 'Created') {
return true return true;
} }
return false; return false;
}, },
isDeletedOrRef() { isDeletedOrRef() {
if (this.request.referenced != undefined && this.request.referenced === 'Deleted' || this.request.referenced === 'REF') { if (this.request.referenced != undefined && this.request.referenced === 'Deleted' || this.request.referenced === 'REF') {
return true return true;
} }
return false; return false;
}, },
projectId() {
return this.$store.state.projectId;
},
}, },
methods: { methods: {
getEnvironments() { getEnvironments() {
@ -351,8 +354,11 @@
}) })
}, },
getProjectName(id) { getProjectName(id) {
const project = this.projectList.find(p => p.id === id); if (this.projectId !== id) {
return project ? project.name : ""; const project = this.projectList.find(p => p.id === id);
return project ? project.name : "";
}
} }
} }
} }

View File

@ -98,10 +98,13 @@
computed: { computed: {
isDeletedOrRef() { isDeletedOrRef() {
if (this.scenario.referenced != undefined && this.scenario.referenced === 'Deleted' || this.scenario.referenced === 'REF') { if (this.scenario.referenced != undefined && this.scenario.referenced === 'Deleted' || this.scenario.referenced === 'REF') {
return true return true;
} }
return false; return false;
} },
projectId() {
return this.$store.state.projectId;
},
}, },
methods: { methods: {
remove() { remove() {
@ -155,8 +158,11 @@
} }
}, },
getProjectName(id) { getProjectName(id) {
const project = this.projectList.find(p => p.id === id); if (this.projectId !== id) {
return project ? project.name : ""; const project = this.projectList.find(p => p.id === id);
return project ? project.name : "";
}
} }
} }
} }