From c2f714797719cfcadf6b0e5541feea9a57ac3e86 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 23 Sep 2022 10:33:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9C=BA=E6=99=AF=E7=BC=96=E8=BE=91-?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=88=97=E8=A1=A8=E5=AF=BC=E5=85=A5-?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4=E5=90=8E?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=A8=A1=E5=9D=97-=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=A0=91=E5=8F=91=E7=94=9F=E5=8F=98=E6=9B=B4=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001017124 --- .../automation/scenario/api/ApiRelevance.vue | 8 +++++--- .../components/module/ApiModule.vue | 20 ++++++++++++++++--- .../components/module/ApiModuleHeader.vue | 12 ++++++++++- 3 files changed, 33 insertions(+), 7 deletions(-) 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);