| | |
| | | export { TEMPLATE_TYPE_OPTIONS }; |
| | | |
| | | export function templateTypeLabel(type) { |
| | | return TEMPLATE_TYPE_OPTIONS.find((x) => x.value === type)?.label || "—"; |
| | | if (type == null || type === "") return "—"; |
| | | const n = Number(type); |
| | | return TEMPLATE_TYPE_OPTIONS.find((x) => x.value === n)?.label || "—"; |
| | | } |
| | | |
| | | /** 节点内审批方式:会签 / 或签 */ |
| | |
| | | description: row.description || "", |
| | | enabled: mapEnabledFromApi(row.enabled), |
| | | enabledRaw: row.enabled, |
| | | templateType: row.templateType, |
| | | templateType: row.templateType != null ? Number(row.templateType) : undefined, |
| | | formConfig: row.formConfig, |
| | | formConfigData: parseFormConfigToData(row.formConfig), |
| | | createdUser: row.createdUser, |
| | |
| | | return dto; |
| | | } |
| | | |
| | | /** 构建分页查询参数 */ |
| | | export function buildApprovalTemplateListParams({ page, searchForm }) { |
| | | export function buildApprovalTemplateListParams({ page, searchForm, templateType = TEMPLATE_TYPE_CUSTOM }) { |
| | | const params = { |
| | | current: page.current, |
| | | size: page.size, |
| | | templateType: searchForm?.templateType != null && searchForm.templateType !== "" |
| | | ? searchForm.templateType |
| | | : templateType, |
| | | }; |
| | | if (searchForm?.templateType != null && searchForm.templateType !== "") { |
| | | params.templateType = searchForm.templateType; |
| | | } |
| | | const kw = (searchForm?.keyword || "").trim(); |
| | | if (kw) params.templateName = kw; |
| | | if (searchForm?.enabledOnly) params.enabled = "1"; |