super-page-runtime 2.3.38-sit4 → 2.3.39-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.
@@ -2,43 +2,76 @@ 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
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";
5
+ import { getAdditionalParamMap as o } 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
8
  import { isWorkflowPage as u, getListCode as f } from "../common-util.js";
9
9
  import { scrollIntoComponentWithCode as c, scrollIntoComponentWithUuid as d } from "../anchor-util.js";
10
- function m(e2, t2, s2) {
10
+ function m(e2, t2 = /* @__PURE__ */ new WeakMap()) {
11
+ if ("function" == typeof structuredClone) try {
12
+ return structuredClone(e2);
13
+ } catch (e3) {
14
+ }
15
+ if (null === e2 || "object" != typeof e2) return e2;
16
+ const s2 = e2;
17
+ if (t2.has(s2)) return t2.get(s2);
18
+ if (Array.isArray(e2)) {
19
+ const n3 = [];
20
+ return t2.set(s2, n3), e2.forEach((e3, s3) => {
21
+ n3[s3] = m(e3, t2);
22
+ }), n3;
23
+ }
24
+ if (e2 instanceof Date) return new Date(e2.getTime());
25
+ if (e2 instanceof RegExp) return new RegExp(e2.source, e2.flags);
26
+ if (e2 instanceof Map) {
27
+ const n3 = /* @__PURE__ */ new Map();
28
+ return t2.set(s2, n3), e2.forEach((e3, s3) => {
29
+ n3.set(m(s3, t2), m(e3, t2));
30
+ }), n3;
31
+ }
32
+ if (e2 instanceof Set) {
33
+ const n3 = /* @__PURE__ */ new Set();
34
+ return t2.set(s2, n3), e2.forEach((e3) => {
35
+ n3.add(m(e3, t2));
36
+ }), n3;
37
+ }
38
+ const n2 = {};
39
+ return t2.set(s2, n2), Object.keys(e2).forEach((s3) => {
40
+ n2[s3] = m(e2[s3], t2);
41
+ }), n2;
42
+ }
43
+ function p(e2, t2, s2) {
11
44
  const n2 = {};
12
45
  t2 || (t2 = {});
13
46
  let r2 = 0;
14
47
  const i2 = e2.split(".");
15
48
  return i2.forEach((e3) => {
16
- let l2;
17
- if (r2 === i2.length - 1) l2 = function(e4, t3, s3) {
49
+ let o2;
50
+ if (r2 === i2.length - 1) o2 = function(e4, t3, s3) {
18
51
  let n3;
19
52
  for (let r3 = 0; r3 < t3.length; r3++) if (n3 = 0 === r3 ? e4[t3[r3]] : n3.fields[t3[r3]], r3 !== t3.length - 1) {
20
53
  if (t3[r3 + 1] === s3) break;
21
54
  }
22
55
  return n3;
23
- }(n2, i2, e3), l2.fields[e3] = s2;
56
+ }(n2, i2, e3), o2.fields[e3] = s2;
24
57
  else {
25
58
  let s3;
26
- 0 === r2 ? l2 = t2 : (s3 = function(e4, t3, s4) {
59
+ 0 === r2 ? o2 = t2 : (s3 = function(e4, t3, s4) {
27
60
  let n3;
28
61
  for (let r3 = 0; r3 < t3.length; r3++) {
29
62
  const i3 = t3[r3];
30
63
  if (n3 = 0 === r3 ? e4[i3] : n3.fields[t3[r3]], i3 === s4) break;
31
64
  }
32
65
  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];
66
+ }(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
67
  }
35
68
  r2++;
36
69
  }), n2;
37
70
  }
38
- function p(e2, t2, s2, n2, r2, i2) {
39
- return b(e2, t2, s2, n2, true, r2, i2);
71
+ function g(e2, t2, s2, n2, r2, i2) {
72
+ return h(e2, t2, s2, n2, true, r2, i2);
40
73
  }
41
- function g(e2) {
74
+ function b(e2) {
42
75
  if (e2) return Object.keys(e2).forEach((t2) => {
43
76
  if (t2.indexOf(".") >= 0) {
44
77
  let s2 = [];
@@ -46,8 +79,8 @@ function g(e2) {
46
79
  }
47
80
  }), e2;
48
81
  }
49
- function b(n2, r2, i2, l2, o2, a2, u2) {
50
- let f2, d2 = g(r2);
82
+ function h(n2, r2, i2, o2, l2, a2, u2) {
83
+ let f2, d2 = b(r2);
51
84
  if (r2 && null !== r2 || !i2 || (d2 = {}), !d2 || 0 === Object.keys(d2).length) return n2.validateErrorField = "", true;
52
85
  return new e(d2).validate(n2, { first: true }, (e2, d3) => {
53
86
  let m2;
@@ -62,85 +95,85 @@ function b(n2, r2, i2, l2, o2, a2, u2) {
62
95
  }
63
96
  }
64
97
  } else f2 = true;
65
- if (m2 && true === o2) {
98
+ if (m2 && true === l2) {
66
99
  if (/[A-Z]+/.test(m2) && void 0 !== n2[m2.toLowerCase()]) {
67
100
  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);
101
+ e3[m2.toUpperCase()] = n2[m2.toLowerCase()], delete e3[m2.toLowerCase()], f2 = h(e3, r2, i2, o2, false, a2, u2);
69
102
  }
70
103
  }
71
104
  }), f2;
72
105
  }
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) {
106
+ function y(e2, n2, r2) {
107
+ const l2 = e2.entity.data, f2 = { ...e2.entity.page, ...l2 }, d2 = e2.rules, p2 = n2.props.base ? n2.props.base.isEnableRequired : null;
108
+ return null != p2 && (r2 = p2), null == r2 && (r2 = false), function(e3, n3, r3, l3) {
76
109
  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) => {
110
+ return u(l3) ? function(e4, n4, r4) {
111
+ return new Promise((l4, u2) => {
112
+ const f3 = o(n4), d3 = n4.entity.context, p3 = n4.entity.task, g2 = true, b2 = n4.subTablePageInfo;
113
+ R(e4, n4, r4).then((r5) => {
81
114
  if (r5) {
82
- let l2, u3, b2, h2, y2 = r5;
83
- const w2 = n4.workflowRules;
84
- if (w2) {
115
+ let o2, u3, h2, y2, w2 = r5;
116
+ const R2 = n4.workflowRules;
117
+ if (R2) {
85
118
  if (!function(e5, n5) {
86
119
  var _a, _b, _c, _d;
87
120
  if (!e5.actionPermissions) return true;
88
121
  const r7 = Object.keys(e5.actionPermissions);
89
- for (let l3 = 0; l3 < r7.length; l3++) {
90
- const o5 = r7[l3], u4 = e5.actionPermissions[o5];
122
+ for (let o3 = 0; o3 < r7.length; o3++) {
123
+ const l5 = r7[o3], u4 = e5.actionPermissions[l5];
91
124
  if (u4 && u4.notEmpty) {
92
- if ((_a = e5.hiddenNotValidatorCodes) == null ? void 0 : _a.has(o5)) continue;
125
+ if ((_a = e5.hiddenNotValidatorCodes) == null ? void 0 : _a.has(l5)) continue;
93
126
  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);
127
+ if (n5[l5] ? Array.isArray(n5[l5]) && 0 === n5[l5].length && (r8 = true) : r8 = true, r8) {
128
+ const r9 = s(e5, l5);
96
129
  if (!r9) return true;
97
- const l4 = r9.getConfigure();
130
+ const o4 = r9.getConfigure();
98
131
  if ((_b = u4.notEmptyCondition) == null ? void 0 : _b.parentCondition) {
99
132
  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
133
  }
101
- return t({ showClose: true, message: i().t("superPageRuntimeMessage.xxxNotEmpty", { label: l4.title ? l4.title : o5 }), type: "warning" }), false;
134
+ return t({ showClose: true, message: i().t("superPageRuntimeMessage.xxxNotEmpty", { label: o4.title ? o4.title : l5 }), type: "warning" }), false;
102
135
  }
103
136
  }
104
137
  }
105
138
  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) => {
139
+ }(n4, e4)) return void l4(false);
140
+ const r6 = true, c2 = m(R2), E2 = n4.hiddenNotValidatorCodes;
141
+ E2 && E2.size > 0 && E2.forEach((e5) => {
109
142
  c2.subRules && delete c2.subRules[e5], c2.rules && delete c2.rules[e5];
110
143
  }), 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;
113
- } else y2 = true;
114
- if (true !== y2) {
115
- if (t({ showClose: true, message: y2 + "", type: "warning" }), u3) {
144
+ const v2 = window.$vueApp.config.globalProperties.$formValidator(e4, c2, g2, f3, p3, d3, b2, r6);
145
+ w2 = v2.msg, o2 = v2.field, u3 = v2.listCode, h2 = v2.rowIndex, y2 = v2.pageNum;
146
+ } else w2 = true;
147
+ if (true !== w2) {
148
+ if (t({ showClose: true, message: w2 + "", type: "warning" }), u3) {
116
149
  const e5 = s(n4, u3);
117
150
  if (e5 && e5.addRequiredClass) {
118
- e5.addRequiredClass(l2, b2, h2);
151
+ e5.addRequiredClass(o2, h2, y2);
119
152
  try {
120
- c(n4, u3), e5.scrollToCell({ fieldName: l2, rowIndex: b2, pageNum: h2 });
153
+ c(n4, u3), e5.scrollToCell({ fieldName: o2, rowIndex: h2, pageNum: y2 });
121
154
  } catch (e6) {
122
155
  }
123
156
  }
124
157
  } else {
125
- const e5 = s(n4, l2);
158
+ const e5 = s(n4, o2);
126
159
  if (e5 && e5.addRequiredClass) {
127
160
  e5.addRequiredClass();
128
161
  try {
129
- c(n4, l2);
162
+ c(n4, o2);
130
163
  } catch (e6) {
131
164
  }
132
165
  }
133
166
  }
134
- o4(false);
135
- } else Object.keys(e4).indexOf("validateErrorField") >= 0 && delete e4.validateErrorField, o4(e4);
167
+ l4(false);
168
+ } else Object.keys(e4).indexOf("validateErrorField") >= 0 && delete e4.validateErrorField, l4(e4);
136
169
  } else u2(new Error(i().t("superPageRuntimeMessage.formDataVerificationFailed")).message);
137
170
  }).catch((e5) => {
138
171
  u2(e5);
139
172
  });
140
173
  });
141
- }(n3, o3, r3) : function(e4, t2, s2) {
174
+ }(n3, l3, r3) : function(e4, t2, s2) {
142
175
  return new Promise((n4, r4) => {
143
- w(e4, t2, s2).then((t3) => {
176
+ R(e4, t2, s2).then((t3) => {
144
177
  if (t3) {
145
178
  const t4 = JSON.parse(JSON.stringify(e4));
146
179
  Object.keys(t4).indexOf("validateErrorField") >= 0 && delete t4.validateErrorField, n4(t4);
@@ -149,14 +182,14 @@ function h(e2, n2, r2) {
149
182
  r4(e5);
150
183
  });
151
184
  });
152
- }(n3, o3, r3);
185
+ }(n3, l3, r3);
153
186
  }
154
187
  return new Promise((e4, t2) => {
155
188
  e4(true);
156
189
  });
157
190
  }(r2, f2, d2, e2);
158
191
  }
159
- function y(e2) {
192
+ function w(e2) {
160
193
  return new Promise((t2, s2) => {
161
194
  const r2 = [], i2 = e2.customValidatorUuids;
162
195
  i2 && i2.forEach((t3) => {
@@ -167,82 +200,39 @@ function y(e2) {
167
200
  }) : t2(true);
168
201
  });
169
202
  }
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);
203
+ function R(e2, t2, s2) {
204
+ return new Promise((n2, r2) => {
205
+ const o2 = JSON.parse(JSON.stringify(e2)), a2 = m(s2), u2 = t2.hiddenNotValidatorCodes;
206
+ if (a2 && u2 && u2.size > 0 && u2.forEach((e3) => {
207
+ delete a2[e3];
208
+ }), a2 && 0 !== Object.keys(a2).length) {
209
+ if (true === g(o2, a2, null, null, true, t2)) {
210
+ if (true === v(t2)) {
211
+ const e3 = O(t2);
212
+ e3 && l(e3) ? e3.then((e4) => {
213
+ e4 ? w(t2).then((e5) => {
214
+ n2(e5);
215
+ }) : n2(false);
216
+ }) : w(t2).then((e4) => {
217
+ n2(e4);
239
218
  });
240
- } else a2(new Error(i().t("superPageRuntimeMessage.tableListSubTableDataVerificationFailed")).message);
241
- } else a2(new Error(i().t("superPageRuntimeMessage.formDataVerificationFailed")).message);
242
- } else l2(true);
219
+ } else r2(new Error(i().t("superPageRuntimeMessage.tableListSubTableDataVerificationFailed")).message);
220
+ } else r2(new Error(i().t("superPageRuntimeMessage.formDataVerificationFailed")).message);
221
+ } else {
222
+ if (true === v(t2)) {
223
+ const e3 = O(t2);
224
+ e3 && l(e3) ? e3.then((e4) => {
225
+ e4 ? w(t2).then((e5) => {
226
+ n2(e5);
227
+ }) : n2(false);
228
+ }) : w(t2).then((e4) => {
229
+ n2(e4);
230
+ });
231
+ } else r2(new Error(i().t("superPageRuntimeMessage.tableListSubTableDataVerificationFailed")).message);
232
+ }
243
233
  });
244
234
  }
245
- function R(e2, t2, s2) {
235
+ function E(e2, t2, s2) {
246
236
  if (!t2) return s2;
247
237
  s2 || (s2 = {});
248
238
  const n2 = u(e2), r2 = Object.keys(t2), i2 = t2;
@@ -252,35 +242,88 @@ function R(e2, t2, s2) {
252
242
  Object.keys(e4).forEach((t3) => {
253
243
  s2.subRules || (s2.subRules = {}), s2.subRules[t3] ? Object.assign(s2.subRules[t3], e4[t3]) : s2.subRules[t3] = e4[t3];
254
244
  });
255
- } else T(i2[e3]), n2 ? (s2.rules[e3] = i2[e3], s2[e3] && (s2[e3] = i2[e3])) : s2[e3] = i2[e3];
256
- }), g(s2);
245
+ } else q(i2[e3]), n2 ? (s2.rules[e3] = i2[e3], s2[e3] && (s2[e3] = i2[e3])) : s2[e3] = i2[e3];
246
+ }), b(s2);
257
247
  }
258
248
  function v(e2) {
249
+ var _a;
250
+ if (!e2) return true;
251
+ if (u(e2)) return true;
252
+ const s2 = e2.tableUuids;
253
+ if (!s2) return true;
254
+ for (let r2 = 0; r2 < s2.length; r2++) {
255
+ const o2 = s2[r2], l2 = e2.hiddenNotValidatorCodes;
256
+ if (l2 && l2.size > 0 && l2.has(o2)) continue;
257
+ const a2 = n(e2, o2);
258
+ if (a2) {
259
+ if (a2.getConfigure()) {
260
+ const s3 = a2.getConfigure();
261
+ if ((_a = s3 == null ? void 0 : s3.verification) == null ? void 0 : _a.notEmpty) {
262
+ const n2 = a2.getTableData();
263
+ if (!n2 || !Array.isArray(n2) || 0 === n2.length) {
264
+ try {
265
+ d(e2, o2);
266
+ } catch (e3) {
267
+ }
268
+ return t({ showClose: true, message: i().t("superPageRuntimeMessage.xxxNotEmpty", { label: s3.title ? s3.title : s3.code }), type: "warning" }), false;
269
+ }
270
+ }
271
+ }
272
+ if (!a2.validatorSunTableListData()) {
273
+ try {
274
+ d(e2, o2);
275
+ } catch (e3) {
276
+ }
277
+ return false;
278
+ }
279
+ }
280
+ }
281
+ return true;
282
+ }
283
+ function P(e2) {
259
284
  if (!e2 || 0 === Object.keys(e2).length) return;
260
285
  const t2 = {}, s2 = Object.keys(e2);
261
286
  for (let n2 = 0; n2 < s2.length; n2++) {
262
287
  const r2 = s2[n2], i2 = e2[r2];
263
- P(i2), r2.indexOf(".") > 0 ? m(r2, t2, i2) : i2 && i2.length > 0 && (t2[r2] = [...i2]);
288
+ k(i2), r2.indexOf(".") > 0 ? p(r2, t2, i2) : i2 && i2.length > 0 && (t2[r2] = [...i2]);
264
289
  }
265
290
  return t2;
266
291
  }
267
- function P(e2, t2) {
292
+ function k(e2, t2) {
268
293
  e2.forEach((e3) => {
269
294
  e3.message;
270
295
  const t3 = e3.label, s2 = i().t(t3);
271
296
  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 }));
272
297
  });
273
298
  }
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;
299
+ function C(e2) {
300
+ const t2 = e2.entity.data, s2 = { ...e2.entity.page, ...t2 }, n2 = o(e2), r2 = e2.entity.context, i2 = e2.entity.task;
276
301
  e2.formPropTiltleMap && Object.keys(e2.formPropTiltleMap).length > 0 && e2.completeTaskParam.fieldPermissions && e2.completeTaskParam.fieldPermissions.length > 0 && e2.completeTaskParam.fieldPermissions.forEach((t3) => {
277
302
  t3.name && e2.formPropTiltleMap[t3.name] && (t3.label = e2.formPropTiltleMap[t3.name]);
278
303
  });
279
- let o2 = window.$vueApp.config.globalProperties.$getValidator(e2.completeTaskParam.fieldPermissions, s2, true, n2, i2, r2);
304
+ let l2 = window.$vueApp.config.globalProperties.$getValidator(e2.completeTaskParam.fieldPermissions, s2, true, n2, i2, r2);
280
305
  const a2 = e2.customRules;
281
- return o2 = R(e2, a2, o2), o2 && (o2.rules || (o2.rules = {}), o2.subRules || (o2.subRules = {})), o2;
306
+ return l2 = E(e2, a2, l2), l2 && (l2.rules || (l2.rules = {}), l2.subRules || (l2.subRules = {})), l2;
282
307
  }
283
- function k(e2, t2) {
308
+ function O(e2) {
309
+ const t2 = [];
310
+ return e2.customRuleEvents && e2.customRuleEvents.length > 0 && e2.customRuleEvents.forEach((s2) => {
311
+ s2.events.forEach((n2) => {
312
+ const r2 = e2.customEvents[n2];
313
+ t2.push(r2.apply(r2, [{ prop: s2.prop, pageContext: e2 }]));
314
+ });
315
+ }), t2 && t2.length > 0 ? new Promise((e3, s2) => {
316
+ const n2 = [], r2 = [];
317
+ t2.forEach((e4) => {
318
+ l(e4) ? n2.push(e4) : r2.push(e4);
319
+ }), r2.includes(false) && e3(false), n2.length > 0 ? Promise.all(n2).then((t3) => {
320
+ t3.includes(false) ? e3(false) : e3(true);
321
+ }).catch((t3) => {
322
+ e3(false);
323
+ }) : e3(true);
324
+ }) : null;
325
+ }
326
+ function j(e2, t2) {
284
327
  if (!t2) return;
285
328
  const n2 = {};
286
329
  if (t2.forEach((e3) => {
@@ -288,34 +331,34 @@ function k(e2, t2) {
288
331
  s2 ? n2[t3] = s2 : false === e3.required && (n2[t3] = []);
289
332
  }), u(e2)) {
290
333
  let t3 = e2.workflowRules ? e2.workflowRules : { rules: {}, subRules: {} };
291
- t3 = R(e2, n2, t3), e2.workflowRules = t3;
334
+ t3 = E(e2, n2, t3), e2.workflowRules = t3;
292
335
  } else {
293
336
  let t3 = e2.rules ? e2.rules : {};
294
- t3 = R(e2, n2, t3), e2.rules = t3;
337
+ t3 = E(e2, n2, t3), e2.rules = t3;
295
338
  }
296
339
  const r2 = t2.filter((e3) => "_all_fields" === e3.name);
297
- r2 && r2.length > 0 && O(e2, r2[0]), t2.forEach((t3) => {
340
+ r2 && r2.length > 0 && M(e2, r2[0]), t2.forEach((t3) => {
298
341
  if ("_all_fields" !== t3.name) {
299
342
  const n3 = s(e2, t3.name);
300
- x(e2, n3, t3);
343
+ N(e2, n3, t3);
301
344
  }
302
345
  });
303
346
  }
304
- function C(e2) {
305
- O(e2, { disabled: true });
347
+ function x(e2) {
348
+ M(e2, { disabled: true });
306
349
  }
307
- function O(e2, t2) {
350
+ function M(e2, t2) {
308
351
  const s2 = r(e2);
309
352
  if (s2) for (const n2 in s2) {
310
353
  const r2 = s2[n2];
311
- x(e2, r2 ? r2.value : r2, t2);
354
+ N(e2, r2 ? r2.value : r2, t2);
312
355
  }
313
356
  }
314
- function j(e2, t2, r2) {
357
+ function T(e2, t2, r2) {
315
358
  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);
359
+ let i2, o2;
360
+ 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;
361
+ const l2 = e2.code, a2 = e2.version, u2 = f(l2, a2, o2);
319
362
  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
363
  const s2 = e2.workflowRules.subRules[r2];
321
364
  t2.forEach((e3) => {
@@ -324,41 +367,41 @@ function j(e2, t2, r2) {
324
367
  }
325
368
  i2.dynamicControlTableEdit(e2, t2, u2);
326
369
  }
327
- function x(e2, t2, s2) {
370
+ function N(e2, t2, s2) {
328
371
  var _a, _b, _c;
329
372
  if (t2) {
330
373
  const n2 = t2.getConfigure();
331
374
  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
375
  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);
376
+ const s3 = t2 ? t2.getTableUuid() : null, n3 = e2.code, r2 = e2.version, i2 = f(n3, r2, s3), o2 = [{ name: "_all_fields", disabled: true }];
377
+ t2.dynamicControlTableEdit(e2, o2, i2);
335
378
  }
336
379
  }
337
380
  }
338
- function T(e2) {
381
+ function q(e2) {
339
382
  if (!(e2 == null ? void 0 : e2.type)) return;
340
- const t2 = N[e2.type];
383
+ const t2 = S[e2.type];
341
384
  t2 && (e2.validator = t2.validator);
342
385
  }
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));
386
+ const S = { boolean: { validator: function(e2, t2, s2) {
387
+ return true === A(e2, t2) && ("number" == typeof t2 && (1 === t2 || 0 === t2) || "boolean" == typeof t2 && (true === t2 || false === t2));
345
388
  } }, date: { validator: function(e2, t2, s2) {
346
- if (true !== M(e2, t2)) return false;
389
+ if (true !== A(e2, t2)) return false;
347
390
  const n2 = new Date(t2);
348
391
  return !isNaN(n2.getTime());
349
392
  } }, 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;
393
+ return true === A(e2, t2) && (("string" != typeof t2 || "" !== t2.trim()) && ("number" == typeof t2 || !isNaN(Number(t2))));
394
+ } } }, A = (e2, t2) => null != t2 && "" !== t2 || !e2.required;
352
395
  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
396
+ x as disabledAllFields,
397
+ T as dynamicControlTableEdit,
398
+ C as getWorkflowRules,
399
+ k as i18nValidatePropRulesMessage,
400
+ P as i18nValidateRulesMessage,
401
+ E as packageCustomRules,
402
+ q as packageCustomValidator,
403
+ p as setObjectPropRule,
404
+ j as updateFormItemEditState,
405
+ y as validateDataModelFunc,
406
+ g as validator
364
407
  };
@@ -118,7 +118,7 @@ const W = ["id"], q = e({ __name: "main-table-runtime", props: { pageContext: {}
118
118
  const l2 = ae.value.lineEditSave, r2 = K;
119
119
  return l2.props.base.tableUuid = r2.uuid, new Promise((t3, n3) => {
120
120
  const i3 = { tableName: r2.props.dataOrigin.tableName };
121
- V(J, l2, "/dsc/commons", false, a2, o2, e3, i3).then((e4) => {
121
+ V(J, l2, "/dsc/commons", false, a2, o2, e3, i3, true).then((e4) => {
122
122
  t3(e4 ? e4.entity : {});
123
123
  }).catch((e4) => {
124
124
  n3(e4);
@@ -1,7 +1,7 @@
1
1
  import e from "./super-page.vue2.js";
2
2
  /* empty css */
3
3
  import p from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = p(e, [["__scopeId", "data-v-9ac149f1"]]);
4
+ const r = p(e, [["__scopeId", "data-v-07f0e7b6"]]);
5
5
  export {
6
6
  r as default
7
7
  };
@@ -242,17 +242,17 @@ const we = e({ __name: "super-page", props: { pageCode: { type: String, required
242
242
  }
243
243
  const _a = me();
244
244
  function Oa(e3) {
245
- var _a2, _b;
245
+ var _a2, _b, _c, _d;
246
246
  if (Pa.value) return Pa.value = false, void window.history.go(-1);
247
- const a2 = ta.value.closeEvent, t2 = ta.value.isRefreshWhenClosePopup;
247
+ const a2 = (_a2 = ta.value) == null ? void 0 : _a2.closeEvent, t2 = (_b = ta.value) == null ? void 0 : _b.isRefreshWhenClosePopup;
248
248
  let l2, o2;
249
249
  const u2 = la.value.tableName;
250
250
  let n2;
251
251
  const i2 = ua.value.columnProp ? ua.value.columnProp : null;
252
252
  if (i2) {
253
- const e4 = (_b = (_a2 = oa.value) == null ? void 0 : _a2.items) == null ? void 0 : _b.filter((e5) => {
254
- var _a3, _b2, _c, _d;
255
- return ((_b2 = (_a3 = e5.props) == null ? void 0 : _a3.base) == null ? void 0 : _b2.prop) && ((_d = (_c = e5.props) == null ? void 0 : _c.base) == null ? void 0 : _d.prop) === i2;
253
+ const e4 = (_d = (_c = oa.value) == null ? void 0 : _c.items) == null ? void 0 : _d.filter((e5) => {
254
+ var _a3, _b2, _c2, _d2;
255
+ return ((_b2 = (_a3 = e5.props) == null ? void 0 : _a3.base) == null ? void 0 : _b2.prop) && ((_d2 = (_c2 = e5.props) == null ? void 0 : _c2.base) == null ? void 0 : _d2.prop) === i2;
256
256
  });
257
257
  n2 = e4 && e4.length > 0 ? e4[0] : null;
258
258
  } else n2 = oa.value;