xh-lab-rc 0.16.1 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,8 +12,9 @@ interface PdfViewerProps {
|
|
|
12
12
|
onChangeBookmarkDatas?: (any: any) => void;
|
|
13
13
|
onTimeoutCallback?: () => void;
|
|
14
14
|
onCollected?: () => void;
|
|
15
|
+
onDownloaded?: () => void;
|
|
15
16
|
isColl?: boolean;
|
|
16
17
|
btnShowList?: Array<boolean>;
|
|
17
18
|
}
|
|
18
|
-
declare const LabPdfViewMobile: ({ src, pdfjsSrc, fileTypeName, fileTitle, isColl, timeout, showTop, onCollected, onTimeoutCallback, onChangeBookmarkDatas, btnShowList, }: PdfViewerProps) => React.JSX.Element;
|
|
19
|
+
declare const LabPdfViewMobile: ({ src, pdfjsSrc, fileTypeName, fileTitle, isColl, timeout, showTop, onCollected, onDownloaded, onTimeoutCallback, onChangeBookmarkDatas, btnShowList, }: PdfViewerProps) => React.JSX.Element;
|
|
19
20
|
export default LabPdfViewMobile;
|
|
@@ -10,7 +10,6 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
10
10
|
*/
|
|
11
11
|
import { SearchBar, TabBar } from 'antd-mobile';
|
|
12
12
|
import { CloseOutline, DownlandOutline, LeftOutline, RightOutline, SearchOutline, StarOutline, UnorderedListOutline } from 'antd-mobile-icons';
|
|
13
|
-
import axios from 'axios';
|
|
14
13
|
import * as React from 'react';
|
|
15
14
|
import { useEffect, useState } from 'react';
|
|
16
15
|
import "./style.less";
|
|
@@ -28,6 +27,7 @@ var LabPdfViewMobile = function LabPdfViewMobile(_ref) {
|
|
|
28
27
|
_ref$showTop = _ref.showTop,
|
|
29
28
|
showTop = _ref$showTop === void 0 ? true : _ref$showTop,
|
|
30
29
|
onCollected = _ref.onCollected,
|
|
30
|
+
onDownloaded = _ref.onDownloaded,
|
|
31
31
|
onTimeoutCallback = _ref.onTimeoutCallback,
|
|
32
32
|
onChangeBookmarkDatas = _ref.onChangeBookmarkDatas,
|
|
33
33
|
_ref$btnShowList = _ref.btnShowList,
|
|
@@ -78,24 +78,11 @@ var LabPdfViewMobile = function LabPdfViewMobile(_ref) {
|
|
|
78
78
|
} // 切换Tab
|
|
79
79
|
function _downFileToLocal() {
|
|
80
80
|
_downFileToLocal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
81
|
-
var res, a;
|
|
82
81
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
83
82
|
while (1) switch (_context.prev = _context.next) {
|
|
84
83
|
case 0:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
responseType: 'blob'
|
|
88
|
-
});
|
|
89
|
-
case 2:
|
|
90
|
-
res = _context.sent;
|
|
91
|
-
// const blob = new Blob(res.data, {type: "application/pdf"})
|
|
92
|
-
a = document.createElement('a');
|
|
93
|
-
a.href = URL.createObjectURL(res.data);
|
|
94
|
-
a.download = "".concat(Date.now(), ".pdf");
|
|
95
|
-
a.click();
|
|
96
|
-
URL.revokeObjectURL(a.href);
|
|
97
|
-
a.remove();
|
|
98
|
-
case 9:
|
|
84
|
+
onDownloaded === null || onDownloaded === void 0 || onDownloaded();
|
|
85
|
+
case 1:
|
|
99
86
|
case "end":
|
|
100
87
|
return _context.stop();
|
|
101
88
|
}
|
|
@@ -146,6 +133,7 @@ var LabPdfViewMobile = function LabPdfViewMobile(_ref) {
|
|
|
146
133
|
iframeWindow.PDFViewerApplication.findBar.highlightAll.checked = true;
|
|
147
134
|
iframeWindow.PDFViewerApplication.findBar.dispatchEvent('highlightallchange');
|
|
148
135
|
if (value === '') {
|
|
136
|
+
setFindCount(['0', '0']);
|
|
149
137
|
return;
|
|
150
138
|
}
|
|
151
139
|
setTimeout(function () {
|
|
@@ -345,7 +333,7 @@ var LabPdfViewMobile = function LabPdfViewMobile(_ref) {
|
|
|
345
333
|
},
|
|
346
334
|
fontSize: 16,
|
|
347
335
|
onClick: clickPreviousHandle
|
|
348
|
-
}), /*#__PURE__*/React.createElement("span", null, findCount[0]), "/", /*#__PURE__*/React.createElement("span", null, findCount[1]), /*#__PURE__*/React.createElement(RightOutline, {
|
|
336
|
+
}), /*#__PURE__*/React.createElement("span", null, (findCount === null || findCount === void 0 ? void 0 : findCount[0]) || '0'), "/", /*#__PURE__*/React.createElement("span", null, (findCount === null || findCount === void 0 ? void 0 : findCount[1]) || '0'), /*#__PURE__*/React.createElement(RightOutline, {
|
|
349
337
|
style: {
|
|
350
338
|
marginLeft: '10px'
|
|
351
339
|
},
|