@cecee/document-flip-book 1.0.19 → 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.
Files changed (91) hide show
  1. package/dist/cjs/AccountingBook/assets/active-line.png +0 -0
  2. package/dist/cjs/AccountingBook/assets/default-line.png +0 -0
  3. package/dist/cjs/AccountingBook/assets/filp-bg.png +0 -0
  4. package/dist/cjs/AccountingBook/components/AccountingVoucher/index.d.ts +26 -0
  5. package/dist/cjs/AccountingBook/components/AccountingVoucher/index.js +398 -0
  6. package/dist/cjs/AccountingBook/components/AccountingVoucher/index.less +231 -0
  7. package/dist/cjs/AccountingBook/components/ExportModal.d.ts +10 -0
  8. package/dist/cjs/AccountingBook/components/ExportModal.js +96 -0
  9. package/dist/cjs/AccountingBook/components/FilpPage.d.ts +7 -0
  10. package/dist/cjs/AccountingBook/components/FilpPage.js +39 -0
  11. package/dist/cjs/AccountingBook/components/HeaderBar.d.ts +28 -0
  12. package/dist/cjs/AccountingBook/components/HeaderBar.js +245 -0
  13. package/dist/cjs/AccountingBook/components/ImagePageRenderer.d.ts +11 -0
  14. package/dist/cjs/AccountingBook/components/ImagePageRenderer.js +91 -0
  15. package/dist/cjs/AccountingBook/components/LoadingComponent.d.ts +7 -0
  16. package/dist/cjs/AccountingBook/components/LoadingComponent.js +54 -0
  17. package/dist/cjs/AccountingBook/components/PDFPageRenderer.d.ts +13 -0
  18. package/dist/cjs/AccountingBook/components/PDFPageRenderer.js +259 -0
  19. package/dist/cjs/AccountingBook/components/index.less +6 -0
  20. package/dist/cjs/AccountingBook/constants.d.ts +11 -0
  21. package/dist/cjs/AccountingBook/constants.js +25 -0
  22. package/dist/cjs/AccountingBook/hooks/useAmountSearch.d.ts +24 -0
  23. package/dist/cjs/AccountingBook/hooks/useAmountSearch.js +165 -0
  24. package/dist/cjs/AccountingBook/hooks/usePageFlip.d.ts +15 -0
  25. package/dist/cjs/AccountingBook/hooks/usePageFlip.js +67 -0
  26. package/dist/cjs/AccountingBook/index.d.ts +29 -1
  27. package/dist/cjs/AccountingBook/index.js +1163 -7
  28. package/dist/cjs/AccountingBook/index.less +188 -0
  29. package/dist/cjs/AccountingBook/types.d.ts +84 -0
  30. package/dist/cjs/AccountingBook/types.js +5 -0
  31. package/dist/cjs/AccountingBook/utils/canvasUtils.d.ts +51 -0
  32. package/dist/cjs/AccountingBook/utils/canvasUtils.js +499 -0
  33. package/dist/cjs/AccountingBook/utils/html.d.ts +9 -0
  34. package/dist/cjs/AccountingBook/utils/html.js +97 -0
  35. package/dist/cjs/AccountingBook/utils/utils.d.ts +38 -0
  36. package/dist/cjs/AccountingBook/utils/utils.js +204 -0
  37. package/dist/cjs/DocumentFlipBook/ExportModal.d.ts +1 -1
  38. package/dist/cjs/DocumentFlipBook/ExportModal.js +1 -1
  39. package/dist/cjs/DocumentFlipBook/HeaderBar.d.ts +2 -1
  40. package/dist/cjs/DocumentFlipBook/HeaderBar.js +13 -11
  41. package/dist/cjs/DocumentFlipBook/SideTabs.js +111 -6
  42. package/dist/cjs/DocumentFlipBook/index.d.ts +1 -0
  43. package/dist/cjs/DocumentFlipBook/index.js +6 -3
  44. package/dist/cjs/DocumentFlipBook/index.less +235 -9
  45. package/dist/cjs/declarations.d.ts +21 -0
  46. package/dist/esm/AccountingBook/assets/active-line.png +0 -0
  47. package/dist/esm/AccountingBook/assets/default-line.png +0 -0
  48. package/dist/esm/AccountingBook/assets/filp-bg.png +0 -0
  49. package/dist/esm/AccountingBook/components/AccountingVoucher/index.d.ts +26 -0
  50. package/dist/esm/AccountingBook/components/AccountingVoucher/index.js +391 -0
  51. package/dist/esm/AccountingBook/components/AccountingVoucher/index.less +231 -0
  52. package/dist/esm/AccountingBook/components/ExportModal.d.ts +10 -0
  53. package/dist/esm/AccountingBook/components/ExportModal.js +88 -0
  54. package/dist/esm/AccountingBook/components/FilpPage.d.ts +7 -0
  55. package/dist/esm/AccountingBook/components/FilpPage.js +33 -0
  56. package/dist/esm/AccountingBook/components/HeaderBar.d.ts +28 -0
  57. package/dist/esm/AccountingBook/components/HeaderBar.js +236 -0
  58. package/dist/esm/AccountingBook/components/ImagePageRenderer.d.ts +11 -0
  59. package/dist/esm/AccountingBook/components/ImagePageRenderer.js +85 -0
  60. package/dist/esm/AccountingBook/components/LoadingComponent.d.ts +7 -0
  61. package/dist/esm/AccountingBook/components/LoadingComponent.js +48 -0
  62. package/dist/esm/AccountingBook/components/PDFPageRenderer.d.ts +13 -0
  63. package/dist/esm/AccountingBook/components/PDFPageRenderer.js +252 -0
  64. package/dist/esm/AccountingBook/components/index.less +6 -0
  65. package/dist/esm/AccountingBook/constants.d.ts +11 -0
  66. package/dist/esm/AccountingBook/constants.js +17 -0
  67. package/dist/esm/AccountingBook/hooks/useAmountSearch.d.ts +24 -0
  68. package/dist/esm/AccountingBook/hooks/useAmountSearch.js +158 -0
  69. package/dist/esm/AccountingBook/hooks/usePageFlip.d.ts +15 -0
  70. package/dist/esm/AccountingBook/hooks/usePageFlip.js +61 -0
  71. package/dist/esm/AccountingBook/index.d.ts +29 -1
  72. package/dist/esm/AccountingBook/index.js +1162 -6
  73. package/dist/esm/AccountingBook/index.less +188 -0
  74. package/dist/esm/AccountingBook/types.d.ts +84 -0
  75. package/dist/esm/AccountingBook/types.js +1 -0
  76. package/dist/esm/AccountingBook/utils/canvasUtils.d.ts +51 -0
  77. package/dist/esm/AccountingBook/utils/canvasUtils.js +493 -0
  78. package/dist/esm/AccountingBook/utils/html.d.ts +9 -0
  79. package/dist/esm/AccountingBook/utils/html.js +89 -0
  80. package/dist/esm/AccountingBook/utils/utils.d.ts +38 -0
  81. package/dist/esm/AccountingBook/utils/utils.js +195 -0
  82. package/dist/esm/DocumentFlipBook/ExportModal.d.ts +1 -1
  83. package/dist/esm/DocumentFlipBook/ExportModal.js +1 -1
  84. package/dist/esm/DocumentFlipBook/HeaderBar.d.ts +2 -1
  85. package/dist/esm/DocumentFlipBook/HeaderBar.js +13 -11
  86. package/dist/esm/DocumentFlipBook/SideTabs.js +110 -5
  87. package/dist/esm/DocumentFlipBook/index.d.ts +1 -0
  88. package/dist/esm/DocumentFlipBook/index.js +6 -3
  89. package/dist/esm/DocumentFlipBook/index.less +235 -9
  90. package/dist/esm/declarations.d.ts +21 -0
  91. package/package.json +8 -2
