ERP-node/frontend/lib/registry/components/v2-timeline-scheduler/config.ts

103 lines
2.1 KiB
TypeScript

"use client";
import { TimelineSchedulerConfig, ZoomLevel } from "./types";
/**
* 기본 타임라인 스케줄러 설정
*/
export const defaultTimelineSchedulerConfig: Partial<TimelineSchedulerConfig> = {
defaultZoomLevel: "day",
editable: true,
draggable: true,
resizable: true,
rowHeight: 50,
headerHeight: 60,
resourceColumnWidth: 150,
cellWidth: {
day: 60,
week: 120,
month: 40,
},
showConflicts: true,
showProgress: true,
showTodayLine: true,
showToolbar: true,
showZoomControls: true,
showNavigation: true,
showAddButton: true,
height: 500,
statusColors: {
planned: "#3b82f6", // blue-500
in_progress: "#f59e0b", // amber-500
completed: "#10b981", // emerald-500
delayed: "#ef4444", // red-500
cancelled: "#6b7280", // gray-500
},
fieldMapping: {
id: "id",
resourceId: "resource_id",
title: "title",
startDate: "start_date",
endDate: "end_date",
status: "status",
progress: "progress",
},
resourceFieldMapping: {
id: "id",
name: "name",
group: "group",
},
};
/**
* 줌 레벨 옵션
*/
export const zoomLevelOptions: { value: ZoomLevel; label: string }[] = [
{ value: "day", label: "일" },
{ value: "week", label: "주" },
{ value: "month", label: "월" },
];
/**
* 상태 옵션
*/
export const statusOptions = [
{ value: "planned", label: "계획됨", color: "#3b82f6" },
{ value: "in_progress", label: "진행중", color: "#f59e0b" },
{ value: "completed", label: "완료", color: "#10b981" },
{ value: "delayed", label: "지연", color: "#ef4444" },
{ value: "cancelled", label: "취소", color: "#6b7280" },
];
/**
* 줌 레벨별 표시 일수
*/
export const zoomLevelDays: Record<ZoomLevel, number> = {
day: 14, // 2주
week: 56, // 8주
month: 90, // 3개월
};
/**
* 요일 라벨 (한글)
*/
export const dayLabels = ["일", "월", "화", "수", "목", "금", "토"];
/**
* 월 라벨 (한글)
*/
export const monthLabels = [
"1월",
"2월",
"3월",
"4월",
"5월",
"6월",
"7월",
"8월",
"9월",
"10월",
"11월",
"12월",
];