From bf34d8aa0c71202336d20b9587beaf1b93832bca Mon Sep 17 00:00:00 2001 From: dj <1042039504@qq.com> Date: Wed, 2 Apr 2025 23:34:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(ProjectAttachment):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailComponent/ProjectAttachment.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/DetailComponent/ProjectAttachment.vue b/src/components/DetailComponent/ProjectAttachment.vue index 221b4ec..e3e0e93 100644 --- a/src/components/DetailComponent/ProjectAttachment.vue +++ b/src/components/DetailComponent/ProjectAttachment.vue @@ -61,7 +61,7 @@ import {addTag, delTag, getTagList, getTags, updateTag} from "@/api/project-manage"; import {ElLoading, ElMessageBox, ElNotification} from "element-plus"; import {searchImplementationFileList, uploadFileList} from "@/api/project-manage/attachment"; -import {deleteFile} from "@/api/project-demand"; +import {deleteFile, downloadFile} from "@/api/project-demand"; const router = useRouter() const route = useRoute() @@ -151,6 +151,15 @@ const isCloseByList = (index) => { // otherAttachmentList.length>0?false:true return otherAttachmentList.value.length == 0; } +const handleDownload = (row) => { + downloadFile(row.fileId).then(res => { + const blob = new Blob([res]) + let a = document.createElement('a') + a.href = URL.createObjectURL(blob) + a.download = row.originalFileName + a.click() + }) +} const deleteSingleFile = (row) => { deleteFile(row.fileId).then(res => { ElNotification({