diff options
| author | joonhoekim <26rote@gmail.com> | 2025-08-14 13:15:21 +0000 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-08-14 13:15:21 +0000 |
| commit | 49d236df3bd2bd976ebc424644f34f5affa1074f (patch) | |
| tree | 7b0f60c399e724847894061fae74876aa1bf5c7e /lib/users/table/users-table-columns.tsx | |
| parent | 969c25b56f6d29d7ffa4bc2ce04c5fb4e5846b34 (diff) | |
(김준회) 결재 테스트 모듈 수정, 환경병수 eVCP 운영 대응, SGIPS JWT TOKEN 수정, SHI-API 기반 유저 관리 추가, 유저목록 테이블 변경
Diffstat (limited to 'lib/users/table/users-table-columns.tsx')
| -rw-r--r-- | lib/users/table/users-table-columns.tsx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/lib/users/table/users-table-columns.tsx b/lib/users/table/users-table-columns.tsx index 217fefcf..d4c5c78a 100644 --- a/lib/users/table/users-table-columns.tsx +++ b/lib/users/table/users-table-columns.tsx @@ -6,7 +6,6 @@ import { type ColumnDef } from "@tanstack/react-table" import { Ellipsis } from "lucide-react" import { userRoles, type UserView } from "@/db/schema/users" -import { formatDate } from "@/lib/utils" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Checkbox } from "@/components/ui/checkbox" @@ -96,10 +95,28 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef<UserVie type: cfg.type, }, cell: ({ row, cell }) => { + // 날짜 컬럼: YYYY-MM-DD HH:mm + if (cfg.id === "created_at" || cfg.id === "updated_at" || cfg.id === "deactivated_at") { + const v = cell.getValue() as Date | string | null | undefined + if (!v) return "" + const d = new Date(v as any) + const y = d.getFullYear() + const m = String(d.getMonth() + 1).padStart(2, "0") + const day = String(d.getDate()).padStart(2, "0") + const hh = String(d.getHours()).padStart(2, "0") + const mm = String(d.getMinutes()).padStart(2, "0") + return `${y}-${m}-${day} ${hh}:${mm}` + } - if (cfg.id === "created_at") { - const dateVal = cell.getValue() as Date - return formatDate(dateVal, "KR") + // 불리언 컬럼: Y/N + if ( + cfg.id === "is_locked" || + cfg.id === "is_absent" || + cfg.id === "is_deleted_on_non_sap" || + cfg.id === "is_regular_employee" + ) { + const v = row.getValue(cfg.id) as boolean | null | undefined + return v === true ? "Y" : v === false ? "N" : "" } if (cfg.id === "roles") { |
