super-page-runtime 2.3.18-tmp2 → 2.3.18-tmp3

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 (43) hide show
  1. package/dist/es/components/runtime/utils/barcode-util.js +5 -5
  2. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +49 -48
  3. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +14 -12
  4. package/dist/es/components/runtime/utils/charts/chart-util.js +58 -56
  5. package/dist/es/components/runtime/utils/events/event-util.js +111 -111
  6. package/dist/es/components/runtime/utils/events/print-label.js +1 -0
  7. package/dist/es/components/runtime/utils/events/standard-event.js +524 -512
  8. package/dist/es/components/runtime/utils/events/validator-util.js +1 -1
  9. package/dist/es/components/runtime/utils/form/scan-util.js +4 -3
  10. package/dist/es/components/runtime/utils/page-helper-util.js +275 -275
  11. package/dist/es/components/runtime/utils/page-init-util.js +82 -79
  12. package/dist/es/components/runtime/utils/page-store.js +10 -10
  13. package/dist/es/components/runtime/utils/table-utils.js +28 -28
  14. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +14 -10
  15. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +3 -3
  16. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +6 -6
  17. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +13 -12
  18. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +15 -14
  19. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +15 -14
  20. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +16 -15
  21. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +86 -85
  22. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +24 -22
  23. package/dist/es/components/runtime/views/assemblys/container/fixed/YxAffix.vue2.js +1 -1
  24. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +63 -63
  25. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +40 -38
  26. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +90 -87
  27. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +39 -38
  28. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +1 -0
  29. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +26 -26
  30. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +14 -14
  31. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +49 -49
  32. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +6 -6
  33. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +10 -10
  34. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +1 -0
  35. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +13 -13
  36. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +16 -16
  37. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +6 -6
  38. package/dist/es/components/runtime/views/home-chart.vue.js +4 -4
  39. package/dist/es/components/runtime/views/super-page-dialog.vue.js +9 -9
  40. package/dist/es/components/runtime/views/super-page.vue.js +1 -1
  41. package/dist/es/components/runtime/views/super-page.vue2.js +171 -170
  42. package/dist/es/style.css +76 -76
  43. package/package.json +1 -1
@@ -4,354 +4,354 @@ import { executeExpression } from "agilebuilder-ui/src/utils/calculator/calculat
4
4
  import { getComponentRef } from "./global-refs.js";
5
5
  import { watch } from "vue";
6
6
  import { deepCopy, getBaseUrl } from "./common-util.js";
