/** Review-only UI disappears in automatic mode; document status and activation remain. */
|
export function isAuditField(item: { field?: string; fieldName?: string; label?: unknown; title?: unknown }) {
|
return /^(auditStatus|auditUserId|auditTime|approvalStatus|approvalUserId|approvalTime|processInstanceId)$/.test(item.field ?? item.fieldName ?? '')
|
|| /^(审批状态|审核状态|审批人|审核人|审批时间|审核时间|流程实例)$/.test(String(item.title ?? item.label ?? ''));
|
}
|
|
export function auditActionMode(label: string | undefined, automatic: boolean) {
|
if (!automatic) return 'normal';
|
if (/^(提交审批|提交审核|审核|审批|通过|审核通过)$/.test(label ?? '')) return 'activate';
|
if (/^(查看审批|查看审核|审批进度|查看审批进度|反审核|撤销审批|取消审批|驳回|拒绝)$/.test(label ?? '')) return 'hidden';
|
return 'normal';
|
}
|