|
@@ -567,19 +567,14 @@ const handleSelectable = (row) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleDownload = (row: FileItem) => {
|
|
const handleDownload = (row: FileItem) => {
|
|
|
- fetch(row.fileUrl)
|
|
|
|
|
- .then((response) => response.blob())
|
|
|
|
|
- .then((blob) => {
|
|
|
|
|
- const url = URL.createObjectURL(blob)
|
|
|
|
|
- const a = document.createElement('a')
|
|
|
|
|
- a.href = url
|
|
|
|
|
- a.download = row.fileName
|
|
|
|
|
- document.body.appendChild(a)
|
|
|
|
|
- a.click()
|
|
|
|
|
- document.body.removeChild(a)
|
|
|
|
|
- setTimeout(() => URL.revokeObjectURL(url), 100);
|
|
|
|
|
- })
|
|
|
|
|
- .catch((error) => console.error('下载失败:', error))
|
|
|
|
|
|
|
+ const a = document.createElement('a')
|
|
|
|
|
+ a.href = row.fileUrl
|
|
|
|
|
+ a.download = row.fileName
|
|
|
|
|
+ a.target = '_blank'
|
|
|
|
|
+ a.rel = 'noopener noreferrer'
|
|
|
|
|
+ document.body.appendChild(a)
|
|
|
|
|
+ a.click()
|
|
|
|
|
+ document.body.removeChild(a)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const getDictLabelArr = (dictArr, field) => {
|
|
const getDictLabelArr = (dictArr, field) => {
|