super-page-runtime 2.3.38 → 2.3.39-sit2

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.
Files changed (73) hide show
  1. package/dist/es/components/runtime/utils/api/page-expose-util.js +131 -131
  2. package/dist/es/components/runtime/utils/eventBus.d.ts +1 -0
  3. package/dist/es/components/runtime/utils/eventBus.js +6 -3
  4. package/dist/es/components/runtime/utils/events/event-util.js +140 -142
  5. package/dist/es/components/runtime/utils/events/print-label.js +33 -34
  6. package/dist/es/components/runtime/utils/events/standard-event.js +309 -293
  7. package/dist/es/components/runtime/utils/events/validator-util.d.ts +8 -1
  8. package/dist/es/components/runtime/utils/events/validator-util.js +281 -231
  9. package/dist/es/components/runtime/utils/page-init-util.js +26 -28
  10. package/dist/es/components/runtime/utils/table-utils.js +1 -1
  11. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +3 -3
  12. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +3 -3
  13. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +3 -3
  14. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +1 -1
  15. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +3 -3
  16. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +1 -1
  17. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +6 -10
  18. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +6 -8
  19. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +1 -1
  20. package/dist/es/components/runtime/views/assemblys/chart/common/home-chart-condition-render.vue.js +8 -8
  21. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +1 -1
  22. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +1 -1
  23. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +1 -1
  24. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +1 -1
  25. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +95 -100
  26. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +2 -3
  27. package/dist/es/components/runtime/views/assemblys/common/event-call-component.vue.js +13 -13
  28. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +9 -11
  29. package/dist/es/components/runtime/views/assemblys/common/save-chart-condition-dialog.vue.js +1 -1
  30. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +3 -3
  31. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +3 -3
  32. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +3 -3
  33. package/dist/es/components/runtime/views/assemblys/container/fixed/YxAffix.vue2.js +0 -2
  34. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +3 -3
  35. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +3 -3
  36. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +5 -5
  37. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +3 -3
  38. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +9 -11
  39. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +1 -1
  40. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +1 -1
  41. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +16 -16
  42. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +3 -3
  43. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +3 -3
  44. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +6 -6
  45. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +33 -33
  46. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +3 -3
  47. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +3 -3
  48. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +6 -7
  49. package/dist/es/components/runtime/views/assemblys/form/image-upload/imageupload-runtime.vue2.js +5 -6
  50. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +3 -3
  51. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +42 -43
  52. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +5 -7
  53. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +4 -6
  54. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +3 -3
  55. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +2 -2
  56. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +4 -5
  57. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +1 -1
  58. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +3 -3
  59. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +11 -11
  60. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +3 -3
  61. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +3 -3
  62. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +8 -10
  63. package/dist/es/components/runtime/views/assemblys/page-bottom.vue.js +2 -2
  64. package/dist/es/components/runtime/views/assemblys/workflow/component/workflow-opinion-box.vue2.js +3 -3
  65. package/dist/es/components/runtime/views/assemblys/workflow/extract-workflow/extract-workflow-runtime-dialog.vue2.js +1 -1
  66. package/dist/es/components/runtime/views/assemblys/workflow/extract-workflow/extract-workflow-runtime.vue2.js +1 -1
  67. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +1 -1
  68. package/dist/es/components/runtime/views/home-chart.vue.js +7 -7
  69. package/dist/es/components/runtime/views/super-page-dialog.vue.js +0 -1
  70. package/dist/es/components/runtime/views/super-page.vue2.js +12 -13
  71. package/dist/es/i18n/langs/cn.js +1 -1
  72. package/dist/es/i18n/langs/en.js +1 -1
  73. package/package.json +2 -2
@@ -1,44 +1,78 @@
1
1
  import e from "async-validator";
2
2
  import { ElMessage as t } from "element-plus";
3
- import { getComponentRefByCode as s, getComponentRef as r, getAllComponentRefs as n } from "../global-refs.js";
4
- import { getI18n as o } from "agilebuilder-ui/src/utils/util";
5
- import { getAdditionalParamMap as i } from "./standard-event.js";
3
+ import { getComponentRefByCode as s, getComponentRef as n, getAllComponentRefs as r } from "../global-refs.js";
4
+ import { getI18n as i } from "agilebuilder-ui/src/utils/util";
5
+ import { getAdditionalParamMap as o } from "./standard-event.js";
6
6
  import { isPromise as l } from "agilebuilder-ui/src/utils/common-util";
7
7
  import { parseSubTablePermissionCondition as a } from "agilebuilder-ui/src/utils/calculator/calculator-util";
