|
|
@@ -12,6 +12,7 @@ import { baseFormData } from '@/pages/Zother/data'
|
|
|
import { voucherCenterTableC } from '@/utils/tableData'
|
|
|
import { Button, message } from 'antd'
|
|
|
import tabLeftArr from '@/pages/Layout/data'
|
|
|
+import { downloadFileByUrl } from '@/utils'
|
|
|
|
|
|
function A4proof() {
|
|
|
const tableInfo = useSelector((state: RootState) => state.A4proof.tableInfo)
|
|
|
@@ -67,7 +68,7 @@ function A4proof() {
|
|
|
window.open(fullUrl)
|
|
|
}
|
|
|
}
|
|
|
- // 已知路径,单独下载
|
|
|
+ // 已知路径,单独下载 改为使用downloadFileByUrl
|
|
|
// const downloadSingleFn = (path: string, fileName: string) => {
|
|
|
// const downloadUrl = `${baseURL}${path}`
|
|
|
// const link = document.createElement('a')
|
|
|
@@ -177,14 +178,7 @@ function A4proof() {
|
|
|
<Button
|
|
|
size='small'
|
|
|
type='text'
|
|
|
- onClick={() => {
|
|
|
- const id = Number(item.id)
|
|
|
- if (Number.isNaN(id)) {
|
|
|
- message.error('当前附件ID异常,无法下载')
|
|
|
- return
|
|
|
- }
|
|
|
- downloadFn(id)
|
|
|
- }}
|
|
|
+ onClick={() => downloadFileByUrl(item.filePath, item.fileName)}
|
|
|
>
|
|
|
下载
|
|
|
</Button>
|