ztxkui 3.4.15 → 3.4.16

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.
@@ -38,6 +38,10 @@ export interface IProps {
38
38
  flowId?: string;
39
39
  /** 水印图片 */
40
40
  imgWaterBg?: string;
41
+ /** 点击打印的回调函数 */
42
+ onPrintCallback?: () => void;
43
+ /** 是否添加点击打印提示 */
44
+ showPrintMessage?: boolean;
41
45
  }
42
46
  declare const PrintContainer: React.FC<IProps>;
43
47
  export default PrintContainer;
@@ -46,7 +46,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
46
46
  import React, { useEffect, useRef, useState } from 'react';
47
47
  // redux
48
48
  // ztxkui公共组件
49
- import { Button, Spin, message } from '../../index';
49
+ import { Button, Spin, message, Modal } from '../../index';
50
50
  // 路由配置
51
51
  // store
52
52
  // 自定义组件
@@ -75,7 +75,7 @@ function downloadFontTTF(_a) {
75
75
  });
76
76
  }
77
77
  var PrintContainer = function (_a) {
78
- var children = _a.children, waterText = _a.waterText, onFonsizeChange = _a.onFonsizeChange, hiddenClassName = _a.hiddenClassName, _b = _a.isAddExportPage, isAddExportPage = _b === void 0 ? false : _b, _c = _a.loading, loading = _c === void 0 ? false : _c, _d = _a.pdfName, pdfName = _d === void 0 ? 'pdf文件' : _d, request = _a.request, sealIdList = _a.sealIdList, autoSealIdList = _a.autoSealIdList, keywordList = _a.keywordList, _e = _a.showHandSeal, showHandSeal = _e === void 0 ? true : _e, _f = _a.showAutoSeal, showAutoSeal = _f === void 0 ? true : _f, _g = _a.needWatermark, needWatermark = _g === void 0 ? 0 : _g, fileId = _a.fileId, deptId = _a.deptId, flowId = _a.flowId, imgWaterBg = _a.imgWaterBg;
78
+ var children = _a.children, waterText = _a.waterText, onFonsizeChange = _a.onFonsizeChange, hiddenClassName = _a.hiddenClassName, _b = _a.isAddExportPage, isAddExportPage = _b === void 0 ? false : _b, _c = _a.loading, loading = _c === void 0 ? false : _c, _d = _a.pdfName, pdfName = _d === void 0 ? 'pdf文件' : _d, request = _a.request, sealIdList = _a.sealIdList, autoSealIdList = _a.autoSealIdList, keywordList = _a.keywordList, _e = _a.showHandSeal, showHandSeal = _e === void 0 ? true : _e, _f = _a.showAutoSeal, showAutoSeal = _f === void 0 ? true : _f, _g = _a.needWatermark, needWatermark = _g === void 0 ? 0 : _g, fileId = _a.fileId, deptId = _a.deptId, flowId = _a.flowId, imgWaterBg = _a.imgWaterBg, onPrintCallback = _a.onPrintCallback, showPrintMessage = _a.showPrintMessage;
79
79
  var _h = useState(false), showWater = _h[0], setShowWater = _h[1];
80
80
  var containerRef = useRef();
81
81
  var allDomRef = useRef();
@@ -231,11 +231,37 @@ var PrintContainer = function (_a) {
231
231
  };
232
232
  // 打印
233
233
  var onPrintHandle = function () {
234
- printCurrentDom({
235
- hiddenClassNames: __spreadArray([
236
- '.print-container--header'
237
- ], (hiddenClassName || [])),
238
- });
234
+ if (showPrintMessage) {
235
+ var isOkSure_1 = false;
236
+ Modal.confirm({
237
+ title: '打印提示',
238
+ content: '点击确认按钮后,将作为一次成功的打印,并记录到系统!你确认要打印吗?',
239
+ okText: '确认',
240
+ onOk: function () {
241
+ isOkSure_1 = true;
242
+ onPrintCallback && onPrintCallback();
243
+ },
244
+ afterClose: function () {
245
+ if (isOkSure_1) {
246
+ setTimeout(function () {
247
+ printCurrentDom({
248
+ hiddenClassNames: __spreadArray([
249
+ '.print-container--header'
250
+ ], (hiddenClassName || [])),
251
+ });
252
+ });
253
+ }
254
+ },
255
+ });
256
+ }
257
+ else {
258
+ onPrintCallback && onPrintCallback();
259
+ printCurrentDom({
260
+ hiddenClassNames: __spreadArray([
261
+ '.print-container--header'
262
+ ], (hiddenClassName || [])),
263
+ });
264
+ }
239
265
  };
240
266
  // 生成pdf
241
267
  var onPdfHandle = function () { return __awaiter(void 0, void 0, void 0, function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.4.15",
3
+ "version": "3.4.16",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",