11.18 修改获取下载路径的方法,让页面内pdf组件正常获取文件链接
This commit is contained in:
@ -3,7 +3,7 @@ import { Modal, Button } from 'antd';
|
||||
import PDF from 'react-pdf-js';
|
||||
import ProCard from '@ant-design/pro-card';
|
||||
import FileDown from '@/utils/Download';
|
||||
import { getDownloadFileUrl, getFileListByBid } from '../DownloadUtils';
|
||||
import { getFileListByBid, useDownLoadUrl } from '../DownloadUtils';
|
||||
/**
|
||||
* Pdf Modal弹窗公共组件
|
||||
* 2021.8.25 zhoujianlong 根据定标结果通知书的弹出窗口改造初始版本,增加备注
|
||||
@ -17,6 +17,7 @@ interface PdfModalProps {
|
||||
|
||||
const PdfModal: React.FC<PdfModalProps> = (props) => {
|
||||
const { fileId, downLoadFileName, modalVisible, onCancel } = props;
|
||||
const [url] = useDownLoadUrl(fileId);
|
||||
const [page, setPage] = useState<number>(1); //页码
|
||||
const [pages, setPages] = useState<number>(0); //总页数
|
||||
const [fileExist, setFileExist] = useState<string>('0'); //0:未验证,1:验证后有,2:验证后没有
|
||||
@ -93,10 +94,10 @@ const PdfModal: React.FC<PdfModalProps> = (props) => {
|
||||
<ProCard layout="center" direction="column" ghost>
|
||||
{fileExist == '0' ? (
|
||||
<div />
|
||||
) : fileExist == '1' ? (
|
||||
) : fileExist == '1' ? url != "" && (
|
||||
<>
|
||||
<PDF
|
||||
file={getDownloadFileUrl(fileId)}
|
||||
file={url}
|
||||
scale={1.6}
|
||||
onDocumentComplete={onDocumentComplete}
|
||||
page={page}
|
||||
|
Reference in New Issue
Block a user