super-page-runtime 2.2.92 → 2.3.0-sit10

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 (23) hide show
  1. package/dist/es/components/runtime/utils/api/page-expose-util.js +25 -25
  2. package/dist/es/components/runtime/utils/events/event-util.js +109 -108
  3. package/dist/es/components/runtime/utils/events/print-label.js +53 -40
  4. package/dist/es/components/runtime/utils/events/standard-event.js +127 -115
  5. package/dist/es/components/runtime/utils/page-helper-util.d.ts +13 -2
  6. package/dist/es/components/runtime/utils/page-helper-util.js +169 -162
  7. package/dist/es/components/runtime/utils/page-init-util.js +10 -7
  8. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +2 -2
  9. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +22 -22
  10. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +16 -16
  11. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +21 -21
  12. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +18 -18
  13. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +17 -17
  14. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +53 -54
  15. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +206 -175
  16. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +111 -91
  17. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +31 -10
  18. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +46 -38
  19. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +41 -25
  20. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +21 -21
  21. package/dist/es/index.d.ts +2 -2
  22. package/dist/es/index.js +2 -1
  23. package/package.json +2 -2
@@ -4,122 +4,125 @@ 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) {
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) {
8
11
  if (!t.props || !t.props.dataOrigin) return;
9
12
  if (t.name && "table" === t.name) return;
10
- const o = t.props.dataOrigin, n = { uuid: t.uuid };
11
- if ("optionGroup" == o.optionValueSetType) n.type = "optionGroup", n.props = { code: o.optionGroup };
12
- else if ("dynamicData" == o.optionValueSetType) n.type = "dynamicData", n.filterType = o.filterType, n.props = { code: o.dynamicDataSourceCode };
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 };
13
16
  else if ("dataTable" == o.optionValueSetType) {
14
- n.filterType = o.filterType;
15
- const t2 = getTableQueryInfo(o, e);
16
- Object.assign(n, t2);
17
+ a.filterType = o.filterType;
18
+ const t2 = getTableQueryInfo(o, e, n);
19
+ Object.assign(a, t2);
17
20
  } else if ("service" == o.optionValueSetType) {
18
- n.filterType = o.filterType;
19
- const t2 = getServiceQueryInfo(o, e);
20
- Object.assign(n, t2);
21
+ a.filterType = o.filterType;
22
+ const t2 = getServiceQueryInfo(o, e, n);
23
+ Object.assign(a, t2);
21
24
  }
22
- return n.type ? n : void 0;
25
+ return a.type ? a : void 0;
23
26
  }
24
- function getTableQueryInfo(t, e) {
27
+ function getTableQueryInfo(t, e, n) {
25
28
  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) {
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) {
27
30
  const e2 = [];
28
- for (const o2 of t.sortFields) o2.name && e2.push({ prop: o2.name, order: o2.type ? o2.type : "asc" });
31
+ for (const n2 of t.sortFields) n2.name && e2.push({ prop: n2.name, order: n2.type ? n2.type : "asc" });
29
32
  o.props.sorts = e2;
30
33
  }
31
- const n = [];
34
+ const a = [];
32
35
  if (t.filterList) {
33
36
  const e2 = [];
34
- for (const o2 of t.filterList) {
35
- if (!o2.propName) continue;
36
- o2.propDbName || (o2.propDbName = o2.propName);
37
+ for (const n2 of t.filterList) {
38
+ if (!n2.propName) continue;
39
+ n2.propDbName || (n2.propDbName = n2.propName);
37
40
  const t2 = {};
38
- Object.assign(t2, o2);
39
- const r2 = getParamNames(o2.propValue);
40
- for (const t3 of r2) t3 && (t3.startsWith("${data.") || t3.startsWith("${task.") || t3.startsWith("${page.")) && (n.includes(t3) || n.push(t3));
41
- o2.propValue, e2.push(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);
42
45
  }
43
46
  o.props.searchForm = e2;
44
47
  }
45
- o.props.monitorFields = n;
48
+ o.props.monitorFields = a;
46
49
  const r = [];
47
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);
48
51
  return o.props.queryFields = r, o.props.pageSize = t.displayQuantity, o;
49
52
  }
