diff options
Diffstat (limited to 'lib/dolce/table/detail-drawing-columns.tsx')
| -rw-r--r-- | lib/dolce/table/detail-drawing-columns.tsx | 96 |
1 files changed, 10 insertions, 86 deletions
diff --git a/lib/dolce/table/detail-drawing-columns.tsx b/lib/dolce/table/detail-drawing-columns.tsx index 77d25953..c082333d 100644 --- a/lib/dolce/table/detail-drawing-columns.tsx +++ b/lib/dolce/table/detail-drawing-columns.tsx @@ -8,8 +8,8 @@ import { formatDolceDateTime } from "../utils/date-formatter"; const DRAWING_USAGE_MAP: Record<string, { ko: string; en: string }> = { APP: { ko: "승인용", en: "Approval" }, WOR: { ko: "작업용", en: "Working" }, - REC: { ko: "입수용 / GTT→SHI", en: "GTT→SHI" }, - SUB: { ko: "제출용 / SHI→GTT", en: "SHI→GTT" }, + REC: { ko: "입수용", en: "GTT→SHI" }, + SUB: { ko: "제출용", en: "SHI→GTT" }, }; const REGISTER_KIND_MAP: Record<string, { ko: string; en: string }> = { @@ -36,82 +36,6 @@ const translateRegisterKind = (code: string | null, lng: string): string => { return lng === "en" ? mapped.en : mapped.ko; }; -// 기본 컬럼 (기존 호환성 유지) -export const detailDrawingColumns: ColumnDef<DetailDwgReceiptItem>[] = [ - { - accessorKey: "RegisterSerialNo", - header: "일련번호", - minSize: 80, - cell: ({ row }) => { - return <div className="text-center">{row.getValue("RegisterSerialNo")}</div>; - }, - }, - { - accessorKey: "DrawingRevNo", - header: "Revision", - minSize: 100, - cell: ({ row }) => { - return <div className="font-medium">{row.getValue("DrawingRevNo")}</div>; - }, - }, - { - accessorKey: "Status", - header: "상태", - minSize: 120, - cell: ({ row }) => { - return <div className="text-center">{row.getValue("Status")}</div>; - }, - }, - { - accessorKey: "CategoryENM", - header: "카테고리", - minSize: 120, - cell: ({ row }) => { - const categoryENM = row.getValue("CategoryENM") as string; - const categoryNM = row.original.CategoryNM; - return <div>{categoryENM || categoryNM}</div>; - }, - }, - { - accessorKey: "DrawingUsageENM", - header: "도면용도", - minSize: 100, - cell: ({ row }) => { - const usageENM = row.getValue("DrawingUsageENM") as string | null; - const usageNM = row.original.DrawingUsageNM; - return <div>{usageENM || usageNM}</div>; - }, - }, - { - accessorKey: "RegisterKindENM", - header: "등록종류", - minSize: 180, - cell: ({ row }) => { - const kindENM = row.getValue("RegisterKindENM") as string | null; - const kindNM = row.original.RegisterKindNM; - return <div>{kindENM || kindNM}</div>; - }, - }, - { - accessorKey: "CreateUserNM", - header: "생성자", - minSize: 150, - cell: ({ row }) => { - const userENM = row.original.CreateUserENM; - const userNM = row.getValue("CreateUserNM") as string; - return <div>{userENM || userNM}</div>; - }, - }, - { - accessorKey: "CreateDt", - header: "생성일시", - minSize: 200, - cell: ({ row }) => { - return <div className="text-sm text-muted-foreground">{row.getValue("CreateDt")}</div>; - }, - }, -]; - // 다국어 지원 컬럼 생성 함수 export function createDetailDrawingColumns( lng: string, @@ -155,25 +79,25 @@ export function createDetailDrawingColumns( }, }, { - accessorKey: "DrawingUsageENM", + accessorKey: "DrawingUsage", header: t("detailDrawing.columns.drawingUsage"), minSize: 100, cell: ({ row }) => { - // API의 ENM이 제대로 번역되지 않아 코드 값으로 직접 변환 - const usageCode = row.getValue("DrawingUsageENM") as string | null; + // API 응답의 DrawingUsage는 코드값이므로 직접 매핑하여 번역 + const usageCode = row.getValue("DrawingUsage") as string; const translated = translateDrawingUsage(usageCode, lng); - return <div>{translated || usageCode || row.original.DrawingUsageNM}</div>; + return <div>{translated}</div>; }, }, { - accessorKey: "RegisterKindENM", + accessorKey: "RegisterKind", header: t("detailDrawing.columns.registerKind"), minSize: 180, cell: ({ row }) => { - // API의 ENM이 제대로 번역되지 않아 코드 값으로 직접 변환 - const kindCode = row.getValue("RegisterKindENM") as string | null; + // API 응답의 RegisterKind는 코드값이므로 직접 매핑하여 번역 + const kindCode = row.getValue("RegisterKind") as string; const translated = translateRegisterKind(kindCode, lng); - return <div>{translated || kindCode || row.original.RegisterKindNM}</div>; + return <div>{translated}</div>; }, }, { |
