super-page-runtime 2.2.23 → 2.2.29-tmp1

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