| | |
| | | return data; |
| | | } |
| | | |
| | | /** 后端附件字段 → 页面 storageBlobDTOs */ |
| | | export function mapAttachmentsFromApi(row) { |
| | | const list = |
| | | row?.storageBlobDTOs || |
| | | row?.storageBlobDTOS || |
| | | row?.storageBlobVOS || |
| | | row?.storageBlobVOList || |
| | | row?.attachmentList || |
| | | []; |
| | | return Array.isArray(list) ? list : []; |
| | | } |
| | | |
| | | /** 分页列表项 → 页面行数据(主表 + 节点) */ |
| | | export function mapTemplateFromApi(row) { |
| | | if (!row) return {}; |
| | |
| | | businessType: row.businessType ?? "", |
| | | formConfig: row.formConfig, |
| | | formConfigData: parseFormConfigToData(row.formConfig), |
| | | storageBlobDTOs: mapAttachmentsFromApi(row), |
| | | createdUser: row.createdUser, |
| | | createdUserName: row.createdUserName, |
| | | ...times, |
| | |
| | | }), |
| | | }; |
| | | if (templateId) dto.id = templateId; |
| | | const attachments = Array.isArray(form.storageBlobDTOs) ? form.storageBlobDTOs : []; |
| | | if (attachments.length) dto.storageBlobDTOs = attachments; |
| | | return dto; |
| | | } |
| | | |
| | |
| | | formConfigData: createEmptyFormConfigData(), |
| | | enabled: true, |
| | | flowNodes: [createEmptyNode(1)], |
| | | storageBlobDTOs: [], |
| | | }; |
| | | } |
| | | |