From 45f4c426c98d86a251644a4858740bec989edf83 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Tue, 20 May 2025 09:01:22 +0000 Subject: (최겸) 기술영업 아이템리스트 수정 및 개발 0520 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/ship/items-ship-table-columns.tsx | 73 ++++------------------ 1 file changed, 13 insertions(+), 60 deletions(-) (limited to 'lib/items-tech/table/ship/items-ship-table-columns.tsx') 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[] = [ + const dataColumns: ColumnDef[] = [ { 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 }) => ( - - ), - cell: ({ row }) =>
{row.original.itemName}
, - 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 }) => ( - + ), - cell: ({ row }) =>
{row.original.description || "-"}
, + cell: ({ row }) =>
{row.original.shipTypes}
, enableSorting: true, enableHiding: true, meta: { - excelHeader: "Size/Dimension", - group: "기본 정보", + excelHeader: "선종", }, }, - ] - - // 3-2) 선종 정보 그룹 컬럼 - const shipTypesColumns: ColumnDef[] = [ { - accessorKey: "shipTypes", + accessorKey: "itemList", header: ({ column }) => ( - + ), - cell: ({ row }) =>
{row.original.shipTypes}
, + cell: ({ row }) =>
{row.original.itemList || "-"}
, enableSorting: true, enableHiding: true, meta: { - excelHeader: "선종", - group: "선종", + excelHeader: "아이템 리스트", }, }, - ] - - // 3-3) 메타데이터 그룹 컬럼 - const metadataColumns: ColumnDef[] = [ - { 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[] = [ - { - 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 -- cgit v1.2.3