diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-07 08:24:16 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-07 08:24:16 +0000 |
| commit | 44bdb81a60d3a44ba7e379f3c20fe6d8fb284339 (patch) | |
| tree | b5c916a1c7ea37573f9bba7fefcef60a3b8aec20 /lib/tech-vendors/table/tech-vendors-table-columns.tsx | |
| parent | 90f79a7a691943a496f67f01c1e493256070e4de (diff) | |
(대표님) 변경사항 20250707 12시 30분
Diffstat (limited to 'lib/tech-vendors/table/tech-vendors-table-columns.tsx')
| -rw-r--r-- | lib/tech-vendors/table/tech-vendors-table-columns.tsx | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/lib/tech-vendors/table/tech-vendors-table-columns.tsx b/lib/tech-vendors/table/tech-vendors-table-columns.tsx index 438fceac..f690d266 100644 --- a/lib/tech-vendors/table/tech-vendors-table-columns.tsx +++ b/lib/tech-vendors/table/tech-vendors-table-columns.tsx @@ -268,7 +268,54 @@ export function getColumns({ setRowAction, router, openItemsDialog }: GetColumns </div> ); } - + // TechVendorType 컬럼을 badge로 표시 + // if (cfg.id === "techVendorType") { + // const techVendorType = row.original.techVendorType as string; + + // // 벤더 타입 파싱 개선 + // let types: string[] = []; + // if (!techVendorType) { + // types = []; + // } else if (techVendorType.startsWith('[') && techVendorType.endsWith(']')) { + // // JSON 배열 형태 + // try { + // const parsed = JSON.parse(techVendorType); + // types = Array.isArray(parsed) ? parsed.filter(Boolean) : [techVendorType]; + // } catch { + // types = [techVendorType]; + // } + // } else if (techVendorType.includes(',')) { + // // 콤마로 구분된 문자열 + // types = techVendorType.split(',').map(t => t.trim()).filter(Boolean); + // } else { + // // 단일 문자열 + // types = [techVendorType.trim()].filter(Boolean); + // } + // // 벤더 타입 정렬 - 조선 > 해양top > 해양hull 순 + // const typeOrder = ["조선", "해양top", "해양hull"]; + // types.sort((a, b) => { + // const indexA = typeOrder.indexOf(a); + // const indexB = typeOrder.indexOf(b); + + // // 정의된 순서에 있는 경우 우선순위 적용 + // if (indexA !== -1 && indexB !== -1) { + // return indexA - indexB; + // } + // return a.localeCompare(b); + // }); + // return ( + // <div className="flex flex-wrap gap-1"> + // {types.length > 0 ? types.map((type, index) => ( + // <Badge key={`${type}-${index}`} variant="secondary" className="text-xs"> + // {type} + // </Badge> + // )) : ( + // <span className="text-muted-foreground">-</span> + // )} + // </div> + // ); + // } + // 날짜 컬럼 포맷팅 if (cfg.type === "date" && cell.getValue()) { return formatDate(cell.getValue() as Date); |
