From ef4c533ebacc2cdc97e518f30e9a9350004fcdfb Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 28 Apr 2025 02:13:30 +0000
Subject: ~20250428 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/form-data/form-data-table-columns.tsx | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

(limited to 'components/form-data/form-data-table-columns.tsx')

diff --git a/components/form-data/form-data-table-columns.tsx b/components/form-data/form-data-table-columns.tsx
index a136b5d3..4db3a724 100644
--- a/components/form-data/form-data-table-columns.tsx
+++ b/components/form-data/form-data-table-columns.tsx
@@ -16,6 +16,7 @@ import {
   DropdownMenuSubTrigger,
   DropdownMenuTrigger,
 } from "@/components/ui/dropdown-menu";
+import { toast } from 'sonner';
 /** row 액션 관련 타입 */
 export interface DataTableRowAction<TData> {
   row: Row<TData>;
@@ -36,6 +37,7 @@ export interface DataTableColumnJSON {
   type: ColumnType;
   options?: string[];
   uom?: string;
+  uomId?: string;
 }
 /**
  * getColumns 함수에 필요한 props
@@ -47,6 +49,7 @@ interface GetColumnsProps<TData> {
     React.SetStateAction<DataTableRowAction<TData> | null>
   >;
   setReportData: React.Dispatch<React.SetStateAction<{ [key: string]: any }[]>>;
+  tempCount: number;
 }
 
 /**
@@ -58,6 +61,7 @@ export function getColumns<TData extends object>({
   columnsJSON,
   setRowAction,
   setReportData,
+  tempCount,
 }: GetColumnsProps<TData>): ColumnDef<TData>[] {
   // (1) 기본 컬럼들
   const baseColumns: ColumnDef<TData>[] = columnsJSON.map((col) => ({
@@ -73,7 +77,7 @@ export function getColumns<TData extends object>({
       excelHeader: col.label,
       minWidth: 80,
       paddingFactor: 1.2,
-      maxWidth: col.key === "tagNumber" ? 120 : 150,
+      maxWidth: col.key === "TAG_NO" ? 120 : 150,
     },
     // (2) 실제 셀(cell) 렌더링: type에 따라 분기 가능
     cell: ({ row }) => {
@@ -129,22 +133,23 @@ export function getColumns<TData extends object>({
           </DropdownMenuItem>
           <DropdownMenuItem
             onSelect={() => {
+              if(tempCount > 0){
               const { original } = row;
               setReportData([original]);
+            } else {
+              toast.error("업로드된 Template File이 없습니다.");
+            }
             }}
           >
-            Create Vendor Document
+            Create Document
           </DropdownMenuItem>
         </DropdownMenuContent>
       </DropdownMenu>
     ),
-    size: 40,
-    meta: {
-      maxWidth: 40,
-    },
+    minSize: 50,
     enablePinning: true,
   };
 
   // (4) 최종 반환
   return [...baseColumns, actionColumn];
-}
+}
\ No newline at end of file
-- 
cgit v1.2.3

