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
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
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"),
|