8
- import { isWorkflowPage as u, getListCode as c } from "../common-util.js";
9
- import { scrollIntoComponentWithCode as f, scrollIntoComponentWithUuid as d } from "../anchor-util.js";
10
- function m(e2, t2, s2) {
11
- const r2 = {};
8
+ import { isWorkflowPage as u, getListCode as f } from "../common-util.js";
9
+ import { scrollIntoComponentWithCode as c, scrollIntoComponentWithUuid as d } from "../anchor-util.js";
10
+ const m = ["downloadTemplate", "back", "exportForm", "exportPDF", "lineEditCreate", "workflowSave"];
11
+ function p(e2, t2 = /* @__PURE__ */ new WeakMap()) {
12
+ if ("function" == typeof structuredClone) try {
13
+ return structuredClone(e2);
14
+ } catch (e3) {
15
+ }
16
+ if (null === e2 || "object" != typeof e2) return e2;
17
+ const s2 = e2;
18
+ if (t2.has(s2)) return t2.get(s2);
19
+ if (Array.isArray(e2)) {
20
+ const n3 = [];
21
+ return t2.set(s2, n3), e2.forEach((e3, s3) => {
22
+ n3[s3] = p(e3, t2);
23
+ }), n3;
24
+ }
25
+ if (e2 instanceof Date) return new Date(e2.getTime());
26
+ if (e2 instanceof RegExp) return new RegExp(e2.source, e2.flags);
27
+ if (e2 instanceof Map) {
28
+ const n3 = /* @__PURE__ */ new Map();
29
+ return t2.set(s2, n3), e2.forEach((e3, s3) => {
30
+ n3.set(p(s3, t2), p(e3, t2));
31
+ }), n3;
32
+ }
33
+ if (e2 instanceof Set) {
34
+ const n3 = /* @__PURE__ */ new Set();
35
+ return t2.set(s2, n3), e2.forEach((e3) => {
36
+ n3.add(p(e3, t2));
37
+ }), n3;
38
+ }
39
+ const n2 = {};
40
+ return t2.set(s2, n2), Object.keys(e2).forEach((s3) => {
41
+ n2[s3] = p(e2[s3], t2);
42
+ }), n2;
43
+ }
44
+ function g(e2, t2, s2) {
45
+ const n2 = {};
12
46
  t2 || (t2 = {});
13
- let n2 = 0;
14
- const o2 = e2.split(".");
15
- return o2.forEach((e3) => {
16
- let i2;
17
- if (n2 === o2.length - 1) i2 = function(e4, t3, s3) {
18
- let r3;
19
- for (let n3 = 0; n3 < t3.length; n3++) if (r3 = 0 === n3 ? e4[t3[n3]] : r3.fields[t3[n3]], n3 !== t3.length - 1) {
20
- if (t3[n3 + 1] === s3) break;
47
+ let r2 = 0;
48
+ const i2 = e2.split(".");
49
+ return i2.forEach((e3) => {
50
+ let o2;
51
+ if (r2 === i2.length - 1) o2 = function(e4, t3, s3) {
52
+ let n3;
53
+ for (let r3 = 0; r3 < t3.length; r3++) if (n3 = 0 === r3 ? e4[t3[r3]] : n3.fields[t3[r3]], r3 !== t3.length - 1) {
54
+ if (t3[r3 + 1] === s3) break;
21
55
  }
22
- return r3;
23
- }(r2, o2, e3), i2.fields[e3] = s2;
56
+ return n3;
57
+ }(n2, i2, e3), o2.fields[e3] = s2;
24
58
  else {
25
59
  let s3;
26
- 0 === n2 ? i2 = t2 : (s3 = function(e4, t3, s4) {
27
- let r3;
28
- for (let n3 = 0; n3 < t3.length; n3++) {
29
- const o3 = t3[n3];
30
- if (r3 = 0 === n3 ? e4[o3] : r3.fields[t3[n3]], o3 === s4) break;
60
+ 0 === r2 ? o2 = t2 : (s3 = function(e4, t3, s4) {
61
+ let n3;
62
+ for (let r3 = 0; r3 < t3.length; r3++) {
63
+ const i3 = t3[r3];
64
+ if (n3 = 0 === r3 ? e4[i3] : n3.fields[t3[r3]], i3 === s4) break;
31
65
  }
32
- return r3;
33
- }(r2, o2, o2[n2 - 1]), i2 = s3.fields), i2[e3] || (i2[e3] = { type: "object", required: true, fields: {} }), 0 === n2 ? r2[e3] = i2[e3] : s3.fields[e3] = i2[e3];
66
+ return n3;
67
+ }(n2, i2, i2[r2 - 1]), o2 = s3.fields), o2[e3] || (o2[e3] = { type: "object", required: true, fields: {} }), 0 === r2 ? n2[e3] = o2[e3] : s3.fields[e3] = o2[e3];
34
68
  }
35
- n2++;
36
- }), r2;
69
+ r2++;
70
+ }), n2;
37
71
  }
38
- function p(e2, t2, s2, r2, n2, o2) {
39
- return b(e2, t2, s2, r2, true, n2, o2);
72
+ function b(e2, t2, s2, n2, r2, i2) {
73
+ return w(e2, t2, s2, n2, true, r2, i2);
40
74
  }
41
- function g(e2) {
75
+ function h(e2) {
42
76
  if (e2) return Object.keys(e2).forEach((t2) => {
43
77
  if (t2.indexOf(".") >= 0) {
44
78
  let s2 = [];
@@ -46,322 +80,338 @@ function g(e2) {
46
80
  }
47
81
  }), e2;
48
82
  }
49
- function b(r2, n2, o2, i2, l2, a2, u2) {
50
- let c2, d2 = g(n2);
51
- if (n2 && null !== n2 || !o2 || (d2 = {}), !d2 || 0 === Object.keys(d2).length) return r2.validateErrorField = "", true;
52
- return new e(d2).validate(r2, { first: true }, (e2, d3) => {
83
+ function w(n2, r2, i2, o2, l2, a2, u2) {
84
+ let f2, d2 = h(r2);
85
+ if (r2 && null !== r2 || !i2 || (d2 = {}), !d2 || 0 === Object.keys(d2).length) return n2.validateErrorField = "", true;
86
+ return new e(d2).validate(n2, { first: true }, (e2, d3) => {
53
87
  let m2;
54
88
  if (e2) {
55
- c2 = e2[0].message, m2 = e2[0].field, t({ message: c2, showClose: true, type: "warning", duration: 3e3 });
56
- const r3 = s(u2, m2);
57
- if (r3 && r3.addRequiredClass) {
58
- r3.addRequiredClass();
89
+ f2 = e2[0].message, m2 = e2[0].field, t({ message: f2, showClose: true, type: "warning", duration: 3e3 });
90
+ const n3 = s(u2, m2);
91
+ if (n3 && n3.addRequiredClass) {
92
+ n3.addRequiredClass();
59
93
  try {
60
- f(u2, m2);
94
+ c(u2, m2);
61
95
  } catch (e3) {
62
- console.error("滚动失败", e3);
63
96
  }
64
97
  }
65
- } else c2 = true;
98
+ } else f2 = true;
66
99
  if (m2 && true === l2) {
67
- if (/[A-Z]+/.test(m2) && void 0 !== r2[m2.toLowerCase()]) {
68
- const e3 = JSON.parse(JSON.stringify(r2));
69
- e3[m2.toUpperCase()] = r2[m2.toLowerCase()], delete e3[m2.toLowerCase()], c2 = b(e3, n2, o2, i2, false, a2, u2);
100
+ if (/[A-Z]+/.test(m2) && void 0 !== n2[m2.toLowerCase()]) {
101
+ const e3 = JSON.parse(JSON.stringify(n2));
102
+ e3[m2.toUpperCase()] = n2[m2.toLowerCase()], delete e3[m2.toLowerCase()], f2 = w(e3, r2, i2, o2, false, a2, u2);
70
103
  }
71
104
  }
72
- }), c2;
105
+ }), f2;
73
106
  }
74
- function h(e2, r2, n2) {
75
- const l2 = e2.entity.data, c2 = { ...e2.entity.page, ...l2 }, d2 = e2.rules, m2 = r2.props.base ? r2.props.base.isEnableRequired : null;
76
- return null != m2 && (n2 = m2), null == n2 && (n2 = false), function(e3, r3, n3, l3) {
107
+ function y(e2, n2, r2, l2) {
108
+ if (r2) {
109
+ if (V(r2.isStandard, r2.event)) return new Promise((e3, t2) => {
110
+ e3(true);
111
+ });
112
+ }
113
+ const f2 = e2.entity.data, d2 = { ...e2.entity.page, ...f2 }, m2 = e2.rules, g2 = n2.props.base ? n2.props.base.isEnableRequired : null;
114
+ return null != g2 && (l2 = g2), null == l2 && (l2 = false), function(e3, n3, r3, l3) {
77
115
  if (e3) {
78
- return u(l3) ? function(e4, r4, n4) {
116
+ return u(l3) ? function(e4, n4, r4) {
79
117
  return new Promise((l4, u2) => {
80
- const c3 = i(r4), d3 = r4.entity.context, m3 = r4.entity.task, p2 = true, g2 = r4.subTablePageInfo;
81
- w(e4, r4, n4).then((n5) => {
82
- if (n5) {
83
- let i2, u3, b2, h2, y2 = n5;
84
- const w2 = r4.workflowRules;
85
- if (w2) {
86
- if (!function(e5, r5) {
118
+ const f3 = o(n4), d3 = n4.entity.context, m3 = n4.entity.task, g3 = true, b2 = n4.subTablePageInfo;
119
+ E(e4, n4, r4).then((r5) => {
120
+ if (r5) {
121
+ let o2, u3, h2, w2, y2 = r5;
122
+ const R2 = n4.workflowRules;
123
+ if (R2) {
124
+ if (!function(e5, n5) {
87
125
  var _a, _b, _c, _d;
88
126
  if (!e5.actionPermissions) return true;
89
- const n7 = Object.keys(e5.actionPermissions);
90
- for (let i3 = 0; i3 < n7.length; i3++) {
91
- const l5 = n7[i3], u4 = e5.actionPermissions[l5];
127
+ const r7 = Object.keys(e5.actionPermissions);
128
+ for (let o3 = 0; o3 < r7.length; o3++) {
129
+ const l5 = r7[o3], u4 = e5.actionPermissions[l5];
92
130
  if (u4 && u4.notEmpty) {
93
131
  if ((_a = e5.hiddenNotValidatorCodes) == null ? void 0 : _a.has(l5)) continue;
94
- let n8 = false;
95
- if (r5[l5] ? Array.isArray(r5[l5]) && 0 === r5[l5].length && (n8 = true) : n8 = true, n8) {
96
- const n9 = s(e5, l5);
97
- if (!n9) return true;
98
- const i4 = n9.getConfigure();
132
+ let r8 = false;
133
+ if (n5[l5] ? Array.isArray(n5[l5]) && 0 === n5[l5].length && (r8 = true) : r8 = true, r8) {
134
+ const r9 = s(e5, l5);
135
+ if (!r9) return true;
136
+ const o4 = r9.getConfigure();
99
137
  if ((_b = u4.notEmptyCondition) == null ? void 0 : _b.parentCondition) {
100
- if (false === a(u4.notEmptyCondition.parentCondition.replaceAll("${field[", "${parent["), e5.dataTypeMaps, r5, {}, (_c = e5.entity) == null ? void 0 : _c.request, (_d = e5.entity) == null ? void 0 : _d.task, e5.contextParam)) return true;
138
+ if (false === a(u4.notEmptyCondition.parentCondition.replaceAll("${field[", "${parent["), e5.dataTypeMaps, n5, {}, (_c = e5.entity) == null ? void 0 : _c.request, (_d = e5.entity) == null ? void 0 : _d.task, e5.contextParam)) return true;
101
139
  }
102
- return t({ showClose: true, message: o().t("superPageRuntimeMessage.xxxNotEmpty", { label: i4.title ? i4.title : l5 }), type: "warning" }), false;
140
+ return t({ showClose: true, message: i().t("superPageRuntimeMessage.xxxNotEmpty", { label: o4.title ? o4.title : l5 }), type: "warning" }), false;
103
141
  }
104
142
  }
105
143
  }
106
144
  return true;
107
- }(r4, e4)) return void l4(false);
108
- const n6 = true, f2 = Object.assign({}, w2), R2 = r4.hiddenNotValidatorCodes;
109
- R2 && R2.size > 0 && R2.forEach((e5) => {
110
- f2.subRules && delete f2.subRules[e5], f2.rules && delete f2.rules[e5];
111
- }), f2.subRules && (Object.keys(f2.subRules).length > 0 ? f2.totalSubRules || (f2.totalSubRules = {}) : delete f2.subRules);
112
- const v2 = window.$vueApp.config.globalProperties.$formValidator(e4, f2, p2, c3, m3, d3, g2, n6);
113
- y2 = v2.msg, i2 = v2.field, u3 = v2.listCode, b2 = v2.rowIndex, h2 = v2.pageNum;
145
+ }(n4, e4)) return void l4(false);
146
+ const r6 = true, c2 = p(R2), E2 = n4.hiddenNotValidatorCodes;
147
+ E2 && E2.size > 0 && E2.forEach((e5) => {
148
+ c2.subRules && delete c2.subRules[e5], c2.rules && delete c2.rules[e5];
149
+ }), c2.subRules && (Object.keys(c2.subRules).length > 0 ? c2.totalSubRules || (c2.totalSubRules = {}) : delete c2.subRules);
150
+ const v2 = window.$vueApp.config.globalProperties.$formValidator(e4, c2, g3, f3, m3, d3, b2, r6);
151
+ y2 = v2.msg, o2 = v2.field, u3 = v2.listCode, h2 = v2.rowIndex, w2 = v2.pageNum;
114
152
  } else y2 = true;
115
153
  if (true !== y2) {
116
154
  if (t({ showClose: true, message: y2 + "", type: "warning" }), u3) {
117
- const e5 = s(r4, u3);
155
+ const e5 = s(n4, u3);
118
156
  if (e5 && e5.addRequiredClass) {
119
- e5.addRequiredClass(i2, b2, h2);
157
+ e5.addRequiredClass(o2, h2, w2);
120
158
  try {
121
- f(r4, u3), e5.scrollToCell({ fieldName: i2, rowIndex: b2, pageNum: h2 });
159
+ c(n4, u3), e5.scrollToCell({ fieldName: o2, rowIndex: h2, pageNum: w2 });
122
160
  } catch (e6) {
123
- console.error("滚动到验证失败的子表字段失败,可能是表格组件版本较低没有scrollToCell方法", e6);
124
161
  }
125
162
  }
126
163
  } else {
127
- const e5 = s(r4, i2);
164
+ const e5 = s(n4, o2);
128
165
  if (e5 && e5.addRequiredClass) {
129
166
  e5.addRequiredClass();
130
167
  try {
131
- f(r4, i2);
168
+ c(n4, o2);
132
169
  } catch (e6) {
133
- console.error("滚动失败", e6);
134
170
  }
135
171
  }
136
172
  }
137
173
  l4(false);
138
174
  } else Object.keys(e4).indexOf("validateErrorField") >= 0 && delete e4.validateErrorField, l4(e4);
139
- } else u2(new Error(o().t("superPageRuntimeMessage.formDataVerificationFailed")).message);
175
+ } else u2(new Error(i().t("superPageRuntimeMessage.formDataVerificationFailed")).message);
140
176
  }).catch((e5) => {
141
177
  u2(e5);
142
178
  });
143
179
  });
144
- }(r3, l3, n3) : function(e4, t2, s2) {
145
- return new Promise((r4, n4) => {
146
- w(e4, t2, s2).then((t3) => {
180
+ }(n3, l3, r3) : function(e4, t2, s2) {
181
+ return new Promise((n4, r4) => {
182
+ E(e4, t2, s2).then((t3) => {
147
183
  if (t3) {
148
184
  const t4 = JSON.parse(JSON.stringify(e4));
149
- Object.keys(t4).indexOf("validateErrorField") >= 0 && delete t4.validateErrorField, r4(t4);
150
- } else r4(false);
185
+ Object.keys(t4).indexOf("validateErrorField") >= 0 && delete t4.validateErrorField, n4(t4);
186
+ } else n4(false);
151
187
  }).catch((e5) => {
152
- n4(e5);
188
+ r4(e5);
153
189
  });
154
190
  });
155
- }(r3, l3, n3);
191
+ }(n3, l3, r3);
156
192
  }
157
193
  return new Promise((e4, t2) => {
158
194
  e4(true);
159
195
  });
160
- }(n2, c2, d2, e2);
196
+ }(l2, d2, m2, e2);
161
197
  }
162
- function y(e2) {
198
+ function R(e2) {
163
199
  return new Promise((t2, s2) => {
164
- const n2 = [], o2 = e2.customValidatorUuids;
165
- o2 && o2.forEach((t3) => {
166
- const s3 = r(e2, t3);
167
- s3 && s3.validator && n2.push(s3.validator());
168
- }), n2 && n2.length > 0 ? Promise.all(n2).then((e3) => {
200
+ const r2 = [], i2 = e2.customValidatorUuids;
201
+ i2 && i2.forEach((t3) => {
202
+ const s3 = n(e2, t3);
203
+ s3 && s3.validator && r2.push(s3.validator());
204
+ }), r2 && r2.length > 0 ? Promise.all(r2).then((e3) => {
169
205
  e3.includes(false) ? t2(false) : t2(true);
170
206
  }) : t2(true);
171
207
  });
172
208
  }
173
- function w(e2, s2, n2) {
174
- return new Promise((i2, a2) => {
175
- const c2 = JSON.parse(JSON.stringify(e2)), f2 = { ...n2 }, m2 = s2.hiddenNotValidatorCodes;
176
- if (f2 && m2 && m2.size > 0 && m2.forEach((e3) => {
177
- delete f2[e3];
178
- }), f2 && 0 !== Object.keys(f2).length) {
179
- if (true === p(c2, f2, null, null, true, s2)) {
180
- const e3 = function(e4) {
181
- var _a;
182
- if (!e4) return true;
183
- if (u(e4)) return true;
184
- const s3 = e4.tableUuids;
185
- if (!s3) return true;
186
- for (let n3 = 0; n3 < s3.length; n3++) {
187
- const i3 = s3[n3], l2 = e4.hiddenNotValidatorCodes;
188
- if (l2 && l2.size > 0 && l2.has(i3)) continue;
189
- const a3 = r(e4, i3);
190
- if (a3) {
191
- if (a3.getConfigure()) {
192
- const s4 = a3.getConfigure();
193
- if ((_a = s4 == null ? void 0 : s4.verification) == null ? void 0 : _a.notEmpty) {
194
- const r2 = a3.getTableData();
195
- if (!r2 || !Array.isArray(r2) || 0 === r2.length) {
196
- try {
197
- d(e4, i3);
198
- } catch (e5) {
199
- }
200
- return t({ showClose: true, message: o().t("superPageRuntimeMessage.xxxNotEmpty", { label: s4.title ? s4.title : s4.code }), type: "warning" }), false;
201
- }
202
- }
203
- }
204
- if (!a3.validatorSunTableListData()) {
205
- try {
206
- d(e4, i3);
207
- } catch (e5) {
208
- }
209
- return false;
210
- }
211
- }
212
- }
213
- return true;
214
- }(s2);
215
- if (true === e3) {
216
- const e4 = function(e5) {
217
- const t2 = [];
218
- e5.customRuleEvents && e5.customRuleEvents.length > 0 && e5.customRuleEvents.forEach((s3) => {
219
- s3.events.forEach((r2) => {
220
- const n3 = e5.customEvents[r2];
221
- t2.push(n3.apply(n3, [{ prop: s3.prop, pageContext: e5 }]));
222
- });
223
- });
224
- if (t2 && t2.length > 0) return new Promise((e6, s3) => {
225
- const r2 = [], n3 = [];
226
- t2.forEach((e7) => {
227
- l(e7) ? r2.push(e7) : n3.push(e7);
228
- }), n3.includes(false) && e6(false), r2.length > 0 ? Promise.all(r2).then((t3) => {
229
- t3.includes(false) ? e6(false) : e6(true);
230
- }).catch((t3) => {
231
- console.error(t3), e6(false);
232
- }) : e6(true);
233
- });
234
- return null;
235
- }(s2);
236
- e4 && l(e4) ? e4.then((e5) => {
237
- e5 ? y(s2).then((e6) => {
238
- i2(e6);
239
- }) : i2(false);
240
- }) : y(s2).then((e5) => {
241
- i2(e5);
209
+ function E(e2, t2, s2) {
210
+ return new Promise((n2, r2) => {
211
+ const o2 = JSON.parse(JSON.stringify(e2)), a2 = p(s2), u2 = t2.hiddenNotValidatorCodes;
212
+ if (a2 && u2 && u2.size > 0 && u2.forEach((e3) => {
213
+ delete a2[e3];
214
+ }), a2 && 0 !== Object.keys(a2).length) {
215
+ if (true === b(o2, a2, null, null, true, t2)) {
216
+ if (true === P(t2)) {
217
+ const e3 = x(t2);
218
+ e3 && l(e3) ? e3.then((e4) => {
219
+ e4 ? R(t2).then((e5) => {
220
+ n2(e5);
221
+ }) : n2(false);
222
+ }) : R(t2).then((e4) => {
223
+ n2(e4);
242
224
  });
243
- } else a2(new Error(o().t("superPageRuntimeMessage.tableListSubTableDataVerificationFailed")).message);
244
- } else a2(new Error(o().t("superPageRuntimeMessage.formDataVerificationFailed")).message);
245
- } else i2(true);
225
+ } else r2(new Error(i().t("superPageRuntimeMessage.tableListSubTableDataVerificationFailed")).message);
226
+ } else r2(new Error(i().t("superPageRuntimeMessage.formDataVerificationFailed")).message);
227
+ } else {
228
+ if (true === P(t2)) {
229
+ const e3 = x(t2);
230
+ e3 && l(e3) ? e3.then((e4) => {
231
+ e4 ? R(t2).then((e5) => {
232
+ n2(e5);
233
+ }) : n2(false);
234
+ }) : R(t2).then((e4) => {
235
+ n2(e4);
236
+ });
237
+ } else r2(new Error(i().t("superPageRuntimeMessage.tableListSubTableDataVerificationFailed")).message);
238
+ }
246
239
  });
247
240
  }
248
- function R(e2, t2, s2) {
241
+ function v(e2, t2, s2) {
249
242
  if (!t2) return s2;
250
243
  s2 || (s2 = {});
251
- const r2 = u(e2), n2 = Object.keys(t2), o2 = t2;
252
- return n2.forEach((e3) => {
244
+ const n2 = u(e2), r2 = Object.keys(t2), i2 = t2;
245
+ return r2.forEach((e3) => {
253
246
  if ("__subRules" === e3) {
254
- const e4 = o2.__subRules;
247
+ const e4 = i2.__subRules;
255
248
  Object.keys(e4).forEach((t3) => {
256
249
  s2.subRules || (s2.subRules = {}), s2.subRules[t3] ? Object.assign(s2.subRules[t3], e4[t3]) : s2.subRules[t3] = e4[t3];
257
250
  });
258
- } else x(o2[e3]), r2 ? (s2.rules[e3] = o2[e3], s2[e3] && (s2[e3] = o2[e3])) : s2[e3] = o2[e3];
259
- }), g(s2);
251
+ } else S(i2[e3]), n2 ? (s2.rules[e3] = i2[e3], s2[e3] && (s2[e3] = i2[e3])) : s2[e3] = i2[e3];
252
+ }), h(s2);
260
253
  }
261
- function v(e2) {
254
+ function P(e2) {
255
+ var _a;
256
+ if (!e2) return true;
257
+ if (u(e2)) return true;
258
+ const s2 = e2.tableUuids;
259
+ if (!s2) return true;
260
+ for (let r2 = 0; r2 < s2.length; r2++) {
261
+ const o2 = s2[r2], l2 = e2.hiddenNotValidatorCodes;
262
+ if (l2 && l2.size > 0 && l2.has(o2)) continue;
263
+ const a2 = n(e2, o2);
264
+ if (a2) {
265
+ if (a2.getConfigure()) {
266
+ const s3 = a2.getConfigure();
267
+ if ((_a = s3 == null ? void 0 : s3.verification) == null ? void 0 : _a.notEmpty) {
268
+ const n2 = a2.getTableData();
269
+ if (!n2 || !Array.isArray(n2) || 0 === n2.length) {
270
+ try {
271
+ d(e2, o2);
272
+ } catch (e3) {
273
+ }
274
+ return t({ showClose: true, message: i().t("superPageRuntimeMessage.xxxNotEmpty", { label: s3.title ? s3.title : s3.code }), type: "warning" }), false;
275
+ }
276
+ }
277
+ }
278
+ if (false === a2.validatorSunTableListData()) {
279
+ try {
280
+ d(e2, o2);
281
+ } catch (e3) {
282
+ }
283
+ return false;
284
+ }
285
+ }
286
+ }
287
+ return true;
288
+ }
289
+ function k(e2) {
262
290
  if (!e2 || 0 === Object.keys(e2).length) return;
263
291
  const t2 = {}, s2 = Object.keys(e2);
264
- for (let r2 = 0; r2 < s2.length; r2++) {
265
- const n2 = s2[r2], o2 = e2[n2];
266
- P(o2), n2.indexOf(".") > 0 ? m(n2, t2, o2) : o2 && o2.length > 0 && (t2[n2] = [...o2]);
292
+ for (let n2 = 0; n2 < s2.length; n2++) {
293
+ const r2 = s2[n2], i2 = e2[r2];
294
+ C(i2), r2.indexOf(".") > 0 ? g(r2, t2, i2) : i2 && i2.length > 0 && (t2[r2] = [...i2]);
267
295
  }
268
296
  return t2;
269
297
  }
270
- function P(e2, t2) {
298
+ function C(e2, t2) {
271
299
  e2.forEach((e3) => {
272
300
  e3.message;
273
- const t3 = e3.label, s2 = o().t(t3);
274
- e3.required && (e3.message = o().t("superPageRuntimeMessage.required", { label: s2 })), e3.myType && (e3.message = o().t("superPageRuntimeMessage.formatMismatch", { label: s2 })), e3.patternType && (e3.message = o().t("superPageRuntimeMessage.formatMismatch", { label: s2 })), void 0 !== e3.max && null !== e3.max && (e3.message = o().t("superPageRuntimeMessage.overMaxLength", { label: s2, value: e3.max })), void 0 !== e3.min && null !== e3.min && (e3.message = o().t("superPageRuntimeMessage.limitMinLength", { label: s2, value: e3.min }));
301
+ const t3 = e3.label, s2 = i().t(t3);
302
+ e3.required && (e3.message = i().t("superPageRuntimeMessage.required", { label: s2 })), e3.myType && (e3.message = i().t("superPageRuntimeMessage.formatMismatch", { label: s2 })), e3.patternType && (e3.message = i().t("superPageRuntimeMessage.formatMismatch", { label: s2 })), void 0 !== e3.max && null !== e3.max && (e3.message = i().t("superPageRuntimeMessage.overMaxLength", { label: s2, value: e3.max })), void 0 !== e3.min && null !== e3.min && (e3.message = i().t("superPageRuntimeMessage.limitMinLength", { label: s2, value: e3.min }));
275
303
  });
276
304
  }
277
- function E(e2) {
278
- const t2 = e2.entity.data, s2 = { ...e2.entity.page, ...t2 }, r2 = i(e2), n2 = e2.entity.context, o2 = e2.entity.task;
305
+ function O(e2) {
306
+ const t2 = e2.entity.data, s2 = { ...e2.entity.page, ...t2 }, n2 = o(e2), r2 = e2.entity.context, i2 = e2.entity.task;
279
307
  e2.formPropTiltleMap && Object.keys(e2.formPropTiltleMap).length > 0 && e2.completeTaskParam.fieldPermissions && e2.completeTaskParam.fieldPermissions.length > 0 && e2.completeTaskParam.fieldPermissions.forEach((t3) => {
280
308
  t3.name && e2.formPropTiltleMap[t3.name] && (t3.label = e2.formPropTiltleMap[t3.name]);
281
309
  });
282
- let l2 = window.$vueApp.config.globalProperties.$getValidator(e2.completeTaskParam.fieldPermissions, s2, true, r2, o2, n2);
310
+ let l2 = window.$vueApp.config.globalProperties.$getValidator(e2.completeTaskParam.fieldPermissions, s2, true, n2, i2, r2);
283
311
  const a2 = e2.customRules;
284
- return l2 = R(e2, a2, l2), l2 && (l2.rules || (l2.rules = {}), l2.subRules || (l2.subRules = {})), l2;
312
+ return l2 = v(e2, a2, l2), l2 && (l2.rules || (l2.rules = {}), l2.subRules || (l2.subRules = {})), l2;
313
+ }
314
+ function x(e2) {
315
+ const t2 = [];
316
+ return e2.customRuleEvents && e2.customRuleEvents.length > 0 && e2.customRuleEvents.forEach((s2) => {
317
+ s2.events.forEach((n2) => {
318
+ const r2 = e2.customEvents[n2];
319
+ t2.push(r2.apply(r2, [{ prop: s2.prop, pageContext: e2 }]));
320
+ });
321
+ }), t2 && t2.length > 0 ? new Promise((e3, s2) => {
322
+ const n2 = [], r2 = [];
323
+ t2.forEach((e4) => {
324
+ l(e4) ? n2.push(e4) : r2.push(e4);
325
+ }), r2.includes(false) && e3(false), n2.length > 0 ? Promise.all(n2).then((t3) => {
326
+ t3.includes(false) ? e3(false) : e3(true);
327
+ }).catch((t3) => {
328
+ e3(false);
329
+ }) : e3(true);
330
+ }) : null;
285
331
  }
286
- function k(e2, t2) {
332
+ function T(e2, t2) {
287
333
  if (!t2) return;
288
- const r2 = {};
334
+ const n2 = {};
289
335
  if (t2.forEach((e3) => {
290
336
  const { name: t3, rules: s2 } = e3;
291
- s2 ? r2[t3] = s2 : false === e3.required && (r2[t3] = []);
337
+ s2 ? n2[t3] = s2 : false === e3.required && (n2[t3] = []);
292
338
  }), u(e2)) {
293
339
  let t3 = e2.workflowRules ? e2.workflowRules : { rules: {}, subRules: {} };
294
- t3 = R(e2, r2, t3), e2.workflowRules = t3;
340
+ t3 = v(e2, n2, t3), e2.workflowRules = t3;
295
341
  } else {
296
342
  let t3 = e2.rules ? e2.rules : {};
297
- t3 = R(e2, r2, t3), e2.rules = t3;
343
+ t3 = v(e2, n2, t3), e2.rules = t3;
298
344
  }
299
- const n2 = t2.filter((e3) => "_all_fields" === e3.name);
300
- n2 && n2.length > 0 && O(e2, n2[0]), t2.forEach((t3) => {
345
+ const r2 = t2.filter((e3) => "_all_fields" === e3.name);
346
+ r2 && r2.length > 0 && M(e2, r2[0]), t2.forEach((t3) => {
301
347
  if ("_all_fields" !== t3.name) {
302
- const r3 = s(e2, t3.name);
303
- T(e2, r3, t3);
348
+ const n3 = s(e2, t3.name);
349
+ q(e2, n3, t3);
304
350
  }
305
351
  });
306
352
  }
307
- function C(e2) {
308
- O(e2, { disabled: true });
353
+ function j(e2) {
354
+ M(e2, { disabled: true });
309
355
  }
310
- function O(e2, t2) {
311
- const s2 = n(e2);
312
- if (s2) for (const r2 in s2) {
313
- const n2 = s2[r2];
314
- T(e2, n2 ? n2.value : n2, t2);
356
+ function M(e2, t2) {
357
+ const s2 = r(e2);
358
+ if (s2) for (const n2 in s2) {
359
+ const r2 = s2[n2];
360
+ q(e2, r2 ? r2.value : r2, t2);
315
361
  }
316
362
  }
317
- function j(e2, t2, n2) {
363
+ function N(e2, t2, r2) {
318
364
  var _a;
319
- let o2, i2;
320
- if (n2 ? (o2 = s(e2, n2), i2 = o2 ? o2.getTableUuid() : null) : (i2 = e2.tableUuids && e2.tableUuids.length > 0 ? e2.tableUuids[0] : null, o2 = i2 ? r(e2, i2) : null), !o2) return;
321
- const l2 = e2.code, a2 = e2.version, u2 = c(l2, a2, i2);
322
- if (e2.workflowRules || (e2.workflowRules = { rules: {}, subRules: {} }), e2.workflowRules.subRules || (e2.workflowRules.subRules = {}), e2.workflowRules.subRules[n2] || (e2.workflowRules.subRules[n2] = {}), ((_a = e2.workflowRules) == null ? void 0 : _a.subRules) && e2.workflowRules.subRules[n2]) {
323
- const s2 = e2.workflowRules.subRules[n2];
365
+ let i2, o2;
366
+ if (r2 ? (i2 = s(e2, r2), o2 = i2 ? i2.getTableUuid() : null) : (o2 = e2.tableUuids && e2.tableUuids.length > 0 ? e2.tableUuids[0] : null, i2 = o2 ? n(e2, o2) : null), !i2) return;
367
+ const l2 = e2.code, a2 = e2.version, u2 = f(l2, a2, o2);
368
+ if (e2.workflowRules || (e2.workflowRules = { rules: {}, subRules: {} }), e2.workflowRules.subRules || (e2.workflowRules.subRules = {}), e2.workflowRules.subRules[r2] || (e2.workflowRules.subRules[r2] = {}), ((_a = e2.workflowRules) == null ? void 0 : _a.subRules) && e2.workflowRules.subRules[r2]) {
369
+ const s2 = e2.workflowRules.subRules[r2];
324
370
  t2.forEach((e3) => {
325
371
  s2[e3.name] = e3;
326
372
  });
327
373
  }
328
- o2.dynamicControlTableEdit(e2, t2, u2);
374
+ i2.dynamicControlTableEdit(e2, t2, u2);
329
375
  }
330
- function T(e2, t2, s2) {
376
+ function q(e2, t2, s2) {
331
377
  var _a, _b, _c;
332
378
  if (t2) {
333
- const r2 = t2.getConfigure();
334
- if (void 0 !== s2.show && (s2.show ? t2.show() : t2.hide()), void 0 !== s2.required && ((_a = r2 == null ? void 0 : r2.runtime) == null ? void 0 : _a.props) && (r2.runtime.props.required = s2.required), void 0 !== s2.readonly && ((_b = r2 == null ? void 0 : r2.runtime) == null ? void 0 : _b.props) && (s2.readonly ? r2.runtime.props.state = "readonly" : r2.runtime.props.state = "enabled"), void 0 !== s2.disabled && r2 && (((_c = r2 == null ? void 0 : r2.runtime) == null ? void 0 : _c.props) && (s2.disabled ? r2.runtime.props.state = "disabled" : r2.runtime.props.state = "enabled"), "table" === r2.name)) {
379
+ const n2 = t2.getConfigure();
380
+ if (void 0 !== s2.show && (s2.show ? t2.show() : t2.hide()), void 0 !== s2.required && ((_a = n2 == null ? void 0 : n2.runtime) == null ? void 0 : _a.props) && (n2.runtime.props.required = s2.required), void 0 !== s2.readonly && ((_b = n2 == null ? void 0 : n2.runtime) == null ? void 0 : _b.props) && (s2.readonly ? n2.runtime.props.state = "readonly" : n2.runtime.props.state = "enabled"), void 0 !== s2.disabled && n2 && (((_c = n2 == null ? void 0 : n2.runtime) == null ? void 0 : _c.props) && (s2.disabled ? n2.runtime.props.state = "disabled" : n2.runtime.props.state = "enabled"), "table" === n2.name)) {
335
381
  t2.changeOperationAddState(false);
336
- const s3 = t2 ? t2.getTableUuid() : null, r3 = e2.code, n2 = e2.version, o2 = c(r3, n2, s3), i2 = [{ name: "_all_fields", disabled: true }];
337
- t2.dynamicControlTableEdit(e2, i2, o2);
382
+ const s3 = t2 ? t2.getTableUuid() : null, n3 = e2.code, r2 = e2.version, i2 = f(n3, r2, s3), o2 = [{ name: "_all_fields", disabled: true }];
383
+ t2.dynamicControlTableEdit(e2, o2, i2);
338
384
  }
339
385
  }
340
386
  }
341
- function x(e2) {
387
+ function S(e2) {
342
388
  if (!(e2 == null ? void 0 : e2.type)) return;
343
- const t2 = N[e2.type];
389
+ const t2 = A[e2.type];
344
390
  t2 && (e2.validator = t2.validator);
345
391
  }
346
- const N = { boolean: { validator: function(e2, t2, s2) {
347
- return true === M(e2, t2) && ("number" == typeof t2 && (1 === t2 || 0 === t2) || "boolean" == typeof t2 && (true === t2 || false === t2));
392
+ const A = { boolean: { validator: function(e2, t2, s2) {
393
+ return true === F(e2, t2) && ("number" == typeof t2 && (1 === t2 || 0 === t2) || "boolean" == typeof t2 && (true === t2 || false === t2));
348
394
  } }, date: { validator: function(e2, t2, s2) {
349
- if (true !== M(e2, t2)) return false;
350
- const r2 = new Date(t2);
351
- return !isNaN(r2.getTime());
395
+ if (true !== F(e2, t2)) return false;
396
+ const n2 = new Date(t2);
397
+ return !isNaN(n2.getTime());
352
398
  } }, number: { validator: function(e2, t2, s2) {
353
- return true === M(e2, t2) && (("string" != typeof t2 || "" !== t2.trim()) && ("number" == typeof t2 || !isNaN(Number(t2))));
354
- } } }, M = (e2, t2) => null != t2 && "" !== t2 || !e2.required;
399
+ return true === F(e2, t2) && (("string" != typeof t2 || "" !== t2.trim()) && ("number" == typeof t2 || !isNaN(Number(t2))));
400
+ } } }, F = (e2, t2) => null != t2 && "" !== t2 || !e2.required;
401
+ function V(e2, t2) {
402
+ return e2 && m.includes(t2.eventName);
403
+ }
355
404
  export {
356
- C as disabledAllFields,
357
- j as dynamicControlTableEdit,
358
- E as getWorkflowRules,
359
- P as i18nValidatePropRulesMessage,
360
- v as i18nValidateRulesMessage,
361
- R as packageCustomRules,
362
- x as packageCustomValidator,
363
- m as setObjectPropRule,
364
- k as updateFormItemEditState,
365
- h as validateDataModelFunc,
366
- p as validator
405
+ j as disabledAllFields,
406
+ N as dynamicControlTableEdit,
407
+ O as getWorkflowRules,
408
+ C as i18nValidatePropRulesMessage,
409
+ k as i18nValidateRulesMessage,
410
+ V as isNotNeedValidateRequired,
411
+ v as packageCustomRules,
412
+ S as packageCustomValidator,
413
+ g as setObjectPropRule,
414
+ T as updateFormItemEditState,
415
+ y as validateDataModelFunc,
416
+ b as validator
367
417
  };