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