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({