From 4eb7532f822c821fb6b69bf103bd075fefba769b Mon Sep 17 00:00:00 2001 From: dujinkim Date: Tue, 15 Jul 2025 10:07:09 +0000 Subject: (대표님) 20250715 협력사 정기평가, spreadJS, roles 서비스에 함수 추가 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/techsales-rfq/table/tech-sales-quotation-attachments-sheet.tsx | 4 ++++ lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/techsales-rfq/table') diff --git a/lib/techsales-rfq/table/tech-sales-quotation-attachments-sheet.tsx b/lib/techsales-rfq/table/tech-sales-quotation-attachments-sheet.tsx index 6d6bde5a..08363535 100644 --- a/lib/techsales-rfq/table/tech-sales-quotation-attachments-sheet.tsx +++ b/lib/techsales-rfq/table/tech-sales-quotation-attachments-sheet.tsx @@ -14,6 +14,7 @@ import { Badge } from "@/components/ui/badge" import { Separator } from "@/components/ui/separator" import { formatDate } from "@/lib/utils" import prettyBytes from "pretty-bytes" +import { downloadFile } from "@/lib/file-download" // 견적서 첨부파일 타입 정의 export interface QuotationAttachment { @@ -82,6 +83,8 @@ export function TechSalesQuotationAttachmentsSheet({ // 파일 다운로드 처리 const handleDownload = (attachment: QuotationAttachment) => { + downloadFile(attachment.filePath, attachment.originalFileName || attachment.fileName) + /* const link = document.createElement('a'); link.href = attachment.filePath; link.download = attachment.originalFileName || attachment.fileName; @@ -89,6 +92,7 @@ export function TechSalesQuotationAttachmentsSheet({ document.body.appendChild(link); link.click(); document.body.removeChild(link); + */ }; // 리비전별로 첨부파일 그룹핑 diff --git a/lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx b/lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx index 0593206a..fccedf0a 100644 --- a/lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx +++ b/lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx @@ -51,6 +51,7 @@ import prettyBytes from "pretty-bytes" import { formatDate } from "@/lib/utils" import { processTechSalesRfqAttachments } from "@/lib/techsales-rfq/service" import { useSession } from "next-auth/react" +import { downloadFile } from "@/lib/file-download" const MAX_FILE_SIZE = 6e8 // 600MB @@ -406,8 +407,9 @@ export function TechSalesRfqAttachmentsSheet({ {/* Download button */} {field.filePath && ( downloadFile(field.filePath, field.originalFileName || field.fileName)} className="inline-block" >