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