diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-25 07:51:15 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-25 07:51:15 +0000 |
| commit | 2650b7c0bb0ea12b68a58c0439f72d61df04b2f1 (patch) | |
| tree | 17156183fd74b69d78178065388ac61a18ac07b4 /config/contactPossibleItemsColumnsConfig.ts | |
| parent | d32acea05915bd6c1ed4b95e56c41ef9204347bc (diff) | |
(대표님) 정기평가 대상, 미들웨어 수정, nextauth 토큰 처리 개선, GTC 등
(최겸) 기술영업
Diffstat (limited to 'config/contactPossibleItemsColumnsConfig.ts')
| -rw-r--r-- | config/contactPossibleItemsColumnsConfig.ts | 227 |
1 files changed, 227 insertions, 0 deletions
diff --git a/config/contactPossibleItemsColumnsConfig.ts b/config/contactPossibleItemsColumnsConfig.ts new file mode 100644 index 00000000..a7201a39 --- /dev/null +++ b/config/contactPossibleItemsColumnsConfig.ts @@ -0,0 +1,227 @@ +import { type ContactPossibleItemDetail } from "@/lib/contact-possible-items/service"
+
+export interface ColumnConfig {
+ accessorKey: keyof ContactPossibleItemDetail
+ title: string
+ enableResizing?: boolean
+ enableSorting?: boolean
+ size?: number
+ minSize?: number
+ maxSize?: number
+}
+
+export interface ColumnGroup {
+ id: string
+ header: string
+ columns: ColumnConfig[]
+}
+
+export const contactPossibleItemsColumnsConfig: ColumnGroup[] = [
+ // 아이템 정보 그룹
+ {
+ id: "itemInfo",
+ header: "아이템 정보",
+ columns: [
+ {
+ accessorKey: "workType",
+ title: "공종",
+ enableResizing: true,
+ enableSorting: true,
+ size: 120,
+ minSize: 80,
+ maxSize: 200,
+ },
+ {
+ accessorKey: "shipTypes",
+ title: "선종",
+ enableResizing: true,
+ enableSorting: true,
+ size: 120,
+ minSize: 80,
+ maxSize: 200,
+ },
+ {
+ accessorKey: "itemCode",
+ title: "자재 그룹",
+ enableResizing: true,
+ enableSorting: true,
+ size: 150,
+ minSize: 100,
+ maxSize: 250,
+ },
+ {
+ accessorKey: "itemList",
+ title: "자재명",
+ enableResizing: true,
+ enableSorting: true,
+ size: 200,
+ minSize: 150,
+ maxSize: 300,
+ },
+ {
+ accessorKey: "subItemList",
+ title: "자재명(상세)",
+ enableResizing: true,
+ enableSorting: true,
+ size: 180,
+ minSize: 120,
+ maxSize: 280,
+ },
+ ],
+ },
+
+ // 벤더 정보 그룹
+ {
+ id: "vendorInfo",
+ header: "벤더 정보",
+ columns: [
+ {
+ accessorKey: "vendorCode",
+ title: "벤더 코드",
+ enableResizing: true,
+ enableSorting: true,
+ size: 120,
+ minSize: 80,
+ maxSize: 180,
+ },
+ {
+ accessorKey: "vendorName",
+ title: "벤더명",
+ enableResizing: true,
+ enableSorting: true,
+ size: 150,
+ minSize: 100,
+ maxSize: 250,
+ },
+ {
+ accessorKey: "vendorCountry",
+ title: "벤더 국가",
+ enableResizing: true,
+ enableSorting: true,
+ size: 120,
+ minSize: 80,
+ maxSize: 180,
+ },
+ {
+ accessorKey: "techVendorType",
+ title: "벤더 타입",
+ enableResizing: true,
+ enableSorting: true,
+ size: 130,
+ minSize: 90,
+ maxSize: 200,
+ },
+ ],
+ },
+
+ // 담당자 정보 그룹
+ {
+ id: "contactInfo",
+ header: "담당자 정보",
+ columns: [
+ {
+ accessorKey: "contactName",
+ title: "담당자명",
+ enableResizing: true,
+ enableSorting: true,
+ size: 120,
+ minSize: 80,
+ maxSize: 200,
+ },
+ {
+ accessorKey: "contactPosition",
+ title: "직책",
+ enableResizing: true,
+ enableSorting: true,
+ size: 100,
+ minSize: 70,
+ maxSize: 150,
+ },
+ {
+ accessorKey: "contactTitle",
+ title: "직위",
+ enableResizing: true,
+ enableSorting: true,
+ size: 100,
+ minSize: 70,
+ maxSize: 150,
+ },
+ {
+ accessorKey: "contactEmail",
+ title: "담당자 이메일",
+ enableResizing: true,
+ enableSorting: true,
+ size: 200,
+ minSize: 150,
+ maxSize: 300,
+ },
+ {
+ accessorKey: "contactPhone",
+ title: "담당자 전화번호",
+ enableResizing: true,
+ enableSorting: true,
+ size: 150,
+ minSize: 120,
+ maxSize: 220,
+ },
+ {
+ accessorKey: "contactCountry",
+ title: "담당자 국가",
+ enableResizing: true,
+ enableSorting: true,
+ size: 120,
+ minSize: 80,
+ maxSize: 180,
+ },
+ {
+ accessorKey: "isPrimary",
+ title: "주담당자",
+ enableResizing: true,
+ enableSorting: true,
+ size: 80,
+ minSize: 60,
+ maxSize: 120,
+ },
+ ],
+ },
+
+ // 시스템 정보 그룹
+ {
+ id: "systemInfo",
+ header: "시스템 정보",
+ columns: [
+ {
+ accessorKey: "createdAt",
+ title: "생성일",
+ enableResizing: true,
+ enableSorting: true,
+ size: 150,
+ minSize: 120,
+ maxSize: 200,
+ },
+ {
+ accessorKey: "updatedAt",
+ title: "수정일",
+ enableResizing: true,
+ enableSorting: true,
+ size: 150,
+ minSize: 120,
+ maxSize: 200,
+ },
+ ],
+ },
+]
+
+// 플랫 컬럼 배열 (그룹핑 없이 단순 배열이 필요한 경우)
+export const flatContactPossibleItemsColumns: ColumnConfig[] =
+ contactPossibleItemsColumnsConfig.flatMap(group => group.columns)
+
+// 특정 컬럼만 선택해서 사용할 수 있는 헬퍼 함수
+export function getSelectedColumns(columnKeys: Array<keyof ContactPossibleItemDetail>): ColumnConfig[] {
+ return flatContactPossibleItemsColumns.filter(col => columnKeys.includes(col.accessorKey))
+}
+
+// 특정 그룹만 선택해서 사용할 수 있는 헬퍼 함수
+export function getSelectedGroups(groupIds: string[]): ColumnGroup[] {
+ return contactPossibleItemsColumnsConfig.filter(group => groupIds.includes(group.id))
+}
\ No newline at end of file |
