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:
@@ -61,7 +61,7 @@
|
|||||||
import {addTag, delTag, getTagList, getTags, updateTag} from "@/api/project-manage";
|
import {addTag, delTag, getTagList, getTags, updateTag} from "@/api/project-manage";
|
||||||
import {ElLoading, ElMessageBox, ElNotification} from "element-plus";
|
import {ElLoading, ElMessageBox, ElNotification} from "element-plus";
|
||||||
import {searchImplementationFileList, uploadFileList} from "@/api/project-manage/attachment";
|
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 router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -151,6 +151,15 @@ const isCloseByList = (index) => {
|
|||||||
// otherAttachmentList.length>0?false:true
|
// otherAttachmentList.length>0?false:true
|
||||||
return otherAttachmentList.value.length == 0;
|
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) => {
|
const deleteSingleFile = (row) => {
|
||||||
deleteFile(row.fileId).then(res => {
|
deleteFile(row.fileId).then(res => {
|
||||||
ElNotification({
|
ElNotification({
|
||||||
|
|||||||
Reference in New Issue
Block a user