From 2b490956c9752c1b756780a3461bc1c37b6fe0a7 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Mon, 15 Sep 2025 18:58:07 +0900 Subject: (김준회) AVL 관리 및 상세 - 기능 구현 1차 + docker compose 내 오류 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/avl/table/project-avl-table-columns.tsx | 167 ++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 lib/avl/table/project-avl-table-columns.tsx (limited to 'lib/avl/table/project-avl-table-columns.tsx') diff --git a/lib/avl/table/project-avl-table-columns.tsx b/lib/avl/table/project-avl-table-columns.tsx new file mode 100644 index 00000000..c052e6f7 --- /dev/null +++ b/lib/avl/table/project-avl-table-columns.tsx @@ -0,0 +1,167 @@ +import { ColumnDef } from "@tanstack/react-table" +import { ProjectAvlItem } from "./project-avl-table" +import { Checkbox } from "@/components/ui/checkbox" + + +// 프로젝트 AVL 테이블 컬럼 +export const getProjectAvlColumns = (): ColumnDef[] => [ + { + id: "select", + header: ({ table }) => ( + table.toggleAllPageRowsSelected(!!value)} + aria-label="Select all" + /> + ), + cell: ({ row, table }) => { + // 프로젝트 AVL 테이블의 단일 선택 핸들러 + const handleRowSelection = (checked: boolean) => { + if (checked) { + // 다른 모든 행의 선택 해제 + table.getRowModel().rows.forEach(r => { + if (r !== row && r.getIsSelected()) { + r.toggleSelected(false) + } + }) + } + // 현재 행 선택/해제 + row.toggleSelected(checked) + } + + return ( + + ) + }, + enableSorting: false, + enableHiding: false, + size: 50, + }, + { + accessorKey: "no", + header: "No.", + size: 60, + cell: ({ row }) => { + return ( + + {row.original.no} + + ) + }, + }, + { + accessorKey: "disciplineName", + header: "설계공종", + size: 120, + cell: ({ row }) => { + return ( + + {row.original.disciplineName} + + ) + }, + }, + { + accessorKey: "materialNameCustomerSide", + header: "고객사 AVL 자재명", + size: 150, + cell: ({ row }) => { + return ( + + {row.original.materialNameCustomerSide} + + ) + }, + }, + { + accessorKey: "materialGroupCode", + header: "자재그룹 코드", + size: 120, + cell: ({ row }) => { + return ( + + {row.original.materialGroupCode} + + ) + }, + }, + { + accessorKey: "materialGroupName", + header: "자재그룹 명", + size: 130, + cell: ({ row }) => { + return ( + + {row.original.materialGroupName} + + ) + }, + }, + { + accessorKey: "avlVendorName", + header: "AVL 등재업체명", + size: 140, + cell: ({ row }) => { + return ( + + {row.original.avlVendorName} + + ) + }, + }, + { + accessorKey: "vendorCode", + header: "협력업체 코드", + size: 120, + cell: ({ row }) => { + return ( + + {row.original.vendorCode} + + ) + }, + }, + { + accessorKey: "vendorName", + header: "협력업체 명", + size: 130, + cell: ({ row }) => { + return ( + + {row.original.vendorName} + + ) + }, + }, + { + accessorKey: "ownerSuggestion", + header: "선주제안", + size: 100, + cell: ({ row }) => { + return ( + + {row.original.ownerSuggestion ? "예" : "아니오"} + + ) + }, + }, + { + accessorKey: "shiSuggestion", + header: "SHI 제안", + size: 100, + cell: ({ row }) => { + return ( + + {row.original.shiSuggestion ? "예" : "아니오"} + + ) + }, + }, +] \ No newline at end of file -- cgit v1.2.3