@@ -0,0 +1,391 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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); }
8
+ 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; }
9
+ 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; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ /*
12
+ * @Author: Geralt Rivia
13
+ * @Date: 2025-05-15 15:43:44
14
+ * @LastEditors: Geralt Rivia
15
+ * @LastEditTime: 2025-09-11 14:40:54
16
+ * @Description: 记账凭证-单据样式组件
17
+ */
18
+ import React, { useState } from 'react';
19
+ import "./index.less";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ import { jsxs as _jsxs } from "react/jsx-runtime";
22
+ // 格式化金额显示的新函数
23
+ function formatAmount(amount, tradeDirection, originalAmount) {
24
+ var result = new Array(11).fill(' ');
25
+
26
+ // 仅在遇到 null/undefined/空字符串时返回空值
27
+ if (!amount) return result;
28
+ var numAmount = parseFloat(amount);
29
+ if (isNaN(numAmount)) return result;
30
+
31
+ // 处理零值的特殊情况
32
+ if (numAmount === 0) {
33
+ // 如果有原始金额信息,检查原始金额是否为0
34
+ if (originalAmount) {
35
+ var originalNum = parseFloat(originalAmount);
36
+ if (originalNum === 0 && tradeDirection) {
37
+ // 只有当trade_direction与当前列匹配时,才显示0
38
+ var zeroResult = new Array(11).fill(' ');
39
+ zeroResult[8] = '0'; // 元位显示0
40
+ zeroResult[9] = '0'; // 角位显示0
41
+ zeroResult[10] = '0'; // 分位显示0
42
+ return zeroResult;
43
+ }
44
+ } else {
45
+ // 原有逻辑保持不变
46
+ var _zeroResult = new Array(11).fill(' ');
47
+ _zeroResult[8] = '0'; // 元位显示0
48
+ _zeroResult[9] = '0'; // 角位显示0
49
+ _zeroResult[10] = '0'; // 分位显示0
50
+ return _zeroResult;
51
+ }
52
+ return result; // 不匹配方向时返回空
53
+ }
54
+
55
+ // 对于非零值,按常规格式显示
56
+ var formattedAmount = numAmount.toFixed(2);
57
+ var _formattedAmount$spli = formattedAmount.split('.'),
58
+ _formattedAmount$spli2 = _slicedToArray(_formattedAmount$spli, 2),
59
+ intPart = _formattedAmount$spli2[0],
60
+ _formattedAmount$spli3 = _formattedAmount$spli2[1],
61
+ decPart = _formattedAmount$spli3 === void 0 ? '00' : _formattedAmount$spli3;
62
+ var paddedInt = intPart.padStart(9, ' ');
63
+ return (paddedInt + decPart).split('').slice(0, 11);
64
+ }
65
+ ;
66
+
67
+ // 判断是否应该显示金额的辅助函数
68
+ function shouldShowAmount(entry, isDebit) {
69
+ var numDebit = parseFloat(entry.debit || '0');
70
+ var numCredit = parseFloat(entry.credit || '0');
71
+ var originalAmount = parseFloat(entry.amount || '0');
72
+ // 允许负数
73
+ if (numDebit !== 0 || numCredit !== 0) {
74
+ return isDebit ? numDebit !== 0 : numCredit !== 0;
75
+ }
76
+
77
+ // 如果都为0,但原始金额为0,根据trade_direction判断
78
+ if (originalAmount === 0 && entry.trade_direction) {
79
+ return isDebit ? entry.trade_direction === '借' : entry.trade_direction === '贷';
80
+ }
81
+ return false;
82
+ }
83
+ var AccountingVoucher = function AccountingVoucher(_ref) {
84
+ var _ref$date = _ref.date,
85
+ date = _ref$date === void 0 ? '' : _ref$date,
86
+ _ref$company = _ref.company,
87
+ company = _ref$company === void 0 ? '迈金西(成都)企业管理咨询有限公司' : _ref$company,
88
+ _ref$voucherNo = _ref.voucherNo,
89
+ voucherNo = _ref$voucherNo === void 0 ? '13' : _ref$voucherNo,
90
+ _ref$entries = _ref.entries,
91
+ entries = _ref$entries === void 0 ? [] : _ref$entries,
92
+ _ref$accountant = _ref.accountant,
93
+ accountant = _ref$accountant === void 0 ? '' : _ref$accountant,
94
+ _ref$recorder = _ref.recorder,
95
+ recorder = _ref$recorder === void 0 ? '' : _ref$recorder,
96
+ _ref$maker = _ref.maker,
97
+ maker = _ref$maker === void 0 ? '邹瑜' : _ref$maker,
98
+ _ref$showTotal = _ref.showTotal,
99
+ showTotal = _ref$showTotal === void 0 ? false : _ref$showTotal,
100
+ _ref$totalDebit = _ref.totalDebit,
101
+ totalDebit = _ref$totalDebit === void 0 ? '0' : _ref$totalDebit,
102
+ _ref$totalCredit = _ref.totalCredit,
103
+ totalCredit = _ref$totalCredit === void 0 ? '0' : _ref$totalCredit;
104
+ var MIN_ROWS = 5; // 每页展示5行数据
105
+ var _useState = useState(1),
106
+ _useState2 = _slicedToArray(_useState, 2),
107
+ currentPage = _useState2[0],
108
+ setCurrentPage = _useState2[1]; // 当前页
109
+
110
+ // 计算总页数
111
+ var totalPages = Math.max(Math.ceil(entries.length / MIN_ROWS), 1);
112
+
113
+ // 获取当前页的数据
114
+ var getPageData = function getPageData() {
115
+ var startIndex = (currentPage - 1) * MIN_ROWS;
116
+ var endIndex = Math.min(currentPage * MIN_ROWS, entries.length);
117
+ return entries.slice(startIndex, endIndex);
118
+ };
119
+
120
+ // 生成空数据行(每个字段为空字符串)
121
+ var generateEmptyRows = function generateEmptyRows(num) {
122
+ return Array(num).fill({
123
+ summary: '',
124
+ account: '',
125
+ debit: '',
126
+ credit: ''
127
+ });
128
+ };
129
+
130
+ // 获取当前页数据
131
+ var pageData = getPageData();
132
+ var emptyRowsNeeded = MIN_ROWS - pageData.length;
133
+ if (emptyRowsNeeded > 0) {
134
+ pageData = [].concat(_toConsumableArray(pageData), _toConsumableArray(generateEmptyRows(emptyRowsNeeded)));
135
+ }
136
+
137
+ // 是否是最后一页
138
+ var isLastPage = currentPage === totalPages;
139
+
140
+ // 格式化凭证号
141
+ var formattedVoucherNo = "".concat(voucherNo);
142
+ return /*#__PURE__*/_jsx("div", {
143
+ className: "voucher-wrapper",
144
+ children: /*#__PURE__*/_jsxs("div", {
145
+ className: "voucher-container",
146
+ children: [/*#__PURE__*/_jsxs("div", {
147
+ className: "voucher-header",
148
+ children: [/*#__PURE__*/_jsx("h1", {
149
+ children: "\u8BB0 \u8D26 \u51ED \u8BC1"
150
+ }), /*#__PURE__*/_jsx("div", {
151
+ className: "header-line"
152
+ }), /*#__PURE__*/_jsx("div", {
153
+ className: "date",
154
+ dangerouslySetInnerHTML: {
155
+ __html: date
156
+ }
157
+ })]
158
+ }), /*#__PURE__*/_jsxs("div", {
159
+ className: "company-info",
160
+ children: [/*#__PURE__*/_jsxs("div", {
161
+ className: "company-name",
162
+ children: [/*#__PURE__*/_jsx("span", {
163
+ children: "\u516C\u53F8\uFF1A"
164
+ }), company]
165
+ }), /*#__PURE__*/_jsxs("div", {
166
+ className: "voucher-no",
167
+ children: [/*#__PURE__*/_jsx("span", {
168
+ children: "\u5B57\u7B2C"
169
+ }), " ", formattedVoucherNo, " ", /*#__PURE__*/_jsx("span", {
170
+ children: "\u53F7"
171
+ })]
172
+ })]
173
+ }), /*#__PURE__*/_jsx("div", {
174
+ className: "voucher-table-wrapper",
175
+ children: /*#__PURE__*/_jsxs("table", {
176
+ className: "voucher-table",
177
+ children: [/*#__PURE__*/_jsx("thead", {
178
+ children: /*#__PURE__*/_jsxs("tr", {
179
+ children: [/*#__PURE__*/_jsx("th", {
180
+ className: "summary",
181
+ children: /*#__PURE__*/_jsx("span", {
182
+ children: "\u6458\u8981"
183
+ })
184
+ }), /*#__PURE__*/_jsx("th", {
185
+ className: "subject",
186
+ children: /*#__PURE__*/_jsx("span", {
187
+ children: "\u79D1\u76EE"
188
+ })
189
+ }), /*#__PURE__*/_jsx("th", {
190
+ className: "checkmark"
191
+ }), " ", /*#__PURE__*/_jsxs("th", {
192
+ className: "amount",
193
+ colSpan: 11,
194
+ children: [/*#__PURE__*/_jsx("div", {
195
+ className: "amount-header",
196
+ children: /*#__PURE__*/_jsx("span", {
197
+ children: "\u501F\u65B9\u91D1\u989D"
198
+ })
199
+ }), /*#__PURE__*/_jsxs("div", {
200
+ className: "amount-grid",
201
+ children: [/*#__PURE__*/_jsx("span", {
202
+ children: "\u4EBF"
203
+ }), /*#__PURE__*/_jsx("span", {
204
+ children: "\u5343"
205
+ }), /*#__PURE__*/_jsx("span", {
206
+ children: "\u767E"
207
+ }), /*#__PURE__*/_jsx("span", {
208
+ children: "\u5341"
209
+ }), /*#__PURE__*/_jsx("span", {
210
+ children: "\u4E07"
211
+ }), /*#__PURE__*/_jsx("span", {
212
+ children: "\u5343"
213
+ }), /*#__PURE__*/_jsx("span", {
214
+ children: "\u767E"
215
+ }), /*#__PURE__*/_jsx("span", {
216
+ children: "\u5341"
217
+ }), /*#__PURE__*/_jsx("span", {
218
+ children: "\u5143"
219
+ }), /*#__PURE__*/_jsx("span", {
220
+ children: "\u89D2"
221
+ }), /*#__PURE__*/_jsx("span", {
222
+ children: "\u5206"
223
+ })]
224
+ })]
225
+ }), /*#__PURE__*/_jsx("th", {
226
+ className: "checkmark"
227
+ }), " ", /*#__PURE__*/_jsxs("th", {
228
+ className: "amount",
229
+ colSpan: 11,
230
+ children: [/*#__PURE__*/_jsx("div", {
231
+ className: "amount-header",
232
+ children: /*#__PURE__*/_jsx("span", {
233
+ children: "\u8D37\u65B9\u91D1\u989D"
234
+ })
235
+ }), /*#__PURE__*/_jsxs("div", {
236
+ className: "amount-grid",
237
+ children: [/*#__PURE__*/_jsx("span", {
238
+ children: "\u4EBF"
239
+ }), /*#__PURE__*/_jsx("span", {
240
+ children: "\u5343"
241
+ }), /*#__PURE__*/_jsx("span", {
242
+ children: "\u767E"
243
+ }), /*#__PURE__*/_jsx("span", {
244
+ children: "\u5341"
245
+ }), /*#__PURE__*/_jsx("span", {
246
+ children: "\u4E07"
247
+ }), /*#__PURE__*/_jsx("span", {
248
+ children: "\u5343"
249
+ }), /*#__PURE__*/_jsx("span", {
250
+ children: "\u767E"
251
+ }), /*#__PURE__*/_jsx("span", {
252
+ children: "\u5341"
253
+ }), /*#__PURE__*/_jsx("span", {
254
+ children: "\u5143"
255
+ }), /*#__PURE__*/_jsx("span", {
256
+ children: "\u89D2"
257
+ }), /*#__PURE__*/_jsx("span", {
258
+ children: "\u5206"
259
+ })]
260
+ })]
261
+ })]
262
+ })
263
+ }), /*#__PURE__*/_jsxs("tbody", {
264
+ children: [pageData.map(function (entry, index) {
265
+ return /*#__PURE__*/_jsxs("tr", {
266
+ className: entry.isTotal ? 'total-row' : '',
267
+ children: [/*#__PURE__*/_jsx("td", {
268
+ className: "summary",
269
+ style: {
270
+ textAlign: 'left',
271
+ fontFamily: '宋体'
272
+ },
273
+ children: entry.summary || ''
274
+ }), /*#__PURE__*/_jsx("td", {
275
+ className: "subject",
276
+ style: {
277
+ textAlign: 'left',
278
+ fontFamily: '宋体'
279
+ },
280
+ children: entry.account || ''
281
+ }), /*#__PURE__*/_jsx("td", {
282
+ className: "checkmark",
283
+ children: shouldShowAmount(entry, true) ? '✓' : ''
284
+ }), /*#__PURE__*/_jsx("td", {
285
+ className: "amount",
286
+ colSpan: 11,
287
+ children: /*#__PURE__*/_jsx("div", {
288
+ className: "money-grid",
289
+ children: shouldShowAmount(entry, true) ? formatAmount(entry.debit, entry.trade_direction, entry.amount).map(function (digit, i) {
290
+ return /*#__PURE__*/_jsx("span", {
291
+ className: "money-cell",
292
+ children: digit
293
+ }, i);
294
+ }) : Array(11).fill(' ').map(function (digit, i) {
295
+ return /*#__PURE__*/_jsx("span", {
296
+ className: "money-cell",
297
+ children: digit
298
+ }, i);
299
+ })
300
+ })
301
+ }), /*#__PURE__*/_jsx("td", {
302
+ className: "checkmark",
303
+ children: shouldShowAmount(entry, false) ? '✓' : ''
304
+ }), /*#__PURE__*/_jsx("td", {
305
+ className: "amount",
306
+ colSpan: 11,
307
+ children: /*#__PURE__*/_jsx("div", {
308
+ className: "money-grid",
309
+ children: shouldShowAmount(entry, false) ? formatAmount(entry.credit, entry.trade_direction, entry.amount).map(function (digit, i) {
310
+ return /*#__PURE__*/_jsx("span", {
311
+ className: "money-cell",
312
+ children: digit
313
+ }, i);
314
+ }) : Array(11).fill(' ').map(function (digit, i) {
315
+ return /*#__PURE__*/_jsx("span", {
316
+ className: "money-cell",
317
+ children: digit
318
+ }, i);
319
+ })
320
+ })
321
+ })]
322
+ }, index);
323
+ }), showTotal && isLastPage && /*#__PURE__*/_jsxs("tr", {
324
+ className: "total-row",
325
+ children: [/*#__PURE__*/_jsx("td", {
326
+ className: "summary"
327
+ }), /*#__PURE__*/_jsx("td", {
328
+ className: "subject"
329
+ }), /*#__PURE__*/_jsx("td", {
330
+ className: "checkmark",
331
+ children: parseFloat(totalDebit) > 0 ? '✓' : ''
332
+ }), /*#__PURE__*/_jsx("td", {
333
+ className: "amount",
334
+ colSpan: 11,
335
+ children: /*#__PURE__*/_jsx("div", {
336
+ className: "money-grid",
337
+ children: formatAmount(totalDebit).map(function (digit, i) {
338
+ return /*#__PURE__*/_jsx("span", {
339
+ className: "money-cell",
340
+ children: digit
341
+ }, i);
342
+ })
343
+ })
344
+ }), /*#__PURE__*/_jsx("td", {
345
+ className: "checkmark",
346
+ children: parseFloat(totalCredit) > 0 ? '✓' : ''
347
+ }), /*#__PURE__*/_jsx("td", {
348
+ className: "amount",
349
+ colSpan: 11,
350
+ children: /*#__PURE__*/_jsx("div", {
351
+ className: "money-grid",
352
+ children: formatAmount(totalCredit).map(function (digit, i) {
353
+ return /*#__PURE__*/_jsx("span", {
354
+ className: "money-cell",
355
+ children: digit
356
+ }, i);
357
+ })
358
+ })
359
+ })]
360
+ })]
361
+ })]
362
+ })
363
+ }), /*#__PURE__*/_jsxs("div", {
364
+ className: "voucher-footer",
365
+ children: [/*#__PURE__*/_jsxs("div", {
366
+ className: "footer-item",
367
+ children: [/*#__PURE__*/_jsx("span", {
368
+ children: "\u4F1A\u8BA1\u4E3B\u7BA1\uFF1A"
369
+ }), /*#__PURE__*/_jsx("span", {
370
+ children: accountant
371
+ })]
372
+ }), /*#__PURE__*/_jsxs("div", {
373
+ className: "footer-item",
374
+ children: [/*#__PURE__*/_jsx("span", {
375
+ children: "\u8BB0\u8D26\uFF1A"
376
+ }), /*#__PURE__*/_jsx("span", {
377
+ children: recorder
378
+ })]
379
+ }), /*#__PURE__*/_jsxs("div", {
380
+ className: "footer-item",
381
+ children: [/*#__PURE__*/_jsx("span", {
382
+ children: "\u5236\u5355\uFF1A"
383
+ }), /*#__PURE__*/_jsx("span", {
384
+ children: maker
385
+ })]
386
+ })]
387
+ })]
388
+ })
389
+ });
390
+ };
391
+ export default AccountingVoucher;
@@ -0,0 +1,231 @@
1
+ .voucher-wrapper {
2
+ background-color: #fffbf0;
3
+ color: #000;
4
+ width: 998px;
5
+ height: 560px;
6
+ display: flex;
7
+ justify-content: center;
8
+ align-items: center;
9
+ }
10
+
11
+ .voucher-container {
12
+ max-width: 100%;
13
+ max-height: 100%;
14
+ // margin: 0 auto;
15
+ // padding: -60px -60px;
16
+ background-color: #fffbf0;
17
+ position: relative;
18
+ }
19
+
20
+ .voucher-header {
21
+ text-align: center;
22
+ // margin-bottom: 20px;
23
+
24
+ h1 {
25
+ font-size: 24px;
26
+ margin: 0;
27
+ letter-spacing: 4px;
28
+ color: #8b4513;
29
+ }
30
+
31
+ .header-line {
32
+ height: 1px;
33
+ background-color: #8b4513;
34
+ margin: 8px auto;
35
+ width: 300px;
36
+ position: relative;
37
+
38
+ &::after {
39
+ content: '';
40
+ position: absolute;
41
+ top: 2px;
42
+ left: 0;
43
+ right: 0;
44
+ height: 1px;
45
+ background-color: #8b4513;
46
+ }
47
+ }
48
+
49
+ .date {
50
+ font-size: 16px;
51
+ margin-top: 10px;
52
+ }
53
+ }
54
+
55
+ .company-info {
56
+ display: flex;
57
+ justify-content: space-between;
58
+ align-items: center;
59
+ margin-bottom: 10px;
60
+ font-size: 14px;
61
+
62
+ .company-name {
63
+ span {
64
+ margin-right: 5px;
65
+ color: #8b4513;
66
+ }
67
+ }
68
+
69
+ .voucher-no {
70
+ margin-right: 20px;
71
+
72
+ span {
73
+ color: #8b4513;
74
+ }
75
+ }
76
+ }
77
+
78
+ .voucher-table-wrapper {
79
+ border: 1px solid #8b4513;
80
+ padding: 1px;
81
+ width: 890px;
82
+ }
83
+
84
+ .voucher-table {
85
+ width: 100%;
86
+ border-collapse: collapse;
87
+ border: 1px solid #8b4513;
88
+
89
+ span {
90
+ color: #8b4513;
91
+ }
92
+
93
+ tbody {
94
+ tr {
95
+ height: 20px; // 固定行高
96
+
97
+ &.total-row {
98
+ // background-color: #fff9e6;
99
+
100
+ .summary {
101
+ text-align: center;
102
+ color: #8b4513;
103
+ }
104
+
105
+ .money-cell {
106
+ color: #8b4513;
107
+ }
108
+ }
109
+ }
110
+
111
+ // 空行样式
112
+ tr:empty {
113
+ height: 20px;
114
+ border: 1px solid #8b4513;
115
+ }
116
+ }
117
+
118
+ th,
119
+ td {
120
+ border: 1px solid #8b4513;
121
+ // padding: 6px;
122
+ text-align: center;
123
+ font-size: 14px;
124
+ height: 40px;
125
+ }
126
+
127
+ .checkmark {
128
+ width: 20px;
129
+ text-align: center;
130
+ border: 1px solid #8b4513;
131
+ color: #000;
132
+ font-weight: normal;
133
+ border-right: none; // 移除右侧边框与金额列融合
134
+ }
135
+
136
+ // .amount {
137
+ // border-left: none; // 移除左侧边框与勾选框融合
138
+ // }
139
+
140
+ .summary {
141
+ width: 40%;
142
+ text-align: center;
143
+ // padding-left: 15px;
144
+
145
+ }
146
+
147
+ .subject {
148
+ width: 45%;
149
+ text-align: center;
150
+ // padding-left: 15px;
151
+ }
152
+
153
+ .amount {
154
+ width: 22.5%;
155
+ padding: 0;
156
+
157
+ .amount-header {
158
+ border-bottom: 1px solid #8b4513;
159
+ padding: 5px 0;
160
+ }
161
+
162
+ .amount-grid,
163
+ .money-grid {
164
+ display: grid;
165
+ grid-template-columns: repeat(11, 1fr);
166
+
167
+ .money-cell {
168
+ width: 100%;
169
+ height: 100%;
170
+ display: flex;
171
+ align-items: center;
172
+ justify-content: center;
173
+ border-right: 1px solid #8b4513;
174
+
175
+ &:last-child {
176
+ border-right: none;
177
+ }
178
+ }
179
+
180
+ span {
181
+ // padding: 10px 0;
182
+ border-right: 1px solid #8b4513;
183
+ font-size: 12px;
184
+ height: 24px;
185
+ line-height: 24px;
186
+ display: flex;
187
+ align-items: center;
188
+ justify-content: center;
189
+
190
+ &:last-child {
191
+ border-right: none;
192
+ }
193
+ }
194
+ }
195
+
196
+ .money-grid {
197
+ height: 100%;
198
+
199
+ .money-cell {
200
+ color: #000;
201
+ }
202
+ }
203
+ }
204
+
205
+ .total-row {
206
+ // background-color: #fff9e6;
207
+
208
+ .summary {
209
+ text-align: center;
210
+ }
211
+ }
212
+ }
213
+
214
+ .voucher-footer {
215
+ display: flex;
216
+ justify-content: space-between;
217
+ margin-top: 20px;
218
+ // padding: 0 20px;
219
+ font-size: 14px;
220
+
221
+ .footer-item {
222
+ span:first-child {
223
+ margin-right: 5px;
224
+ color: #8b4513;
225
+ }
226
+
227
+ span:last-child {
228
+ margin-left: 10px;
229
+ }
230
+ }
231
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface ExportModalProps {
4
+ visible: boolean;
5
+ onCancel: () => void;
6
+ onConfirm: (type: 'pdf' | 'epub') => void;
7
+ themeColor?: string;
8
+ }
9
+ declare const ExportModal: React.FC<ExportModalProps>;
10
+ export default ExportModal;