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 dae7e3cf8f
commit d3c2fba41b
2 changed files with 24 additions and 30 deletions

View File

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

View File

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