68 lines
2.2 KiB
TypeScript
68 lines
2.2 KiB
TypeScript
import { User, UserTableColumn } from "@/types/user";
|
|
|
|
/**
|
|
* 사용자 관리 관련 상수 정의
|
|
*/
|
|
|
|
// 사용자 상태 코드 정의
|
|
export const USER_STATUS = {
|
|
ACTIVE: "active",
|
|
INACTIVE: "inactive",
|
|
} as const;
|
|
|
|
// 사용자 상태 라벨 매핑
|
|
export const USER_STATUS_LABELS = {
|
|
[USER_STATUS.ACTIVE]: "활성",
|
|
[USER_STATUS.INACTIVE]: "비활성",
|
|
} as const;
|
|
|
|
// 사용자 목록 테이블 컬럼 정의 (camelCase)
|
|
// 검색 가능한 컬럼 정의 (등록일, 상태, 작업 제외)
|
|
export const SEARCH_OPTIONS = [
|
|
{ value: "all", label: "전체" },
|
|
{ value: "sabun", label: "사번" },
|
|
{ value: "company_name", label: "회사" },
|
|
{ value: "dept_name", label: "부서명" },
|
|
{ value: "position_name", label: "직책" },
|
|
{ value: "user_id", label: "사용자 ID" },
|
|
{ value: "user_name", label: "사용자명" },
|
|
{ value: "tel", label: "전화번호" },
|
|
{ value: "email", label: "이메일" },
|
|
] as const;
|
|
|
|
export const USER_TABLE_COLUMNS: UserTableColumn[] = [
|
|
{ key: "no", label: "No", sortable: false, width: "60px" },
|
|
{ key: "sabun", label: "사번", sortable: true, width: "80px" },
|
|
{ key: "company_name", label: "회사", sortable: true, width: "120px" },
|
|
{ key: "dept_name", label: "부서명", sortable: true, width: "120px" },
|
|
{ key: "position_name", label: "직책", sortable: true, width: "100px" },
|
|
{ key: "user_id", label: "사용자 ID", sortable: true, width: "120px" },
|
|
{ key: "user_name", label: "사용자명", sortable: true, width: "100px" },
|
|
{ key: "tel", label: "전화번호", sortable: false, width: "120px" },
|
|
{ key: "email", label: "이메일", sortable: true, width: "200px" },
|
|
{ key: "regdate", label: "등록일", sortable: true, width: "100px" },
|
|
{ key: "status", label: "상태", sortable: true, width: "120px" },
|
|
];
|
|
|
|
// MOCK_USERS 제거 - 이제 실제 백엔드 데이터 사용
|
|
|
|
// 새 사용자 등록 시 기본값 (camelCase)
|
|
export const DEFAULT_USER_FORM_DATA = {
|
|
user_id: "",
|
|
user_name: "",
|
|
dept_code: "",
|
|
dept_name: "",
|
|
position_name: "",
|
|
email: "",
|
|
tel: "",
|
|
cell_phone: "",
|
|
user_type_name: "",
|
|
status: USER_STATUS.ACTIVE,
|
|
};
|
|
|
|
// 페이징 관련 상수
|
|
export const USER_PAGINATION = {
|
|
DEFAULT_PAGE_SIZE: 20,
|
|
PAGE_SIZE_OPTIONS: [10, 20, 50, 100],
|
|
} as const;
|