ztxkui 3.5.16 → 3.5.17

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.
@@ -54,7 +54,6 @@ import { Button, Spin, message, Modal } from '../../index';
54
54
  import { printCurrentDom, htmlToPdfNoCanvas, htmlToPdf, } from 'ztxkutils/dist/print';
55
55
  import { createDownloadUrlNoBase } from 'ztxkutils/dist/fileOperation';
56
56
  import { dataURLtoFile, image2Base64 } from './handle';
57
- import { createTask } from './lodop';
58
57
  var fontTTF = {
59
58
  data: '',
60
59
  };
@@ -306,80 +305,64 @@ var PrintContainer = function (_a) {
306
305
  });
307
306
  }); };
308
307
  // EC打印
309
- var onECPrintHandle = function () { return __awaiter(void 0, void 0, void 0, function () {
310
- var result, err_2, isOkSure_2;
311
- return __generator(this, function (_a) {
312
- switch (_a.label) {
313
- case 0:
314
- result = true;
315
- if (!onPrintBeforeCallback) return [3 /*break*/, 4];
316
- _a.label = 1;
317
- case 1:
318
- _a.trys.push([1, 3, , 4]);
319
- return [4 /*yield*/, onPrintBeforeCallback()];
320
- case 2:
321
- result = _a.sent();
322
- return [3 /*break*/, 4];
323
- case 3:
324
- err_2 = _a.sent();
325
- result = null;
326
- return [3 /*break*/, 4];
327
- case 4:
328
- if (!result) {
329
- return [2 /*return*/];
330
- }
331
- if (showPrintMessage) {
332
- isOkSure_2 = false;
333
- Modal.confirm({
334
- title: '打印提示',
335
- content: '点击确认按钮后,将作为一次成功的打印,并记录到系统!你确认要打印吗?',
336
- okText: '确认',
337
- onOk: function () {
338
- if (onPrintCallback) {
339
- var result_2 = onPrintCallback();
340
- if (result_2 instanceof Promise) {
341
- var startTime_2 = Date.now();
342
- result_2.then(function (res) {
343
- if (res) {
344
- if (Date.now() - startTime_2 > 1000) {
345
- // 关闭打印页面
346
- setTimeout(function () {
347
- ecPrintHandle();
348
- });
349
- }
350
- else {
351
- setTimeout(function () {
352
- ecPrintHandle();
353
- }, 1000);
354
- }
355
- }
356
- });
357
- }
358
- else {
359
- isOkSure_2 = true;
360
- }
361
- }
362
- else {
363
- isOkSure_2 = true;
364
- }
365
- },
366
- afterClose: function () {
367
- if (isOkSure_2) {
368
- setTimeout(function () {
369
- ecPrintHandle();
370
- });
371
- }
372
- },
373
- });
374
- }
375
- else {
376
- onPrintCallback && onPrintCallback();
377
- ecPrintHandle();
378
- }
379
- return [2 /*return*/];
380
- }
381
- });
382
- }); };
308
+ // const onECPrintHandle = async () => {
309
+ // let result: any = true;
310
+ // if (onPrintBeforeCallback) {
311
+ // try {
312
+ // result = await onPrintBeforeCallback();
313
+ // } catch (err) {
314
+ // result = null;
315
+ // }
316
+ // }
317
+ // if (!result) {
318
+ // return;
319
+ // }
320
+ // if (showPrintMessage) {
321
+ // let isOkSure = false;
322
+ // Modal.confirm({
323
+ // title: '打印提示',
324
+ // content:
325
+ // '点击确认按钮后,将作为一次成功的打印,并记录到系统!你确认要打印吗?',
326
+ // okText: '确认',
327
+ // onOk: () => {
328
+ // if (onPrintCallback) {
329
+ // const result = onPrintCallback();
330
+ // if (result instanceof Promise) {
331
+ // let startTime = Date.now();
332
+ // result.then((res) => {
333
+ // if (res) {
334
+ // if (Date.now() - startTime > 1000) {
335
+ // // 关闭打印页面
336
+ // setTimeout(() => {
337
+ // ecPrintHandle();
338
+ // });
339
+ // } else {
340
+ // setTimeout(() => {
341
+ // ecPrintHandle();
342
+ // }, 1000);
343
+ // }
344
+ // }
345
+ // });
346
+ // } else {
347
+ // isOkSure = true;
348
+ // }
349
+ // } else {
350
+ // isOkSure = true;
351
+ // }
352
+ // },
353
+ // afterClose: () => {
354
+ // if (isOkSure) {
355
+ // setTimeout(() => {
356
+ // ecPrintHandle();
357
+ // });
358
+ // }
359
+ // },
360
+ // });
361
+ // } else {
362
+ // onPrintCallback && onPrintCallback();
363
+ // ecPrintHandle();
364
+ // }
365
+ // };
383
366
  // 打印方法
