wsj
3 days ago cd2b7d36f3610417c268d062454b7ec43e9ca937
src/pages/system/users/columns.tsx
@@ -7,10 +7,13 @@
  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: {