From 2650b7c0bb0ea12b68a58c0439f72d61df04b2f1 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Fri, 25 Jul 2025 07:51:15 +0000 Subject: (대표님) 정기평가 대상, 미들웨어 수정, nextauth 토큰 처리 개선, GTC 등 (최겸) 기술영업 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/form-data/form-data-table.tsx | 11 ++- .../ship-vendor-document/add-attachment-dialog.tsx | 6 +- .../ship-vendor-document/new-revision-dialog.tsx | 5 +- components/signup/tech-vendor-join-form.tsx | 45 +++++++-- components/tech-vendors/tech-vendor-container.tsx | 103 --------------------- 5 files changed, 52 insertions(+), 118 deletions(-) delete mode 100644 components/tech-vendors/tech-vendor-container.tsx (limited to 'components') diff --git a/components/form-data/form-data-table.tsx b/components/form-data/form-data-table.tsx index 90c8490b..9936e870 100644 --- a/components/form-data/form-data-table.tsx +++ b/components/form-data/form-data-table.tsx @@ -231,6 +231,12 @@ export default function DynamicTable({ const [tempCount, setTempCount] = React.useState(0); const [addTagDialogOpen, setAddTagDialogOpen] = React.useState(false); + // TAG_NO가 있는 첫 번째 행의 shi 값 확인 + const isAddTagDisabled = React.useMemo(() => { + const firstRowWithTagNo = tableData.find(row => row.TAG_NO); + return firstRowWithTagNo?.shi === true; + }, [tableData]); + // Clean up polling on unmount React.useEffect(() => { return () => { @@ -743,7 +749,10 @@ export default function DynamicTable({ Get Tags )} - setAddTagDialogOpen(true)} disabled={isAnyOperationPending}> + setAddTagDialogOpen(true)} + disabled={isAnyOperationPending || isAddTagDisabled} + > Add Tags diff --git a/components/ship-vendor-document/add-attachment-dialog.tsx b/components/ship-vendor-document/add-attachment-dialog.tsx index a285b4de..8357c0b6 100644 --- a/components/ship-vendor-document/add-attachment-dialog.tsx +++ b/components/ship-vendor-document/add-attachment-dialog.tsx @@ -38,7 +38,7 @@ import { useSession } from "next-auth/react" * -----------------------------------------------------------------------------------------------*/ // 파일 검증 스키마 -const MAX_FILE_SIZE = 50 * 1024 * 1024 // 50MB +const MAX_FILE_SIZE = 1024 * 1024 * 1024 // 50MB const ACCEPTED_FILE_TYPES = [ 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', @@ -56,7 +56,7 @@ const attachmentUploadSchema = z.object({ attachments: z .array(z.instanceof(File)) .min(1, "Please upload at least 1 file") - .max(10, "Maximum 10 files can be uploaded") + // .max(10, "Maximum 10 files can be uploaded") .refine( (files) => files.every((file) => file.size <= MAX_FILE_SIZE), "File size must be 50MB or less" @@ -131,7 +131,7 @@ function FileUploadArea({ Drag files to add here or click to select

- Supports PDF, Word, Excel, Image, Text, ZIP files (max 50MB) + Supports PDF, Word, Excel, Image, Text, ZIP files (max 1GB)

{ attachments: z .array(z.instanceof(File)) .min(1, "Please upload at least 1 file") - .max(10, "Maximum 10 files can be uploaded") .refine( (files) => files.every((file) => file.size <= MAX_FILE_SIZE), "File size must be 50MB or less" @@ -219,7 +218,7 @@ function FileUploadArea({ Drag files here or click to select

- Supports PDF, Word, Excel, Image, Text, ZIP files (max 50MB) + Supports PDF, Word, Excel, Image, Text, ZIP files (max 1GB)

{ @@ -297,11 +299,11 @@ export function TechVendorJoinForm() { form.setValue("files", updated, { shouldValidate: true }) } - const handleItemsSelected = (itemCodes: string[]) => { - setSelectedItemCodes(itemCodes) - // 선택된 아이템 코드들을 콤마로 구분하여 items 필드에 설정 - const itemsString = itemCodes.join(", ") - form.setValue("items", itemsString) + type SelectedItem = { type: "SHIP" | "TOP" | "HULL", id: number, code: string, name: string }; + + const handleItemsSelected = (items: SelectedItem[]) => { + setSelectedItemCodes(items.map(item => item.code)); + form.setValue("items", JSON.stringify(items)); } // Submit @@ -805,6 +807,33 @@ export function TechVendorJoinForm() { )} /> + ( + + 직위 + + + + + + )} + /> + + ( + + 국가 + + + + + + )} + /> searchParamsObj || new URLSearchParams(), - [searchParamsObj] - ) - - // URL에서 현재 선택된 벤더 타입 가져오기 - const vendorType = searchParams.get("vendorType") || "all" - - // // 선택한 벤더 타입에 해당하는 이름 찾기 - // const selectedVendor = vendorTypes.find((vendor) => vendor.id === vendorType)?.name || "전체" - - // // 벤더 타입 변경 핸들러 - // const handleVendorTypeChange = React.useCallback((value: string) => { - // const params = new URLSearchParams(searchParams.toString()) - // if (value === "all") { - // params.delete("vendorType") - // } else { - // params.set("vendorType", value) - // } - - // router.push(`${pathname}?${params.toString()}`) - // }, [router, pathname, searchParams]) - - return ( - <> - {/* 상단 영역: 제목 왼쪽 / 벤더 타입 선택기 오른쪽 */} -
- {/* 왼쪽: 타이틀 & 설명 */} -
-
-

기술영업 협력업체 리스트

- -
- {/*

- 기술영업 벤더에 대한 요약 정보를 확인하고 관리할 수 있습니다. -

*/} -
- - {/* 오른쪽: 벤더 타입 드롭다운 - - - - - - {vendorTypes.map((vendor) => ( - handleVendorTypeChange(vendor.id)} - className={vendor.id === vendorType ? "bg-muted" : ""} - > - {vendor.name} - - ))} - - */} -
- - {/* 컨텐츠 영역 */} -
-
- {children} -
-
- - ) -} \ No newline at end of file -- cgit v1.2.3