From 96ba777cda69af8caf3a6e0e8bfc1aca5016fe58 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 23 Jun 2025 08:59:54 +0000 Subject: (최겸) 기술영업 해양 프로젝트 AVL 개발 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/accepted-quotations-table.tsx | 117 +++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 lib/tech-project-avl/table/accepted-quotations-table.tsx (limited to 'lib/tech-project-avl/table/accepted-quotations-table.tsx') diff --git a/lib/tech-project-avl/table/accepted-quotations-table.tsx b/lib/tech-project-avl/table/accepted-quotations-table.tsx new file mode 100644 index 00000000..da33d0d5 --- /dev/null +++ b/lib/tech-project-avl/table/accepted-quotations-table.tsx @@ -0,0 +1,117 @@ +"use client" + +import * as React from "react" +import { type DataTableAdvancedFilterField } from "@/types/table" +import { useDataTable } from "@/hooks/use-data-table" +import { DataTable } from "@/components/data-table/data-table" +import { DataTableAdvancedToolbar } from "@/components/data-table/data-table-advanced-toolbar" + +import { getColumns, type AcceptedQuotationItem } from "./accepted-quotations-table-columns" +import { AcceptedQuotationsTableToolbarActions } from "./accepted-quotations-table-toolbar-actions" + +interface AcceptedQuotationsTableProps { + data: AcceptedQuotationItem[] + pageCount: number + onRefresh?: () => void +} + +export function AcceptedQuotationsTable({ + data, + pageCount, + onRefresh, +}: AcceptedQuotationsTableProps) { + + // 필터 필드 정의 + const filterFields: DataTableAdvancedFilterField[] = [ + { + id: "rfqCode", + label: "RFQ 코드", + type: "text", + placeholder: "RFQ 코드로 필터...", + }, + { + id: "vendorName", + label: "업체명", + type: "text", + placeholder: "업체명으로 필터...", + }, + { + id: "vendorCode", + label: "업체 코드", + type: "text", + placeholder: "업체 코드로 필터...", + }, + { + id: "projNm", + label: "프로젝트명", + type: "text", + placeholder: "프로젝트명으로 필터...", + }, + { + id: "vendorCountry", + label: "국가", + type: "text", + placeholder: "국가로 필터...", + }, + { + id: "currency", + label: "통화", + type: "select", + options: [ + { label: "USD", value: "USD" }, + { label: "EUR", value: "EUR" }, + { label: "KRW", value: "KRW" }, + { label: "JPY", value: "JPY" }, + { label: "CNY", value: "CNY" }, + ], + }, + { + id: "rfqType", + label: "RFQ 타입", + type: "select", + options: [ + { label: "TOP", value: "TOP" }, + { label: "HULL", value: "HULL" }, + ], + }, + { + id: "dueDate", + label: "마감일", + type: "date", + }, + { + id: "acceptedAt", + label: "승인일", + type: "date", + }, + ] + + const columns = React.useMemo( + () => getColumns(), + [] + ) + + const { table } = useDataTable({ + data, + columns, + pageCount, + filterFields, + initialState: { + sorting: [{ id: "acceptedAt", desc: true }], + columnPinning: { left: ["select"] }, + }, + getRowId: (originalRow) => `${originalRow.id}`, + }) + + return ( +
+ + + + +
+ ) +} \ No newline at end of file -- cgit v1.2.3