7
- function getComponentOptionConfigs(t, e, n, o) {
8
- return getComponentOptionConfigsBase(t, (e == null ? void 0 : e.systemCode) ? e.systemCode : n, (e == null ? void 0 : e.systemVersion) ? e == null ? void 0 : e.systemVersion : o);
9
- }
10
- function getComponentOptionConfigsBase(t, e, n) {
11
- if (!t.props || !t.props.dataOrigin) return;
12
- if (t.name && "table" === t.name) return;
13
- const o = t.props.dataOrigin, a = { uuid: t.uuid };
14
- if ("optionGroup" == o.optionValueSetType) a.type = "optionGroup", a.props = { code: o.optionGroup };
15
- else if ("dynamicData" == o.optionValueSetType) a.type = "dynamicData", a.filterType = o.filterType, a.props = { code: o.dynamicDataSourceCode };
16
- else if ("dataTable" == o.optionValueSetType) {
17
- a.filterType = o.filterType;
18
- const t2 = getTableQueryInfo(o, e, n);
19
- Object.assign(a, t2);
20
- } else if ("service" == o.optionValueSetType) {
21
- a.filterType = o.filterType;
22
- const t2 = getServiceQueryInfo(o, e, n);
23
- Object.assign(a, t2);
7
+ function getComponentOptionConfigs(e, t, o, n) {
8
+ return getComponentOptionConfigsBase(e, (t == null ? void 0 : t.systemCode) ? t.systemCode : o, (t == null ? void 0 : t.systemVersion) ? t == null ? void 0 : t.systemVersion : n);
9
+ }
10
+ function getComponentOptionConfigsBase(e, t, o) {
11
+ if (!e.props || !e.props.dataOrigin) return;
12
+ if (e.name && "table" === e.name) return;
13
+ const n = e.props.dataOrigin, a = { uuid: e.uuid };
14
+ if ("optionGroup" == n.optionValueSetType) a.type = "optionGroup", a.props = { code: n.optionGroup };
15
+ else if ("dynamicData" == n.optionValueSetType) a.type = "dynamicData", a.filterType = n.filterType, a.props = { code: n.dynamicDataSourceCode };
16
+ else if ("dataTable" == n.optionValueSetType) {
17
+ a.filterType = n.filterType;
18
+ const e2 = getTableQueryInfo(n, t, o);
19
+ Object.assign(a, e2);
20
+ } else if ("service" == n.optionValueSetType) {
21
+ a.filterType = n.filterType;
22
+ const e2 = getServiceQueryInfo(n, t, o);
23
+ Object.assign(a, e2);
24
24
  }
25
25
  return a.type ? a : void 0;
26
26
  }
27
- function getTableQueryInfo(t, e, n) {
28
- const o = { type: "dataTable" };
29
- if (o.valueLabelSwitch = !!t.valueLabelSwitch, o.props = { tableName: t.tableName, systemCode: t.tableSysCode ? t.tableSysCode : e, systemVersion: t.tableSysVersion ? t.tableSysVersion : n }, t.sortFields) {
30
- const e2 = [];
31
- for (const n2 of t.sortFields) n2.name && e2.push({ prop: n2.name, order: n2.type ? n2.type : "asc" });
32
- o.props.sorts = e2;
27
+ function getTableQueryInfo(e, t, o) {
28
+ const n = { type: "dataTable" };
29
+ if (n.valueLabelSwitch = !!e.valueLabelSwitch, n.props = { tableName: e.tableName, systemCode: e.tableSysCode ? e.tableSysCode : t, systemVersion: e.tableSysVersion ? e.tableSysVersion : o }, e.sortFields) {
30
+ const t2 = [];
31
+ for (const o2 of e.sortFields) o2.name && t2.push({ prop: o2.name, order: o2.type ? o2.type : "asc" });
32
+ n.props.sorts = t2;
33
33
  }
34
34
  const a = [];
35
- if (t.filterList) {
36
- const e2 = [];
37
- for (const n2 of t.filterList) {
38
- if (!n2.propName) continue;
39
- n2.propDbName || (n2.propDbName = n2.propName);
40
- const t2 = {};
41
- Object.assign(t2, n2);
42
- const o2 = getParamNames(n2.propValue);
43
- for (const t3 of o2) t3 && (t3.startsWith("${data.") || t3.startsWith("${task.") || t3.startsWith("${page.")) && (a.includes(t3) || a.push(t3));
44
- n2.propValue, e2.push(t2);
35
+ if (e.filterList) {
36
+ const t2 = [];
37
+ for (const o2 of e.filterList) {
38
+ if (!o2.propName) continue;
39
+ o2.propDbName || (o2.propDbName = o2.propName);
40
+ const e2 = {};
41
+ Object.assign(e2, o2);
42
+ const n2 = getParamNames(o2.propValue);
43
+ for (const e3 of n2) e3 && (e3.startsWith("${data.") || e3.startsWith("${task.") || e3.startsWith("${page.")) && (a.includes(e3) || a.push(e3));
44
+ o2.propValue, t2.push(e2);
45
45
  }
46
- o.props.searchForm = e2;
46
+ n.props.searchForm = t2;
47
47
  }
48
- o.props.monitorFields = a;
48
+ n.props.monitorFields = a;
49
49
  const r = [];
50
- if (t.tableValueField && (o.props.valueField = t.tableValueField), t.tableLableField && -1 == r.indexOf(t.tableLableField) && (o.props.lableField = t.tableLableField), t.autoSets) for (const e2 of t.autoSets) e2.source && -1 == r.indexOf(e2.source) && r.push(e2.source);
51
- return o.props.queryFields = r, o.props.pageSize = t.displayQuantity, o;
52
- }
53
- function getServiceQueryInfo(t, e, n) {
54
- const o = { type: "service" };
55
- if (o.valueLabelSwitch = !!t.valueLabelSwitch, o.props = { serivceCode: t.serviceCode, systemCode: t.tableSysCode ? t.tableSysCode : e, systemVersion: t.tableSysVersion ? t.tableSysVersion : n }, t.serviceInputs) {
56
- const e2 = [];
57
- for (const n2 of t.serviceInputs) {
58
- if (!n2.name || n2.value) continue;
59
- const t2 = {};
60
- Object.assign(t2, n2), e2.push(t2);
50
+ if (e.tableValueField && (n.props.valueField = e.tableValueField), e.tableLableField && -1 == r.indexOf(e.tableLableField) && (n.props.lableField = e.tableLableField), e.autoSets) for (const t2 of e.autoSets) t2.source && -1 == r.indexOf(t2.source) && r.push(t2.source);
51
+ return n.props.queryFields = r, n.props.pageSize = e.displayQuantity, n;
52
+ }
53
+ function getServiceQueryInfo(e, t, o) {
54
+ const n = { type: "service" };
55
+ if (n.valueLabelSwitch = !!e.valueLabelSwitch, n.props = { serivceCode: e.serviceCode, systemCode: e.tableSysCode ? e.tableSysCode : t, systemVersion: e.tableSysVersion ? e.tableSysVersion : o }, e.serviceInputs) {
56
+ const t2 = [];
57
+ for (const o2 of e.serviceInputs) {
58
+ if (!o2.name || o2.value) continue;
59
+ const e2 = {};
60
+ Object.assign(e2, o2), t2.push(e2);
61
61
  }
62
- o.props.inputs = e2;
62
+ n.props.inputs = t2;
63
63
  }
64
- return o.props.dataSetField = t.serviceDataSetField, o.props.valueField = t.serviceValueField, o.props.labelField = t.serviceLabelField, o;
64
+ return n.props.dataSetField = e.serviceDataSetField, n.props.valueField = e.serviceValueField, n.props.labelField = e.serviceLabelField, n;
65
65
  }
66
- function updateChartDatasources(t, e, n, o) {
66
+ function updateChartDatasources(e, t, o, n) {
67
67
  return new Promise((a, r) => {
68
- if (!e || 0 == e.length) return void r(new Error("无需查询的统计图配置!"));
69
- const s = deepCopy(e);
70
- s.forEach((e2) => {
71
- const n2 = e2.services;
72
- if (n2 && n2.length > 0) {
73
- const e3 = n2[0].serviceInputs;
74
- e3 && (n2[0].serviceInParams = {}, e3.forEach((e4) => {
75
- const o2 = e4.name, a2 = e4.value;
76
- n2[0].serviceInParams[o2] = getValueFromVariable(t.entity, a2);
77
- }), delete n2[0].serviceInputs);
68
+ if (!t || 0 == t.length) return void r(new Error("无需查询的统计图配置!"));
69
+ const s = deepCopy(t);
70
+ s.forEach((t2) => {
71
+ const o2 = t2.services;
72
+ if (o2 && o2.length > 0) {
73
+ const t3 = o2[0].serviceInputs;
74
+ t3 && (o2[0].serviceInParams = {}, t3.forEach((t4) => {
75
+ const n2 = t4.name, a2 = t4.value;
76
+ o2[0].serviceInParams[n2] = getValueFromVariable(e.entity, a2);
77
+ }), delete o2[0].serviceInputs);
78
78
  }
79
79
  });
80
- const i = t.entity ? t.entity : {}, u = {};
81
- i.request && Object.assign(u, i.request), i.page && Object.assign(u, i.page), n && Object.assign(u, n);
82
- const l = {};
83
- i.task && Object.assign(l, i.task);
84
- const c = { entityMap: i.data, additionalParamMap: u, taskMap: l, dataSourceList: s, systemCode: t.systemCode, pageCode: t.code }, p = t.backendUrl, f = getBaseUrl(p, t.isTest) + "/common/common-data/find-chart-datas";
85
- http.post(f, c, { headers: { customSystem: t.systemCode } }).then((e2) => {
80
+ const i = e.entity ? e.entity : {}, l = {};
81
+ i.request && Object.assign(l, i.request), i.page && Object.assign(l, i.page), o && Object.assign(l, o);
82
+ const u = {};
83
+ i.task && Object.assign(u, i.task);
84
+ const c = { entityMap: i.data, additionalParamMap: l, taskMap: u, dataSourceList: s, systemCode: e.systemCode, pageCode: e.code }, p = e.backendUrl, f = getBaseUrl(p, e.isTest) + "/common/common-data/find-chart-datas";
85
+ http.post(f, c, { headers: { customSystem: e.systemCode } }).then((t2) => {
86
86
  var _a, _b;
87
- t.chartDataSourceMap || (t.chartDataSourceMap = {});
88
- for (const n2 in e2) {
89
- t.chartDataSourceMap[n2] = e2[n2];
90
- const a2 = getComponentRef(t, n2);
87
+ e.chartDataSourceMap || (e.chartDataSourceMap = {});
88
+ for (const o2 in t2) {
89
+ e.chartDataSourceMap[o2] = t2[o2];
90
+ const a2 = getComponentRef(e, o2);
91
91
  if (a2) {
92
92
  const r2 = a2.getConfigure();
93
- if ((!o || r2 && (void 0 === r2.initializationQuery || r2.initializationQuery)) && a2.updateChartDatas && (a2.updateChartDatas(e2[n2]), (_b = (_a = r2.runtime) == null ? void 0 : _a.dataConfig) == null ? void 0 : _b.resultSet)) {
94
- const o2 = e2[n2] && e2[n2].length > 0 ? e2[n2][0] : {}, a3 = o2 && o2.result ? o2.result : {};
93
+ if ((!n || r2 && (void 0 === r2.initializationQuery || r2.initializationQuery)) && a2.updateChartDatas && (a2.updateChartDatas(t2[o2]), (_b = (_a = r2.runtime) == null ? void 0 : _a.dataConfig) == null ? void 0 : _b.resultSet)) {
94
+ const n2 = t2[o2] && t2[o2].length > 0 ? t2[o2][0] : {}, a3 = n2 && n2.result ? n2.result : {};
95
95
  let s2 = null;
96
- r2.serviceDataField ? s2 = a3[r2.serviceDataField] : a3 && (s2 = Array.isArray(a3) ? a3 : [a3]), s2 || (s2 = []), setValueForVariableName(t.entity, r2.runtime.dataConfig.resultSet, s2);
96
+ r2.serviceDataField ? s2 = a3[r2.serviceDataField] : a3 && (s2 = Array.isArray(a3) ? a3 : [a3]), s2 || (s2 = []), setValueForVariableName(e.entity, r2.runtime.dataConfig.resultSet, s2);
97
97
  }
98
98
  }
99
99
  }
100
- a(e2);
101
- }).catch((t2) => {
102
- r(t2);
100
+ console.log("查询统计图数据完成", t2), a(t2);
101
+ }).catch((e2) => {
102
+ console.log("查询统计图数据失败", e2), r(e2);
103
103
  });
104
104
  });
105
105
  }
106
- function updateChartDatasourcesByComponent(t, e) {
107
- const n = t.initChartServiceConfigs.find((t2) => t2.uuid === e);
108
- n && updateChartDatasources(t, [n], null, false);
109
- }
110
- function updateOptionDatasources(t, e, n) {
111
- return new Promise((o, a) => {
112
- if (!e || 0 == e.length) return void a(new Error("无需查询的配置!"));
113
- const r = t.entity ? t.entity : {}, s = {};
114
- r.request && Object.assign(s, r.request), r.page && Object.assign(s, r.page), s.query = n;
115
- const i = { entityMap: r.data, additionalParamMap: s, dataSourceList: e, systemCode: t.systemCode, query: n }, u = t.backendUrl, l = getBaseUrl(u, t.isTest) + "/common/common-data/find-datas";
116
- http.post(l, i).then((e2) => {
117
- t.optionSourceMap || (t.optionSourceMap = {});
118
- for (const n2 in e2) {
119
- t.optionSourceMap[n2] = e2[n2];
120
- const o2 = getComponentRef(t, n2);
121
- o2 && o2.updateOptions && o2.updateOptions(e2[n2]);
106
+ function updateChartDatasourcesByComponent(e, t) {
107
+ const o = e.initChartServiceConfigs.find((e2) => e2.uuid === t);
108
+ o && updateChartDatasources(e, [o], null, false);
109
+ }
110
+ function updateOptionDatasources(e, t, o) {
111
+ return new Promise((n, a) => {
112
+ if (!t || 0 == t.length) return void a(new Error("无需查询的配置!"));
113
+ const r = e.entity ? e.entity : {}, s = {};
114
+ r.request && Object.assign(s, r.request), r.page && Object.assign(s, r.page), s.query = o;
115
+ const i = { entityMap: r.data, additionalParamMap: s, dataSourceList: t, systemCode: e.systemCode, query: o }, l = e.backendUrl, u = getBaseUrl(l, e.isTest) + "/common/common-data/find-datas";
116
+ http.post(u, i).then((t2) => {
117
+ e.optionSourceMap || (e.optionSourceMap = {});
118
+ for (const o2 in t2) {
119
+ e.optionSourceMap[o2] = t2[o2];
120
+ const n2 = getComponentRef(e, o2);
121
+ n2 && n2.updateOptions && n2.updateOptions(t2[o2]);
122
122
  }
123
- o(e2);
124
- }).catch((t2) => {
125
- a(t2);
123
+ console.log("查询选项数据完成", t2), n(t2);
124
+ }).catch((e2) => {
125
+ console.log("查询选项数据失败", e2), a(e2);
126
126
  });
127
127
  });
128
128
  }
129
- function getOptionDatasFromPage(t, e) {
130
- return getComponentOptionDatasFromPage(t, e.uuid);
131
- }
132
- function getComponentOptionDatasFromPage(t, e) {
133
- const n = getOptionDatasSourceMap(t)[e];
134
- return n || [];
135
- }
136
- function getOptionDatasSourceMap(t) {
137
- if (!t || !t.optionSourceMap) return {};
138
- const e = t.optionSourceMap;
139
- return e || {};
140
- }
141
- function getChartDatasFromPage(t, e) {
142
- if (!t || !t.chartDataSourceMap || !e) return null;
143
- return t.chartDataSourceMap[e.uuid];
144
- }
145
- function queryOptionDatasources(t, e, n) {
146
- return updateOptionDatasources(t, e ? [e] : [], n);
147
- }
148
- function autoSetAfterSelect(t, e, n, o, a = []) {
149
- if (!n || 0 == n.length) return;
150
- const r = e.entity ? e.entity : {};
151
- for (const t2 of n) {
152
- if (!t2.source || !t2.target || a.includes(t2.target)) continue;
153
- const e2 = getValuesByField(o, t2.source);
154
- let n2 = t2.target;
155
- if (!n2 || !n2.startsWith("${")) continue;
156
- n2 = n2.substring(2, n2.length - 1);
157
- setVariableValue(r, n2.split("."), e2.join(","));
129
+ function getOptionDatasFromPage(e, t) {
130
+ return getComponentOptionDatasFromPage(e, t.uuid);
131
+ }
132
+ function getComponentOptionDatasFromPage(e, t) {
133
+ const o = getOptionDatasSourceMap(e)[t];
134
+ return o || [];
135
+ }
136
+ function getOptionDatasSourceMap(e) {
137
+ if (!e || !e.optionSourceMap) return {};
138
+ const t = e.optionSourceMap;
139
+ return t || {};
140
+ }
141
+ function getChartDatasFromPage(e, t) {
142
+ if (!e || !e.chartDataSourceMap || !t) return null;
143
+ return e.chartDataSourceMap[t.uuid];
144
+ }
145
+ function queryOptionDatasources(e, t, o) {
146
+ return updateOptionDatasources(e, t ? [t] : [], o);
147
+ }
148
+ function autoSetAfterSelect(e, t, o, n, a = []) {
149
+ if (!o || 0 == o.length) return;
150
+ const r = t.entity ? t.entity : {};
151
+ for (const e2 of o) {
152
+ if (!e2.source || !e2.target || a.includes(e2.target)) continue;
153
+ const t2 = getValuesByField(n, e2.source);
154
+ let o2 = e2.target;
155
+ if (!o2 || !o2.startsWith("${")) continue;
156
+ o2 = o2.substring(2, o2.length - 1);
157
+ setVariableValue(r, o2.split("."), t2.join(","));
158
158
  }
159
159
  }
160
- function getValuesByField(t, e) {
161
- if (t) {
162
- const n = [];
163
- for (const o of t) {
164
- let t2 = o[e];
165
- null != t2 && null != t2 || (t2 = ""), n.push(t2);
160
+ function getValuesByField(e, t) {
161
+ if (e) {
162
+ const o = [];
163
+ for (const n of e) {
164
+ let e2 = n[t];
165
+ null != e2 && null != e2 || (e2 = ""), o.push(e2);
166
166
  }
167
- return n;
167
+ return o;
168
168
  }
169
169
  return [""];
170
170
  }
171
- function getVariableValue(t, e) {
172
- if (!t || !e || 0 == e.length) return;
173
- let n = t;
174
- for (let t2 = 0; t2 < e.length; t2++) {
175
- if (null == n) return n;
176
- n = n[e[t2]];
171
+ function getVariableValue(e, t) {
172
+ if (!e || !t || 0 == t.length) return;
173
+ let o = e;
174
+ for (let e2 = 0; e2 < t.length; e2++) {
175
+ if (null == o) return o;
176
+ o = o[t[e2]];
177
177
  }
178
- return n;
179
- }
180
- function setValueForVariableName(t, e, n) {
181
- if (!e || !e.startsWith("${")) return;
182
- setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."), n);
183
- }
184
- function setVariableValue(t, e, n) {
185
- if (!t || !e || 0 == e.length) return;
186
- let o = t;
187
- for (let t2 = 0; t2 < e.length; t2++) {
188
- const a = e[t2];
189
- t2 + 1 === e.length ? o[a] = n : (void 0 === o[a] && (o[a] = {}), o = o[a]);
178
+ return o;
179
+ }
180
+ function setValueForVariableName(e, t, o) {
181
+ if (!t || !t.startsWith("${")) return;
182
+ setVariableValue(e, (t = t.substring(2, t.length - 1)).split("."), o);
183
+ }
184
+ function setVariableValue(e, t, o) {
185
+ if (!e || !t || 0 == t.length) return;
186
+ let n = e;
187
+ for (let e2 = 0; e2 < t.length; e2++) {
188
+ const a = t[e2];
189
+ e2 + 1 === t.length ? n[a] = o : (void 0 === n[a] && (n[a] = {}), n = n[a]);
190
190
  }
191
191
  }
192
- function setVariableValueWithProp(t, e, n) {
193
- if (!t || !e) return;
194
- setVariableValue(t, e.split("."), n);
192
+ function setVariableValueWithProp(e, t, o) {
193
+ if (!e || !t) return;
194
+ setVariableValue(e, t.split("."), o);
195
195
  }
196
- function formatVariableValue(t, e) {
197
- if (!t || "" == e || null == e || null == e) return e;
198
- const n = t.entity ? t.entity : {}, o = getParamNames(e);
199
- for (const t2 in o) {
200
- const a = o[t2], r = getValueFromVariable(n, a);
196
+ function formatVariableValue(e, t) {
197
+ if (!e || "" == t || null == t || null == t) return t;
198
+ const o = e.entity ? e.entity : {}, n = getParamNames(t);
199
+ for (const e2 in n) {
200
+ const a = n[e2], r = getValueFromVariable(o, a);
201
201
  if (r && "[object Date]" === Object.prototype.toString.call(r)) return dayjs(r).format("YYYY-MM-DD HH:mm:ss");
202
202
  if (r && "number" == typeof r) return r;
203
- e = e.replace(a, null == r ? "" : r);
203
+ t = t.replace(a, null == r ? "" : r);
204
204
  }
205
- return e;
205
+ return t;
206
206
  }
207
- function getParamNames(t) {
208
- if (!t) return [];
209
- const e = t.match(/\$\{[^\{|\}]+\}/g);
210
- return e || [];
207
+ function getParamNames(e) {
208
+ if (!e) return [];
209
+ const t = e.match(/\$\{[^\{|\}]+\}/g);
210
+ return t || [];
211
211
  }
212
- function formatValueByType(t, e, n) {
213
- if (!e || "" == t || null == t || null == t) return t;
214
- if (n = n || {}, "number" == e || "percent" == e) {
215
- if (isNaN(t)) return t;
216
- let o = parseInt(n.decimalDigit);
217
- if ((null == o || isNaN(o)) && (o = -1), t = parseFloat(t), "percent" == e && (t *= 100), o > -1 && (t = parseFloat(t.toFixed(o))), "percent" == e) t += "%";
212
+ function formatValueByType(e, t, o) {
213
+ if (!t || "" == e || null == e || null == e) return e;
214
+ if (console.log("aaa", e, t, o), o = o || {}, "number" == t || "percent" == t) {
215
+ if (isNaN(e)) return e;
216
+ let n = parseInt(o.decimalDigit);
217
+ if ((null == n || isNaN(n)) && (n = -1), e = parseFloat(e), "percent" == t && (e *= 100), n > -1 && (e = parseFloat(e.toFixed(n))), "percent" == t) e += "%";
218
218
  else {
219
- if (n.thousandsSeparator) {
220
- const e2 = t.toString().split(".");
221
- e2[0] = e2[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), t = e2.length > 1 ? e2.join(".") : e2[0];
219
+ if (o.thousandsSeparator) {
220
+ const t2 = e.toString().split(".");
221
+ t2[0] = t2[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), e = t2.length > 1 ? t2.join(".") : t2[0];
222
222
  }
223
- n.symbol && (t = n.symbol + "" + t);
223
+ o.symbol && (e = o.symbol + "" + e);
224
224
  }
225
- return t;
225
+ return e;
226
226
  }
227
- if ("date" == e || "time" == e) {
228
- let o = "";
229
- return "date" == e ? (o = n.dateFormat, o || (o = "YYYY-MM-DD")) : (o = n.timeFormat, o || (o = "HH:mm:ss")), dayjs(t).format(o);
227
+ if ("date" == t || "time" == t) {
228
+ let n = "";
229
+ return "date" == t ? (n = o.dateFormat, n || (n = "YYYY-MM-DD")) : (n = o.timeFormat, n || (n = "HH:mm:ss")), dayjs(e).format(n);
230
230
  }
231
- return "custom" == e && n.formatEventUuid, t;
232
- }
233
- function getValueFromVariable(t, e, n) {
234
- if (null == e || null == e) return e;
235
- if (e.startsWith("${") && e.endsWith("}")) {
236
- let o = e.substring(2, e.length - 1), a = null, r = null;
237
- if (o.startsWith("data.")) o = o.substring(5), r = t.data, a = "data";
238
- else if (o.startsWith("page.")) o = o.substring(5), a = "page", r = t.page;
239
- else if (o.startsWith("task.")) o = o.substring(5), a = "task", r = t.task;
240
- else if (o.startsWith("request.")) o = o.substring(8), a = "request", r = t.request;
241
- else if (o.startsWith("context.")) o = o.substring(8), a = "context", r = t.context;
242
- else if (o.startsWith("system.")) o = o.substring(7), a = "system", r = t.system;
231
+ return "custom" == t && o.formatEventUuid && console.log("自定义方法", o), e;
232
+ }
233
+ function getValueFromVariable(e, t, o) {
234
+ if (null == t || null == t) return t;
235
+ if (t.startsWith("${") && t.endsWith("}")) {
236
+ let n = t.substring(2, t.length - 1), a = null, r = null;
237
+ if (n.startsWith("data.")) n = n.substring(5), r = e.data, a = "data";
238
+ else if (n.startsWith("page.")) n = n.substring(5), a = "page", r = e.page;
239
+ else if (n.startsWith("task.")) n = n.substring(5), a = "task", r = e.task;
240
+ else if (n.startsWith("request.")) n = n.substring(8), a = "request", r = e.request;
241
+ else if (n.startsWith("context.")) n = n.substring(8), a = "context", r = e.context;
242
+ else if (n.startsWith("system.")) n = n.substring(7), a = "system", r = e.system;
243
243
  else {
244
- if (o.startsWith("fixed.")) return o.substring(6);
245
- o.startsWith("row.") && (o = o.substring(4), r = n, a = "row");
244
+ if (n.startsWith("fixed.")) return n.substring(6);
245
+ n.startsWith("row.") && (n = n.substring(4), r = o, a = "row");
246
246
  }
247
- return o ? getValueFromSource(r, o, a) : "";
247
+ return n ? getValueFromSource(r, n, a) : (console.log("获取变量失败", t, e), "");
248
248
  }
249
- return e;
250
- }
251
- function getValueFromSource(t, e, n) {
252
- if ("context" != n && !t || !e) return;
253
- const o = e.indexOf(".");
254
- if (o > -1) {
255
- const a = e.substring(0, o), r = e.substring(o + 1);
256
- let s = t[a];
257
- return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, r, n);
249
+ return t;
250
+ }
251
+ function getValueFromSource(e, t, o) {
252
+ if ("context" != o && !e || !t) return;
253
+ const n = t.indexOf(".");
254
+ if (n > -1) {
255
+ const a = t.substring(0, n), r = t.substring(n + 1);
256
+ let s = e[a];
257
+ return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, r, o);
258
258
  }
259
- if ("context" == n) {
260
- if ("currentDate" == e || "currentTime" == e) return /* @__PURE__ */ new Date();
261
- if (e.startsWith("currentDate") && e.length > 11) {
262
- const t2 = e.substring(11), n2 = t2.substring(0, 1);
263
- let o2 = parseInt(t2.substring(1, t2.length - 1), 10);
264
- const a = t2.substring(t2.length - 1), r = /* @__PURE__ */ new Date();
265
- return o2 = "+" === n2 ? o2 : -o2, "d" === a || "w" === a ? (o2 = "w" === a ? 7 * o2 : o2, r.setDate(r.getDate() + o2)) : "m" === a ? r.setMonth(r.getMonth() + o2) : "y" === a && r.setFullYear(r.getFullYear() + o2), r;
259
+ if ("context" == o) {
260
+ if ("currentDate" == t || "currentTime" == t) return /* @__PURE__ */ new Date();
261
+ if (t.startsWith("currentDate") && t.length > 11) {
262
+ const e2 = t.substring(11), o2 = e2.substring(0, 1);
263
+ let n2 = parseInt(e2.substring(1, e2.length - 1), 10);
264
+ const a = e2.substring(e2.length - 1), r = /* @__PURE__ */ new Date();
265
+ return n2 = "+" === o2 ? n2 : -n2, "d" === a || "w" === a ? (n2 = "w" === a ? 7 * n2 : n2, r.setDate(r.getDate() + n2)) : "m" === a ? r.setMonth(r.getMonth() + n2) : "y" === a && r.setFullYear(r.getFullYear() + n2), r;
266
266
  }
267
- if (!t) return;
267
+ if (!e) return;
268
268
  }
269
- return t[e];
269
+ return e[t];
270
270
  }
271
271
  function caculateShowCondition(pageContext, showConditions, row) {
272
272
  if (!showConditions || 0 == showConditions.length || !pageContext || !pageContext.entity) return true;
273
273
  const entityData = pageContext.entity;
274
274
  let conditions = "";
275
275
  const maxLen = showConditions.length;
276
- for (let t = 0; t < maxLen; t++) {
277
- const e = showConditions[t], n = e.propName;
278
- let o = e.operator;
279
- if (!n || "" === n) continue;
280
- o || (o = "EQ");
281
- const a = getValueFromVariable(entityData, n, row);
282
- let r = getValueFromVariable(entityData, e.propValue, row);
283
- const s = e.dataType;
284
- "CONTAIN" != o && "NOT_CONTAIN" != o || a && !a.includes && (o = "CONTAIN" == o ? "EQ" : "NET");
285
- let i = e.variableIsNull, u;
286
- if (i || (i = "null"), "IS_NULL" !== o && "IS_NOT_NULL" !== o && (void 0 !== r && "" !== r || (r = null, "null" === i ? o = "IS_NULL" : "notequal" === i ? o = "IS_NOT_NULL" : u = true)), null == u) try {
287
- u = executeExpression(a, o, r, s);
288
- } catch (t2) {
289
- u = false;
276
+ for (let e = 0; e < maxLen; e++) {
277
+ const t = showConditions[e], o = t.propName;
278
+ let n = t.operator;
279
+ if (!o || "" === o) continue;
280
+ n || (n = "EQ");
281
+ const a = getValueFromVariable(entityData, o, row);
282
+ let r = getValueFromVariable(entityData, t.propValue, row);
283
+ const s = t.dataType;
284
+ "CONTAIN" != n && "NOT_CONTAIN" != n || a && !a.includes && (n = "CONTAIN" == n ? "EQ" : "NET");
285
+ let i = t.variableIsNull, l;
286
+ if (i || (i = "null"), "IS_NULL" !== n && "IS_NOT_NULL" !== n && (void 0 !== r && "" !== r || (r = null, "null" === i ? n = "IS_NULL" : "notequal" === i ? n = "IS_NOT_NULL" : l = true)), null == l) try {
287
+ l = executeExpression(a, n, r, s);
288
+ } catch (e2) {
289
+ console.log("executeExpression error", e2), l = false;
290
290
  }
291
- const l = e.leftBracket, c = e.rightBracket;
292
- let p = e.joinSign;
293
- if (l && null !== l && "" !== l && (conditions += l, conditions += " "), conditions += u + " ", c && null !== c && "" !== c && (conditions += c, conditions += " "), t < maxLen - 1 && p && null !== p && "" !== p) {
294
- const t2 = p.toLowerCase();
295
- "and" === t2 ? p = t2.replace("and", "&&") : "or" === t2 && (p = t2.replace("or", "||")), conditions += p + " ";
291
+ const u = t.leftBracket, c = t.rightBracket;
292
+ let p = t.joinSign;
293
+ if (u && null !== u && "" !== u && (conditions += u, conditions += " "), conditions += l + " ", c && null !== c && "" !== c && (conditions += c, conditions += " "), e < maxLen - 1 && p && null !== p && "" !== p) {
294
+ const e2 = p.toLowerCase();
295
+ "and" === e2 ? p = e2.replace("and", "&&") : "or" === e2 && (p = e2.replace("or", "||")), conditions += p + " ";
296
296
  }
297
297
  }
298
298
  return !conditions || eval("(" + conditions + ")");
299
299
  }
300
- function monitorFieldChange(t, e, n) {
301
- if (!n || !t || !e || 0 == e.length) return;
302
- const o = [], a = [];
303
- for (let t2 of e) if (t2.startsWith("${")) {
304
- t2 = t2.substring(2, t2.length - 1);
305
- const e2 = t2.split(".");
306
- "page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (o.push(e2), a.includes(e2[0]) || a.push(e2[0]));
300
+ function monitorFieldChange(e, t, o) {
301
+ if (!o || !e || !t || 0 == t.length) return;
302
+ const n = [], a = [];
303
+ for (let e2 of t) if (e2.startsWith("${")) {
304
+ e2 = e2.substring(2, e2.length - 1);
305
+ const t2 = e2.split(".");
306
+ "page" !== t2[0] && "task" !== t2[0] && "data" !== t2[0] || (n.push(t2), a.includes(t2[0]) || a.push(t2[0]));
307
307
  }
308
- let r = getMonitorFieldValues(o, t.entity), s = false;
309
- for (const e2 of a) watch(t.entity[e2], () => {
308
+ let r = getMonitorFieldValues(n, e.entity), s = false;
309
+ for (const t2 of a) watch(e.entity[t2], () => {
310
310
  s && clearTimeout(s), s = setTimeout(function() {
311
- const e3 = getMonitorFieldValues(o, t.entity);
312
- r != e3 && (r = e3, n());
311
+ const t3 = getMonitorFieldValues(n, e.entity);
312
+ r != t3 && (r = t3, o());
313
313
  }, 200);
314
314
  });
315
315
  }
316
- function getMonitorFieldValues(t, e) {
317
- let n = "";
318
- for (const o of t) n += "_" + getVariableValue(e, o);
319
- return n;
320
- }
321
- function getFormPropName(t) {
322
- return t && t.indexOf("${") >= 0 ? t.substring(t.indexOf(".") + 1, t.lastIndexOf("}")) : t;
323
- }
324
- function getSizeConfig(t, e) {
325
- const n = getPageModeType(t);
326
- let o;
327
- return e.props && e.props.size && e.props.size[n] && (o = e.props.size[n]), !o && e.props && e.props.size && (o = e.props.size.pc), o;
328
- }
329
- function getPageModeType(t) {
330
- let e = t.dimensions;
331
- return e || (e = "pc"), e;
332
- }
333
- function isPromise(t) {
334
- return t && "[object Promise]" === Object.prototype.toString.call(t);
335
- }
336
- function decomposeVariable(t) {
337
- if (!t) return [];
338
- const e = t.match(/\${(.*?)}/);
339
- return e ? e[1].split(".") : [];
340
- }
341
- function getModelFieldFromPageContext(t, e) {
342
- if (!e.modelFieldsMap) return;
343
- let n = null;
344
- for (let o = 0; o < t.length; o++) {
345
- const a = t[o];
346
- o + 1 === t.length && (n = e.modelFieldsMap[a]);
316
+ function getMonitorFieldValues(e, t) {
317
+ let o = "";
318
+ for (const n of e) o += "_" + getVariableValue(t, n);
319
+ return o;
320
+ }
321
+ function getFormPropName(e) {
322
+ return e && e.indexOf("${") >= 0 ? e.substring(e.indexOf(".") + 1, e.lastIndexOf("}")) : e;
323
+ }
324
+ function getSizeConfig(e, t) {
325
+ const o = getPageModeType(e);
326
+ let n;
327
+ return t.props && t.props.size && t.props.size[o] && (n = t.props.size[o]), !n && t.props && t.props.size && (n = t.props.size.pc), n;
328
+ }
329
+ function getPageModeType(e) {
330
+ let t = e.dimensions;
331
+ return t || (t = "pc"), t;
332
+ }
333
+ function isPromise(e) {
334
+ return e && "[object Promise]" === Object.prototype.toString.call(e);
335
+ }
336
+ function decomposeVariable(e) {
337
+ if (!e) return [];
338
+ const t = e.match(/\${(.*?)}/);
339
+ return t ? t[1].split(".") : [];
340
+ }
341
+ function getModelFieldFromPageContext(e, t) {
342
+ if (!t.modelFieldsMap) return;
343
+ let o = null;
344
+ for (let n = 0; n < e.length; n++) {
345
+ const a = e[n];
346
+ n + 1 === e.length && (o = t.modelFieldsMap[a]);
347
347
  }
348
- return n;
348
+ return o;
349
349
  }
350
- function isNumberDataType(t) {
351
- return "INTEGER" === t || "LONG" === t || "DOUBLE" === t || "FLOAT_COM" === t;
350
+ function isNumberDataType(e) {
351
+ return "INTEGER" === e || "LONG" === e || "DOUBLE" === e || "FLOAT_COM" === e;
352
352
  }
353
- function isDateDataType(t) {
354
- return "DATE" === (t = t ? t.toUpperCase() : "") || "TIME" === t || "DATETIME" === t || "TIMESTAMP" === t;
353
+ function isDateDataType(e) {
354
+ return "DATE" === (e = e ? e.toUpperCase() : "") || "TIME" === e || "DATETIME" === e || "TIMESTAMP" === e;
355
355
  }
356
356
  export {
357
357
  autoSetAfterSelect,