diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-15 10:07:09 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-15 10:07:09 +0000 |
| commit | 4eb7532f822c821fb6b69bf103bd075fefba769b (patch) | |
| tree | b4bcf6c0bf791d71569f3f35498ed256bf7cfaf3 /lib/techsales-rfq | |
| parent | 660c7888d885badab7af3e96f9c16bd0172ad0f1 (diff) | |
(대표님) 20250715 협력사 정기평가, spreadJS, roles 서비스에 함수 추가
Diffstat (limited to 'lib/techsales-rfq')
| -rw-r--r-- | lib/techsales-rfq/table/tech-sales-quotation-attachments-sheet.tsx | 4 | ||||
| -rw-r--r-- | lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx | 6 |
2 files changed, 8 insertions, 2 deletions
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 && ( <a - href={`/api/tech-sales-rfq-download?path=${encodeURIComponent(field.filePath)}`} - download={field.originalFileName || field.fileName} + // href={`/api/tech-sales-rfq-download?path=${encodeURIComponent(field.filePath)}`} + // download={field.originalFileName || field.fileName} + onClick={() => downloadFile(field.filePath, field.originalFileName || field.fileName)} className="inline-block" > <Button variant="ghost" size="icon" type="button" className="h-8 w-8"> |
