super-page-runtime 2.3.0-tmp2 → 2.3.2-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/validator-util.js +94 -87
- package/dist/es/components/runtime/utils/page-helper-util.d.ts +4 -1
- package/dist/es/components/runtime/utils/page-helper-util.js +152 -152
- package/dist/es/components/runtime/utils/page-init-util.js +5 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +17 -17
- 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 +81 -29
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +185 -158
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +130 -114
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +31 -10
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +15 -15
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +15 -15
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +41 -25
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +38 -38
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +21 -21
- package/dist/es/style.css +17 -8
- package/package.json +2 -2
|
@@ -4,94 +4,94 @@ 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,
|
|
8
|
-
return getComponentOptionConfigsBase(t, (e == null ? void 0 : e.systemCode) ? e.systemCode :
|
|
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
9
|
}
|
|
10
|
-
function getComponentOptionConfigsBase(t, e,
|
|
10
|
+
function getComponentOptionConfigsBase(t, e, n) {
|
|
11
11
|
if (!t.props || !t.props.dataOrigin) return;
|
|
12
12
|
if (t.name && "table" === t.name) return;
|
|
13
|
-
const
|
|
14
|
-
if ("optionGroup" ==
|
|
15
|
-
else if ("dynamicData" ==
|
|
16
|
-
else if ("dataTable" ==
|
|
17
|
-
a.filterType =
|
|
18
|
-
const t2 = getTableQueryInfo(
|
|
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
19
|
Object.assign(a, t2);
|
|
20
|
-
} else if ("service" ==
|
|
21
|
-
a.filterType =
|
|
22
|
-
const t2 = getServiceQueryInfo(
|
|
20
|
+
} else if ("service" == o.optionValueSetType) {
|
|
21
|
+
a.filterType = o.filterType;
|
|
22
|
+
const t2 = getServiceQueryInfo(o, e, n);
|
|
23
23
|
Object.assign(a, t2);
|
|
24
24
|
}
|
|
25
25
|
return a.type ? a : void 0;
|
|
26
26
|
}
|
|
27
|
-
function getTableQueryInfo(t, e,
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
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
30
|
const e2 = [];
|
|
31
|
-
for (const
|
|
32
|
-
|
|
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
35
|
if (t.filterList) {
|
|
36
36
|
const e2 = [];
|
|
37
|
-
for (const
|
|
38
|
-
if (!
|
|
39
|
-
|
|
37
|
+
for (const n2 of t.filterList) {
|
|
38
|
+
if (!n2.propName) continue;
|
|
39
|
+
n2.propDbName || (n2.propDbName = n2.propName);
|
|
40
40
|
const t2 = {};
|
|
41
|
-
Object.assign(t2,
|
|
42
|
-
const
|
|
43
|
-
for (const t3 of
|
|
44
|
-
|
|
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 (t.tableValueField && (
|
|
51
|
-
return
|
|
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
52
|
}
|
|
53
|
-
function getServiceQueryInfo(t, e,
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
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
56
|
const e2 = [];
|
|
57
|
-
for (const
|
|
58
|
-
if (!
|
|
57
|
+
for (const n2 of t.serviceInputs) {
|
|
58
|
+
if (!n2.name || n2.value) continue;
|
|
59
59
|
const t2 = {};
|
|
60
|
-
Object.assign(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(t, e,
|
|
66
|
+
function updateChartDatasources(t, e, n, o) {
|
|
67
67
|
return new Promise((a, r) => {
|
|
68
68
|
if (!e || 0 == e.length) return void r(new Error("无需查询的统计图配置!"));
|
|
69
69
|
const s = deepCopy(e);
|
|
70
70
|
s.forEach((e2) => {
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
const e3 =
|
|
74
|
-
e3 && (
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
}), 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);
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
const i = t.entity ? t.entity : {}, u = {};
|
|
81
|
-
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);
|
|
82
82
|
const l = {};
|
|
83
83
|
i.task && Object.assign(l, i.task);
|
|
84
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
85
|
http.post(f, c, { headers: { customSystem: t.systemCode } }).then((e2) => {
|
|
86
86
|
var _a, _b;
|
|
87
87
|
t.chartDataSourceMap || (t.chartDataSourceMap = {});
|
|
88
|
-
for (const
|
|
89
|
-
t.chartDataSourceMap[
|
|
90
|
-
const a2 = getComponentRef(t,
|
|
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
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
|
}
|
|
@@ -104,23 +104,23 @@ function updateChartDatasources(t, e, o, n) {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
function updateChartDatasourcesByComponent(t, e) {
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const n = t.initChartServiceConfigs.find((t2) => t2.uuid === e);
|
|
108
|
+
n && updateChartDatasources(t, [n], null, false);
|
|
109
109
|
}
|
|
110
|
-
function updateOptionDatasources(t, e,
|
|
111
|
-
return new Promise((
|
|
110
|
+
function updateOptionDatasources(t, e, n) {
|
|
111
|
+
return new Promise((o, a) => {
|
|
112
112
|
if (!e || 0 == e.length) return void a(new Error("无需查询的配置!"));
|
|
113
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 =
|
|
115
|
-
const i = { entityMap: r.data, additionalParamMap: s, dataSourceList: e, systemCode: t.systemCode, query:
|
|
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
116
|
http.post(l, i).then((e2) => {
|
|
117
117
|
t.optionSourceMap || (t.optionSourceMap = {});
|
|
118
|
-
for (const
|
|
119
|
-
t.optionSourceMap[
|
|
120
|
-
const
|
|
121
|
-
|
|
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
|
-
|
|
123
|
+
o(e2);
|
|
124
124
|
}).catch((t2) => {
|
|
125
125
|
a(t2);
|
|
126
126
|
});
|
|
@@ -130,8 +130,8 @@ function getOptionDatasFromPage(t, e) {
|
|
|
130
130
|
return getComponentOptionDatasFromPage(t, e.uuid);
|
|
131
131
|
}
|
|
132
132
|
function getComponentOptionDatasFromPage(t, e) {
|
|
133
|
-
const
|
|
134
|
-
return
|
|
133
|
+
const n = getOptionDatasSourceMap(t)[e];
|
|
134
|
+
return n || [];
|
|
135
135
|
}
|
|
136
136
|
function getOptionDatasSourceMap(t) {
|
|
137
137
|
if (!t || !t.optionSourceMap) return {};
|
|
@@ -142,63 +142,63 @@ function getChartDatasFromPage(t, e) {
|
|
|
142
142
|
if (!t || !t.chartDataSourceMap || !e) return null;
|
|
143
143
|
return t.chartDataSourceMap[e.uuid];
|
|
144
144
|
}
|
|
145
|
-
function queryOptionDatasources(t, e,
|
|
146
|
-
return updateOptionDatasources(t, e ? [e] : [],
|
|
147
|
-
}
|
|
148
|
-
function autoSetAfterSelect(t, e, o,
|
|
149
|
-
if (!
|
|
150
|
-
const
|
|
151
|
-
for (const t2 of
|
|
152
|
-
if (!t2.source || !t2.target) continue;
|
|
153
|
-
const e2 = getValuesByField(
|
|
154
|
-
let
|
|
155
|
-
if (!
|
|
156
|
-
|
|
157
|
-
setVariableValue(
|
|
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
160
|
function getValuesByField(t, e) {
|
|
161
161
|
if (t) {
|
|
162
|
-
const
|
|
163
|
-
for (const
|
|
164
|
-
let t2 =
|
|
165
|
-
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);
|
|
166
166
|
}
|
|
167
|
-
return
|
|
167
|
+
return n;
|
|
168
168
|
}
|
|
169
169
|
return [""];
|
|
170
170
|
}
|
|
171
171
|
function getVariableValue(t, e) {
|
|
172
172
|
if (!t || !e || 0 == e.length) return;
|
|
173
|
-
let
|
|
173
|
+
let n = t;
|
|
174
174
|
for (let t2 = 0; t2 < e.length; t2++) {
|
|
175
|
-
if (null ==
|
|
176
|
-
|
|
175
|
+
if (null == n) return n;
|
|
176
|
+
n = n[e[t2]];
|
|
177
177
|
}
|
|
178
|
-
return
|
|
178
|
+
return n;
|
|
179
179
|
}
|
|
180
|
-
function setValueForVariableName(t, e,
|
|
180
|
+
function setValueForVariableName(t, e, n) {
|
|
181
181
|
if (!e || !e.startsWith("${")) return;
|
|
182
|
-
setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."),
|
|
182
|
+
setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."), n);
|
|
183
183
|
}
|
|
184
|
-
function setVariableValue(t, e,
|
|
184
|
+
function setVariableValue(t, e, n) {
|
|
185
185
|
if (!t || !e || 0 == e.length) return;
|
|
186
|
-
let
|
|
186
|
+
let o = t;
|
|
187
187
|
for (let t2 = 0; t2 < e.length; t2++) {
|
|
188
188
|
const a = e[t2];
|
|
189
|
-
t2 + 1 === e.length ?
|
|
189
|
+
t2 + 1 === e.length ? o[a] = n : (void 0 === o[a] && (o[a] = {}), o = o[a]);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
function setVariableValueWithProp(t, e,
|
|
192
|
+
function setVariableValueWithProp(t, e, n) {
|
|
193
193
|
if (!t || !e) return;
|
|
194
|
-
setVariableValue(t, e.split("."),
|
|
194
|
+
setVariableValue(t, e.split("."), n);
|
|
195
195
|
}
|
|
196
196
|
function formatVariableValue(t, e) {
|
|
197
197
|
if (!t || "" == e || null == e || null == e) return e;
|
|
198
|
-
const
|
|
199
|
-
for (const t2 in
|
|
200
|
-
const a =
|
|
201
|
-
if (r && "[object Date]" === Object.prototype.toString.call(r)) return dayjs(r).format("YYYY-MM-DD
|
|
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
202
|
if (r && "number" == typeof r) return r;
|
|
203
203
|
e = e.replace(a, null == r ? "" : r);
|
|
204
204
|
}
|
|
@@ -209,60 +209,60 @@ function getParamNames(t) {
|
|
|
209
209
|
const e = t.match(/\$\{[^\{|\}]+\}/g);
|
|
210
210
|
return e || [];
|
|
211
211
|
}
|
|
212
|
-
function formatValueByType(t, e,
|
|
212
|
+
function formatValueByType(t, e, n) {
|
|
213
213
|
if (!e || "" == t || null == t || null == t) return t;
|
|
214
|
-
if (
|
|
214
|
+
if (n = n || {}, "number" == e || "percent" == e) {
|
|
215
215
|
if (isNaN(t)) return t;
|
|
216
|
-
let
|
|
217
|
-
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 += "%";
|
|
218
218
|
else {
|
|
219
|
-
if (
|
|
219
|
+
if (n.thousandsSeparator) {
|
|
220
220
|
const e2 = t.toString().split(".");
|
|
221
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
225
|
return t;
|
|
226
226
|
}
|
|
227
227
|
if ("date" == e || "time" == e) {
|
|
228
|
-
let
|
|
229
|
-
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);
|
|
230
230
|
}
|
|
231
|
-
return "custom" == e &&
|
|
231
|
+
return "custom" == e && n.formatEventUuid, t;
|
|
232
232
|
}
|
|
233
|
-
function getValueFromVariable(t, e,
|
|
233
|
+
function getValueFromVariable(t, e, n) {
|
|
234
234
|
if (null == e || null == e) return e;
|
|
235
235
|
if (e.startsWith("${") && e.endsWith("}")) {
|
|
236
|
-
let
|
|
237
|
-
if (
|
|
238
|
-
else if (
|
|
239
|
-
else if (
|
|
240
|
-
else if (
|
|
241
|
-
else if (
|
|
242
|
-
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;
|
|
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
249
|
return e;
|
|
250
250
|
}
|
|
251
|
-
function getValueFromSource(t, e,
|
|
252
|
-
if ("context" !=
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
255
|
-
const a = e.substring(0,
|
|
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
256
|
let s = t[a];
|
|
257
|
-
return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, r,
|
|
257
|
+
return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, r, n);
|
|
258
258
|
}
|
|
259
|
-
if ("context" ==
|
|
259
|
+
if ("context" == n) {
|
|
260
260
|
if ("currentDate" == e || "currentTime" == e) return /* @__PURE__ */ new Date();
|
|
261
261
|
if (e.startsWith("currentDate") && e.length > 11) {
|
|
262
|
-
const t2 = e.substring(11),
|
|
263
|
-
let
|
|
262
|
+
const t2 = e.substring(11), n2 = t2.substring(0, 1);
|
|
263
|
+
let o2 = parseInt(t2.substring(1, t2.length - 1), 10);
|
|
264
264
|
const a = t2.substring(t2.length - 1), r = /* @__PURE__ */ new Date();
|
|
265
|
-
return
|
|
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
267
|
if (!t) return;
|
|
268
268
|
}
|
|
@@ -274,17 +274,17 @@ function caculateShowCondition(pageContext, showConditions, row) {
|
|
|
274
274
|
let conditions = "";
|
|
275
275
|
const maxLen = showConditions.length;
|
|
276
276
|
for (let t = 0; t < maxLen; t++) {
|
|
277
|
-
const e = showConditions[t],
|
|
278
|
-
let
|
|
279
|
-
if (!
|
|
280
|
-
|
|
281
|
-
const a = getValueFromVariable(entityData,
|
|
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
282
|
let r = getValueFromVariable(entityData, e.propValue, row);
|
|
283
283
|
const s = e.dataType;
|
|
284
|
-
"CONTAIN" !=
|
|
284
|
+
"CONTAIN" != o && "NOT_CONTAIN" != o || a && !a.includes && (o = "CONTAIN" == o ? "EQ" : "NET");
|
|
285
285
|
let i = e.variableIsNull, u;
|
|
286
|
-
if (i || (i = "null"), "IS_NULL" !==
|
|
287
|
-
u = executeExpression(a,
|
|
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
288
|
} catch (t2) {
|
|
289
289
|
u = false;
|
|
290
290
|
}
|
|
@@ -297,34 +297,34 @@ function caculateShowCondition(pageContext, showConditions, row) {
|
|
|
297
297
|
}
|
|
298
298
|
return !conditions || eval("(" + conditions + ")");
|
|
299
299
|
}
|
|
300
|
-
function monitorFieldChange(t, e,
|
|
301
|
-
if (!
|
|
302
|
-
const
|
|
300
|
+
function monitorFieldChange(t, e, n) {
|
|
301
|
+
if (!n || !t || !e || 0 == e.length) return;
|
|
302
|
+
const o = [], a = [];
|
|
303
303
|
for (let t2 of e) if (t2.startsWith("${")) {
|
|
304
304
|
t2 = t2.substring(2, t2.length - 1);
|
|
305
305
|
const e2 = t2.split(".");
|
|
306
|
-
"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]));
|
|
307
307
|
}
|
|
308
|
-
let r = getMonitorFieldValues(
|
|
308
|
+
let r = getMonitorFieldValues(o, t.entity), s = false;
|
|
309
309
|
for (const e2 of a) watch(t.entity[e2], () => {
|
|
310
310
|
s && clearTimeout(s), s = setTimeout(function() {
|
|
311
|
-
const e3 = getMonitorFieldValues(
|
|
312
|
-
r != e3 && (r = e3,
|
|
311
|
+
const e3 = getMonitorFieldValues(o, t.entity);
|
|
312
|
+
r != e3 && (r = e3, n());
|
|
313
313
|
}, 200);
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
function getMonitorFieldValues(t, e) {
|
|
317
|
-
let
|
|
318
|
-
for (const
|
|
319
|
-
return
|
|
317
|
+
let n = "";
|
|
318
|
+
for (const o of t) n += "_" + getVariableValue(e, o);
|
|
319
|
+
return n;
|
|
320
320
|
}
|
|
321
321
|
function getFormPropName(t) {
|
|
322
322
|
return t && t.indexOf("${") >= 0 ? t.substring(t.indexOf(".") + 1, t.lastIndexOf("}")) : t;
|
|
323
323
|
}
|
|
324
324
|
function getSizeConfig(t, e) {
|
|
325
|
-
const
|
|
326
|
-
let
|
|
327
|
-
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;
|
|
328
328
|
}
|
|
329
329
|
function getPageModeType(t) {
|
|
330
330
|
let e = t.dimensions;
|
|
@@ -340,12 +340,12 @@ function decomposeVariable(t) {
|
|
|
340
340
|
}
|
|
341
341
|
function getModelFieldFromPageContext(t, e) {
|
|
342
342
|
if (!e.modelFieldsMap) return;
|
|
343
|
-
let
|
|
344
|
-
for (let
|
|
345
|
-
const a = t[
|
|
346
|
-
|
|
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
350
|
function isNumberDataType(t) {
|
|
351
351
|
return "INTEGER" === t || "LONG" === t || "DOUBLE" === t || "FLOAT_COM" === t;
|
|
@@ -88,8 +88,11 @@ function w(e2, t2, s2) {
|
|
|
88
88
|
t2 && (s3 = t2.props.base ? t2.props.base : {}, l2 = t2.name, a2 = s3.multiple);
|
|
89
89
|
const p2 = n(r2, i2);
|
|
90
90
|
if (null == p2) {
|
|
91
|
-
const t3 =
|
|
92
|
-
|
|
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;
|
package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js
CHANGED
|
@@ -14,50 +14,50 @@ import "../../../../utils/page-store.js";
|
|
|
14
14
|
import "agilebuilder-ui/src/utils/i18n-util";
|
|
15
15
|
import "vue-i18n";
|
|
16
16
|
import "../../../../utils/events/print-label.js";
|
|
17
|
-
const
|
|
18
|
-
} } }, setup(e2, { expose:
|
|
19
|
-
const
|
|
17
|
+
const b = { style: { overflow: "auto", height: "calc(100vh - 140px)" }, ref: "dialogBody" }, O = { class: "dialog-footer" }, x = e({ __name: "common-homepage-search", props: { configure: { type: Object, required: true }, pageContext: { type: Object, default: () => {
|
|
18
|
+
} } }, setup(e2, { expose: x2 }) {
|
|
19
|
+
const N = e2, _ = t(false), J = t({}), j = t(0);
|
|
20
20
|
let I;
|
|
21
21
|
o(() => {
|
|
22
22
|
I = setTimeout(() => {
|
|
23
|
-
J.value = JSON.parse(JSON.stringify(
|
|
23
|
+
J.value = JSON.parse(JSON.stringify(N.pageContext.entity));
|
|
24
24
|
}, 200);
|
|
25
25
|
}), i(() => {
|
|
26
26
|
I && clearTimeout(I);
|
|
27
27
|
});
|
|
28
28
|
const k = t([]), w = () => {
|
|
29
|
-
|
|
29
|
+
_.value = false;
|
|
30
30
|
}, T = () => {
|
|
31
31
|
const e3 = y.service({ lock: true, text: "Loading", background: "rgba(0, 0, 0, 0.7)" });
|
|
32
|
-
v(
|
|
33
|
-
|
|
32
|
+
v(N.pageContext, N.pageContext.initChartServiceConfigs, null, false).then(() => {
|
|
33
|
+
_.value = false;
|
|
34
34
|
}).finally(() => {
|
|
35
|
-
|
|
35
|
+
_.value = false, e3.close();
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
function H() {
|
|
39
|
-
|
|
39
|
+
N.pageContext.entity = JSON.parse(JSON.stringify(J.value)), j.value++;
|
|
40
40
|
}
|
|
41
41
|
function A() {
|
|
42
42
|
const e3 = {};
|
|
43
|
-
|
|
43
|
+
N.pageContext.variables.forEach((t3) => {
|
|
44
44
|
const o3 = "${page." + t3.name + "}";
|
|
45
|
-
e3[o3] = h(
|
|
45
|
+
e3[o3] = h(N.pageContext.entity, o3, null);
|
|
46
46
|
});
|
|
47
47
|
let t2 = window.localStorage.getItem("HOME_MY_CHARTS_CONDITIONS"), o2 = {};
|
|
48
|
-
t2 && (o2 = JSON.parse(t2)), o2[
|
|
48
|
+
t2 && (o2 = JSON.parse(t2)), o2[N.configure.homeChartSettingUserId] = e3;
|
|
49
49
|
const i2 = JSON.stringify(e3);
|
|
50
|
-
window.localStorage.setItem("HOME_MY_CHARTS_CONDITIONS", JSON.stringify(o2)), J.value = JSON.parse(JSON.stringify(
|
|
50
|
+
window.localStorage.setItem("HOME_MY_CHARTS_CONDITIONS", JSON.stringify(o2)), J.value = JSON.parse(JSON.stringify(N.pageContext.entity)), S.post(window.$vueApp.config.globalProperties.baseAPI + "/component/home-chart-settings/search-conditions", { id: N.configure.homeChartSettingUserId, searchConditionsJson: i2 }).then((e4) => {
|
|
51
51
|
C.success("保存成功"), T();
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
return
|
|
55
|
-
|
|
54
|
+
return x2({ openSearch: () => {
|
|
55
|
+
_.value = true, k.value = N.configure.pushHomepage.searchConditions;
|
|
56
56
|
} }), (t2, o2) => {
|
|
57
57
|
const i2 = l("el-empty"), v2 = l("el-form"), h2 = l("el-button"), y2 = l("el-dialog");
|
|
58
|
-
return r(), a(y2, { modelValue:
|
|
58
|
+
return r(), a(y2, { modelValue: _.value, "onUpdate:modelValue": o2[0] || (o2[0] = (e3) => _.value = e3), title: "筛选", close: w, "append-to-body": "", fullscreen: "", top: "40vh", append: "", width: "70%", draggable: "" }, { default: n(() => [u("div", b, [k.value && 0 !== k.value.length ? c("", true) : (r(), a(i2, { key: 0, description: "未设置筛选条件", "image-size": 50 })), (r(), a(v2, { key: j.value }, { default: n(() => [(r(true), g(m, null, d(k.value, (t3) => (r(), a(f, { key: t3.uuid, configure: t3, pageContext: e2.pageContext }, null, 8, ["configure", "pageContext"]))), 128))]), _: 1 }))], 512)]), footer: n(() => [u("div", O, [s(h2, { type: "primary", onClick: T }, { default: n(() => o2[1] || (o2[1] = [p(" 确定 ")])), _: 1 }), s(h2, { type: "default", onClick: H }, { default: n(() => o2[2] || (o2[2] = [p("重置")])), _: 1 }), s(h2, { type: "primary", onClick: A }, { default: n(() => o2[3] || (o2[3] = [p(" 保存为默认条件 ")])), _: 1 })])]), _: 1 }, 8, ["modelValue"]);
|
|
59
59
|
};
|
|
60
60
|
} });
|
|
61
61
|
export {
|
|
62
|
-
|
|
62
|
+
x as default
|
|
63
63
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./tabs-runtime.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import e from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const r = e(t, [["__scopeId", "data-v-
|
|
4
|
+
const r = e(t, [["__scopeId", "data-v-50669d0c"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|