|
|
@ -8,28 +8,28 @@ import React, { useEffect, useState } from 'react'; |
|
|
|
import { httpDel } from '@peace/utils' |
|
|
|
import { PinyinHelper } from '@peace/utils'; |
|
|
|
import RoadModal from './file/roadModal'; |
|
|
|
import Pdfh5 from "pdfh5"; |
|
|
|
import "pdfh5/css/pdfh5.css"; |
|
|
|
// import Pdfh5 from "pdfh5";
|
|
|
|
// import "pdfh5/css/pdfh5.css";
|
|
|
|
import FunctionMenu from './file/functionMenu'; |
|
|
|
const { confirm } = Modal; |
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
import UploadModal from './file/uploadModal'; |
|
|
|
|
|
|
|
var pdfh5 = null; |
|
|
|
// var pdfh5 = null;
|
|
|
|
const DetailList = (props) => { |
|
|
|
const { fileList, loading, dispatch, handelRefresh, onPageChange } = props; |
|
|
|
const [imgSrc, setImgSrc] = useState({ imageView: false, imgSrc: '' }) |
|
|
|
const [pdfView, setPdfView] = useState({ showPDF: false, pdfName: '', pdfurl: '' }) |
|
|
|
var tyApiRoot = localStorage.getItem('tyApiRoot') |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (pdfView.showPDF) { |
|
|
|
pdfh5 = new Pdfh5("#pdf-loader", { |
|
|
|
pdfurl: pdfView.pdfurl |
|
|
|
}) |
|
|
|
} |
|
|
|
}, [pdfView]) |
|
|
|
// useEffect(() => {
|
|
|
|
// if (pdfView.showPDF) {
|
|
|
|
// pdfh5 = new Pdfh5("#pdf-loader", {
|
|
|
|
// pdfurl: pdfView.pdfurl
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// }, [pdfView])
|
|
|
|
|
|
|
|
const handleRemove = (record, filePath) => { |
|
|
|
if (record) { |
|
|
@ -144,12 +144,12 @@ const DetailList = (props) => { |
|
|
|
<a style={{ color: '#333398' }} onClick={() => { setImgSrc({ imageView: true, imgSrc: path }) }}>预览</a>] |
|
|
|
: '' |
|
|
|
} |
|
|
|
{ |
|
|
|
{/* { |
|
|
|
['.pdf'].some(item => item == record.fileExt) ? |
|
|
|
[<span className="ant-divider" />, |
|
|
|
<a style={{ color: '#333398' }} onClick={() => overviewPDF(record, path)}>预览</a>] |
|
|
|
: '' |
|
|
|
} |
|
|
|
} */} |
|
|
|
</span> |
|
|
|
}, |
|
|
|
}, |
|
|
@ -184,18 +184,18 @@ const DetailList = (props) => { |
|
|
|
}, |
|
|
|
}} |
|
|
|
/>, |
|
|
|
<Modal |
|
|
|
visible={pdfView.showPDF} |
|
|
|
footer={null} |
|
|
|
title={pdfView.pdfName} |
|
|
|
width={860} |
|
|
|
onCancel={() => { |
|
|
|
pdfh5 = null; |
|
|
|
setPdfView({ showPDF: false, pdfName: '', pdfurl: '' }); |
|
|
|
}} |
|
|
|
> |
|
|
|
<div id="pdf-loader" style={{ width: 830, height: 600, overflowY: 'hidden' }} /> |
|
|
|
</Modal> |
|
|
|
// <Modal
|
|
|
|
// visible={pdfView.showPDF}
|
|
|
|
// footer={null}
|
|
|
|
// title={pdfView.pdfName}
|
|
|
|
// width={860}
|
|
|
|
// onCancel={() => {
|
|
|
|
// pdfh5 = null;
|
|
|
|
// setPdfView({ showPDF: false, pdfName: '', pdfurl: '' });
|
|
|
|
// }}
|
|
|
|
// >
|
|
|
|
// <div id="pdf-loader" style={{ width: 830, height: 600, overflowY: 'hidden' }} />
|
|
|
|
// </Modal>
|
|
|
|
|
|
|
|
]; |
|
|
|
}; |
|
|
|