Browse Source

pdf预览注释

release_0.0.4^2^2
LUCAS 3 years ago
parent
commit
19efae5afa
  1. 48
      web/client/src/sections/fillion/components/fileTable.js
  2. 8
      web/log/development.txt
  3. 7
      web/package-lock.json
  4. 1
      web/package.json

48
web/client/src/sections/fillion/components/fileTable.js

@ -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>
];
};

8
web/log/development.txt

@ -0,0 +1,8 @@
2022-07-28 22:42:53.030 - debug: [FS-LOGGER] Init.
2022-07-28 22:42:53.107 - info: [Router] Inject api: attachment/index
2022-07-28 22:49:11.218 - debug: [FS-LOGGER] Init.
2022-07-28 22:49:11.297 - info: [Router] Inject api: attachment/index
2022-07-28 22:54:17.432 - debug: [FS-LOGGER] Init.
2022-07-28 22:54:17.511 - info: [Router] Inject api: attachment/index
2022-07-28 22:55:15.428 - debug: [FS-LOGGER] Init.
2022-07-28 22:55:15.513 - info: [Router] Inject api: attachment/index

7
web/package-lock.json

@ -8359,11 +8359,6 @@
"through": "~2.3"
}
},
"pdfh5": {
"version": "1.4.2",
"resolved": "http://npm.anxinyun.cn:443/pdfh5/-/pdfh5-1.4.2.tgz",
"integrity": "sha512-1BL8HIx/EEZowRPBgas7/WokbGEv1gxKNRmmHSimG113178mKxIBH4pxWBc0tj6d25Sy+EwnlQwv9cUUmQa42w=="
},
"perfect-scrollbar": {
"version": "1.5.5",
"resolved": "http://npm.anxinyun.cn/perfect-scrollbar/-/perfect-scrollbar-1.5.5.tgz",
@ -9340,7 +9335,7 @@
},
"react-quill": {
"version": "1.3.5",
"resolved": "http://npm.anxinyun.cn/react-quill/-/react-quill-1.3.5.tgz",
"resolved": "http://npm.anxinyun.cn:443/react-quill/-/react-quill-1.3.5.tgz",
"integrity": "sha1-jErXWdoDNlsXx5xsUq+pdyJZhE4=",
"dev": true,
"requires": {

1
web/package.json

@ -92,7 +92,6 @@
"swiper": "^8.3.1",
"uuid": "^8.3.1",
"webpack-dev-server": "^3.11.2",
"pdfh5": "^1.4.2",
"xlsx": "^0.16.9"
}
}

Loading…
Cancel
Save