diff --git a/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue b/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue index dec309f2c1..39c4b6daa1 100644 --- a/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue +++ b/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue @@ -10,6 +10,7 @@ @protocolChange="handleProtocolChange" @refreshTable="refresh" @setModuleOptions="setModuleOptions" + :select-project-id="projectId" :is-relevance="true" :is-read-only="true" ref="nodeTree"/> @@ -90,9 +91,9 @@ export default { ScenarioRelevanceApiList, MsMainContainer, MsAsideContainer, MsContainer, MsApiModule, ScenarioRelevanceCaseList }, - props:{ - isAcrossSpace:{ - type:Boolean, + props: { + isAcrossSpace: { + type: Boolean, default() { return false; } @@ -234,6 +235,7 @@ export default { /deep/ .filter-input { width: 140px !important; } + .version-select { padding-left: 10px; } diff --git a/frontend/src/business/components/api/definition/components/module/ApiModule.vue b/frontend/src/business/components/api/definition/components/module/ApiModule.vue index a1a9983b0b..dfd6ed0656 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModule.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModule.vue @@ -35,6 +35,7 @@ :options="options" :total="total" :is-trash-data="isTrashData" + :select-project-id="projectId" @exportAPI="exportAPI" @saveAsEdit="saveAsEdit" @refreshTable="$emit('refreshTable')" @@ -115,6 +116,12 @@ export default { default() { return OPTIONS; } + }, + selectProjectId: { + type: String, + default() { + return getCurrentProjectID(); + } } }, computed: { @@ -128,7 +135,11 @@ export default { return this.reviewId ? true : false; }, projectId() { - return getCurrentProjectID(); + if (this.selectProjectId) { + return this.selectProjectId; + } else { + return getCurrentProjectID(); + } } }, mounted() { @@ -202,6 +213,9 @@ 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/module/list/plan/' + this.planId + '/' + this.condition.protocol; @@ -209,10 +223,10 @@ export default { url = "/api/module/list/" + this.relevanceProjectId + "/" + this.condition.protocol + (this.currentVersion ? '/' + this.currentVersion : ''); } else if (this.isTrashData) { - url = "/api/module/trash/list/" + (projectId ? projectId : this.projectId) + "/" + this.condition.protocol + + url = "/api/module/trash/list/" + projectId + "/" + this.condition.protocol + (this.currentVersion ? '/' + this.currentVersion : ''); } else { - url = "/api/module/list/" + (projectId ? projectId : this.projectId) + "/" + this.condition.protocol + + url = "/api/module/list/" + projectId + "/" + this.condition.protocol + (this.currentVersion ? '/' + this.currentVersion : ''); if (!this.projectId) { return; diff --git a/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue b/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue index 0e36f59582..b67de34e50 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue @@ -179,11 +179,21 @@ export default { default() { return OPTIONS; } + }, + selectProjectId: { + type: String, + default() { + return getCurrentProjectID(); + } } }, computed: { projectId() { - return getCurrentProjectID(); + if (this.selectProjectId) { + return this.selectProjectId; + } else { + return getCurrentProjectID(); + } }, showTrashNode() { return (!this.isReadOnly && !this.isTrashData);