384
367
  function printHandle() {
385
368
  printCurrentDom({
@@ -388,22 +371,23 @@ var PrintContainer = function (_a) {
388
371
  ], (hiddenClassName || [])),
389
372
  });
390
373
  }
391
- function ecPrintHandle() {
392
- var LODOP = createTask({
393
- taskName: '测试',
394
- width: '1',
395
- height: '1',
396
- });
397
- var style = '';
398
- var styleTag = window.document.getElementsByTagName('style');
399
- for (var i = 0, len = styleTag.length; i < len; i++) {
400
- style += '<style >' + styleTag[i].innerText + '</style>';
401
- }
402
- var strFormHtml = style + '<body>' + containerRef.current.innerHTML + '</body>';
403
- LODOP.ADD_PRINT_HTM('1%', '1%', '98%', '98%', strFormHtml); //设置打印内容
404
- LODOP.SET_PREVIEW_WINDOW(2, 0, 0, 800, 600, ''); //设置预览窗口模式和大小
405
- LODOP.PREVIEW();
406
- }
374
+ // function ecPrintHandle() {
375
+ // const LODOP = createTask({
376
+ // taskName: '测试',
377
+ // width: '1',
378
+ // height: '1',
379
+ // });
380
+ // let style = '';
381
+ // let styleTag = window.document.getElementsByTagName('style');
382
+ // for (let i = 0, len = styleTag.length; i < len; i++) {
383
+ // style += '<style >' + styleTag[i].innerText + '</style>';
384
+ // }
385
+ // const strFormHtml =
386
+ // style + '<body>' + containerRef.current.innerHTML + '</body>';
387
+ // LODOP.ADD_PRINT_HTM('1%', '1%', '98%', '98%', strFormHtml); //设置打印内容
388
+ // LODOP.SET_PREVIEW_WINDOW(2, 0, 0, 800, 600, ''); //设置预览窗口模式和大小
389
+ // LODOP.PREVIEW();
390
+ // }
407
391
  // 生成pdf
408
392
  var onPdfHandle = function () { return __awaiter(void 0, void 0, void 0, function () {
409
393
  var html2canvasDom;
@@ -786,7 +770,6 @@ var PrintContainer = function (_a) {
786
770
  React.createElement(Button, { type: "primary", onClick: function () { return onFontsizeHandle('reduce'); } }, "\u7F29\u5C0F\u6587\u5B57"),
787
771
  React.createElement(Button, { type: "primary", onClick: onWaterHandle }, !showWater ? '添加水印' : '移除水印'),
788
772
  React.createElement(Button, { type: "primary", onClick: onPrintHandle }, "\u6253\u5370"),
789
- false && (React.createElement(Button, { type: "primary", onClick: onECPrintHandle }, "EC\u6253\u5370")),
790
773
  React.createElement(Button, { type: "primary", onClick: onPdfHandle }, "\u5BFC\u51FAPDF"),
791
774
  showHandSeal && (React.createElement(React.Fragment, null,
792
775
  React.createElement(Button, { type: "primary", onClick: onSurePositionHandle }, "\u786E\u8BA4\u76D6\u7AE0\u4F4D\u7F6E"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.5.16",
3
+ "version": "3.5.17",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",