配合前端完善字典值匹配

This commit is contained in:
cool 2023-11-07 16:32:04 +08:00
parent d8aa27ecd0
commit 139b6b1063

View File

@ -50,7 +50,13 @@ export class DictInfoService extends BaseService {
.addOrderBy('a.createTime', 'ASC')
.getMany();
for (const item of typeData) {
result[item.key] = _.filter(data, { typeId: item.id });
result[item.key] = _.filter(data, { typeId: item.id }).map(e => {
const value = Number(e.value);
return {
...e,
value: isNaN(value) ? e.value : value,
};
});
}
return result;
}