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

--user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001017124
This commit is contained in:
guoyuqi 2022-09-21 17:51:10 +08:00 committed by xiaomeinvG
parent 1347f6786e
commit 62307f0e44
2 changed files with 17 additions and 3 deletions

View File

@ -84,6 +84,12 @@ export default {
default() {
return true;
}
},
selectProjectId: {
type: String,
default() {
return getCurrentProjectID();
}
}
},
computed: {
@ -94,8 +100,12 @@ export default {
return this.relevanceProjectId ? true : false;
},
projectId() {
if (this.selectProjectId) {
return this.selectProjectId;
} else {
return getCurrentProjectID();
}
}
},
data() {
return {
@ -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;
}

View File

@ -13,6 +13,7 @@
@setModuleOptions="setModuleOptions"
@enableTrash="false"
:is-read-only="true"
:select-project-id="projectId"
ref="nodeTree"/>
</template>