fix(测试跟踪): 公共用例库自定义字段责任人查看有误

--bug=1024436 --user=宋昌昌 【测试跟踪】公共用例库-查看,责任人为空 https://www.tapd.cn/55049933/s/1350590
This commit is contained in:
song-cc-rock 2023-03-15 19:06:59 +08:00
parent a14b2ca5ad
commit f42b037e4e
2 changed files with 24 additions and 30 deletions

View File

@ -201,19 +201,14 @@ export default {
return;
}
if (this.projectId) {
getProjectMemberById(this.projectId).then((r) => {
this.memberOptions = r.data;
if (this.data.name === '责任人' && this.data.system && this.isTemplateEdit) {
this.memberOptions.unshift({id: 'CURRENT_USER', name: '创建人', email: ''});
}
})
getProjectMemberById(this.projectId)
.then((r) => {
this.handleMemberOptions(r.data);
});
} else {
getProjectMemberOption()
.then((r) => {
this.memberOptions = r.data;
if (this.data.name === '责任人' && this.data.system && this.isTemplateEdit) {
this.memberOptions.unshift({id: 'CURRENT_USER', name: '创建人', email: ''});
}
this.handleMemberOptions(r.data);
});
}
},
@ -223,6 +218,12 @@ export default {
}
},
methods: {
handleMemberOptions(data) {
this.memberOptions = data;
if (this.data.name === '责任人' && this.data.system && this.isTemplateEdit) {
this.memberOptions.unshift({id: 'CURRENT_USER', name: '创建人', email: ''});
}
},
clickPane(){
this.$emit("onClick");
},

View File

@ -221,30 +221,23 @@ export default {
getMemberOptions() {
if (this.projectId) {
getProjectMemberById(this.projectId).then((r) => {
let tempMemberOptions = r.data || [];
let tempArr = [];
tempMemberOptions.forEach((e) => {
tempArr.push({
value: e.id,
text: e.name,
});
});
this.memberOptions = tempArr;
this.handelMemberOptions(r.data);
});
} else {
getProjectMemberOption().then((r) => {
let tempMemberOptions = r.data || [];
let tempArr = [];
tempMemberOptions.forEach((e) => {
tempArr.push({
value: e.id,
text: e.name,
});
});
this.memberOptions = tempArr;
});
this.handelMemberOptions(r.data);
}
},
handelMemberOptions(data) {
let tempMemberOptions = data || [];
let tempArr = [];
tempMemberOptions.forEach((e) => {
tempArr.push({
value: e.id,
text: e.name,
});
});
this.memberOptions = tempArr;
},
getTranslateOption(item) {
if (!item) {
return '';