diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-24 20:13:50 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-24 20:13:50 +0900 |
| commit | c54a2445b6285d06c0ce3afa1cd3aa6aecf6de94 (patch) | |
| tree | 7a3f8e9d2eb3c8f4d9659cfe1d719d45dcbec139 /lib/dolce/table/gtt-drawing-list-columns.tsx | |
| parent | b284a6e07c2dd03d10eb471d69457e92bcc0ac76 (diff) | |
(김준회) dolce rebuild: i18n 지원
Diffstat (limited to 'lib/dolce/table/gtt-drawing-list-columns.tsx')
| -rw-r--r-- | lib/dolce/table/gtt-drawing-list-columns.tsx | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/lib/dolce/table/gtt-drawing-list-columns.tsx b/lib/dolce/table/gtt-drawing-list-columns.tsx index 2ff2d7e2..093fc10c 100644 --- a/lib/dolce/table/gtt-drawing-list-columns.tsx +++ b/lib/dolce/table/gtt-drawing-list-columns.tsx @@ -2,27 +2,27 @@ import { ColumnDef } from "@tanstack/react-table"; import { GttDwgReceiptItem } from "../actions"; - -// 날짜 포맷 헬퍼 -function formatDate(dateStr: string | null): string | null { - if (!dateStr || dateStr.length !== 8) return null; - return `${dateStr.substring(0, 4)}-${dateStr.substring(4, 6)}-${dateStr.substring(6, 8)}`; -} +import { translateDrawingMoveGbn } from "../utils/code-translator"; +import { formatDolceDateYYYYMMDD, formatDolceDateTime } from "../utils/date-formatter"; // Document Type 필터 export type DocumentType = "ALL" | "GTT_DELIVERABLES" | "SHI_INPUT"; interface GttDrawingListColumnsOptions { documentType: DocumentType; + lng: string; + t: any; } export function createGttDrawingListColumns({ documentType, + lng, + t, }: GttDrawingListColumnsOptions): ColumnDef<GttDwgReceiptItem>[] { const baseColumns: ColumnDef<GttDwgReceiptItem>[] = [ { accessorKey: "DrawingNo", - header: "도면번호", + header: t("drawingList.columns.drawingNo"), minSize: 200, cell: ({ row }) => { return <div className="font-medium">{row.getValue("DrawingNo")}</div>; @@ -30,7 +30,7 @@ export function createGttDrawingListColumns({ }, { accessorKey: "DrawingName", - header: "도면명", + header: t("drawingList.columns.drawingName"), minSize: 400, cell: ({ row }) => { return <div>{row.getValue("DrawingName")}</div>; @@ -38,12 +38,12 @@ export function createGttDrawingListColumns({ }, { accessorKey: "Discipline", - header: "설계공종", + header: t("drawingList.columns.discipline"), minSize: 80, }, { accessorKey: "Manager", - header: "담당자명", + header: t("drawingList.columns.manager"), minSize: 200, cell: ({ row }) => { const managerENM = row.original.ManagerENM; @@ -53,8 +53,12 @@ export function createGttDrawingListColumns({ }, { accessorKey: "DrawingMoveGbn", - header: "구분", + header: t("drawingList.columns.category"), minSize: 120, + cell: ({ row }) => { + const value = row.getValue("DrawingMoveGbn") as string; + return <div>{translateDrawingMoveGbn(value, lng)}</div>; + }, }, ]; @@ -66,39 +70,39 @@ export function createGttDrawingListColumns({ dateColumns.push( { accessorKey: "GTTInput_PlanDate", - header: "GTT Input 예정일", + header: t("drawingList.columns.gttInputPlanDate"), minSize: 150, - cell: ({ row }) => formatDate(row.getValue("GTTInput_PlanDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTInput_PlanDate")), }, { accessorKey: "GTTInput_ResultDate", - header: "GTT Input 결과일", + header: t("drawingList.columns.gttInputResultDate"), minSize: 150, - cell: ({ row }) => formatDate(row.getValue("GTTInput_ResultDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTInput_ResultDate")), }, { accessorKey: "GTTPreDwg_PlanDate", - header: "GTT Pre 예정일", + header: t("drawingList.columns.gttPreDwgPlanDate"), minSize: 140, - cell: ({ row }) => formatDate(row.getValue("GTTPreDwg_PlanDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTPreDwg_PlanDate")), }, { accessorKey: "GTTPreDwg_ResultDate", - header: "GTT Pre 결과일", + header: t("drawingList.columns.gttPreDwgResultDate"), minSize: 140, - cell: ({ row }) => formatDate(row.getValue("GTTPreDwg_ResultDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTPreDwg_ResultDate")), }, { accessorKey: "GTTWorkingDwg_PlanDate", - header: "GTT Working 예정일", + header: t("drawingList.columns.gttWorkingDwgPlanDate"), minSize: 160, - cell: ({ row }) => formatDate(row.getValue("GTTWorkingDwg_PlanDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTWorkingDwg_PlanDate")), }, { accessorKey: "GTTWorkingDwg_ResultDate", - header: "GTT Working 결과일", + header: t("drawingList.columns.gttWorkingDwgResultDate"), minSize: 160, - cell: ({ row }) => formatDate(row.getValue("GTTWorkingDwg_ResultDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTWorkingDwg_ResultDate")), } ); } @@ -107,15 +111,15 @@ export function createGttDrawingListColumns({ dateColumns.push( { accessorKey: "GTTInput_PlanDate", - header: "Input 예정일", + header: t("drawingList.columns.inputPlanDate"), minSize: 120, - cell: ({ row }) => formatDate(row.getValue("GTTInput_PlanDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTInput_PlanDate")), }, { accessorKey: "GTTInput_ResultDate", - header: "Input 결과일", + header: t("drawingList.columns.inputResultDate"), minSize: 120, - cell: ({ row }) => formatDate(row.getValue("GTTInput_ResultDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTInput_ResultDate")), } ); } @@ -124,27 +128,27 @@ export function createGttDrawingListColumns({ dateColumns.push( { accessorKey: "GTTPreDwg_PlanDate", - header: "Pre 예정일", + header: t("drawingList.columns.prePlanDate"), minSize: 120, - cell: ({ row }) => formatDate(row.getValue("GTTPreDwg_PlanDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTPreDwg_PlanDate")), }, { accessorKey: "GTTPreDwg_ResultDate", - header: "Pre 결과일", + header: t("drawingList.columns.preResultDate"), minSize: 120, - cell: ({ row }) => formatDate(row.getValue("GTTPreDwg_ResultDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTPreDwg_ResultDate")), }, { accessorKey: "GTTWorkingDwg_PlanDate", - header: "Working 예정일", + header: t("drawingList.columns.workingPlanDate"), minSize: 130, - cell: ({ row }) => formatDate(row.getValue("GTTWorkingDwg_PlanDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTWorkingDwg_PlanDate")), }, { accessorKey: "GTTWorkingDwg_ResultDate", - header: "Working 결과일", + header: t("drawingList.columns.workingResultDate"), minSize: 130, - cell: ({ row }) => formatDate(row.getValue("GTTWorkingDwg_ResultDate")), + cell: ({ row }) => formatDolceDateYYYYMMDD(row.getValue("GTTWorkingDwg_ResultDate")), } ); } @@ -153,10 +157,11 @@ export function createGttDrawingListColumns({ const endColumns: ColumnDef<GttDwgReceiptItem>[] = [ { accessorKey: "CreateDt", - header: "생성일시", + header: t("drawingList.columns.createDt"), minSize: 200, cell: ({ row }) => { - return <div className="text-sm text-muted-foreground">{row.getValue("CreateDt")}</div>; + const date = row.getValue("CreateDt") as string; + return <div className="text-sm text-muted-foreground">{formatDolceDateTime(date)}</div>; }, }, ]; |
