From 74843fe598702a9a55f914f2d2d291368a5abb13 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 1 Oct 2025 10:31:23 +0000 Subject: (대표님) dolce 수정, spreadjs 수정 등 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user-vendor-document-table-container.tsx | 168 ++++++++++++++------- 1 file changed, 116 insertions(+), 52 deletions(-) (limited to 'components/ship-vendor-document/user-vendor-document-table-container.tsx') diff --git a/components/ship-vendor-document/user-vendor-document-table-container.tsx b/components/ship-vendor-document/user-vendor-document-table-container.tsx index 7fac34a9..775dac47 100644 --- a/components/ship-vendor-document/user-vendor-document-table-container.tsx +++ b/components/ship-vendor-document/user-vendor-document-table-container.tsx @@ -40,6 +40,16 @@ import { useRouter } from 'next/navigation' import { AddAttachmentDialog } from "./add-attachment-dialog" // ✅ import 추가 import { EditRevisionDialog } from "./edit-revision-dialog" // ✅ 추가 import { downloadFile } from "@/lib/file-download" // ✅ 공용 다운로드 함수 import +import { + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, +} from "@/components/ui/alert-dialog" /* ------------------------------------------------------------------------------------------------- * Types & Constants @@ -172,12 +182,12 @@ function RevisionTable({ // ✅ 리비전 수정 가능 여부 확인 함수 const canEditRevision = React.useCallback((revision: RevisionInfo) => { // 첨부파일이 없으면 수정 가능 - if ((!revision.attachments || revision.attachments.length === 0)&&revision.uploaderType ==="vendor") { + if ((!revision.attachments || revision.attachments.length === 0) && revision.uploaderType === "vendor") { return true } // 모든 첨부파일의 dolceFilePath가 null이거나 빈값이어야 수정 가능 - return revision.attachments.every(attachment => + return revision.attachments.every(attachment => !attachment.dolceFilePath || attachment.dolceFilePath.trim() === '' ) }, []) @@ -188,7 +198,7 @@ function RevisionTable({ return 'no-files' } - const processedCount = revision.attachments.filter(attachment => + const processedCount = revision.attachments.filter(attachment => attachment.dolceFilePath && attachment.dolceFilePath.trim() !== '' ).length @@ -241,7 +251,7 @@ function RevisionTable({ {revisions.map((revision) => { const canEdit = canEditRevision(revision) const processStatus = getRevisionProcessStatus(revision) - + return ( )} {processStatus === 'partially-processed' && ( -
)} @@ -333,7 +343,7 @@ function RevisionTable({ {/* ✅ 처리된 파일 수 표시 */} {processStatus === 'partially-processed' && ( - ({revision.attachments.filter(att => + ({revision.attachments.filter(att => att.dolceFilePath && att.dolceFilePath.trim() !== '' ).length} processed) @@ -354,21 +364,20 @@ function RevisionTable({ )} - + {/* ✅ 수정 버튼 */} - - {/* ✅ 삭제 버튼 */} +