feat(ProjectAttachment): 添加文件下载功能
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user