super-page-runtime 2.3.38-sit4 → 2.3.39-cdn1

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