super-page-runtime 2.2.92 → 2.3.0-sit1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/runtime/utils/api/page-expose-util.js +25 -25
- package/dist/es/components/runtime/utils/events/event-util.js +109 -108
- package/dist/es/components/runtime/utils/events/print-label.js +53 -40
- package/dist/es/components/runtime/utils/events/standard-event.js +127 -115
- package/dist/es/components/runtime/utils/page-helper-util.d.ts +13 -2
- package/dist/es/components/runtime/utils/page-helper-util.js +169 -162
- package/dist/es/components/runtime/utils/page-init-util.js +10 -7
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +22 -22
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +16 -16
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +21 -21
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +18 -18
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +17 -17
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +53 -54
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +206 -175
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +111 -91
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +31 -10
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +46 -38
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +39 -24
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +21 -21
- package/dist/es/index.d.ts +2 -2
- package/dist/es/index.js +2 -1
- 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,
|
|
11
|
-
if ("optionGroup" == o.optionValueSetType)
|
|
12
|
-
else if ("dynamicData" == o.optionValueSetType)
|
|
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
|
-
|
|
15
|
-
const t2 = getTableQueryInfo(o, e);
|
|
16
|
-
Object.assign(
|
|
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
|
-
|
|
19
|
-
const t2 = getServiceQueryInfo(o, e);
|
|
20
|
-
Object.assign(
|
|
21
|
+
a.filterType = o.filterType;
|
|
22
|
+
const t2 = getServiceQueryInfo(o, e, n);
|
|
23
|
+
Object.assign(a, t2);
|
|
21
24
|
}
|
|
22
|
-
return
|
|
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
|
|
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
|
|
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
|
|
34
|
+
const a = [];
|
|
32
35
|
if (t.filterList) {
|
|
33
36
|
const e2 = [];
|
|
34
|
-
for (const
|
|
35
|
-
if (!
|
|
36
|
-
|
|
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,
|
|
39
|
-
const
|
|
40
|
-
for (const t3 of
|
|
41
|
-
|
|
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 =
|
|
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
|
|
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
|
|
55
|
-
if (!
|
|
57
|
+
for (const n2 of t.serviceInputs) {
|
|
58
|
+
if (!n2.name || n2.value) continue;
|
|
56
59
|
const t2 = {};
|
|
57
|
-
Object.assign(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,
|
|
64
|
-
return new Promise((
|
|
65
|
-
if (!e || 0 == e.length) return void
|
|
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
|
|
69
|
-
if (
|
|
70
|
-
const e3 =
|
|
71
|
-
e3 && (
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
}), delete
|
|
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),
|
|
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
|
|
86
|
-
t.chartDataSourceMap[
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
if ((!
|
|
91
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
100
|
+
a(e2);
|
|
98
101
|
}).catch((t2) => {
|
|
99
|
-
|
|
102
|
+
r(t2);
|
|
100
103
|
});
|
|
101
104
|
});
|
|
102
105
|
}
|
|
103
106
|
function updateChartDatasourcesByComponent(t, e) {
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
function updateOptionDatasources(t, e,
|
|
108
|
-
return new Promise((
|
|
109
|
-
if (!e || 0 == e.length) return void
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const i = { entityMap:
|
|
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
|
|
116
|
-
t.optionSourceMap[
|
|
117
|
-
const
|
|
118
|
-
|
|
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
|
-
|
|
123
|
+
o(e2);
|
|
121
124
|
}).catch((t2) => {
|
|
122
|
-
|
|
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
|
|
131
|
-
return
|
|
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,
|
|
143
|
-
return updateOptionDatasources(t, e ? [e] : [],
|
|
145
|
+
function queryOptionDatasources(t, e, n) {
|
|
146
|
+
return updateOptionDatasources(t, e ? [e] : [], n);
|
|
144
147
|
}
|
|
145
|
-
function autoSetAfterSelect(t, e, o,
|
|
146
|
-
if (!
|
|
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
|
|
149
|
-
if (!t2.source || !t2.target) continue;
|
|
150
|
-
const e2 = getValuesByField(
|
|
151
|
-
let
|
|
152
|
-
if (!
|
|
153
|
-
|
|
154
|
-
setVariableValue(r,
|
|
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
|
|
160
|
-
for (const
|
|
161
|
-
let t2 =
|
|
162
|
-
null != t2 && null != t2 || (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
|
|
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
|
|
173
|
+
let n = t;
|
|
171
174
|
for (let t2 = 0; t2 < e.length; t2++) {
|
|
172
|
-
if (null ==
|
|
173
|
-
|
|
175
|
+
if (null == n) return n;
|
|
176
|
+
n = n[e[t2]];
|
|
174
177
|
}
|
|
175
|
-
return
|
|
178
|
+
return n;
|
|
176
179
|
}
|
|
177
|
-
function setValueForVariableName(t, e,
|
|
180
|
+
function setValueForVariableName(t, e, n) {
|
|
178
181
|
if (!e || !e.startsWith("${")) return;
|
|
179
|
-
setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."),
|
|
182
|
+
setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."), n);
|
|
180
183
|
}
|
|
181
|
-
function setVariableValue(t, e,
|
|
184
|
+
function setVariableValue(t, e, n) {
|
|
182
185
|
if (!t || !e || 0 == e.length) return;
|
|
183
|
-
let
|
|
186
|
+
let o = t;
|
|
184
187
|
for (let t2 = 0; t2 < e.length; t2++) {
|
|
185
|
-
const
|
|
186
|
-
t2 + 1 === e.length ?
|
|
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,
|
|
192
|
+
function setVariableValueWithProp(t, e, n) {
|
|
190
193
|
if (!t || !e) return;
|
|
191
|
-
setVariableValue(t, e.split("."),
|
|
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
|
|
196
|
-
for (const t2 in
|
|
197
|
-
const
|
|
198
|
-
if (
|
|
199
|
-
if (
|
|
200
|
-
e = e.replace(
|
|
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,
|
|
212
|
+
function formatValueByType(t, e, n) {
|
|
210
213
|
if (!e || "" == t || null == t || null == t) return t;
|
|
211
|
-
if (
|
|
214
|
+
if (n = n || {}, "number" == e || "percent" == e) {
|
|
212
215
|
if (isNaN(t)) return t;
|
|
213
|
-
let
|
|
214
|
-
if ((null ==
|
|
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 (
|
|
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
|
-
|
|
223
|
+
n.symbol && (t = n.symbol + "" + t);
|
|
221
224
|
}
|
|
222
225
|
return t;
|
|
223
226
|
}
|
|
224
227
|
if ("date" == e || "time" == e) {
|
|
225
|
-
let
|
|
226
|
-
return "date" == 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
230
|
}
|
|
228
|
-
return "custom" == e &&
|
|
231
|
+
return "custom" == e && n.formatEventUuid, t;
|
|
229
232
|
}
|
|
230
|
-
function getValueFromVariable(t, e,
|
|
233
|
+
function getValueFromVariable(t, e, n) {
|
|
231
234
|
if (null == e || null == e) return e;
|
|
232
235
|
if (e.startsWith("${") && e.endsWith("}")) {
|
|
233
|
-
let
|
|
234
|
-
if (
|
|
235
|
-
else if (
|
|
236
|
-
else if (
|
|
237
|
-
else if (
|
|
238
|
-
else if (
|
|
239
|
-
else if (
|
|
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 (
|
|
242
|
-
|
|
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
|
|
247
|
+
return o ? getValueFromSource(r, o, a) : "";
|
|
245
248
|
}
|
|
246
249
|
return e;
|
|
247
250
|
}
|
|
248
|
-
function getValueFromSource(t, e,
|
|
249
|
-
if ("context" !=
|
|
250
|
-
const
|
|
251
|
-
if (
|
|
252
|
-
const
|
|
253
|
-
let s = t[
|
|
254
|
-
return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s,
|
|
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" ==
|
|
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),
|
|
260
|
-
let
|
|
261
|
-
const
|
|
262
|
-
return
|
|
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],
|
|
275
|
-
let
|
|
276
|
-
if (!
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
let
|
|
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" !=
|
|
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" !==
|
|
284
|
-
u = executeExpression(
|
|
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,
|
|
298
|
-
if (!
|
|
299
|
-
const
|
|
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] || (
|
|
306
|
+
"page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (o.push(e2), a.includes(e2[0]) || a.push(e2[0]));
|
|
304
307
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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
|
|
316
|
-
for (const
|
|
317
|
-
return
|
|
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
|
|
324
|
-
let
|
|
325
|
-
return e.props && e.props.size && e.props.size[
|
|
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
|
|
342
|
-
for (let
|
|
343
|
-
const
|
|
344
|
-
|
|
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
|
|
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,
|
|
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
|
|
88
|
-
t2 && (
|
|
89
|
-
const
|
|
90
|
-
if (null ==
|
|
91
|
-
const t3 =
|
|
92
|
-
|
|
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
|
|
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, "
|
|
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 {
|