gaoluyang
18 小时以前 6f35f9dc767e99ad701f7f6e2f5d4c52b6cc1d0f
1
2
3
4
5
6
7
8
9
10
11
12
/** 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';
}