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