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 4be0e60728
commit ec2ac6defe
2 changed files with 17 additions and 3 deletions

View File

@ -84,6 +84,12 @@ export default {
default() { default() {
return true; return true;
} }
},
selectProjectId: {
type: String,
default() {
return getCurrentProjectID();
}
} }
}, },
computed: { computed: {
@ -94,8 +100,12 @@ export default {
return this.relevanceProjectId ? true : false; return this.relevanceProjectId ? true : false;
}, },
projectId() { projectId() {
if (this.selectProjectId) {
return this.selectProjectId;
} else {
return getCurrentProjectID(); return getCurrentProjectID();
} }
}
}, },
data() { data() {
return { return {
@ -178,15 +188,18 @@ export default {
this.$refs.nodeTree.filter(this.condition.filterText); this.$refs.nodeTree.filter(this.condition.filterText);
}, },
list(projectId) { list(projectId) {
if (!projectId) {
projectId = this.projectId ? this.projectId : getCurrentProjectID();
}
let url = undefined; let url = undefined;
if (this.isPlanModel) { if (this.isPlanModel) {
url = '/api/automation/module/list/plan/' + this.planId; url = '/api/automation/module/list/plan/' + this.planId;
} else if (this.isRelevanceModel) { } else if (this.isRelevanceModel) {
url = "/api/automation/module/list/" + this.relevanceProjectId; url = "/api/automation/module/list/" + this.relevanceProjectId;
} else if (this.isTrashData) { } else if (this.isTrashData) {
url = "/api/automation/module/trash/list/" + (projectId ? projectId : this.projectId); url = "/api/automation/module/trash/list/" + projectId;
} else { } else {
url = "/api/automation/module/list/" + (projectId ? projectId : this.projectId); url = "/api/automation/module/list/" + projectId;
if (!this.projectId) { if (!this.projectId) {
return; return;
} }

View File

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