From 7e86ecb9d3df7f554f82a8d5fdd538d1c148ce73 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Sun, 2 Nov 2025 18:43:05 +0900
Subject: (김준회) PCR: 컬럼 표현방식 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/pcr/table/pcr-table-column.tsx | 56 ++++++++++++++++++++------------------
 1 file changed, 30 insertions(+), 26 deletions(-)

(limited to 'lib/pcr/table/pcr-table-column.tsx')

diff --git a/lib/pcr/table/pcr-table-column.tsx b/lib/pcr/table/pcr-table-column.tsx
index aa4936ce..98cf9502 100644
--- a/lib/pcr/table/pcr-table-column.tsx
+++ b/lib/pcr/table/pcr-table-column.tsx
@@ -1,4 +1,4 @@
-import { ColumnDef } from "@tanstack/react-table"
+import { ColumnDef, Column, Row } from "@tanstack/react-table"
 import { Badge } from "@/components/ui/badge"
 import { Button } from "@/components/ui/button"
 import { Checkbox } from "@/components/ui/checkbox"
@@ -12,9 +12,9 @@ import {
 } from "@/components/ui/dropdown-menu"
 import { DataTableColumnHeaderSimple } from "@/components/data-table/data-table-column-simple-header"
 import { PcrPoData, PCR_APPROVAL_STATUS_CONFIG, PCR_CHANGE_TYPE_CONFIG } from "@/lib/pcr/types"
-import { MoreHorizontal, Eye, Edit, Trash2 } from "lucide-react"
+import { MoreHorizontal, Edit } from "lucide-react"
 import type { DataTableRowAction } from "@/types/table"
-import { DataTableColumnHeader } from "@/components/data-table/data-table-column-header"
+import { formatNumber } from "@/lib/utils"
 
 interface GetColumnsProps {
   setRowAction: React.Dispatch<React.SetStateAction<DataTableRowAction<PcrPoData> | null>>
@@ -81,7 +81,7 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
 
         return (
           <Badge
-            variant={config.variant as any}
+            variant={config.variant as "default" | "secondary" | "destructive" | "outline"}
             className={config.color}
           >
             {config.label}
@@ -137,7 +137,7 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
       cell: ({ row }) => {
         const value = row.getValue("project") as string
         return (
-          <div className="max-w-[200px] truncate" title={value}>
+          <div className="max-w-[200px]" title={value}>
             {value || "-"}
           </div>
         )
@@ -171,7 +171,7 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
       cell: ({ row }) => {
         const value = row.getValue("revItemNumber") as string
         return (
-          <div className="max-w-[150px] truncate" title={value}>
+          <div className="max-w-[150px]" title={value}>
             {value || "-"}
           </div>
         )
@@ -185,7 +185,7 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
       cell: ({ row }) => {
         const value = row.getValue("purchaseContractManager") as string
         return (
-          <div className="max-w-[120px] truncate" title={value}>
+          <div className="max-w-[120px]" title={value}>
             {value || "-"}
           </div>
         )
@@ -199,7 +199,7 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
       cell: ({ row }) => {
         const value = row.getValue("pcrCreator") as string
         return (
-          <div className="max-w-[120px] truncate" title={value}>
+          <div className="max-w-[120px]" title={value}>
             {value || "-"}
           </div>
         )
@@ -212,13 +212,10 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
       ),
       cell: ({ row }) => {
         const value = row.getValue("poContractAmountBefore") as number
-        const currency = row.original.contractCurrency
-
-        if (!value) return "-"
 
         return (
           <div className="text-right font-mono text-sm">
-            {currency} {value.toLocaleString()}
+            {formatNumber(value)}
           </div>
         )
       },
@@ -230,13 +227,10 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
       ),
       cell: ({ row }) => {
         const value = row.getValue("poContractAmountAfter") as number
-        const currency = row.original.contractCurrency
-
-        if (!value) return "-"
 
         return (
           <div className="text-right font-mono text-sm">
-            {currency} {value.toLocaleString()}
+            {formatNumber(value)}
           </div>
         )
       },
@@ -258,10 +252,10 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
     // EvcP 페이지에서만 협력업체 정보 표시
     ...(isEvcpPage ? [{
       accessorKey: "vendorName" as const,
-      header: ({ column }: { column: any }) => (
+      header: ({ column }: { column: Column<PcrPoData, unknown> }) => (
         <DataTableColumnHeaderSimple column={column} title="협력업체" />
       ),
-      cell: ({ row }: { row: any }) => {
+      cell: ({ row }: { row: Row<PcrPoData> }) => {
         const vendorName = row.getValue("vendorName") as string
         const vendorCode = row.original.vendorCode as string
         const displayText = vendorName
@@ -271,7 +265,7 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
           : "-"
 
         return (
-          <div className="max-w-[150px] truncate" title={displayText}>
+          <div className="max-w-[150px]" title={displayText}>
             {displayText}
           </div>
         )
@@ -284,9 +278,21 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
       ),
       cell: ({ row }) => {
         const value = row.getValue("details") as string
+        
+        if (!value) return <div>-</div>
+        
+        // 세미콜론으로 구분하고 빈 문자열 제거
+        const items = value.split(";").filter(item => item.trim() !== "")
+        
+        if (items.length === 0) return <div>-</div>
+        
         return (
-          <div className="max-w-[200px] truncate" title={value}>
-            {value || "-"}
+          <div className="flex flex-wrap gap-1">
+            {items.map((item, index) => (
+              <Badge key={index} variant="secondary" className="text-xs">
+                {item.trim()}
+              </Badge>
+            ))}
           </div>
         )
       },
@@ -299,7 +305,7 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
       cell: ({ row }) => {
         const value = row.getValue("pcrReason") as string
         return (
-          <div className="max-w-[150px] truncate" title={value}>
+          <div className="max-w-[150px]" title={value}>
             {value || "-"}
           </div>
         )
@@ -313,7 +319,7 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
       cell: ({ row }) => {
         const value = row.getValue("detailsReason") as string
         return (
-          <div className="max-w-[150px] truncate" title={value}>
+          <div className="max-w-[150px]" title={value}>
             {value || "-"}
           </div>
         )
@@ -327,7 +333,7 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
       cell: ({ row }) => {
         const value = row.getValue("rejectionReason") as string
         return (
-          <div className="max-w-[150px] truncate" title={value}>
+          <div className="max-w-[150px]" title={value}>
             {value || "-"}
           </div>
         )
@@ -379,8 +385,6 @@ export function getColumns({ setRowAction, isEvcpPage = false }: GetColumnsProps
         <DataTableColumnHeaderSimple column={column} title="작업" />
       ),
       cell: ({ row }) => {
-        const pcrPo = row.original
-
         return (
           <DropdownMenu>
             <DropdownMenuTrigger asChild>
-- 
cgit v1.2.3

