fix(缺陷管理): 缺陷模板多选字段展示问题

--bug=1050557 --user=宋昌昌 【缺陷管理】项目集成tapd-缺陷列表-操作-编辑-页面未展示缺陷内容 https://www.tapd.cn/55049933/s/1634409
This commit is contained in:
song-cc-rock 2024-12-19 13:43:08 +08:00 committed by Craftsman
parent 7dbc18889e
commit 422c016e67
1 changed files with 5 additions and 6 deletions

View File

@ -729,18 +729,17 @@
tmpObj[item.id] = ''; tmpObj[item.id] = '';
// //
} else if (MULTIPLE_TYPE.includes(item.type)) { } else if (MULTIPLE_TYPE.includes(item.type)) {
if (!item.value) {
tmpObj[item.id] = [];
}
const multipleOptions = getOptionFromTemplate( const multipleOptions = getOptionFromTemplate(
currentCustomFields.value.find((filed: any) => item.id === filed.fieldId) currentCustomFields.value.find((filed: any) => item.id === filed.fieldId)
); );
// //
const optionsIds = (multipleOptions || []).map((e: any) => e.value); const optionsIds = (multipleOptions || []).map((e: any) => e.value);
if (item.type !== 'MULTIPLE_INPUT') { if (item.type !== 'MULTIPLE_INPUT') {
if (item.value) {
const currentDefaultValue = optionsIds.filter((e: any) => JSON.parse(item.value).includes(e)); const currentDefaultValue = optionsIds.filter((e: any) => JSON.parse(item.value).includes(e));
tmpObj[item.id] = currentDefaultValue; tmpObj[item.id] = currentDefaultValue;
} else {
tmpObj[item.id] = [];
}
} else { } else {
tmpObj[item.id] = JSON.parse(item.value); tmpObj[item.id] = JSON.parse(item.value);
} }