ztxkui 4.0.7 → 4.0.8

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.
@@ -324,7 +324,7 @@ export function setPositionDeviation(value) {
324
324
  export function setMinusPosition(dom, style) {
325
325
  try {
326
326
  var childrenDom = dom.querySelectorAll('.set-box');
327
- if (childrenDom) {
327
+ if (childrenDom && childrenDom[0]) {
328
328
  var top_1 = childrenDom[0].dataset.top
329
329
  ? parseInt(childrenDom[0].dataset.top)
330
330
  : 0;
@@ -67,6 +67,10 @@ export interface IProps {
67
67
  defaultAddWater?: boolean;
68
68
  /** 设置插件打印方法 */
69
69
  ecPrintFn?: any;
70
+ /** 点击生成PDF前 */
71
+ clickCreatePdfHandlePre?: any;
72
+ /** 点击生成PDF后 */
73
+ clickCreatePdfHandleNext?: any;
70
74
  }
71
75
  declare const PrintContainer: React.FC<IProps>;
72
76
  export default PrintContainer;
@@ -94,7 +94,7 @@ function downloadFontTTF(_a) {
94
94
  }
95
95
  var PrintContainer = function (_a) {
96
96
  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, _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, onPrintBeforeCallback = _a.onPrintBeforeCallback, _h = _a.showPrintBtn, showPrintBtn = _h === void 0 ? true : _h, _j = _a.showPluginPrintBtn, showPluginPrintBtn = _j === void 0 ? true : _j, isUseXy = _a.isUseXy, localKey = _a.localKey, _k = _a.showExportBtn, showExportBtn = _k === void 0 ? true : _k, showSetFontBtn = _a.showSetFontBtn, isSetPosition = _a.isSetPosition, // 默认不需要偏移
97
- showAddSeal = _a.showAddSeal, apiUrl = _a.apiUrl, defaultAddWater = _a.defaultAddWater, fileBaseUrl = _a.fileBaseUrl, ecPrintFn = _a.ecPrintFn;
97
+ showAddSeal = _a.showAddSeal, apiUrl = _a.apiUrl, defaultAddWater = _a.defaultAddWater, fileBaseUrl = _a.fileBaseUrl, ecPrintFn = _a.ecPrintFn, clickCreatePdfHandlePre = _a.clickCreatePdfHandlePre, clickCreatePdfHandleNext = _a.clickCreatePdfHandleNext;
98
98
  var _l = useState(false), showWater = _l[0], setShowWater = _l[1];
99
99
  var _m = useState(false), showSeal = _m[0], setShowSeal = _m[1];
100
100
  var containerRef = useRef();
@@ -553,6 +553,7 @@ var PrintContainer = function (_a) {
553
553
  */
554
554
  function createPdf(_a) {
555
555
  var successCallback = _a.successCallback, options = _a.options;
556
+ clickCreatePdfHandlePre && clickCreatePdfHandlePre();
556
557
  setTimeout(function () {
557
558
  if (isSetPosition) {
558
559
  setPositionDom(setPositionDeviation(value));
@@ -571,11 +572,13 @@ var PrintContainer = function (_a) {
571
572
  },
572
573
  })
573
574
  .then(function (option) {
575
+ clickCreatePdfHandleNext && clickCreatePdfHandleNext();
574
576
  setPositionDom(value);
575
577
  // 成功回调
576
578
  successCallback(option);
577
579
  })
578
580
  .catch(function () {
581
+ clickCreatePdfHandleNext && clickCreatePdfHandleNext();
579
582
  setPositionDom(value);
580
583
  setSpinning(false);
581
584
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "4.0.7",
3
+ "version": "4.0.8",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",