fix(接口测试): 解决场景编辑-接口列表导入-切换工作空间后点击模块-模块树发生变更的问题

--user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001017124
This commit is contained in:
guoyuqi 2022-09-23 10:33:55 +08:00 committed by xiaomeinvG
parent 607e370d03
commit c2f7147977
3 changed files with 33 additions and 7 deletions

View File

@ -10,6 +10,7 @@
@protocolChange="handleProtocolChange"
@refreshTable="refresh"
@setModuleOptions="setModuleOptions"
:select-project-id="projectId"
:is-relevance="true"
:is-read-only="true"
ref="nodeTree"/>
@ -234,6 +235,7 @@ export default {
/deep/ .filter-input {
width: 140px !important;
}
.version-select {
padding-left: 10px;
}

View File

@ -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,8 +135,12 @@ export default {
return this.reviewId ? true : false;
},
projectId() {
if (this.selectProjectId) {
return this.selectProjectId;
} else {
return getCurrentProjectID();
}
}
},
mounted() {
this.initProtocol();
@ -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;

View File

@ -179,11 +179,21 @@ export default {
default() {
return OPTIONS;
}
},
selectProjectId: {
type: String,
default() {
return getCurrentProjectID();
}
}
},
computed: {
projectId() {
if (this.selectProjectId) {
return this.selectProjectId;
} else {
return getCurrentProjectID();
}
},
showTrashNode() {
return (!this.isReadOnly && !this.isTrashData);