Merge pull request 'feat(ProjectAttachment): 添加文件下载功能' (#964) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/964
This commit is contained in:
2025-04-02 15:37:56 +00:00

View File

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