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