From d26274d89d377067c1e2648192cffbf89464b361 Mon Sep 17 00:00:00 2001
From: wsj <593216709@qq.com>
Date: Wed, 28 Oct 2026 23:34:32 +0800
Subject: [PATCH] feat: 拆包
---
src/pages/system/users/columns.tsx | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/pages/system/users/columns.tsx b/src/pages/system/users/columns.tsx
index 8640ce5..75f4180 100644
--- a/src/pages/system/users/columns.tsx
+++ b/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: {
--
Gitblit v1.9.3