50
- function getServiceQueryInfo(t, e) {
53
+ function getServiceQueryInfo(t, e, n) {
51
54
  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) {
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) {
53
56
  const e2 = [];
54
- for (const o2 of t.serviceInputs) {
55
- if (!o2.name || o2.value) continue;
57
+ for (const n2 of t.serviceInputs) {
58
+ if (!n2.name || n2.value) continue;
56
59
  const t2 = {};
57
- Object.assign(t2, o2), e2.push(t2);
60
+ Object.assign(t2, n2), e2.push(t2);
58
61
  }
59
62
  o.props.inputs = e2;
60
63
  }
61
64
  return o.props.dataSetField = t.serviceDataSetField, o.props.valueField = t.serviceValueField, o.props.labelField = t.serviceLabelField, o;
62
65
  }
63
- function updateChartDatasources(t, e, o, n) {
64
- return new Promise((r, a) => {
65
- if (!e || 0 == e.length) return void a(new Error("无需查询的统计图配置!"));
66
+ function updateChartDatasources(t, e, n, o) {
67
+ return new Promise((a, r) => {
68
+ if (!e || 0 == e.length) return void r(new Error("无需查询的统计图配置!"));
66
69
  const s = deepCopy(e);
67
70
  s.forEach((e2) => {
68
- const o2 = e2.services;
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, r2 = e4.value;
73
- o2[0].serviceInParams[n2] = getValueFromVariable(t.entity, r2);
74
- }), delete o2[0].serviceInputs);
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);
75
78
  }
76
79
  });
77
80
  const i = t.entity ? t.entity : {}, u = {};
78
- i.request && Object.assign(u, i.request), i.page && Object.assign(u, i.page), o && Object.assign(u, o);
81
+ i.request && Object.assign(u, i.request), i.page && Object.assign(u, i.page), n && Object.assign(u, n);
79
82
  const l = {};
80
83
  i.task && Object.assign(l, i.task);
81
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";
82
85
  http.post(f, c, { headers: { customSystem: t.systemCode } }).then((e2) => {
83
86
  var _a, _b;
84
87
  t.chartDataSourceMap || (t.chartDataSourceMap = {});
85
- for (const o2 in e2) {
86
- t.chartDataSourceMap[o2] = e2[o2];
87
- const r2 = getComponentRef(t, o2);
88
- if (r2) {
89
- const a2 = r2.getConfigure();
90
- if ((!n || a2 && (void 0 === a2.initializationQuery || a2.initializationQuery)) && r2.updateChartDatas && (r2.updateChartDatas(e2[o2]), (_b = (_a = a2.runtime) == null ? void 0 : _a.dataConfig) == null ? void 0 : _b.resultSet)) {
91
- const n2 = e2[o2] && e2[o2].length > 0 ? e2[o2][0] : {}, r3 = n2 && n2.result ? n2.result : {};
88
+ for (const n2 in e2) {
89
+ t.chartDataSourceMap[n2] = e2[n2];
90
+ const a2 = getComponentRef(t, n2);
91
+ if (a2) {
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 : {};
92
95
  let s2 = null;
93
- a2.serviceDataField ? s2 = r3[a2.serviceDataField] : r3 && (s2 = Array.isArray(r3) ? r3 : [r3]), s2 || (s2 = []), setValueForVariableName(t.entity, a2.runtime.dataConfig.resultSet, s2);
96
+ r2.serviceDataField ? s2 = a3[r2.serviceDataField] : a3 && (s2 = Array.isArray(a3) ? a3 : [a3]), s2 || (s2 = []), setValueForVariableName(t.entity, r2.runtime.dataConfig.resultSet, s2);
94
97
  }
95
98
  }
96
99
  }
97
- r(e2);
100
+ a(e2);
98
101
  }).catch((t2) => {
99
- a(t2);
102
+ r(t2);
100
103
  });
101
104
  });
102
105
  }
103
106
  function updateChartDatasourcesByComponent(t, e) {
104
- const o = t.initChartServiceConfigs.find((t2) => t2.uuid === e);
105
- o && updateChartDatasources(t, [o], null, false);
106
- }
107
- function updateOptionDatasources(t, e, o) {
108
- return new Promise((n, r) => {
109
- if (!e || 0 == e.length) return void r(new Error("无需查询的配置!"));
110
- const a = t.entity ? t.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: e, systemCode: t.systemCode, query: o }, u = t.backendUrl, l = getBaseUrl(u, t.isTest) + "/common/common-data/find-datas";
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";
113
116
  http.post(l, i).then((e2) => {
114
117
  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]);
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]);
119
122
  }
