From ed864fa46c7ce0aac2de4c5ba5d311ebfd7e6a88 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Thu, 15 May 2025 01:34:49 +0000
Subject: (대표님) 벤더 문서 관련 개발사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/vendors/table/vendors-table-columns.tsx | 45 +++++++++++++++++++----------
 1 file changed, 29 insertions(+), 16 deletions(-)

(limited to 'lib/vendors/table/vendors-table-columns.tsx')

diff --git a/lib/vendors/table/vendors-table-columns.tsx b/lib/vendors/table/vendors-table-columns.tsx
index c768b587..21086918 100644
--- a/lib/vendors/table/vendors-table-columns.tsx
+++ b/lib/vendors/table/vendors-table-columns.tsx
@@ -51,9 +51,12 @@ type NextRouter = ReturnType<typeof useRouter>;
 interface GetColumnsProps {
   setRowAction: React.Dispatch<React.SetStateAction<DataTableRowAction<VendorWithType> | null>>;
   router: NextRouter;
-  userId: number; 
+  userId: number;
 }
 
+
+
+
 /**
  * tanstack table 컬럼 정의 (중첩 헤더 버전)
  */
@@ -110,13 +113,13 @@ export function getColumns({ setRowAction, router, userId }: GetColumnsProps): C
             </Button>
           </DropdownMenuTrigger>
           <DropdownMenuContent align="end" className="w-56">
-          {(isApproved ||afterApproved) && (
-            <DropdownMenuItem
-              onSelect={() => setRowAction({ row, type: "update" })}
-            >
-              레코드 편집
-            </DropdownMenuItem>
-                )}
+            {(isApproved || afterApproved) && (
+              <DropdownMenuItem
+                onSelect={() => setRowAction({ row, type: "update" })}
+              >
+                레코드 편집
+              </DropdownMenuItem>
+            )}
 
             <DropdownMenuItem
               onSelect={() => {
@@ -130,10 +133,18 @@ export function getColumns({ setRowAction, router, userId }: GetColumnsProps): C
               상세보기
             </DropdownMenuItem>
             <DropdownMenuItem
-            onSelect={() => setRowAction({ row, type: "log" })}
-          >
-            감사 로그 보기
-          </DropdownMenuItem>
+              onSelect={() => {
+                // 새창으로 열기 위해 window.open() 사용
+                window.open(`/evcp/vendors/${row.original.id}/info`, '_blank');
+              }}
+            >
+              상세보기(새창)
+            </DropdownMenuItem>
+            <DropdownMenuItem
+              onSelect={() => setRowAction({ row, type: "log" })}
+            >
+              감사 로그 보기
+            </DropdownMenuItem>
 
             <Separator />
             <DropdownMenuSub>
@@ -409,10 +420,12 @@ export function getColumns({ setRowAction, router, userId }: GetColumnsProps): C
       <DataTableColumnHeaderSimple column={column} title="" />
     ),
     cell: ({ row }) => {
-      // hasAttachments 및 attachmentsList 속성이 추가되었다고 가정
-      const hasAttachments = (row.original as VendorWithAttachments).hasAttachments;
-      const attachmentsList = (row.original as VendorWithAttachments).attachmentsList || [];
-
+      const vendor = row.original as unknown as VendorWithAttachments;
+    
+    // 속성이 undefined일 수 있으므로 옵셔널 체이닝과 기본값 사용
+    const hasAttachments = vendor.hasAttachments ?? false;
+    const attachmentsList = vendor.attachmentsList ?? [];
+    
       if (hasAttachments) {
         // 서버 액션을 사용하는 컴포넌트로 교체
         return (
-- 
cgit v1.2.3

