| | |
| | | import dayjs from "dayjs"; |
| | | import { getTypeEnums } from "@/api/basicData/enum.js"; |
| | | import { TEMPLATE_TYPE_CUSTOM } from "@/api/officeProcessAutomation/approvalTemplate.js"; |
| | | import { |
| | | TEMPLATE_TYPE_BUILTIN, |
| | | TEMPLATE_TYPE_CUSTOM, |
| | | } from "@/api/officeProcessAutomation/approvalTemplate.js"; |
| | | import { APPROVAL_TYPE_OPTIONS } from "../approve-list/approveListConstants.js"; |
| | | import { |
| | | buildFormConfigJson, |
| | |
| | | } catch { |
| | | return []; |
| | | } |
| | | } |
| | | |
| | | /** 是否为系统内置模板(templateType === 0) */ |
| | | export function isBuiltinTemplate(row) { |
| | | return Number(row?.templateType) === TEMPLATE_TYPE_BUILTIN; |
| | | } |
| | | |
| | | /** 节点内审批方式:会签 / 或签 */ |
| | |
| | | templateName: (form.templateName || "").trim(), |
| | | description: (form.description || "").trim(), |
| | | enabled: mapEnabledToApi(form.enabled), |
| | | templateType: TEMPLATE_TYPE_CUSTOM, |
| | | templateType: |
| | | form.templateType != null ? Number(form.templateType) : TEMPLATE_TYPE_CUSTOM, |
| | | businessType: form.businessType ?? "", |
| | | formConfig: buildFormConfigJson(form.formConfigData), |
| | | nodes: nodes.map((n, i) => { |
| | |
| | | return dto; |
| | | } |
| | | |
| | | export function buildApprovalTemplateListParams({ page, searchForm, templateType = TEMPLATE_TYPE_CUSTOM }) { |
| | | export function buildApprovalTemplateListParams({ page, searchForm }) { |
| | | const params = { |
| | | current: page.current, |
| | | size: page.size, |
| | | templateType: searchForm?.templateType != null && searchForm.templateType !== "" |
| | | ? searchForm.templateType |
| | | : templateType, |
| | | }; |
| | | const kw = (searchForm?.keyword || "").trim(); |
| | | if (kw) params.templateName = kw; |
| | |
| | | templateName: "", |
| | | description: "", |
| | | templateType: TEMPLATE_TYPE_CUSTOM, |
| | | lockedFormFieldUids: [], |
| | | businessType: "", |
| | | formConfig: "", |
| | | formConfigData: createEmptyFormConfigData(), |