summaryrefslogtreecommitdiff
path: root/lib/items-tech/table/ship/items-ship-table-columns.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/items-tech/table/ship/items-ship-table-columns.tsx')
-rw-r--r--lib/items-tech/table/ship/items-ship-table-columns.tsx73
1 files changed, 13 insertions, 60 deletions
diff --git a/lib/items-tech/table/ship/items-ship-table-columns.tsx b/lib/items-tech/table/ship/items-ship-table-columns.tsx
index 2b46db92..29e1d503 100644
--- a/lib/items-tech/table/ship/items-ship-table-columns.tsx
+++ b/lib/items-tech/table/ship/items-ship-table-columns.tsx
@@ -24,6 +24,7 @@ interface ShipbuildingTableItem {
itemId: number;
workType: "기장" | "전장" | "선실" | "배관" | "철의";
shipTypes: string;
+ itemList: string | null;
itemCode: string;
itemName: string;
description: string | null;
@@ -107,11 +108,10 @@ export function getShipbuildingColumns({ setRowAction }: GetColumnsProps): Colum
}
// ----------------------------------------------------------------
- // 3) 데이터 컬럼들을 그룹별로 구성
+ // 3) 데이터 컬럼들 정의
// ----------------------------------------------------------------
- // 3-1) 기본 정보 그룹 컬럼
- const basicInfoColumns: ColumnDef<ShipbuildingTableItem>[] = [
+ const dataColumns: ColumnDef<ShipbuildingTableItem>[] = [
{
accessorKey: "itemCode",
header: ({ column }) => (
@@ -122,20 +122,6 @@ export function getShipbuildingColumns({ setRowAction }: GetColumnsProps): Colum
enableHiding: true,
meta: {
excelHeader: "Material Group",
- group: "기본 정보",
- },
- },
- {
- accessorKey: "itemName",
- header: ({ column }) => (
- <DataTableColumnHeaderSimple column={column} title="Description" />
- ),
- cell: ({ row }) => <div>{row.original.itemName}</div>,
- enableSorting: true,
- enableHiding: true,
- meta: {
- excelHeader: "Description",
- group: "기본 정보",
},
},
{
@@ -148,44 +134,32 @@ export function getShipbuildingColumns({ setRowAction }: GetColumnsProps): Colum
enableHiding: true,
meta: {
excelHeader: "기능(공종)",
- group: "기본 정보",
},
},
{
- accessorKey: "description",
+ accessorKey: "shipTypes",
header: ({ column }) => (
- <DataTableColumnHeaderSimple column={column} title="Size/Dimension" />
+ <DataTableColumnHeaderSimple column={column} title="선종" />
),
- cell: ({ row }) => <div>{row.original.description || "-"}</div>,
+ cell: ({ row }) => <div>{row.original.shipTypes}</div>,
enableSorting: true,
enableHiding: true,
meta: {
- excelHeader: "Size/Dimension",
- group: "기본 정보",
+ excelHeader: "선종",
},
},
- ]
-
- // 3-2) 선종 정보 그룹 컬럼
- const shipTypesColumns: ColumnDef<ShipbuildingTableItem>[] = [
{
- accessorKey: "shipTypes",
+ accessorKey: "itemList",
header: ({ column }) => (
- <DataTableColumnHeaderSimple column={column} title="선종" />
+ <DataTableColumnHeaderSimple column={column} title="아이템 리스트" />
),
- cell: ({ row }) => <div>{row.original.shipTypes}</div>,
+ cell: ({ row }) => <div>{row.original.itemList || "-"}</div>,
enableSorting: true,
enableHiding: true,
meta: {
- excelHeader: "선종",
- group: "선종",
+ excelHeader: "아이템 리스트",
},
},
- ]
-
- // 3-3) 메타데이터 그룹 컬럼
- const metadataColumns: ColumnDef<ShipbuildingTableItem>[] = [
-
{
accessorKey: "createdAt",
header: ({ column }) => (
@@ -196,7 +170,6 @@ export function getShipbuildingColumns({ setRowAction }: GetColumnsProps): Colum
enableHiding: true,
meta: {
excelHeader: "생성일",
- group: "Metadata",
},
},
{
@@ -209,36 +182,16 @@ export function getShipbuildingColumns({ setRowAction }: GetColumnsProps): Colum
enableHiding: true,
meta: {
excelHeader: "수정일",
- group: "Metadata",
},
}
]
-
- // 3-4) 그룹별 컬럼 구성
- const groupedColumns: ColumnDef<ShipbuildingTableItem>[] = [
- {
- id: "기본 정보",
- header: "기본 정보",
- columns: basicInfoColumns,
- },
- {
- id: "선종",
- header: "선종",
- columns: shipTypesColumns,
- },
- {
- id: "Metadata",
- header: "Metadata",
- columns: metadataColumns,
- }
- ]
// ----------------------------------------------------------------
- // 4) 최종 컬럼 배열: select, groupedColumns, actions
+ // 4) 최종 컬럼 배열: select, dataColumns, actions
// ----------------------------------------------------------------
return [
selectColumn,
- ...groupedColumns,
+ ...dataColumns,
actionsColumn,
]
} \ No newline at end of file