fix(测试跟踪): 用例评审关联功能用例时切换项目后高级搜索中所属模块数据查询有误

--bug=1018289 --user=宋昌昌 【测试跟踪】用例评审-关联功能用例-高级搜索-所属模块和所选项目模块不一致 https://www.tapd.cn/55049933/s/1266832

Co-authored-by: song-cc-rock <changchang.song@fit2cloud.com>
This commit is contained in:
MeterSphere Bot 2022-10-19 10:22:25 +08:00 committed by GitHub
parent e155d4b02c
commit 96be530110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -181,9 +181,15 @@ export default {
this.isInit = true; this.isInit = true;
this.init(); this.init();
} else { } else {
//
this.setModulesParam();
this.refreshComponentOption(); this.refreshComponentOption();
} }
}, },
setModulesParam() {
let comps = this.optional.components.filter(c => c.key === 'moduleIds');
comps.forEach(comp => comp.options.params = {"projectId": this.condition.projectId});
},
refreshComponentOption() { refreshComponentOption() {
// //
let comps = this.optional.components.filter(cp => cp.init && cp.init instanceof Function); let comps = this.optional.components.filter(cp => cp.init && cp.init instanceof Function);

View File

@ -86,7 +86,11 @@ export default {
let options = cloneDeep(this.component.options); let options = cloneDeep(this.component.options);
let {url, params, type} = options; let {url, params, type} = options;
if (!url) return; if (!url) return;
url += '/' + getCurrentProjectID(); if (params.projectId) {
url += '/' + params.projectId;
} else {
url += '/' + getCurrentProjectID();
}
if (type === "POST") { if (type === "POST") {
this.loading = post(url, params || {}).then(response => { this.loading = post(url, params || {}).then(response => {
this.handleTreeNodes(response.data); this.handleTreeNodes(response.data);