| | |
| | | mergeFormConfigForEdit, |
| | | } from "./approvalFormField.js"; |
| | | import { |
| | | appendDotNotationQuery, |
| | | buildApprovalInstanceSearchDto, |
| | | formatKnownSelectLabel, |
| | | resolveInstanceFormPayload, |
| | | resolveListFieldRawValue, |
| | |
| | | } |
| | | |
| | | /** |
| | | * 与 Web buildApprovalInstanceListParams 一致:扁平 query(current/size/businessType/...) |
| | | * 审批列表不传 businessType 即查全部 |
| | | * 与 Web buildApprovalInstanceListParams 一致 |
| | | */ |
| | | export function buildInstanceListParams({ |
| | | page, |
| | |
| | | extraDto = {}, |
| | | searchForm, |
| | | }) { |
| | | const extra = { ...(extraDto && typeof extraDto === "object" ? extraDto : {}) }; |
| | | if (extra.createTime != null && extra.createTimeStart == null) { |
| | | extra.createTimeStart = extra.createTime; |
| | | const dto = buildApprovalInstanceSearchDto(searchForm, extraDto); |
| | | const bizType = businessType ?? searchForm?.businessType; |
| | | if (bizType != null && bizType !== "") { |
| | | dto.businessType = bizType; |
| | | } |
| | | delete extra.createTime; |
| | | |
| | | const params = { |
| | | current: page.current, |
| | | size: page.size, |
| | | ...extra, |
| | | "page.current": page.current, |
| | | "page.size": page.size, |
| | | ...dto, |
| | | }; |
| | | |
| | | const bizType = businessType ?? searchForm?.businessType; |
| | | if (bizType != null && bizType !== "") { |
| | | params.businessType = bizType; |
| | | } |
| | | if (searchForm?.status) { |
| | | params.status = searchForm.status; |
| | | } |
| | | |
| | | const range = |
| | | searchForm?.createTimeRange ?? |
| | | searchForm?.applyDateRange ?? |
| | | searchForm?.transferDateRange; |
| | | if (Array.isArray(range) && range[0] && params.createTimeStart == null) { |
| | | params.createTimeStart = range[0]; |
| | | } |
| | | if (Array.isArray(range) && range[1] && params.createTimeEnd == null) { |
| | | params.createTimeEnd = range[1]; |
| | | } |
| | | |
| | | appendDotNotationQuery(params, "approvalInstanceDto", dto); |
| | | return params; |
| | | } |
| | | |