super-page-runtime 2.2.91 → 2.2.92-sit1

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.
@@ -3,84 +3,97 @@ import { hiprint as t, disAutoConnect as n } from "vue-plugin-hiprint";
3
3
  import { generateCodeByRule as o } from "../barcode-util.js";
4
4
  function a(n2, a2) {
5
5
  e.post(window.$vueApp.config.globalProperties.baseAPI + "/dc/print-models/by-codes", [a2]).then((e2) => {
6
- const a3 = JSON.parse(e2[0].template), l2 = [];
6
+ const a3 = JSON.parse(e2[0].template), i2 = [];
7
7
  a3.panels.forEach((e3) => {
8
8
  e3.printElements.forEach((e4) => {
9
- "barcode" !== e4.options.textType && "qrcode" !== e4.options.textType || l2.push(e4.options);
9
+ "barcode" !== e4.options.textType && "qrcode" !== e4.options.textType || i2.push(e4.options);
10
10
  });
11
11
  });
12
- const i = new t.PrintTemplate({ template: a3 }), r = { callback: () => {
13
- }, styleHandler: () => "" }, c = { leftOffset: -1, topOffset: -1 };
14
- n2.pageContext.pageType ? "list" === n2.pageContext.pageType ? function(e3, t2, n3, a4, p2) {
15
- if (t2.length > 0) {
16
- const l3 = [], i2 = JSON.parse(JSON.stringify(e3.selections));
17
- t2.forEach((e4) => {
18
- l3.push(function(e5, t3) {
12
+ const l = new t.PrintTemplate({ template: a3 }), r = { callback: () => {
13
+ }, styleHandler: () => "" }, c = { leftOffset: -1, topOffset: -1 }, f = {};
14
+ a3.panels[0].printElements.forEach((e3) => {
15
+ if ("datetime" === e3.options.dataType && e3.options.field) {
16
+ const t2 = e3.options.field.substring(6);
17
+ f[t2] = e3.options.dateFormat;
18
+ }
19
+ }), n2.pageContext.pageType ? "list" === n2.pageContext.pageType ? function(e3, t2, n3, a4, s2, i3) {
20
+ const l2 = JSON.parse(JSON.stringify(e3.selections));
21
+ if (l2.forEach((e4) => {
22
+ Object.keys(t2).forEach((t3) => {
23
+ if (e4[t3] && "number" == typeof e4[t3] && !isNaN(e4[t3])) try {
24
+ e4[t3] = new Date(e4[t3]);
25
+ } catch (e5) {
26
+ }
27
+ });
28
+ }), n3.length > 0) {
29
+ const e4 = [];
30
+ n3.forEach((t3) => {
31
+ e4.push(function(e5, t4) {
19
32
  return new Promise((n4, a5) => {
20
- const p3 = e5.field.split("."), l4 = [];
21
- p3.length < 2 && n4([]);
33
+ const s3 = e5.field.split("."), i4 = [];
34
+ s3.length < 2 && n4([]);
22
35
  try {
23
- s(p3[1]).then((e6) => {
24
- t3.forEach((t4, n5) => {
25
- const a6 = { type: p3[0], name: p3[1], value: null, index: n5 };
26
- a6.value = o(JSON.parse(e6.barcodeModelItems), t4), l4.push(a6);
27
- }), n4(l4);
36
+ p(s3[1]).then((e6) => {
37
+ t4.forEach((t5, n5) => {
38
+ const a6 = { type: s3[0], name: s3[1], value: null, index: n5 };
39
+ a6.value = o(JSON.parse(e6.barcodeModelItems), t5), i4.push(a6);
40
+ }), n4(i4);
28
41
  });
29
42
  } catch (e6) {
30
43
  n4([]);
31
44
  }
32
45
  });
33
- }(e4, i2));
34
- }), Promise.all(l3).then((e4) => {
35
- e4.forEach((e5) => {
36
- e5.forEach((e6) => {
37
- const t3 = e6.index, n4 = i2[t3];
38
- n4[e6.type] || (n4[e6.type] = {}), n4[e6.type][e6.name] = e6.value;
46
+ }(t3, l2));
47
+ }), Promise.all(e4).then((e5) => {
48
+ e5.forEach((e6) => {
49
+ e6.forEach((e7) => {
50
+ const t3 = e7.index, n4 = l2[t3];
51
+ n4[e7.type] || (n4[e7.type] = {}), n4[e7.type][e7.name] = e7.value;
39
52
  });
40
- }), n3.print(i2, a4, p2);
53
+ }), a4.print(l2, s2, i3);
41
54
  });
42
- } else n3.print(e3.selections, a4, p2);
43
- }(n2, l2, i, c, r) : "form" === n2.pageContext.pageType && p(n2, l2, i, c, r) : p(n2, l2, i, c, r);
55
+ } else a4.print(l2, s2, i3);
56
+ }(n2, f, i2, l, c, r) : "form" === n2.pageContext.pageType && s(n2, i2, l, c, r) : s(n2, i2, l, c, r);
44
57
  });
45
58
  }
46
- function p(e2, t2, n2, a2, p2) {
59
+ function s(e2, t2, n2, a2, s2) {
47
60
  if (t2.length > 0) {
48
- const l2 = [];
61
+ const i2 = [];
49
62
  t2.forEach((t3) => {
50
- l2.push(function(e3, t4) {
63
+ i2.push(function(e3, t4) {
51
64
  return new Promise((n3, a3) => {
52
- const p3 = t4.field.split("."), l3 = { type: null, name: null, value: null };
53
- p3.length < 2 && n3(l3), l3.type = p3[0], l3.name = p3[1];
65
+ const s3 = t4.field.split("."), i3 = { type: null, name: null, value: null };
66
+ s3.length < 2 && n3(i3), i3.type = s3[0], i3.name = s3[1];
54
67
  try {
55
- s(l3.name).then((t5) => {
68
+ p(i3.name).then((t5) => {
56
69
  const a4 = JSON.parse(t5.barcodeModelItems);
57
- l3.value = o(a4, e3.entity.data), n3(l3);
70
+ i3.value = o(a4, e3.entity.data), n3(i3);
58
71
  });
59
72
  } catch (e4) {
60
- n3(l3);
73
+ n3(i3);
61
74
  }
62
75
  });
63
76
  }(e2.pageContext, t3));
64
- }), Promise.all(l2).then((t3) => {
77
+ }), Promise.all(i2).then((t3) => {
65
78
  const o2 = {};
66
79
  t3.forEach((e3) => {
67
80
  e3.type && e3.name && e3.value && (o2[e3.type] || (o2[e3.type] = {}), o2[e3.type][e3.name] = e3.value);
68
81
  });
69
- const s2 = { table: {} };
70
- Object.assign(s2, e2.pageContext.entity, o2), s2.table = e2.pageContext.entity.data, n2.print(s2, a2, p2);
82
+ const p2 = { table: {} };
83
+ Object.assign(p2, e2.pageContext.entity, o2), p2.table = e2.pageContext.entity.data, n2.print(p2, a2, s2);
71
84
  });
72
85
  } else {
73
86
  const t3 = { table: {} };
74
- Object.assign(t3, e2.pageContext.entity), t3.table = e2.pageContext.entity.data, n2.print(t3, a2, p2);
87
+ Object.assign(t3, e2.pageContext.entity), t3.table = e2.pageContext.entity.data, n2.print(t3, a2, s2);
75
88
  }
76
89
  }
77
- function s(t2) {
90
+ function p(t2) {
78
91
  const n2 = encodeURIComponent(t2);
79
92
  return e.get(window.$vueApp.config.globalProperties.baseAPI + `/dc/setting-barcode-models/by-name?name=${n2}`);
80
93
  }
81
94
  n();
82
- const l = { printLabel: a };
95
+ const i = { printLabel: a };
83
96
  export {
84
- l as default,
97
+ i as default,
85
98
  a as printLabel
86
99
  };