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

1
web/package.json

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

Loading…
Cancel
Save