| | |
| | | DISABLED: { text: '禁用', color: 'default' }, |
| | | }; |
| | | |
| | | /** 兼容后端返回未知或小写状态,避免直接索引得到 undefined。 */ |
| | | export const getEmployeeStatusMeta = (status?: string) => { |
| | | const key = String(status ?? '').toUpperCase() as EmployeeStatus; |
| | | return employeeStatusMeta[key] ?? { text: status || '-', color: 'default' }; |
| | | /** 兼容后端返回 null、小写或未知状态:ACTIVE 与空值均为启用,仅 DISABLED 为禁用。 */ |
| | | export const getEmployeeStatusMeta = (status?: string | null) => { |
| | | const key = String(status ?? '').toUpperCase(); |
| | | |
| | | if (!key || key === 'ACTIVE') return employeeStatusMeta.ACTIVE; |
| | | if (key === 'DISABLED') return employeeStatusMeta.DISABLED; |
| | | return { text: status || '-', color: 'default' }; |
| | | }; |
| | | |
| | | export const createUserColumns = (options: { |