From 0a3a84bb98e5b7575ac4834b8a2aeae9c0c8b58d Mon Sep 17 00:00:00 2001 From: bicochan Date: Wed, 16 Jul 2025 12:08:18 +0900 Subject: [PATCH] =?UTF-8?q?[apps/cs]=20feat:=20=ED=9A=8C=EC=9B=90=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=20=EB=B1=83=EC=A7=80=EB=A1=9C=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C=20(CS=5FUT05010109)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/cs/src/entities/user/index.ts | 1 + .../src/entities/user/model/user-interface.ts | 3 ++- .../src/pages/users/model/table-columns.tsx | 27 +++++++++++++++++-- apps/cs/src/pages/users/ui/create-page.tsx | 9 ------- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/apps/cs/src/entities/user/index.ts b/apps/cs/src/entities/user/index.ts index 7b4615e01..8927256f9 100644 --- a/apps/cs/src/entities/user/index.ts +++ b/apps/cs/src/entities/user/index.ts @@ -4,6 +4,7 @@ export { userSaveSchema, userPasswordUpdateSchema, userUpdateSchema, + type UserStateCode, type UserSearchParams, type UserListResponse, type UserSaveData, diff --git a/apps/cs/src/entities/user/model/user-interface.ts b/apps/cs/src/entities/user/model/user-interface.ts index 69320e8c7..012fe9e92 100644 --- a/apps/cs/src/entities/user/model/user-interface.ts +++ b/apps/cs/src/entities/user/model/user-interface.ts @@ -9,7 +9,8 @@ export const USER_STATE_CODE = { 삭제: "09", } as const; -type UserStateCode = (typeof USER_STATE_CODE)[keyof typeof USER_STATE_CODE]; +export type UserStateCode = + (typeof USER_STATE_CODE)[keyof typeof USER_STATE_CODE]; // 사용자 검색 파라미터 export interface UserSearchParams extends PageableParams { diff --git a/apps/cs/src/pages/users/model/table-columns.tsx b/apps/cs/src/pages/users/model/table-columns.tsx index 0b61b0569..1aad6de27 100644 --- a/apps/cs/src/pages/users/model/table-columns.tsx +++ b/apps/cs/src/pages/users/model/table-columns.tsx @@ -1,6 +1,11 @@ import dayjs from "dayjs"; import type { ColumnDef } from "@tanstack/react-table"; -import type { UserListResponse } from "@/entities/user"; +import { + USER_STATE_CODE, + type UserListResponse, + type UserStateCode, +} from "@/entities/user"; +import { Badge } from "@common/components"; export const columns: ColumnDef[] = [ { @@ -42,8 +47,11 @@ export const columns: ColumnDef[] = [ header: "기관/부서", }, { - accessorKey: "userStateCodeName", + accessorKey: "userStateCode", header: "회원상태", + cell: ({ row }) => { + return getUserStateBadge(row.original.userStateCode); + }, }, { accessorKey: "aprvYmd", @@ -63,3 +71,18 @@ export const columns: ColumnDef[] = [ }, }, ]; + +const getUserStateBadge = (userStateCode: UserStateCode) => { + switch (userStateCode) { + case USER_STATE_CODE.대기: + return 대기; + case USER_STATE_CODE.정상: + return 정상; + case USER_STATE_CODE.정지: + return 정지; + case USER_STATE_CODE.탈퇴: + return 탈퇴; + case USER_STATE_CODE.삭제: + return 삭제; + } +}; diff --git a/apps/cs/src/pages/users/ui/create-page.tsx b/apps/cs/src/pages/users/ui/create-page.tsx index f58469327..2d55a1cd2 100644 --- a/apps/cs/src/pages/users/ui/create-page.tsx +++ b/apps/cs/src/pages/users/ui/create-page.tsx @@ -16,20 +16,11 @@ function CreatePage() { defaultValues: { userId: "", userName: "", - email: "", password: "", pswdHnt: "", - pswdAns: "", - mphn: "", - telno: "", - zip: "", - addr: "", - daddr: "", laeSeCd: "", ogdpSeCd: "", expryYmd: "", - instSeCd: "", - enoCd: "", }, });