From ff902243a658067fae858a615c0629aa2e0a4837 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 11 Jun 2025 12:18:38 +0000 Subject: (대표님) 20250611 21시 15분 OCR 등 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/welding/table/ocr-table-columns.tsx | 115 ++++++++++++++++++-------------- 1 file changed, 65 insertions(+), 50 deletions(-) (limited to 'lib/welding/table/ocr-table-columns.tsx') diff --git a/lib/welding/table/ocr-table-columns.tsx b/lib/welding/table/ocr-table-columns.tsx index 85830405..d1aefe06 100644 --- a/lib/welding/table/ocr-table-columns.tsx +++ b/lib/welding/table/ocr-table-columns.tsx @@ -14,11 +14,11 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" -import { DataTableColumnHeader } from "@/components/data-table/data-table-column-header" import { toast } from "sonner" import { formatDate } from "@/lib/utils" import { OcrRow } from "@/db/schema" import { type DataTableRowAction } from "@/types/table" +import { DataTableColumnHeaderSimple } from "@/components/data-table/data-table-column-simple-header" interface GetColumnsProps { setRowAction: React.Dispatch | null>> @@ -56,26 +56,16 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef { accessorKey: "reportNo", header: ({ column }) => ( - + ), cell: ({ getValue }) => { const reportNo = getValue() as string return (
- + {/* */} {reportNo || "N/A"} - - + {/* */} +
) }, @@ -87,7 +77,7 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef { accessorKey: "no", header: ({ column }) => ( - + ), cell: ({ getValue }) => { const no = getValue() as string @@ -104,7 +94,7 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef { accessorKey: "identificationNo", header: ({ column }) => ( - + ), cell: ({ getValue }) => { const identificationNo = getValue() as string @@ -121,7 +111,7 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef { accessorKey: "tagNo", header: ({ column }) => ( - + ), cell: ({ getValue }) => { const tagNo = getValue() as string @@ -138,7 +128,7 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef { accessorKey: "jointNo", header: ({ column }) => ( - + ), cell: ({ getValue }) => { const jointNo = getValue() as string @@ -155,7 +145,7 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef { accessorKey: "jointType", header: ({ column }) => ( - + ), cell: ({ getValue }) => { const jointType = getValue() as string @@ -172,7 +162,7 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef { accessorKey: "weldingDate", header: ({ column }) => ( - + ), cell: ({ getValue }) => { const weldingDate = getValue() as string @@ -189,7 +179,7 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef { accessorKey: "confidence", header: ({ column }) => ( - + ), cell: ({ getValue }) => { const confidence = parseFloat(getValue() as string) || 0 @@ -209,46 +199,78 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef }, // Source Table 컬럼 + // { + // accessorKey: "sourceTable", + // header: ({ column }) => ( + // + // ), + // cell: ({ getValue }) => { + // const sourceTable = getValue() as number + // return ( + //
+ // + // T{sourceTable} + // + //
+ // ) + // }, + // enableSorting: true, + // }, + + // // Source Row 컬럼 + // { + // accessorKey: "sourceRow", + // header: ({ column }) => ( + // + // ), + // cell: ({ getValue }) => { + // const sourceRow = getValue() as number + // return ( + //
+ // {sourceRow} + //
+ // ) + // }, + // enableSorting: true, + // }, + + { - accessorKey: "sourceTable", + accessorKey: "userName", header: ({ column }) => ( - + ), cell: ({ getValue }) => { - const sourceTable = getValue() as number + const userName = getValue() as string return ( -
- - T{sourceTable} - +
+ {userName || "-"}
) }, enableSorting: true, }, - // Source Row 컬럼 { - accessorKey: "sourceRow", + accessorKey: "userEmail", header: ({ column }) => ( - + ), cell: ({ getValue }) => { - const sourceRow = getValue() as number + const userEmail = getValue() as string return ( -
- {sourceRow} +
+ {userEmail || "-"}
) }, enableSorting: true, }, - // Created At 컬럼 { accessorKey: "createdAt", header: ({ column }) => ( - + ), cell: ({ cell }) => { const date = cell.getValue() as Date @@ -276,24 +298,17 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef - { - const rowData = row.original - navigator.clipboard.writeText(JSON.stringify(rowData, null, 2)) - toast.success("Row data copied to clipboard") + setRowAction({ type: "update", row }) }} + // className="text-destructive focus:text-destructive" > - + - { - setRowAction({ type: "view", row }) - }} - > - View Details - + { setRowAction({ type: "delete", row }) -- cgit v1.2.3