120
- n(e2);
123
+ o(e2);
121
124
  }).catch((t2) => {
122
- r(t2);
125
+ a(t2);
123
126
  });
124
127
  });
125
128
  }
@@ -127,8 +130,8 @@ function getOptionDatasFromPage(t, e) {
127
130
  return getComponentOptionDatasFromPage(t, e.uuid);
128
131
  }
129
132
  function getComponentOptionDatasFromPage(t, e) {
130
- const o = getOptionDatasSourceMap(t)[e];
131
- return o || [];
133
+ const n = getOptionDatasSourceMap(t)[e];
134
+ return n || [];
132
135
  }
133
136
  function getOptionDatasSourceMap(t) {
134
137
  if (!t || !t.optionSourceMap) return {};
@@ -139,65 +142,65 @@ function getChartDatasFromPage(t, e) {
139
142
  if (!t || !t.chartDataSourceMap || !e) return null;
140
143
  return t.chartDataSourceMap[e.uuid];
141
144
  }
142
- function queryOptionDatasources(t, e, o) {
143
- return updateOptionDatasources(t, e ? [e] : [], o);
145
+ function queryOptionDatasources(t, e, n) {
146
+ return updateOptionDatasources(t, e ? [e] : [], n);
144
147
  }
145
- function autoSetAfterSelect(t, e, o, n) {
146
- if (!o || 0 == o.length) return;
148
+ function autoSetAfterSelect(t, e, n, o, a = []) {
149
+ if (!n || 0 == n.length) return;
147
150
  const r = 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;
152
- if (!o2 || !o2.startsWith("${")) continue;
153
- o2 = o2.substring(2, o2.length - 1);
154
- setVariableValue(r, o2.split("."), e2.join(","));
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(","));
155
158
  }
156
159
  }
157
160
  function getValuesByField(t, e) {
158
161
  if (t) {
159
- const o = [];
160
- for (const n of t) {
161
- let t2 = n[e];
162
- null != t2 && null != t2 || (t2 = ""), o.push(t2);
162
+ const n = [];
163
+ for (const o of t) {
164
+ let t2 = o[e];
165
+ null != t2 && null != t2 || (t2 = ""), n.push(t2);
163
166
  }
164
- return o;
167
+ return n;
165
168
  }
166
169
  return [""];
167
170
  }
168
171
  function getVariableValue(t, e) {
169
172
  if (!t || !e || 0 == e.length) return;
170
- let o = t;
173
+ let n = t;
171
174
  for (let t2 = 0; t2 < e.length; t2++) {
172
- if (null == o) return o;
173
- o = o[e[t2]];
175
+ if (null == n) return n;
176
+ n = n[e[t2]];
174
177
  }
175
- return o;
178
+ return n;
176
179
  }
177
- function setValueForVariableName(t, e, o) {
180
+ function setValueForVariableName(t, e, n) {
178
181
  if (!e || !e.startsWith("${")) return;
179
- setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."), o);
182
+ setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."), n);
180
183
  }
181
- function setVariableValue(t, e, o) {
184
+ function setVariableValue(t, e, n) {
182
185
  if (!t || !e || 0 == e.length) return;
183
- let n = t;
186
+ let o = t;
184
187
  for (let t2 = 0; t2 < e.length; t2++) {
185
- const r = e[t2];
186
- t2 + 1 === e.length ? n[r] = o : (void 0 === n[r] && (n[r] = {}), n = n[r]);
188
+ const a = e[t2];
189
+ t2 + 1 === e.length ? o[a] = n : (void 0 === o[a] && (o[a] = {}), o = o[a]);
187
190
  }
188
191
  }
189
- function setVariableValueWithProp(t, e, o) {
192
+ function setVariableValueWithProp(t, e, n) {
190
193
  if (!t || !e) return;
191
- setVariableValue(t, e.split("."), o);
194
+ setVariableValue(t, e.split("."), n);
192
195
  }
193
196
  function formatVariableValue(t, e) {
194
197
  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 r = n[t2], 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
- e = e.replace(r, null == a ? "" : a);
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);
201
+ if (r && "[object Date]" === Object.prototype.toString.call(r)) return dayjs(r).format("YYYY-MM-DD HH:mm:ss");
202
+ if (r && "number" == typeof r) return r;
203
+ e = e.replace(a, null == r ? "" : r);
201
204
  }
202
205
  return e;
203
206
  }
@@ -206,60 +209,60 @@ function getParamNames(t) {
206
209
  const e = t.match(/\$\{[^\{|\}]+\}/g);
207
210
  return e || [];
208
211
  }
209
- function formatValueByType(t, e, o) {
212
+ function formatValueByType(t, e, n) {
210
213
  if (!e || "" == t || null == t || null == t) return t;
211
- if (o = o || {}, "number" == e || "percent" == e) {
214
+ if (n = n || {}, "number" == e || "percent" == e) {
212
215
  if (isNaN(t)) return t;
213
- let n = parseInt(o.decimalDigit);
214
- if ((null == n || isNaN(n)) && (n = -1), t = parseFloat(t), "percent" == e && (t *= 100), n > -1 && (t = parseFloat(t.toFixed(n))), "percent" == e) 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 += "%";
215
218
  else {
216
- if (o.thousandsSeparator) {
219
+ if (n.thousandsSeparator) {
217
220
  const e2 = t.toString().split(".");
218
221
  e2[0] = e2[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), t = e2.length > 1 ? e2.join(".") : e2[0];
219
222
  }
220
- o.symbol && (t = o.symbol + "" + t);
223
+ n.symbol && (t = n.symbol + "" + t);
221
224
  }
222
225
  return t;
223
226
  }
224
227
  if ("date" == e || "time" == e) {
225
- let n = "";
226
- return "date" == e ? (n = o.dateFormat, n || (n = "YYYY-MM-DD")) : (n = o.timeFormat, n || (n = "HH:mm:ss")), dayjs(t).format(n);
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
230
  }
228
- return "custom" == e && o.formatEventUuid, t;
231
+ return "custom" == e && n.formatEventUuid, t;
229
232
  }
230
- function getValueFromVariable(t, e, o) {
233
+ function getValueFromVariable(t, e, n) {
231
234
  if (null == e || null == e) return e;
232
235
  if (e.startsWith("${") && e.endsWith("}")) {
233
- let n = e.substring(2, e.length - 1), r = null, a = null;
234
- if (n.startsWith("data.")) n = n.substring(5), a = t.data, r = "data";
235
- else if (n.startsWith("page.")) n = n.substring(5), r = "page", a = t.page;
236
- else if (n.startsWith("task.")) n = n.substring(5), r = "task", a = t.task;
237
- else if (n.startsWith("request.")) n = n.substring(8), r = "request", a = t.request;
238
- else if (n.startsWith("context.")) n = n.substring(8), r = "context", a = t.context;
239
- else if (n.startsWith("system.")) n = n.substring(7), r = "system", a = t.system;
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;
240
243
  else {
241
- if (n.startsWith("fixed.")) return n.substring(6);
242
- n.startsWith("row.") && (n = n.substring(4), a = o, r = "row");
244
+ if (o.startsWith("fixed.")) return o.substring(6);
245
+ o.startsWith("row.") && (o = o.substring(4), r = n, a = "row");
243
246
  }
244
- return n ? getValueFromSource(a, n, r) : "";
247
+ return o ? getValueFromSource(r, o, a) : "";
245
248
  }
246
249
  return e;
247
250
  }
248
- function getValueFromSource(t, e, o) {
249
- if ("context" != o && !t || !e) return;
250
- const n = e.indexOf(".");
251
- if (n > -1) {
252
- const r = e.substring(0, n), a = e.substring(n + 1);
253
- let s = t[r];
254
- return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, a, o);
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);
255
258
  }
256
- if ("context" == o) {
259
+ if ("context" == n) {
257
260
  if ("currentDate" == e || "currentTime" == e) return /* @__PURE__ */ new Date();
258
261
  if (e.startsWith("currentDate") && e.length > 11) {
259
- const t2 = e.substring(11), o2 = t2.substring(0, 1);
260
- let n2 = parseInt(t2.substring(1, t2.length - 1), 10);
261
- const r = t2.substring(t2.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
+ 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;
263
266
  }
264
267
  if (!t) return;
265
268
  }
@@ -271,17 +274,17 @@ function caculateShowCondition(pageContext, showConditions, row) {
271
274
  let conditions = "";
272
275
  const maxLen = showConditions.length;
273
276
  for (let t = 0; t < maxLen; t++) {
274
- const e = showConditions[t], o = e.propName;
275
- let n = e.operator;
276
- if (!o || "" === o) continue;
277
- n || (n = "EQ");
278
- const r = getValueFromVariable(entityData, o, row);
279
- let a = getValueFromVariable(entityData, e.propValue, row);
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);
280
283
  const s = e.dataType;
281
- "CONTAIN" != n && "NOT_CONTAIN" != n || r && !r.includes && (n = "CONTAIN" == n ? "EQ" : "NET");
284
+ "CONTAIN" != o && "NOT_CONTAIN" != o || a && !a.includes && (o = "CONTAIN" == o ? "EQ" : "NET");
282
285
  let i = e.variableIsNull, u;
283
- if (i || (i = "null"), "IS_NULL" !== n && "IS_NOT_NULL" !== n && (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);
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);
285
288
  } catch (t2) {
286
289
  u = false;
287
290
  }
@@ -294,35 +297,34 @@ function caculateShowCondition(pageContext, showConditions, row) {
294
297
  }
295
298
  return !conditions || eval("(" + conditions + ")");
296
299
  }
297
- function monitorFieldChange(t, e, o) {
298
- if (!o || !t || !e || 0 == e.length) return;
299
- const n = [], r = [];
300
+ function monitorFieldChange(t, e, n) {
301
+ if (!n || !t || !e || 0 == e.length) return;
302
+ const o = [], a = [];
300
303
  for (let t2 of e) if (t2.startsWith("${")) {
301
304
  t2 = t2.substring(2, t2.length - 1);
302
305
  const e2 = t2.split(".");
303
- "page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (n.push(e2), r.includes(e2[0]) || r.push(e2[0]));
306
+ "page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (o.push(e2), a.includes(e2[0]) || a.push(e2[0]));
304
307
  }
305
- const a = t.entity;
306
- let s = getMonitorFieldValues(n, a), i = false;
307
- for (const t2 of r) watch(a[t2], () => {
308
- i && clearTimeout(i), i = setTimeout(function() {
309
- const t3 = getMonitorFieldValues(n, a);
310
- s != t3 && (s = t3, o());
308
+ let r = getMonitorFieldValues(o, t.entity), s = false;
309
+ for (const e2 of a) watch(t.entity[e2], () => {
310
+ s && clearTimeout(s), s = setTimeout(function() {
311
+ const e3 = getMonitorFieldValues(o, t.entity);
312
+ r != e3 && (r = e3, n());
311
313
  }, 200);
312
314
  });
313
315
  }
314
316
  function getMonitorFieldValues(t, e) {
315
- let o = "";
316
- for (const n of t) o += "_" + getVariableValue(e, n);
317
- return o;
317
+ let n = "";
318
+ for (const o of t) n += "_" + getVariableValue(e, o);
319
+ return n;
318
320
  }
319
321
  function getFormPropName(t) {
320
322
  return t && t.indexOf("${") >= 0 ? t.substring(t.indexOf(".") + 1, t.lastIndexOf("}")) : t;
321
323
  }
322
324
  function getSizeConfig(t, e) {
323
- const o = getPageModeType(t);
324
- let n;
325
- 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
+ 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;
326
328
  }
327
329
  function getPageModeType(t) {
328
330
  let e = t.dimensions;
@@ -338,16 +340,19 @@ function decomposeVariable(t) {
338
340
  }
339
341
  function getModelFieldFromPageContext(t, e) {
340
342
  if (!e.modelFieldsMap) return;
341
- let o = null;
342
- for (let n = 0; n < t.length; n++) {
343
- const r = t[n];
344
- n + 1 === t.length && (o = e.modelFieldsMap[r]);
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]);
345
347
  }
346
- return o;
348
+ return n;
347
349
  }
348
350
  function isNumberDataType(t) {
349
351
  return "INTEGER" === t || "LONG" === t || "DOUBLE" === t || "FLOAT_COM" === t;
350
352
  }
353
+ function isDateDataType(t) {
354
+ return "DATE" === (t = t ? t.toUpperCase() : "") || "TIME" === t || "DATETIME" === t || "TIMESTAMP" === t;
355
+ }
351
356
  export {
352
357
  autoSetAfterSelect,
353
358
  caculateShowCondition,
@@ -356,6 +361,7 @@ export {
356
361
  formatVariableValue,
357
362
  getChartDatasFromPage,
358
363
  getComponentOptionConfigs,
364
+ getComponentOptionConfigsBase,
359
365
  getComponentOptionDatasFromPage,
360
366
  getFormPropName,
361
367
  getModelFieldFromPageContext,
@@ -366,6 +372,7 @@ export {
366
372
  getValueFromSource,
367
373
  getValueFromVariable,
368
374
  getVariableValue,
375
+ isDateDataType,
369
376
  isNumberDataType,
370
377
  isPromise,
371
378
  monitorFieldChange,
@@ -1,7 +1,7 @@
1
1
  import e from "agilebuilder-ui/src/utils/request";
2
2
  import { getAdditionalParamMap as t } from "./events/standard-event.js";
3
3
  import { PageDimensions as s } from "./interfaces/page-design-types.js";
4
- import { getFormPropName as i, getValueFromVariable as n, setVariableValue as o, formatVariableValue as r } from "./page-helper-util.js";
4
+ import { getFormPropName as i, getVariableValue as n, setVariableValue as o, formatVariableValue as r } from "./page-helper-util.js";
5
5
  import { getSessionCache as l } from "agilebuilder-ui/src/utils/auth";
6
6
  import { functions as a } from "./api/page-expose-util.js";
7
7
  import { isWorkflowPage as p, deepCopy as u } from "./common-util.js";
@@ -84,12 +84,15 @@ function E(e2, t2) {
84
84
  function w(e2, t2, s2) {
85
85
  const i2 = E(t2, s2), r2 = e2.entity;
86
86
  if (null == r2.data.ID && null == r2.data.id) {
87
- let l2, a2, p2 = false;
88
- t2 && (l2 = t2.props.base ? t2.props.base : {}, a2 = t2.name, p2 = l2.multiple);
89
- const u2 = n(r2, s2, null);
90
- if (null == u2) {
91
- const t3 = P(e2, l2 ? l2.defaultValue : null, a2, p2);
92
- null != t3 && o(r2, i2, t3);
87
+ let s3, l2, a2 = false;
88
+ t2 && (s3 = t2.props.base ? t2.props.base : {}, l2 = t2.name, a2 = s3.multiple);
89
+ const p2 = n(r2, i2);
90
+ if (null == p2) {
91
+ const t3 = s3 ? s3.defaultValue : null;
92
+ if (t3) {
93
+ const s4 = P(e2, t3, l2, a2);
94
+ null != s4 && o(r2, i2, s4);
95
+ }
93
96
  }
94
97
  }
95
98
  return i2;
@@ -1,4 +1,4 @@
1
- import { defineComponent as e, ref as t, computed as l, onMounted as n, nextTick as o, resolveComponent as u, createBlock as i, openBlock as a, normalizeStyle as r, normalizeClass as p, unref as s, withCtx as c, createElementBlock as g, Fragment as f, createTextVNode as m, toDisplayString as d, createVNode as v, renderList as y } from "vue";
1
+ import { defineComponent as e, ref as t, computed as l, onMounted as n, nextTick as o, resolveComponent as u, createBlock as i, openBlock as a, normalizeStyle as r, normalizeClass as p, unref as s, withCtx as c, createElementBlock as g, Fragment as f, createTextVNode as d, toDisplayString as m, createVNode as v, renderList as y } from "vue";
2
2
  import { ArrowDown as b } from "@element-plus/icons-vue";
3
3
  import { formatVariableValue as C } from "../../../../utils/page-helper-util.js";
4
4
  import { handleAfterInitEvent as k, handleEvent as x, handleFormEvent as _ } from "../../../../utils/events/event-util.js";
@@ -33,7 +33,7 @@ const z = { key: 1 }, h = e({ __name: "dropdown-runtime", props: { pageContext:
33
33
  });
34
34
  }), (e3, t2) => {
35
35
  const l2 = u("el-button"), n2 = u("el-icon"), o2 = u("el-text"), C2 = u("el-dropdown-item"), k2 = u("el-dropdown-menu"), _2 = u("el-dropdown");
36
- return a(), i(_2, { ref_key: "componentRef", ref: V, class: p(s(A)), style: r(s(T)), placement: B.value.placement, "split-button": B.value.splitButton, disabled: "disabled" === B.value.state, type: B.value.buttonType, size: B.value.size, trigger: B.value.trigger, onVisibleChange: S }, { dropdown: c(() => [v(k2, null, { default: c(() => [(a(true), g(f, null, y(s(O), (t3, l3) => (a(), i(C2, { key: t3, onClick: (l4) => s(x)(l4, e3.pageContext, e3.configure, "menuClick", { menuItem: t3 }) }, { default: c(() => [m(d(s(w)(t3.label)), 1)]), _: 2 }, 1032, ["onClick"]))), 128))]), _: 1 })]), default: c(() => ["button" === B.value.triggerElement ? (a(), g(f, { key: 0 }, [B.value.splitButton ? (a(), g("span", z, d(B.value.title), 1)) : (a(), i(l2, { key: 0, size: B.value.size, type: B.value.buttonType, onClick: t2[0] || (t2[0] = (t3) => s(x)(t3, e3.pageContext, e3.configure, "menuClick")) }, { default: c(() => [m(d(s(w)(B.value.title)), 1)]), _: 1 }, 8, ["size", "type"]))], 64)) : (a(), i(o2, { key: 1 }, { default: c(() => [m(d(s(w)(B.value.title)) + " ", 1), v(n2, null, { default: c(() => [v(s(b))]), _: 1 })]), _: 1 }))]), _: 1 }, 8, ["class", "style", "placement", "split-button", "disabled", "type", "size", "trigger"]);
36
+ return a(), i(_2, { ref_key: "componentRef", ref: V, class: p(s(A)), style: r(s(T)), placement: B.value.placement, "split-button": B.value.splitButton, disabled: "disabled" === B.value.state, type: B.value.buttonType, size: B.value.size, trigger: B.value.trigger, onVisibleChange: S }, { dropdown: c(() => [v(k2, null, { default: c(() => [(a(true), g(f, null, y(s(O), (t3, l3) => (a(), i(C2, { key: t3, onClick: (l4) => s(x)(l4, e3.pageContext, e3.configure, "click", { menuItem: t3 }) }, { default: c(() => [d(m(s(w)(t3.label)), 1)]), _: 2 }, 1032, ["onClick"]))), 128))]), _: 1 })]), default: c(() => ["button" === B.value.triggerElement ? (a(), g(f, { key: 0 }, [B.value.splitButton ? (a(), g("span", z, m(B.value.title), 1)) : (a(), i(l2, { key: 0, size: B.value.size, type: B.value.buttonType }, { default: c(() => [d(m(s(w)(B.value.title)), 1)]), _: 1 }, 8, ["size", "type"]))], 64)) : (a(), i(o2, { key: 1 }, { default: c(() => [d(m(s(w)(B.value.title)) + " ", 1), v(n2, null, { default: c(() => [v(s(b))]), _: 1 })]), _: 1 }))]), _: 1 }, 8, ["class", "style", "placement", "split-button", "disabled", "type", "size", "trigger"]);
37
37
  };
38
38
  } });
39
39
  export {