@cecee/document-flip-book 1.0.18 → 1.0.20
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.
- package/dist/cjs/AccountingBook/assets/active-line.png +0 -0
- package/dist/cjs/AccountingBook/assets/default-line.png +0 -0
- package/dist/cjs/AccountingBook/assets/filp-bg.png +0 -0
- package/dist/cjs/AccountingBook/components/AccountingVoucher/index.d.ts +26 -0
- package/dist/cjs/AccountingBook/components/AccountingVoucher/index.js +398 -0
- package/dist/cjs/AccountingBook/components/AccountingVoucher/index.less +231 -0
- package/dist/cjs/AccountingBook/components/ExportModal.d.ts +10 -0
- package/dist/cjs/AccountingBook/components/ExportModal.js +96 -0
- package/dist/cjs/AccountingBook/components/FilpPage.d.ts +7 -0
- package/dist/cjs/AccountingBook/components/FilpPage.js +39 -0
- package/dist/cjs/AccountingBook/components/HeaderBar.d.ts +28 -0
- package/dist/cjs/AccountingBook/components/HeaderBar.js +245 -0
- package/dist/cjs/AccountingBook/components/ImagePageRenderer.d.ts +11 -0
- package/dist/cjs/AccountingBook/components/ImagePageRenderer.js +91 -0
- package/dist/cjs/AccountingBook/components/LoadingComponent.d.ts +7 -0
- package/dist/cjs/AccountingBook/components/LoadingComponent.js +54 -0
- package/dist/cjs/AccountingBook/components/PDFPageRenderer.d.ts +13 -0
- package/dist/cjs/AccountingBook/components/PDFPageRenderer.js +259 -0
- package/dist/cjs/AccountingBook/components/index.less +6 -0
- package/dist/cjs/AccountingBook/constants.d.ts +11 -0
- package/dist/cjs/AccountingBook/constants.js +25 -0
- package/dist/cjs/AccountingBook/hooks/useAmountSearch.d.ts +24 -0
- package/dist/cjs/AccountingBook/hooks/useAmountSearch.js +165 -0
- package/dist/cjs/AccountingBook/hooks/usePageFlip.d.ts +15 -0
- package/dist/cjs/AccountingBook/hooks/usePageFlip.js +67 -0
- package/dist/cjs/AccountingBook/index.d.ts +29 -1
- package/dist/cjs/AccountingBook/index.js +1163 -7
- package/dist/cjs/AccountingBook/index.less +188 -0
- package/dist/cjs/AccountingBook/types.d.ts +84 -0
- package/dist/cjs/AccountingBook/types.js +5 -0
- package/dist/cjs/AccountingBook/utils/canvasUtils.d.ts +51 -0
- package/dist/cjs/AccountingBook/utils/canvasUtils.js +499 -0
- package/dist/cjs/AccountingBook/utils/html.d.ts +9 -0
- package/dist/cjs/AccountingBook/utils/html.js +97 -0
- package/dist/cjs/AccountingBook/utils/utils.d.ts +38 -0
- package/dist/cjs/AccountingBook/utils/utils.js +204 -0
- package/dist/cjs/DocumentFlipBook/ExportModal.d.ts +1 -1
- package/dist/cjs/DocumentFlipBook/ExportModal.js +1 -1
- package/dist/cjs/DocumentFlipBook/HeaderBar.d.ts +2 -1
- package/dist/cjs/DocumentFlipBook/HeaderBar.js +13 -11
- package/dist/cjs/DocumentFlipBook/SideTabs.js +111 -6
- package/dist/cjs/DocumentFlipBook/index.d.ts +1 -0
- package/dist/cjs/DocumentFlipBook/index.js +9 -6
- package/dist/cjs/DocumentFlipBook/index.less +239 -12
- package/dist/cjs/declarations.d.ts +21 -0
- package/dist/esm/AccountingBook/assets/active-line.png +0 -0
- package/dist/esm/AccountingBook/assets/default-line.png +0 -0
- package/dist/esm/AccountingBook/assets/filp-bg.png +0 -0
- package/dist/esm/AccountingBook/components/AccountingVoucher/index.d.ts +26 -0
- package/dist/esm/AccountingBook/components/AccountingVoucher/index.js +391 -0
- package/dist/esm/AccountingBook/components/AccountingVoucher/index.less +231 -0
- package/dist/esm/AccountingBook/components/ExportModal.d.ts +10 -0
- package/dist/esm/AccountingBook/components/ExportModal.js +88 -0
- package/dist/esm/AccountingBook/components/FilpPage.d.ts +7 -0
- package/dist/esm/AccountingBook/components/FilpPage.js +33 -0
- package/dist/esm/AccountingBook/components/HeaderBar.d.ts +28 -0
- package/dist/esm/AccountingBook/components/HeaderBar.js +236 -0
- package/dist/esm/AccountingBook/components/ImagePageRenderer.d.ts +11 -0
- package/dist/esm/AccountingBook/components/ImagePageRenderer.js +85 -0
- package/dist/esm/AccountingBook/components/LoadingComponent.d.ts +7 -0
- package/dist/esm/AccountingBook/components/LoadingComponent.js +48 -0
- package/dist/esm/AccountingBook/components/PDFPageRenderer.d.ts +13 -0
- package/dist/esm/AccountingBook/components/PDFPageRenderer.js +252 -0
- package/dist/esm/AccountingBook/components/index.less +6 -0
- package/dist/esm/AccountingBook/constants.d.ts +11 -0
- package/dist/esm/AccountingBook/constants.js +17 -0
- package/dist/esm/AccountingBook/hooks/useAmountSearch.d.ts +24 -0
- package/dist/esm/AccountingBook/hooks/useAmountSearch.js +158 -0
- package/dist/esm/AccountingBook/hooks/usePageFlip.d.ts +15 -0
- package/dist/esm/AccountingBook/hooks/usePageFlip.js +61 -0
- package/dist/esm/AccountingBook/index.d.ts +29 -1
- package/dist/esm/AccountingBook/index.js +1162 -6
- package/dist/esm/AccountingBook/index.less +188 -0
- package/dist/esm/AccountingBook/types.d.ts +84 -0
- package/dist/esm/AccountingBook/types.js +1 -0
- package/dist/esm/AccountingBook/utils/canvasUtils.d.ts +51 -0
- package/dist/esm/AccountingBook/utils/canvasUtils.js +493 -0
- package/dist/esm/AccountingBook/utils/html.d.ts +9 -0
- package/dist/esm/AccountingBook/utils/html.js +89 -0
- package/dist/esm/AccountingBook/utils/utils.d.ts +38 -0
- package/dist/esm/AccountingBook/utils/utils.js +195 -0
- package/dist/esm/DocumentFlipBook/ExportModal.d.ts +1 -1
- package/dist/esm/DocumentFlipBook/ExportModal.js +1 -1
- package/dist/esm/DocumentFlipBook/HeaderBar.d.ts +2 -1
- package/dist/esm/DocumentFlipBook/HeaderBar.js +13 -11
- package/dist/esm/DocumentFlipBook/SideTabs.js +110 -5
- package/dist/esm/DocumentFlipBook/index.d.ts +1 -0
- package/dist/esm/DocumentFlipBook/index.js +9 -6
- package/dist/esm/DocumentFlipBook/index.less +239 -12
- package/dist/esm/declarations.d.ts +21 -0
- package/package.json +8 -2
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { Modal, Radio, Button, Flex } from 'antd';
|
|
9
|
+
import "./index.less";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
var ExportModal = function ExportModal(_ref) {
|
|
13
|
+
var visible = _ref.visible,
|
|
14
|
+
onCancel = _ref.onCancel,
|
|
15
|
+
onConfirm = _ref.onConfirm,
|
|
16
|
+
_ref$themeColor = _ref.themeColor,
|
|
17
|
+
themeColor = _ref$themeColor === void 0 ? '#9F7D4E' : _ref$themeColor;
|
|
18
|
+
var _useState = useState('pdf'),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
exportType = _useState2[0],
|
|
21
|
+
setExportType = _useState2[1];
|
|
22
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
23
|
+
title: /*#__PURE__*/_jsx("span", {
|
|
24
|
+
style: {
|
|
25
|
+
fontSize: 18,
|
|
26
|
+
fontWeight: 'bold'
|
|
27
|
+
},
|
|
28
|
+
children: "\u5BFC\u51FA"
|
|
29
|
+
}),
|
|
30
|
+
open: visible,
|
|
31
|
+
onCancel: onCancel,
|
|
32
|
+
footer: [/*#__PURE__*/_jsx(Button, {
|
|
33
|
+
onClick: onCancel,
|
|
34
|
+
style: {
|
|
35
|
+
color: themeColor,
|
|
36
|
+
borderColor: themeColor
|
|
37
|
+
},
|
|
38
|
+
children: "\u53D6\u6D88"
|
|
39
|
+
}, "back"), /*#__PURE__*/_jsx(Button, {
|
|
40
|
+
type: "primary",
|
|
41
|
+
onClick: function onClick() {
|
|
42
|
+
return onConfirm(exportType);
|
|
43
|
+
},
|
|
44
|
+
style: {
|
|
45
|
+
backgroundColor: themeColor,
|
|
46
|
+
borderColor: themeColor
|
|
47
|
+
},
|
|
48
|
+
children: "\u786E\u5B9A"
|
|
49
|
+
}, "submit")],
|
|
50
|
+
width: 400,
|
|
51
|
+
className: "export-modal",
|
|
52
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
53
|
+
style: {
|
|
54
|
+
padding: '20px 0'
|
|
55
|
+
},
|
|
56
|
+
children: /*#__PURE__*/_jsx(Radio.Group, {
|
|
57
|
+
onChange: function onChange(e) {
|
|
58
|
+
return setExportType(e.target.value);
|
|
59
|
+
},
|
|
60
|
+
value: exportType,
|
|
61
|
+
children: /*#__PURE__*/_jsxs(Flex, {
|
|
62
|
+
vertical: true,
|
|
63
|
+
gap: 16,
|
|
64
|
+
children: [/*#__PURE__*/_jsx(Radio, {
|
|
65
|
+
value: "pdf",
|
|
66
|
+
className: "export-radio",
|
|
67
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
68
|
+
style: {
|
|
69
|
+
fontSize: 16
|
|
70
|
+
},
|
|
71
|
+
children: "PDF \u6587\u6863"
|
|
72
|
+
})
|
|
73
|
+
}), /*#__PURE__*/_jsx(Radio, {
|
|
74
|
+
value: "epub",
|
|
75
|
+
className: "export-radio",
|
|
76
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
77
|
+
style: {
|
|
78
|
+
fontSize: 16
|
|
79
|
+
},
|
|
80
|
+
children: "EPUB \u7535\u5B50\u4E66"
|
|
81
|
+
})
|
|
82
|
+
})]
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
export default ExportModal;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export var FilpPage = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
index = _ref.index;
|
|
7
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
8
|
+
className: "page",
|
|
9
|
+
ref: ref,
|
|
10
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
11
|
+
className: "page-content",
|
|
12
|
+
children: children || /*#__PURE__*/_jsxs("div", {
|
|
13
|
+
style: {
|
|
14
|
+
color: '#f00',
|
|
15
|
+
fontSize: '20px'
|
|
16
|
+
},
|
|
17
|
+
children: ["\u5185\u5BB9\u7F3A\u5931 (\u9875\u9762 ", index + 1, ")"]
|
|
18
|
+
})
|
|
19
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
20
|
+
className: "page-back",
|
|
21
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
22
|
+
style: {
|
|
23
|
+
width: '100%',
|
|
24
|
+
height: '100%',
|
|
25
|
+
backgroundColor: '#fff',
|
|
26
|
+
position: 'absolute',
|
|
27
|
+
top: 0,
|
|
28
|
+
left: 0
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface HeaderBarProps {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
totalPages: number;
|
|
6
|
+
onGoFirst: () => void;
|
|
7
|
+
onPrevPage: () => void;
|
|
8
|
+
onNextPage: () => void;
|
|
9
|
+
onGoLast: () => void;
|
|
10
|
+
onPrint: () => void;
|
|
11
|
+
onDownload: (type: 'pdf' | 'epub') => void;
|
|
12
|
+
onUnbinding?: () => void;
|
|
13
|
+
onRefresh?: () => void;
|
|
14
|
+
iconColor?: string;
|
|
15
|
+
showSearchSelect?: boolean;
|
|
16
|
+
searchValue?: string;
|
|
17
|
+
searchOptions?: Array<{
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
pageLabel?: string;
|
|
21
|
+
}>;
|
|
22
|
+
onSearchInputChange?: (value: string) => void;
|
|
23
|
+
onSearchSelect?: (value: string, option: any) => void;
|
|
24
|
+
onSearchClear?: () => void;
|
|
25
|
+
themeColor?: string;
|
|
26
|
+
}
|
|
27
|
+
declare const HeaderBar: React.FC<HeaderBarProps>;
|
|
28
|
+
export default HeaderBar;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { Button, Select, Space } from 'antd';
|
|
9
|
+
import { StepBackwardOutlined, CaretLeftOutlined, CaretRightOutlined, StepForwardOutlined, PrinterOutlined, DownloadOutlined, RollbackOutlined, ReloadOutlined } from '@ant-design/icons';
|
|
10
|
+
import ExportModal from "./ExportModal";
|
|
11
|
+
import "./index.less";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
var HeaderBar = function HeaderBar(_ref) {
|
|
15
|
+
var currentPage = _ref.currentPage,
|
|
16
|
+
totalPages = _ref.totalPages,
|
|
17
|
+
onGoFirst = _ref.onGoFirst,
|
|
18
|
+
onPrevPage = _ref.onPrevPage,
|
|
19
|
+
onNextPage = _ref.onNextPage,
|
|
20
|
+
onGoLast = _ref.onGoLast,
|
|
21
|
+
onPrint = _ref.onPrint,
|
|
22
|
+
onDownload = _ref.onDownload,
|
|
23
|
+
onUnbinding = _ref.onUnbinding,
|
|
24
|
+
onRefresh = _ref.onRefresh,
|
|
25
|
+
showSearchSelect = _ref.showSearchSelect,
|
|
26
|
+
searchValue = _ref.searchValue,
|
|
27
|
+
_ref$searchOptions = _ref.searchOptions,
|
|
28
|
+
searchOptions = _ref$searchOptions === void 0 ? [] : _ref$searchOptions,
|
|
29
|
+
onSearchInputChange = _ref.onSearchInputChange,
|
|
30
|
+
onSearchSelect = _ref.onSearchSelect,
|
|
31
|
+
onSearchClear = _ref.onSearchClear,
|
|
32
|
+
_ref$themeColor = _ref.themeColor,
|
|
33
|
+
themeColor = _ref$themeColor === void 0 ? '#4Baae3' : _ref$themeColor,
|
|
34
|
+
_ref$iconColor = _ref.iconColor,
|
|
35
|
+
iconColor = _ref$iconColor === void 0 ? '#0064ff' : _ref$iconColor;
|
|
36
|
+
var _useState = useState(false),
|
|
37
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
+
exportModalVisible = _useState2[0],
|
|
39
|
+
setExportModalVisible = _useState2[1];
|
|
40
|
+
var handleDownloadConfirm = function handleDownloadConfirm(type) {
|
|
41
|
+
onDownload(type);
|
|
42
|
+
setExportModalVisible(false);
|
|
43
|
+
};
|
|
44
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
45
|
+
className: "common-header-bar",
|
|
46
|
+
style: {
|
|
47
|
+
marginBottom: '10px'
|
|
48
|
+
},
|
|
49
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
50
|
+
className: "header-left",
|
|
51
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
52
|
+
className: "header-item",
|
|
53
|
+
children: [/*#__PURE__*/_jsxs(Button, {
|
|
54
|
+
type: "link",
|
|
55
|
+
onClick: onRefresh,
|
|
56
|
+
className: "header-nav-btn",
|
|
57
|
+
children: [/*#__PURE__*/_jsx(ReloadOutlined, {
|
|
58
|
+
style: {
|
|
59
|
+
fontSize: 16,
|
|
60
|
+
color: iconColor
|
|
61
|
+
}
|
|
62
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
63
|
+
children: "\u5237\u65B0"
|
|
64
|
+
})]
|
|
65
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
66
|
+
className: "dfb-divider"
|
|
67
|
+
})]
|
|
68
|
+
}), /*#__PURE__*/_jsxs(Space, {
|
|
69
|
+
size: 0,
|
|
70
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
71
|
+
className: "header-item",
|
|
72
|
+
children: /*#__PURE__*/_jsxs(Button, {
|
|
73
|
+
type: "link",
|
|
74
|
+
disabled: currentPage === 0,
|
|
75
|
+
onClick: onGoFirst,
|
|
76
|
+
className: "header-nav-btn",
|
|
77
|
+
children: [/*#__PURE__*/_jsx(StepBackwardOutlined, {
|
|
78
|
+
style: {
|
|
79
|
+
fontSize: 16,
|
|
80
|
+
color: iconColor
|
|
81
|
+
}
|
|
82
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
83
|
+
children: "\u5230\u5934"
|
|
84
|
+
})]
|
|
85
|
+
})
|
|
86
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
87
|
+
className: "header-item",
|
|
88
|
+
children: /*#__PURE__*/_jsxs(Button, {
|
|
89
|
+
type: "link",
|
|
90
|
+
disabled: currentPage === 0,
|
|
91
|
+
onClick: onPrevPage,
|
|
92
|
+
className: "header-nav-btn",
|
|
93
|
+
children: [/*#__PURE__*/_jsx(CaretLeftOutlined, {
|
|
94
|
+
style: {
|
|
95
|
+
fontSize: 16,
|
|
96
|
+
color: iconColor
|
|
97
|
+
}
|
|
98
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
99
|
+
children: "\u4E0A\u9875"
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
103
|
+
className: "header-item",
|
|
104
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
105
|
+
className: "dfb-pageIndicator",
|
|
106
|
+
children: [currentPage + 1, " / ", totalPages]
|
|
107
|
+
})
|
|
108
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
109
|
+
className: "header-item",
|
|
110
|
+
children: /*#__PURE__*/_jsxs(Button, {
|
|
111
|
+
type: "link",
|
|
112
|
+
disabled: currentPage >= totalPages - 1,
|
|
113
|
+
onClick: onNextPage,
|
|
114
|
+
className: "header-nav-btn",
|
|
115
|
+
children: [/*#__PURE__*/_jsx(CaretRightOutlined, {
|
|
116
|
+
style: {
|
|
117
|
+
fontSize: 16,
|
|
118
|
+
color: iconColor
|
|
119
|
+
}
|
|
120
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
121
|
+
children: "\u4E0B\u9875"
|
|
122
|
+
})]
|
|
123
|
+
})
|
|
124
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
125
|
+
className: "header-item",
|
|
126
|
+
children: /*#__PURE__*/_jsxs(Button, {
|
|
127
|
+
type: "link",
|
|
128
|
+
disabled: currentPage >= totalPages - 1,
|
|
129
|
+
onClick: onGoLast,
|
|
130
|
+
className: "header-nav-btn",
|
|
131
|
+
children: [/*#__PURE__*/_jsx(StepForwardOutlined, {
|
|
132
|
+
style: {
|
|
133
|
+
fontSize: 16,
|
|
134
|
+
color: iconColor
|
|
135
|
+
}
|
|
136
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
137
|
+
children: "\u5230\u5C3E"
|
|
138
|
+
})]
|
|
139
|
+
})
|
|
140
|
+
})]
|
|
141
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
142
|
+
className: "dfb-divider"
|
|
143
|
+
}), onUnbinding && /*#__PURE__*/_jsxs(Button, {
|
|
144
|
+
type: "link",
|
|
145
|
+
onClick: onUnbinding,
|
|
146
|
+
className: "header-nav-btn",
|
|
147
|
+
children: [/*#__PURE__*/_jsx(RollbackOutlined, {
|
|
148
|
+
style: {
|
|
149
|
+
fontSize: 16,
|
|
150
|
+
color: iconColor
|
|
151
|
+
}
|
|
152
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
153
|
+
children: "\u64A4\u9500\u88C5\u8BA2"
|
|
154
|
+
})]
|
|
155
|
+
})]
|
|
156
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
157
|
+
className: "header-right",
|
|
158
|
+
children: [showSearchSelect && /*#__PURE__*/_jsx(Select, {
|
|
159
|
+
showSearch: true,
|
|
160
|
+
allowClear: true,
|
|
161
|
+
className: "toolbar-search-select",
|
|
162
|
+
value: searchValue || undefined,
|
|
163
|
+
placeholder: "\u8BF7\u8F93\u5165\u91D1\u989D\u6216\u5355\u636E\u5173\u952E\u5B57",
|
|
164
|
+
options: searchOptions,
|
|
165
|
+
maxTagTextLength: 400,
|
|
166
|
+
optionRender: function optionRender(option) {
|
|
167
|
+
var data = option.data;
|
|
168
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
169
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
170
|
+
children: data.label
|
|
171
|
+
}), data.pageLabel && /*#__PURE__*/_jsx("div", {
|
|
172
|
+
className: "toolbar-search-select-meta",
|
|
173
|
+
style: {
|
|
174
|
+
fontSize: '12px',
|
|
175
|
+
color: '#999'
|
|
176
|
+
},
|
|
177
|
+
children: data.pageLabel
|
|
178
|
+
})]
|
|
179
|
+
});
|
|
180
|
+
},
|
|
181
|
+
onSearch: onSearchInputChange,
|
|
182
|
+
onChange: function onChange(value, option) {
|
|
183
|
+
if (!value) {
|
|
184
|
+
onSearchClear === null || onSearchClear === void 0 || onSearchClear();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
onSearchSelect === null || onSearchSelect === void 0 || onSearchSelect(value, option);
|
|
188
|
+
},
|
|
189
|
+
onClear: onSearchClear,
|
|
190
|
+
filterOption: false,
|
|
191
|
+
style: {
|
|
192
|
+
width: '280px',
|
|
193
|
+
marginLeft: '10px'
|
|
194
|
+
}
|
|
195
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
196
|
+
className: "dfb-divider"
|
|
197
|
+
}), /*#__PURE__*/_jsxs(Space, {
|
|
198
|
+
children: [/*#__PURE__*/_jsxs(Button, {
|
|
199
|
+
type: "link",
|
|
200
|
+
onClick: onPrint,
|
|
201
|
+
className: "header-nav-btn",
|
|
202
|
+
children: [/*#__PURE__*/_jsx(PrinterOutlined, {
|
|
203
|
+
style: {
|
|
204
|
+
fontSize: 16,
|
|
205
|
+
color: iconColor
|
|
206
|
+
}
|
|
207
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
208
|
+
children: "\u6253\u5370"
|
|
209
|
+
})]
|
|
210
|
+
}), /*#__PURE__*/_jsxs(Button, {
|
|
211
|
+
type: "link",
|
|
212
|
+
onClick: function onClick() {
|
|
213
|
+
return setExportModalVisible(true);
|
|
214
|
+
},
|
|
215
|
+
className: "header-nav-btn",
|
|
216
|
+
children: [/*#__PURE__*/_jsx(DownloadOutlined, {
|
|
217
|
+
style: {
|
|
218
|
+
fontSize: 16,
|
|
219
|
+
color: iconColor
|
|
220
|
+
}
|
|
221
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
222
|
+
children: "\u5BFC\u51FA"
|
|
223
|
+
})]
|
|
224
|
+
})]
|
|
225
|
+
})]
|
|
226
|
+
}), /*#__PURE__*/_jsx(ExportModal, {
|
|
227
|
+
themeColor: themeColor,
|
|
228
|
+
visible: exportModalVisible,
|
|
229
|
+
onCancel: function onCancel() {
|
|
230
|
+
return setExportModalVisible(false);
|
|
231
|
+
},
|
|
232
|
+
onConfirm: handleDownloadConfirm
|
|
233
|
+
})]
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
export default HeaderBar;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ImagePageRendererProps {
|
|
3
|
+
src: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
attachmentId: number;
|
|
6
|
+
currentIndex: number;
|
|
7
|
+
totalCount: number;
|
|
8
|
+
amount: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const ImagePageRenderer: React.FC<ImagePageRendererProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export var ImagePageRenderer = function ImagePageRenderer(_ref) {
|
|
5
|
+
var src = _ref.src,
|
|
6
|
+
alt = _ref.alt,
|
|
7
|
+
currentIndex = _ref.currentIndex,
|
|
8
|
+
totalCount = _ref.totalCount,
|
|
9
|
+
amount = _ref.amount;
|
|
10
|
+
var formattedAmount = amount ? Number(amount).toLocaleString('en-US', {
|
|
11
|
+
minimumFractionDigits: 2,
|
|
12
|
+
maximumFractionDigits: 2
|
|
13
|
+
}) : '0.00';
|
|
14
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
15
|
+
style: {
|
|
16
|
+
width: '100%',
|
|
17
|
+
height: '100%',
|
|
18
|
+
backgroundColor: '#fff',
|
|
19
|
+
position: 'relative',
|
|
20
|
+
padding: '0 20px 20px'
|
|
21
|
+
},
|
|
22
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
23
|
+
style: {
|
|
24
|
+
margin: '0 auto',
|
|
25
|
+
padding: '10px',
|
|
26
|
+
textAlign: 'center',
|
|
27
|
+
fontSize: '26px',
|
|
28
|
+
width: '220px',
|
|
29
|
+
fontWeight: 'bold',
|
|
30
|
+
color: '#597461'
|
|
31
|
+
},
|
|
32
|
+
children: "\u539F\u59CB\u51ED\u8BC1\u7C98\u8D34\u5355"
|
|
33
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
34
|
+
style: {
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
top: '10px',
|
|
37
|
+
right: '20px',
|
|
38
|
+
textAlign: 'right',
|
|
39
|
+
fontSize: '14px',
|
|
40
|
+
color: '#597461',
|
|
41
|
+
lineHeight: '1.5'
|
|
42
|
+
},
|
|
43
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
44
|
+
children: ["\u539F\u59CB\u51ED\u8BC1 ", /*#__PURE__*/_jsxs("span", {
|
|
45
|
+
style: {
|
|
46
|
+
borderBottom: '1px solid #597461'
|
|
47
|
+
},
|
|
48
|
+
children: [currentIndex, "/", totalCount]
|
|
49
|
+
}), " \u5F20"]
|
|
50
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
51
|
+
children: ["\u91D1\u989D ", /*#__PURE__*/_jsx("span", {
|
|
52
|
+
style: {
|
|
53
|
+
borderBottom: '1px solid #597461'
|
|
54
|
+
},
|
|
55
|
+
children: formattedAmount
|
|
56
|
+
})]
|
|
57
|
+
})]
|
|
58
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
59
|
+
style: {
|
|
60
|
+
width: '100%',
|
|
61
|
+
height: '430px',
|
|
62
|
+
display: 'flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
margin: '10px 0',
|
|
66
|
+
border: '1px solid #597461',
|
|
67
|
+
overflow: 'hidden',
|
|
68
|
+
padding: '10px'
|
|
69
|
+
},
|
|
70
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
71
|
+
src: src,
|
|
72
|
+
alt: alt,
|
|
73
|
+
style: {
|
|
74
|
+
maxWidth: '100%',
|
|
75
|
+
maxHeight: '100%',
|
|
76
|
+
objectFit: 'contain'
|
|
77
|
+
},
|
|
78
|
+
onError: function onError(e) {
|
|
79
|
+
e.currentTarget.style.display = 'none';
|
|
80
|
+
e.currentTarget.parentElement.innerHTML += '<span style="color: #f00; fontSize: 20px;">图片加载失败</span>';
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export var LoadingComponent = function LoadingComponent(_ref) {
|
|
5
|
+
var message = _ref.message,
|
|
6
|
+
pdfLoading = _ref.pdfLoading;
|
|
7
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
8
|
+
style: {
|
|
9
|
+
position: 'fixed',
|
|
10
|
+
top: 0,
|
|
11
|
+
left: 0,
|
|
12
|
+
width: '100%',
|
|
13
|
+
height: '100%',
|
|
14
|
+
background: 'rgba(255,255,255,0.9)',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
zIndex: 9999
|
|
20
|
+
},
|
|
21
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
22
|
+
style: {
|
|
23
|
+
width: 60,
|
|
24
|
+
height: 60,
|
|
25
|
+
border: '4px solid #f3f3f3',
|
|
26
|
+
borderTop: '4px solid #1890ff',
|
|
27
|
+
borderRadius: '50%',
|
|
28
|
+
animation: 'spin 1s linear infinite',
|
|
29
|
+
marginBottom: 20
|
|
30
|
+
}
|
|
31
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
32
|
+
style: {
|
|
33
|
+
fontSize: 16,
|
|
34
|
+
color: '#666'
|
|
35
|
+
},
|
|
36
|
+
children: message
|
|
37
|
+
}), pdfLoading && /*#__PURE__*/_jsx("div", {
|
|
38
|
+
style: {
|
|
39
|
+
fontSize: 14,
|
|
40
|
+
color: '#999',
|
|
41
|
+
marginTop: 8
|
|
42
|
+
},
|
|
43
|
+
children: "PDF\u6587\u4EF6\u8F83\u5927\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85..."
|
|
44
|
+
}), /*#__PURE__*/_jsx("style", {
|
|
45
|
+
children: "@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}"
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'react-pdf/dist/Page/AnnotationLayer.css';
|
|
3
|
+
import 'react-pdf/dist/Page/TextLayer.css';
|
|
4
|
+
interface PDFPageRendererProps {
|
|
5
|
+
pdfPath: string;
|
|
6
|
+
attachmentId: number;
|
|
7
|
+
pageNumber: number;
|
|
8
|
+
currentIndex: number;
|
|
9
|
+
totalCount: number;
|
|
10
|
+
amount: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const PDFPageRenderer: React.FC<PDFPageRendererProps>;
|
|
13
|
+
export {};
|