ztxkui 3.6.0 → 3.6.1
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.
|
@@ -29,7 +29,7 @@ function request(options) {
|
|
|
29
29
|
return axios({
|
|
30
30
|
baseURL: options.baseURL ? options.baseURL : 'http://192.168.0.83:8000',
|
|
31
31
|
url: options.url,
|
|
32
|
-
headers: __assign({ 'Zmdms-Auth': 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
32
|
+
headers: __assign({ 'Zmdms-Auth': 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25hbWUiOm51bGwsImVtcF9udW1iZXIiOm51bGwsImltdF9pZCI6bnVsbCwicmVhbF9uYW1lIjoi6ZmI5Lqa6ZuEIiwiY2xpZW50X3R5cGUiOiJ3ZWIiLCJkYXRhX3JvbGVfaWQiOiIxMzQ1OTc4NTA1MzAyMDU2OTYyLDE0NjgwMzUzNTE2MjUyODU2MzQsMTU0MjA3NjMwODU3ODAyNTQ3NCIsImNsaWVudF9pZCI6InN3b3JkIiwidXNlcl90eXBlIjoid2ViIiwicm9sZV9pZCI6IjExMjM1OTg4MTY3Mzg2NzUyMDEsMTQ2NzAxNTk3NTQ4NDc2MDA2NiwxNDY4MDM0NDM3MTU3OTYxNzI5LDE0ODA4MjkzMzc5MzkxMzI0MTciLCJwb3N0X25hbWUiOm51bGwsInNjb3BlIjpbImFsbCJdLCJpbnRlcnZpZXdfaWQiOm51bGwsImV4cCI6MTY2MTk0Mjk2MCwib3JnX25hbWUiOm51bGwsImp0aSI6ImVlN2QwNmM2LTg2YjktNDM3NC1hNjhiLTM2MTJkYTZlYmNkZSIsIm1lbWJlcl9pZCI6MSwiY29tcGFueV9pZCI6bnVsbCwic3lzdGVtX2lkIjpudWxsLCJkZXB0X25hbWUiOm51bGwsImF2YXRhciI6IiIsImRhdGFfcm9sZV9uYW1lIjoiYWRtaW4sYWRtaW4sYWRtaW4iLCJhdXRob3JpdGllcyI6WyJhZG1pbiIsInVzZXIiLCJhZG1pbmlzdHJhdG9yIl0sInJvbGVfbmFtZSI6ImFkbWluaXN0cmF0b3IsdXNlcixhZG1pbixhZG1pbiIsInJlc3VtZV90ZW1wbGF0ZSI6bnVsbCwibGljZW5zZSI6InBvd2VyZWQgYnkgem1kbXMiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjE0MTI5NTM4MDQzMzM1NTU3MTQiLCJvcmdfaWQiOm51bGwsIm5pY2tfbmFtZSI6IumZiOS6mumbhCIsImNvbXBhbnlfbmFtZSI6bnVsbCwiZGVwdF9pZCI6IiIsImhhbmRsZV9ocl9uYW1lIjpudWxsLCJhY2NvdW50IjoiY2hlbnl4IiwicmVzdW1lX2lkIjpudWxsfQ.ZWKKK_sK1JgHAGYnTVDm3BXy_r8OK3y_GwfOi7nmRiQ' }, options.headers),
|
|
33
33
|
method: options.method,
|
|
34
34
|
data: options.data,
|
|
35
35
|
params: options.params,
|
|
@@ -91,7 +91,7 @@ var PrintContainerDemo = function () {
|
|
|
91
91
|
var _c = useState(''), base64Img = _c[0], setBase64Img = _c[1];
|
|
92
92
|
useEffect(function () {
|
|
93
93
|
var xhr = new XMLHttpRequest();
|
|
94
|
-
var token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
94
|
+
var token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25hbWUiOm51bGwsImVtcF9udW1iZXIiOm51bGwsImltdF9pZCI6bnVsbCwicmVhbF9uYW1lIjoi6ZmI5Lqa6ZuEIiwiY2xpZW50X3R5cGUiOiJ3ZWIiLCJkYXRhX3JvbGVfaWQiOiIxMzQ1OTc4NTA1MzAyMDU2OTYyLDE0NjgwMzUzNTE2MjUyODU2MzQsMTU0MjA3NjMwODU3ODAyNTQ3NCIsImNsaWVudF9pZCI6InN3b3JkIiwidXNlcl90eXBlIjoid2ViIiwicm9sZV9pZCI6IjExMjM1OTg4MTY3Mzg2NzUyMDEsMTQ2NzAxNTk3NTQ4NDc2MDA2NiwxNDY4MDM0NDM3MTU3OTYxNzI5LDE0ODA4MjkzMzc5MzkxMzI0MTciLCJwb3N0X25hbWUiOm51bGwsInNjb3BlIjpbImFsbCJdLCJpbnRlcnZpZXdfaWQiOm51bGwsImV4cCI6MTY2MTk0Mjk2MCwib3JnX25hbWUiOm51bGwsImp0aSI6ImVlN2QwNmM2LTg2YjktNDM3NC1hNjhiLTM2MTJkYTZlYmNkZSIsIm1lbWJlcl9pZCI6MSwiY29tcGFueV9pZCI6bnVsbCwic3lzdGVtX2lkIjpudWxsLCJkZXB0X25hbWUiOm51bGwsImF2YXRhciI6IiIsImRhdGFfcm9sZV9uYW1lIjoiYWRtaW4sYWRtaW4sYWRtaW4iLCJhdXRob3JpdGllcyI6WyJhZG1pbiIsInVzZXIiLCJhZG1pbmlzdHJhdG9yIl0sInJvbGVfbmFtZSI6ImFkbWluaXN0cmF0b3IsdXNlcixhZG1pbixhZG1pbiIsInJlc3VtZV90ZW1wbGF0ZSI6bnVsbCwibGljZW5zZSI6InBvd2VyZWQgYnkgem1kbXMiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjE0MTI5NTM4MDQzMzM1NTU3MTQiLCJvcmdfaWQiOm51bGwsIm5pY2tfbmFtZSI6IumZiOS6mumbhCIsImNvbXBhbnlfbmFtZSI6bnVsbCwiZGVwdF9pZCI6IiIsImhhbmRsZV9ocl9uYW1lIjpudWxsLCJhY2NvdW50IjoiY2hlbnl4IiwicmVzdW1lX2lkIjpudWxsfQ.ZWKKK_sK1JgHAGYnTVDm3BXy_r8OK3y_GwfOi7nmRiQ';
|
|
95
95
|
xhr.open('GET', "http://192.168.0.83:8000/api/zmdms-resource/oss/endpoint/download-file/1559472632642387969?Zmdms-Auth=bearer " + token, true);
|
|
96
96
|
xhr.responseType = 'blob';
|
|
97
97
|
xhr.onload = function () {
|
|
@@ -103,7 +103,7 @@ var PrintContainerDemo = function () {
|
|
|
103
103
|
};
|
|
104
104
|
xhr.send();
|
|
105
105
|
}, []);
|
|
106
|
-
return (React.createElement(PrintContainer, { isAddExportPage: true, loading: loading, request: request, deptId: "
|
|
106
|
+
return (React.createElement(PrintContainer, { isAddExportPage: true, loading: loading, request: request, deptId: "1295909488001540097", flowId: "scm_print_tdtd", fileId: "1551733945007517697",
|
|
107
107
|
// keywordList={keywordList}
|
|
108
108
|
imgWaterBg: water, showPrintMessage: true,
|
|
109
109
|
// onPrintBeforeCallback={() => {
|
|
@@ -240,128 +240,6 @@ var PrintContainerDemo = function () {
|
|
|
240
240
|
React.createElement("td", { colSpan: 2 }, "\u91CD\u5E86\u4E2D\u62D3-\u7535\u5546\u90E8"),
|
|
241
241
|
React.createElement("td", null, "\u4E1A\u52A1\u4EE3\u8868"),
|
|
242
242
|
React.createElement("td", { colSpan: 2 }, "\u80E1\u4F1F\u534E"))))),
|
|
243
|
-
React.createElement("div", { className: "pt_bottom" },
|
|
244
|
-
React.createElement("div", { className: "ant-row", style: { rowGap: '0px' } },
|
|
245
|
-
React.createElement("div", { className: "ant-col ant-col-17", style: { paddingLeft: '0px' } },
|
|
246
|
-
React.createElement("div", { className: "ant-row", style: { rowGap: '0px' } }, "1\u3001\u672C\u63D0\u5355\u5728\u4E0A\u8FF0\u6709\u6548\u671F\u5185\u6709\u6548\uFF0C\u8FC7\u671F\u4F5C\u5E9F\uFF1B"),
|
|
247
|
-
React.createElement("div", { className: "ant-row", style: { rowGap: '0px' } }, "2\u3001\u672C\u63D0\u8D27\u5355\u4F4D\u7ECF\u8D22\u52A1\u6536\u6B3E\u76D6\u7AE0\u540E\u63D0\u8D27\uFF1B\u6B64\u63D0\u8D27\u5355\u9057\u5931\uFF0C\u63D0\u8D27\u5355\u4F4D\u8D23\u4EFB\u81EA\u8D1F\uFF1B\u51ED\u6B64\u63D0\u8D27\u5355\u4EA4\u4ED8\u8D27\u7269\u540E\uFF0C\u8D27\u7269\u6240\u6709\u98CE\u9669\u8F6C\u79FB\u5230\u63D0\u8D27\u5355\u4F4D\u3002"),
|
|
248
|
-
React.createElement("div", { className: "ant-row", style: { rowGap: '0px' } })),
|
|
249
|
-
React.createElement("div", { className: "ant-col ant-col-7", style: { paddingRight: '0px' } },
|
|
250
|
-
React.createElement("div", { className: "ant-row", style: { justifyContent: 'flex-end', rowGap: '0px' } },
|
|
251
|
-
React.createElement("span", null, "\u6253\u5370\u65F6\u95F4\uFF1A"),
|
|
252
|
-
React.createElement("span", null, "2022-08-12 14:45:57")),
|
|
253
|
-
React.createElement("div", { className: "ant-row", style: { justifyContent: 'flex-end', rowGap: '0px' } },
|
|
254
|
-
React.createElement("span", null, "\u6253\u5370\u4EBA\uFF1A"),
|
|
255
|
-
React.createElement("span", null, "chenyx"))))))),
|
|
256
|
-
React.createElement("div", { className: "html2canvas-container-page simple-print" },
|
|
257
|
-
React.createElement("div", { className: "print-header" },
|
|
258
|
-
React.createElement("img", { src: base64Img, alt: "" }),
|
|
259
|
-
React.createElement("h3", { className: "print-title" }, "\u63D0\u8D27\u5355"),
|
|
260
|
-
React.createElement("div", { className: "right-info" },
|
|
261
|
-
React.createElement("div", { className: "info-item" },
|
|
262
|
-
React.createElement("span", null, "\u63D0\u8D27\u5355\u53F7\uFF1A"),
|
|
263
|
-
React.createElement("span", null, "8000000399")),
|
|
264
|
-
React.createElement("div", { className: "info-item" },
|
|
265
|
-
React.createElement("span", null, "\u5F00\u5355\u65F6\u95F4\uFF1A"),
|
|
266
|
-
React.createElement("span", null, "2022-08-03")),
|
|
267
|
-
React.createElement("div", { className: "info-item" },
|
|
268
|
-
React.createElement("span", null, "\u5BA1\u6838\u65F6\u95F4\uFF1A"),
|
|
269
|
-
React.createElement("span", null, "2022-08-06")))),
|
|
270
|
-
React.createElement("div", { className: "purchaseIn-print-box" },
|
|
271
|
-
React.createElement("div", { className: "pt10" },
|
|
272
|
-
React.createElement("table", null,
|
|
273
|
-
React.createElement("tbody", null,
|
|
274
|
-
React.createElement("tr", null,
|
|
275
|
-
React.createElement("td", null, "\u63D0\u8D27\u5355\u4F4D"),
|
|
276
|
-
React.createElement("td", { colSpan: 3 }, "\u4E2D\u94C1\u4E8C\u5341\u4E8C\u5C40\u96C6\u56E2\u6709\u9650,\u516C\u53F8"),
|
|
277
|
-
React.createElement("td", null, "\u5F00\u6237\u94F6\u884C\u53CA\u8D26\u53F7"),
|
|
278
|
-
React.createElement("td", { colSpan: 3 }),
|
|
279
|
-
React.createElement("td", { width: "100px" }, "\u7269\u6D41\u6307\u4EE4\u5355\u53F7"),
|
|
280
|
-
React.createElement("td", { colSpan: 3 })),
|
|
281
|
-
React.createElement("tr", null,
|
|
282
|
-
React.createElement("td", null, "\u7A0E\u53F7"),
|
|
283
|
-
React.createElement("td", { colSpan: 3 }, "9111000071092227XH"),
|
|
284
|
-
React.createElement("td", null, "\u5730\u5740\u53CA\u7535\u8BDD"),
|
|
285
|
-
React.createElement("td", { colSpan: 3 }, "\u5317\u4EAC\u5E02\u77F3\u666F\u5C71\u533A\u77F3\u666F\u5C71\u8DEF35\u53F7"),
|
|
286
|
-
React.createElement("td", { width: "100px" }, "\u9500\u552E\u5408\u540C\u53F7"),
|
|
287
|
-
React.createElement("td", { colSpan: 3 }, "SC2208010002")),
|
|
288
|
-
React.createElement("tr", null,
|
|
289
|
-
React.createElement("td", null, "\u63D0\u8D27\u4ED3\u5E93"),
|
|
290
|
-
React.createElement("td", { colSpan: 2 }, "\u7269\u4EA7\u7269\u6D41\u6B23\u987A\u7F8E\u5E93"),
|
|
291
|
-
React.createElement("td", null, "\u4ED3\u5E93\u5730\u5740"),
|
|
292
|
-
React.createElement("td", { colSpan: 2 }),
|
|
293
|
-
React.createElement("td", null, "\u4ED3\u5E93\u8054\u7CFB\u4EBA"),
|
|
294
|
-
React.createElement("td", { colSpan: 2 }),
|
|
295
|
-
React.createElement("td", null, "\u4ED3\u5E93\u7535\u8BDD"),
|
|
296
|
-
React.createElement("td", { colSpan: 2 })),
|
|
297
|
-
React.createElement("tr", null,
|
|
298
|
-
React.createElement("td", { rowSpan: 2, colSpan: 4 }, "\u5546\u54C1\u540D\u79F0"),
|
|
299
|
-
React.createElement("td", { width: "100px", rowSpan: 2 }, "\u6279\u6B21\u53F7"),
|
|
300
|
-
React.createElement("td", { colSpan: 2, width: "150px" }, "\u5F00\u5355\u6570\u91CF"),
|
|
301
|
-
React.createElement("td", { colSpan: 2, width: "150px" }, "\u5B9E\u53D1\u6570\u91CF"),
|
|
302
|
-
React.createElement("td", { rowSpan: 2 }, "\u5355\u4EF7(\u542B\u7A0E)"),
|
|
303
|
-
React.createElement("td", { width: "56px", rowSpan: 2 }, "\u662F\u5426\u542B\u8FD0\u8F93\u8D39"),
|
|
304
|
-
React.createElement("td", { width: "56px", rowSpan: 2 }, "\u662F\u5426\u542B\u51FA\u5E93\u8D39")),
|
|
305
|
-
React.createElement("tr", null,
|
|
306
|
-
React.createElement("td", { width: "50px" }, "\u4EF6"),
|
|
307
|
-
React.createElement("td", { width: "100px" }, "\u91CD\u91CF(\u5428)"),
|
|
308
|
-
React.createElement("td", { width: "50px" }, "\u4EF6"),
|
|
309
|
-
React.createElement("td", { width: "100px" }, "\u91CD\u91CF(\u5428)")),
|
|
310
|
-
React.createElement("tr", null,
|
|
311
|
-
React.createElement("td", { colSpan: 4 }, "\u91CD\u8F68 50MN \u6CB3\u5317\u6C38\u6D0B"),
|
|
312
|
-
React.createElement("td", null, "BN2207210002"),
|
|
313
|
-
React.createElement("td", null, "0"),
|
|
314
|
-
React.createElement("td", null, "1.000000"),
|
|
315
|
-
React.createElement("td", null, "0"),
|
|
316
|
-
React.createElement("td", null, "0.000000"),
|
|
317
|
-
React.createElement("td", null, "12.00"),
|
|
318
|
-
React.createElement("td", null, "\u5426"),
|
|
319
|
-
React.createElement("td", null, "\u5426")),
|
|
320
|
-
React.createElement("tr", null,
|
|
321
|
-
React.createElement("td", { colSpan: 4 }, "\u91CD\u8F68 50MN \u6CB3\u5317\u6C38\u6D0B"),
|
|
322
|
-
React.createElement("td", null, "BN2207140002"),
|
|
323
|
-
React.createElement("td", null, "0"),
|
|
324
|
-
React.createElement("td", null, "10.000000"),
|
|
325
|
-
React.createElement("td", null, "0"),
|
|
326
|
-
React.createElement("td", null, "0.000000"),
|
|
327
|
-
React.createElement("td", null, "12.00"),
|
|
328
|
-
React.createElement("td", null, "\u5426"),
|
|
329
|
-
React.createElement("td", null, "\u5426")),
|
|
330
|
-
React.createElement("tr", null,
|
|
331
|
-
React.createElement("td", { colSpan: 4, align: "left", style: { padding: '0px 30px' } }, "\u5408\u8BA1"),
|
|
332
|
-
React.createElement("td", null),
|
|
333
|
-
React.createElement("td", null, "0"),
|
|
334
|
-
React.createElement("td", null, "11.000000"),
|
|
335
|
-
React.createElement("td", null, "0"),
|
|
336
|
-
React.createElement("td", null, "0.000000"),
|
|
337
|
-
React.createElement("td", null),
|
|
338
|
-
React.createElement("td", null),
|
|
339
|
-
React.createElement("td", null)),
|
|
340
|
-
React.createElement("tr", null,
|
|
341
|
-
React.createElement("td", null, "\u5907\u6CE8"),
|
|
342
|
-
React.createElement("td", { colSpan: 5 }),
|
|
343
|
-
React.createElement("td", null, "\u63D0\u5355\u6709\u6548\u671F"),
|
|
344
|
-
React.createElement("td", { colSpan: 2 }, "24"),
|
|
345
|
-
React.createElement("td", null, "\u51FA\u5E93\u65B9\u5F0F"),
|
|
346
|
-
React.createElement("td", { colSpan: 2 }, "\u5BA2\u6237\u81EA\u63D0")),
|
|
347
|
-
React.createElement("tr", null,
|
|
348
|
-
React.createElement("td", null, "\u63D0\u8D27\u4EBA"),
|
|
349
|
-
React.createElement("td", { colSpan: 2 }),
|
|
350
|
-
React.createElement("td", null, "\u63D0\u8D27\u8F66\u724C"),
|
|
351
|
-
React.createElement("td", { colSpan: 2 }),
|
|
352
|
-
React.createElement("td", null, "\u6253\u5370\u6B21\u6570"),
|
|
353
|
-
React.createElement("td", { colSpan: 2 }),
|
|
354
|
-
React.createElement("td", null, "\u5B58\u8D27\u5355\u4F4D"),
|
|
355
|
-
React.createElement("td", { colSpan: 2 }, "\u91CD\u5E86\u4E2D\u62D3-\u7535\u5546\u90E8")),
|
|
356
|
-
React.createElement("tr", null,
|
|
357
|
-
React.createElement("td", null, "\u53D1\u8D27\u4EBA"),
|
|
358
|
-
React.createElement("td", { colSpan: 2 }),
|
|
359
|
-
React.createElement("td", null, "\u5236\u5355\u4EBA"),
|
|
360
|
-
React.createElement("td", { colSpan: 2 }, "\u9EC4\u667A\u575A"),
|
|
361
|
-
React.createElement("td", null, "\u90E8\u95E8"),
|
|
362
|
-
React.createElement("td", { colSpan: 2 }, "\u91CD\u5E86\u4E2D\u62D3-\u7535\u5546\u90E8"),
|
|
363
|
-
React.createElement("td", null, "\u4E1A\u52A1\u4EE3\u8868"),
|
|
364
|
-
React.createElement("td", { colSpan: 2 }, "\u80E1\u4F1F\u534E"))))),
|
|
365
243
|
React.createElement("div", { className: "pt_bottom" },
|
|
366
244
|
React.createElement("div", { className: "ant-row", style: { rowGap: '0px' } },
|
|
367
245
|
React.createElement("div", { className: "ant-col ant-col-17", style: { paddingLeft: '0px' } },
|
|
@@ -33,6 +33,7 @@ import React, { useCallback, useEffect, memo, useRef, useState } from 'react';
|
|
|
33
33
|
import { Select } from 'antd';
|
|
34
34
|
import { useFetchState } from 'ztxkutils/dist/hooks';
|
|
35
35
|
import debounce from 'lodash/debounce';
|
|
36
|
+
import { dangerouslySetXss } from 'ztxkutils/dist/tools';
|
|
36
37
|
/**
|
|
37
38
|
* 组件缓存的数据格式,在当前浏览器运行内,能保证是唯一的引用,用来缓存数据用
|
|
38
39
|
* {
|
|
@@ -502,21 +503,23 @@ function EnhanceSelect(_a) {
|
|
|
502
503
|
? item[componentKey]
|
|
503
504
|
: item[dataKey];
|
|
504
505
|
var value = item[dataKey];
|
|
505
|
-
var title = item[titleKey];
|
|
506
|
+
var title = dangerouslySetXss(item[titleKey]);
|
|
506
507
|
var joinTitle = [];
|
|
507
508
|
var linefeedTitle = [];
|
|
508
509
|
if (joinKey) {
|
|
509
510
|
joinTitle = Array.isArray(joinKey)
|
|
510
|
-
? joinKey.map(function (joinItem) { return item[joinItem]; })
|
|
511
|
+
? joinKey.map(function (joinItem) { return dangerouslySetXss(item[joinItem]); })
|
|
511
512
|
: item[joinKey]
|
|
512
|
-
? [item[joinKey]]
|
|
513
|
+
? [dangerouslySetXss(item[joinKey])]
|
|
513
514
|
: [];
|
|
514
515
|
}
|
|
515
516
|
if (lineFeedKey) {
|
|
516
517
|
linefeedTitle = Array.isArray(lineFeedKey)
|
|
517
|
-
? lineFeedKey.map(function (joinItem) {
|
|
518
|
+
? lineFeedKey.map(function (joinItem) {
|
|
519
|
+
return dangerouslySetXss(item[joinItem]);
|
|
520
|
+
})
|
|
518
521
|
: item[lineFeedKey]
|
|
519
|
-
? [item[lineFeedKey]]
|
|
522
|
+
? [dangerouslySetXss(item[lineFeedKey])]
|
|
520
523
|
: [];
|
|
521
524
|
}
|
|
522
525
|
if (Array.isArray(joinTitle)) {
|
|
@@ -65,7 +65,9 @@ import PrintModal from './PrintModal';
|
|
|
65
65
|
// 其他文件
|
|
66
66
|
import { printCurrentDom, htmlToPdfNoCanvas, htmlToPdf, } from 'ztxkutils/dist/print';
|
|
67
67
|
import { createDownloadUrlNoBase } from 'ztxkutils/dist/fileOperation';
|
|
68
|
-
import { dataURLtoFile,
|
|
68
|
+
import { dataURLtoFile,
|
|
69
|
+
// image2Base64,
|
|
70
|
+
setPositionLocal, getPositionLocal, } from './handle';
|
|
69
71
|
import { createTask } from './lodop';
|
|
70
72
|
import { setWater, removeWater } from './printUtils';
|
|
71
73
|
var fontTTF = {
|
|
@@ -518,65 +520,88 @@ var PrintContainer = function (_a) {
|
|
|
518
520
|
});
|
|
519
521
|
}); };
|
|
520
522
|
function createPdf() {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
.then(function () {
|
|
544
|
-
setSpinning(false);
|
|
545
|
-
setShowWater(false);
|
|
546
|
-
})
|
|
547
|
-
.catch(function () {
|
|
548
|
-
setSpinning(false);
|
|
549
|
-
setShowWater(false);
|
|
550
|
-
});
|
|
551
|
-
};
|
|
552
|
-
img.onerror = function () {
|
|
553
|
-
console.log('img error', '加载失败!');
|
|
554
|
-
};
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
else {
|
|
558
|
-
setTimeout(function () {
|
|
559
|
-
htmlToPdfNoCanvas({
|
|
560
|
-
dom: containerRef.current,
|
|
561
|
-
fileBinary: fontTTF,
|
|
562
|
-
isShowPage: isAddExportPage,
|
|
563
|
-
pdfName: pdfName,
|
|
564
|
-
isAddWater: showWater,
|
|
565
|
-
isDownload: true,
|
|
566
|
-
pdfOption: {
|
|
567
|
-
pageFormat: [1000, 1000],
|
|
568
|
-
},
|
|
569
|
-
})
|
|
570
|
-
.then(function () {
|
|
571
|
-
setSpinning(false);
|
|
572
|
-
setShowWater(false);
|
|
573
|
-
})
|
|
574
|
-
.catch(function () {
|
|
575
|
-
setSpinning(false);
|
|
576
|
-
setShowWater(false);
|
|
577
|
-
});
|
|
523
|
+
setTimeout(function () {
|
|
524
|
+
htmlToPdfNoCanvas({
|
|
525
|
+
dom: containerRef.current,
|
|
526
|
+
fileBinary: fontTTF,
|
|
527
|
+
isShowPage: isAddExportPage,
|
|
528
|
+
pdfName: pdfName,
|
|
529
|
+
// isAddWater: showWater,
|
|
530
|
+
isDownload: true,
|
|
531
|
+
pdfOption: {
|
|
532
|
+
pageFormat: [1000, 1000],
|
|
533
|
+
// 因为生成的pdf需要打印,所以边距需要去掉
|
|
534
|
+
pageMarginX: 0,
|
|
535
|
+
pageMarginY: 0,
|
|
536
|
+
},
|
|
537
|
+
})
|
|
538
|
+
.then(function () {
|
|
539
|
+
setSpinning(false);
|
|
540
|
+
setShowWater(false);
|
|
541
|
+
})
|
|
542
|
+
.catch(function () {
|
|
543
|
+
setSpinning(false);
|
|
544
|
+
setShowWater(false);
|
|
578
545
|
});
|
|
579
|
-
}
|
|
546
|
+
});
|
|
547
|
+
// if (imgWaterBg) {
|
|
548
|
+
// setTimeout(() => {
|
|
549
|
+
// let waterBase64 = '';
|
|
550
|
+
// const img = new Image();
|
|
551
|
+
// img.src = imgWaterBg;
|
|
552
|
+
// img.setAttribute('crossOrigin', 'Anonymous');
|
|
553
|
+
// img.onload = function () {
|
|
554
|
+
// waterBase64 = image2Base64(img);
|
|
555
|
+
// htmlToPdfNoCanvas({
|
|
556
|
+
// dom: containerRef.current,
|
|
557
|
+
// fileBinary: fontTTF,
|
|
558
|
+
// isShowPage: isAddExportPage,
|
|
559
|
+
// pdfName,
|
|
560
|
+
// isAddWater: showWater,
|
|
561
|
+
// waterBase64,
|
|
562
|
+
// imgWidth: img.width,
|
|
563
|
+
// imgHeight: img.height,
|
|
564
|
+
// isDownload: true,
|
|
565
|
+
// pdfOption: {
|
|
566
|
+
// pageFormat: [1000, 1000] as any,
|
|
567
|
+
// },
|
|
568
|
+
// })
|
|
569
|
+
// .then(() => {
|
|
570
|
+
// setSpinning(false);
|
|
571
|
+
// setShowWater(false);
|
|
572
|
+
// })
|
|
573
|
+
// .catch(() => {
|
|
574
|
+
// setSpinning(false);
|
|
575
|
+
// setShowWater(false);
|
|
576
|
+
// });
|
|
577
|
+
// };
|
|
578
|
+
// img.onerror = function () {
|
|
579
|
+
// console.log('img error', '加载失败!');
|
|
580
|
+
// };
|
|
581
|
+
// });
|
|
582
|
+
// } else {
|
|
583
|
+
// setTimeout(() => {
|
|
584
|
+
// htmlToPdfNoCanvas({
|
|
585
|
+
// dom: containerRef.current,
|
|
586
|
+
// fileBinary: fontTTF,
|
|
587
|
+
// isShowPage: isAddExportPage,
|
|
588
|
+
// pdfName,
|
|
589
|
+
// // isAddWater: showWater,
|
|
590
|
+
// isDownload: true,
|
|
591
|
+
// pdfOption: {
|
|
592
|
+
// pageFormat: [1000, 1000] as any,
|
|
593
|
+
// },
|
|
594
|
+
// })
|
|
595
|
+
// .then(() => {
|
|
596
|
+
// setSpinning(false);
|
|
597
|
+
// setShowWater(false);
|
|
598
|
+
// })
|
|
599
|
+
// .catch(() => {
|
|
600
|
+
// setSpinning(false);
|
|
601
|
+
// setShowWater(false);
|
|
602
|
+
// });
|
|
603
|
+
// });
|
|
604
|
+
// }
|
|
580
605
|
}
|
|
581
606
|
// 关闭
|
|
582
607
|
var onCloseHandle = function () {
|
|
@@ -641,6 +666,9 @@ var PrintContainer = function (_a) {
|
|
|
641
666
|
fileBinary: fontTTF,
|
|
642
667
|
pdfOption: {
|
|
643
668
|
pageFormat: [1000, 1000],
|
|
669
|
+
// 因为生成的pdf需要打印,所以边距需要去掉
|
|
670
|
+
pageMarginX: 0,
|
|
671
|
+
pageMarginY: 0,
|
|
644
672
|
},
|
|
645
673
|
})
|
|
646
674
|
.then(function (option) {
|
|
@@ -798,6 +826,9 @@ var PrintContainer = function (_a) {
|
|
|
798
826
|
fileBinary: fontTTF,
|
|
799
827
|
pdfOption: {
|
|
800
828
|
pageFormat: [1000, 1000],
|
|
829
|
+
// 因为生成的pdf需要打印,所以边距需要去掉
|
|
830
|
+
pageMarginX: 0,
|
|
831
|
+
pageMarginY: 0,
|
|
801
832
|
},
|
|
802
833
|
})
|
|
803
834
|
.then(function (option) {
|