diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue index f26b3b9f08..6714c01f82 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -84,6 +84,12 @@ export default { default() { return true; } + }, + selectProjectId: { + type: String, + default() { + return getCurrentProjectID(); + } } }, computed: { @@ -94,7 +100,11 @@ export default { return this.relevanceProjectId ? true : false; }, projectId() { - return getCurrentProjectID(); + if (this.selectProjectId) { + return this.selectProjectId; + } else { + return getCurrentProjectID(); + } } }, data() { @@ -178,15 +188,18 @@ export default { this.$refs.nodeTree.filter(this.condition.filterText); }, list(projectId) { + if (!projectId) { + projectId = this.projectId ? this.projectId : getCurrentProjectID(); + } let url = undefined; if (this.isPlanModel) { url = '/api/automation/module/list/plan/' + this.planId; } else if (this.isRelevanceModel) { url = "/api/automation/module/list/" + this.relevanceProjectId; } else if (this.isTrashData) { - url = "/api/automation/module/trash/list/" + (projectId ? projectId : this.projectId); + url = "/api/automation/module/trash/list/" + projectId; } else { - url = "/api/automation/module/list/" + (projectId ? projectId : this.projectId); + url = "/api/automation/module/list/" + projectId; if (!this.projectId) { return; } diff --git a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue index d12cd5d553..d2923d857b 100644 --- a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue +++ b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue @@ -13,6 +13,7 @@ @setModuleOptions="setModuleOptions" @enableTrash="false" :is-read-only="true" + :select-project-id="projectId" ref="nodeTree"/>