super-page-runtime 2.2.26 → 2.2.29
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.
|
@@ -36,16 +36,16 @@ function getTableQueryInfo(t, e) {
|
|
|
36
36
|
o2.propDbName || (o2.propDbName = o2.propName);
|
|
37
37
|
const t2 = {};
|
|
38
38
|
Object.assign(t2, o2);
|
|
39
|
-
const
|
|
40
|
-
for (const t3 of
|
|
39
|
+
const r2 = getParamNames(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
41
|
o2.propValue, e2.push(t2);
|
|
42
42
|
}
|
|
43
43
|
o.props.searchForm = e2;
|
|
44
44
|
}
|
|
45
45
|
o.props.monitorFields = n;
|
|
46
|
-
const
|
|
47
|
-
if (t.tableValueField && (o.props.valueField = t.tableValueField), t.tableLableField && -1 ==
|
|
48
|
-
return o.props.queryFields =
|
|
46
|
+
const r = [];
|
|
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
50
|
function getServiceQueryInfo(t, e) {
|
|
51
51
|
const o = { type: "service" };
|
|
@@ -61,16 +61,16 @@ function getServiceQueryInfo(t, e) {
|
|
|
61
61
|
return o.props.dataSetField = t.serviceDataSetField, o.props.valueField = t.serviceValueField, o.props.labelField = t.serviceLabelField, o;
|
|
62
62
|
}
|
|
63
63
|
function updateChartDatasources(t, e, o, n) {
|
|
64
|
-
return new Promise((
|
|
65
|
-
if (!e || 0 == e.length) return void
|
|
64
|
+
return new Promise((r, a) => {
|
|
65
|
+
if (!e || 0 == e.length) return void a(new Error("无需查询的统计图配置!"));
|
|
66
66
|
const s = deepCopy(e);
|
|
67
67
|
s.forEach((e2) => {
|
|
68
68
|
const o2 = e2.services;
|
|
69
69
|
if (o2 && o2.length > 0) {
|
|
70
70
|
const e3 = o2[0].serviceInputs;
|
|
71
71
|
e3 && (o2[0].serviceInParams = {}, e3.forEach((e4) => {
|
|
72
|
-
const n2 = e4.name,
|
|
73
|
-
o2[0].serviceInParams[n2] = getValueFromVariable(t.entity,
|
|
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
|
});
|
|
@@ -84,19 +84,19 @@ function updateChartDatasources(t, e, o, n) {
|
|
|
84
84
|
t.chartDataSourceMap || (t.chartDataSourceMap = {});
|
|
85
85
|
for (const o2 in e2) {
|
|
86
86
|
t.chartDataSourceMap[o2] = e2[o2];
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
if ((!n ||
|
|
91
|
-
const n2 = e2[o2] && e2[o2].length > 0 ? e2[o2][0] : {},
|
|
87
|
+
const r2 = getComponentRef(t, o2);
|
|
88
|
+
if (r2) {
|
|
89
|
+
const a2 = r2.getConfigure();
|
|
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
|
-
|
|
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
|
-
|
|
97
|
+
r(e2);
|
|
98
98
|
}).catch((t2) => {
|
|
99
|
-
|
|
99
|
+
a(t2);
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -105,11 +105,11 @@ function updateChartDatasourcesByComponent(t, e) {
|
|
|
105
105
|
o && updateChartDatasources(t, [o], null, false);
|
|
106
106
|
}
|
|
107
107
|
function updateOptionDatasources(t, e, o) {
|
|
108
|
-
return new Promise((n,
|
|
109
|
-
if (!e || 0 == e.length) return void
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const i = { entityMap:
|
|
108
|
+
return new Promise((n, r) => {
|
|
109
|
+
if (!e || 0 == e.length) return void r(new Error("无需查询的配置!"));
|
|
110
|
+
const a = t.entity ? t.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: e, systemCode: t.systemCode, query: o }, u = t.backendUrl, l = getBaseUrl(u, t.isTest) + "/common/common-data/find-datas";
|
|
113
113
|
http.post(l, i).then((e2) => {
|
|
114
114
|
t.optionSourceMap || (t.optionSourceMap = {});
|
|
115
115
|
for (const o2 in e2) {
|
|
@@ -119,7 +119,7 @@ function updateOptionDatasources(t, e, o) {
|
|
|
119
119
|
}
|
|
120
120
|
n(e2);
|
|
121
121
|
}).catch((t2) => {
|
|
122
|
-
|
|
122
|
+
r(t2);
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
}
|
|
@@ -144,14 +144,14 @@ function queryOptionDatasources(t, e, o) {
|
|
|
144
144
|
}
|
|
145
145
|
function autoSetAfterSelect(t, e, o, n) {
|
|
146
146
|
if (!o || 0 == o.length) return;
|
|
147
|
-
const
|
|
147
|
+
const r = e.entity ? e.entity : {};
|
|
148
148
|
for (const t2 of o) {
|
|
149
149
|
if (!t2.source || !t2.target) continue;
|
|
150
150
|
const e2 = getValuesByField(n, t2.source);
|
|
151
151
|
let o2 = t2.target;
|
|
152
152
|
if (!o2 || !o2.startsWith("${")) continue;
|
|
153
153
|
o2 = o2.substring(2, o2.length - 1);
|
|
154
|
-
setVariableValue(
|
|
154
|
+
setVariableValue(r, o2.split("."), e2.join(","));
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
function getValuesByField(t, e) {
|
|
@@ -182,8 +182,8 @@ function setVariableValue(t, e, o) {
|
|
|
182
182
|
if (!t || !e || 0 == e.length) return;
|
|
183
183
|
let n = t;
|
|
184
184
|
for (let t2 = 0; t2 < e.length; t2++) {
|
|
185
|
-
const
|
|
186
|
-
t2 + 1 === e.length ? n[
|
|
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
189
|
function setVariableValueWithProp(t, e, o) {
|
|
@@ -194,9 +194,10 @@ function formatVariableValue(t, e) {
|
|
|
194
194
|
if (!t || "" == e || null == e || null == e) return e;
|
|
195
195
|
const o = t.entity ? t.entity : {}, n = getParamNames(e);
|
|
196
196
|
for (const t2 in n) {
|
|
197
|
-
const
|
|
198
|
-
if (
|
|
199
|
-
|
|
197
|
+
const r = n[t2], 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
|
+
e = e.replace(r, null == a ? "" : a);
|
|
200
201
|
}
|
|
201
202
|
return e;
|
|
202
203
|
}
|
|
@@ -229,18 +230,18 @@ function formatValueByType(t, e, o) {
|
|
|
229
230
|
function getValueFromVariable(t, e, o) {
|
|
230
231
|
if (null == e || null == e) return e;
|
|
231
232
|
if (e.startsWith("${") && e.endsWith("}")) {
|
|
232
|
-
let n = e.substring(2, e.length - 1),
|
|
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),
|
|
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;
|
|
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) : "";
|
|
244
245
|
}
|
|
245
246
|
return e;
|
|
246
247
|
}
|
|
@@ -248,17 +249,17 @@ function getValueFromSource(t, e, o) {
|
|
|
248
249
|
if ("context" != o && !t || !e) return;
|
|
249
250
|
const n = e.indexOf(".");
|
|
250
251
|
if (n > -1) {
|
|
251
|
-
const
|
|
252
|
-
let s = t[
|
|
253
|
-
return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s,
|
|
252
|
+
const r = e.substring(0, n), a = e.substring(n + 1);
|
|
253
|
+
let s = t[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
257
|
if ("currentDate" == e || "currentTime" == e) return /* @__PURE__ */ new Date();
|
|
257
258
|
if (e.startsWith("currentDate") && e.length > 11) {
|
|
258
259
|
const t2 = e.substring(11), o2 = t2.substring(0, 1);
|
|
259
260
|
let n2 = parseInt(t2.substring(1, t2.length - 1), 10);
|
|
260
|
-
const
|
|
261
|
-
return n2 = "+" === o2 ? n2 : -n2, "d" ===
|
|
261
|
+
const r = t2.substring(t2.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
264
|
if (!t) return;
|
|
264
265
|
}
|
|
@@ -274,13 +275,13 @@ function caculateShowCondition(pageContext, showConditions, row) {
|
|
|
274
275
|
let n = e.operator;
|
|
275
276
|
if (!o || "" === o) continue;
|
|
276
277
|
n || (n = "EQ");
|
|
277
|
-
const
|
|
278
|
-
let
|
|
278
|
+
const r = getValueFromVariable(entityData, o, row);
|
|
279
|
+
let a = getValueFromVariable(entityData, e.propValue, row);
|
|
279
280
|
const s = e.dataType;
|
|
280
|
-
"CONTAIN" != n && "NOT_CONTAIN" != n ||
|
|
281
|
+
"CONTAIN" != n && "NOT_CONTAIN" != n || r && !r.includes && (n = "CONTAIN" == n ? "EQ" : "NET");
|
|
281
282
|
let i = e.variableIsNull, u;
|
|
282
|
-
if (i || (i = "null"), void 0 !==
|
|
283
|
-
u = executeExpression(
|
|
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);
|
|
284
285
|
} catch (t2) {
|
|
285
286
|
u = false;
|
|
286
287
|
}
|
|
@@ -295,17 +296,17 @@ function caculateShowCondition(pageContext, showConditions, row) {
|
|
|
295
296
|
}
|
|
296
297
|
function monitorFieldChange(t, e, o) {
|
|
297
298
|
if (!o || !t || !e || 0 == e.length) return;
|
|
298
|
-
const n = [],
|
|
299
|
+
const n = [], r = [];
|
|
299
300
|
for (let t2 of e) if (t2.startsWith("${")) {
|
|
300
301
|
t2 = t2.substring(2, t2.length - 1);
|
|
301
302
|
const e2 = t2.split(".");
|
|
302
|
-
"page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (n.push(e2),
|
|
303
|
+
"page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (n.push(e2), r.includes(e2[0]) || r.push(e2[0]));
|
|
303
304
|
}
|
|
304
|
-
const
|
|
305
|
-
let s = getMonitorFieldValues(n,
|
|
306
|
-
for (const t2 of
|
|
305
|
+
const a = t.entity;
|
|
306
|
+
let s = getMonitorFieldValues(n, a), i = false;
|
|
307
|
+
for (const t2 of r) watch(a[t2], () => {
|
|
307
308
|
i && clearTimeout(i), i = setTimeout(function() {
|
|
308
|
-
const t3 = getMonitorFieldValues(n,
|
|
309
|
+
const t3 = getMonitorFieldValues(n, a);
|
|
309
310
|
s != t3 && (s = t3, o());
|
|
310
311
|
}, 200);
|
|
311
312
|
});
|
|
@@ -57,7 +57,7 @@ function b(e2) {
|
|
|
57
57
|
function y(e2, t2) {
|
|
58
58
|
if (e2) {
|
|
59
59
|
Object.assign(t2, e2);
|
|
60
|
-
E(e2.paramStoreId, t2), delete e2.paramStoreId;
|
|
60
|
+
E(e2.paramStoreId, t2), delete e2.paramStoreId, e2.jumpMode && (t2.jumpMode = e2.jumpMode);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
function h(e2, t2) {
|
|
@@ -102,7 +102,7 @@ function P(e2, t2, s2, i2) {
|
|
|
102
102
|
}
|
|
103
103
|
return n2;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function M(e2, t2) {
|
|
106
106
|
if (!t2 || !e2 || t2.isTest) return "true";
|
|
107
107
|
const s2 = [];
|
|
108
108
|
if (e2.autoPermissions) for (const i2 of e2.autoPermissions) s2.push(t2.code + "." + i2.simpleCode);
|
|
@@ -116,13 +116,13 @@ function C(e2, t2) {
|
|
|
116
116
|
}
|
|
117
117
|
return s2.join(",");
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function j(s2, i2, n2) {
|
|
120
120
|
const o2 = s2.tableRuntimes, r2 = t(i2);
|
|
121
121
|
let l2;
|
|
122
122
|
const a2 = i2.code;
|
|
123
123
|
return r2 && Object.keys(r2) > 0 && (l2 = JSON.stringify(r2)), e.post(window.$vueApp.config.globalProperties.baseAPI + "/component/super-page-design/super-grids", { tableRuntimes: o2, additionalParamMapJson: l2, pageCode: a2, publishVersion: n2, pageType: s2.pageType });
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function C(e2, t2) {
|
|
126
126
|
var _a, _b;
|
|
127
127
|
const s2 = t2.props && t2.props.base ? t2.props.base.prop : null;
|
|
128
128
|
let n2 = false;
|
|
@@ -141,7 +141,7 @@ function M(e2, t2) {
|
|
|
141
141
|
((_b = t2.props) == null ? void 0 : _b.customRuleEvents) && (e2.customRuleEvents || (e2.customRuleEvents = []), e2.customRuleEvents.push({ prop: o2, events: t2.props.customRuleEvents }));
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function I(e2, t2) {
|
|
145
145
|
if (e2.initInfo) {
|
|
146
146
|
["dynamicControlFormEdit", "disableElement", "enableElement", "hideElement", "showElement"].forEach((s2) => {
|
|
147
147
|
const i2 = e2.initInfo[s2];
|
|
@@ -157,16 +157,16 @@ function j(e2, t2) {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
export {
|
|
160
|
-
|
|
160
|
+
I as controlObjectRenderState,
|
|
161
161
|
c as convertToPageContext,
|
|
162
162
|
P as getDefaultValue,
|
|
163
163
|
w as getFormModelFields,
|
|
164
164
|
v as getModelFields,
|
|
165
|
-
|
|
165
|
+
M as getPermissionCodes,
|
|
166
166
|
b as packageAdditionalMapWithLocationSearch,
|
|
167
167
|
y as packageAdditionalMapWithPageRequest,
|
|
168
168
|
h as packageAdditionalMapWithRoute,
|
|
169
|
-
|
|
169
|
+
C as packageFormRules,
|
|
170
170
|
f as queryPageDesignByCode,
|
|
171
|
-
|
|
171
|
+
j as queryPageSuperGrids
|
|
172
172
|
};
|
|
@@ -9,6 +9,7 @@ const C = { "element-loading-text": "加载中..." }, v = e({ name: "HomeChart",
|
|
|
9
9
|
const v2 = e2, y = t(true), S = t(false), b = t({});
|
|
10
10
|
let I, U = t(null);
|
|
11
11
|
return v2.chartCode && g.get(window.$vueApp.config.globalProperties.baseAPI + "/mms/home-chart-layout/" + v2.chartCode).then((e3) => {
|
|
12
|
+
var _a, _b;
|
|
12
13
|
if (e3 && e3.designJson) {
|
|
13
14
|
const t2 = JSON.parse(e3.designJson);
|
|
14
15
|
let a2 = window.localStorage.getItem("HOME_MY_CHARTS_ALIAS");
|
|
@@ -18,8 +19,8 @@ const C = { "element-loading-text": "加载中..." }, v = e({ name: "HomeChart",
|
|
|
18
19
|
}
|
|
19
20
|
const i2 = window.frameElement;
|
|
20
21
|
b.value = t2.chartJson, b.value.homeChartSettingUserId = v2.homeChartSettingUserId, i2 && (b.value.runtime.common.style.pc_style.height = i2.clientHeight + "px");
|
|
21
|
-
const n2 = { showHomepageSearch:
|
|
22
|
-
if (t2.variables) {
|
|
22
|
+
const n2 = { showHomepageSearch: false, name: e3.pageName, code: e3.pageCode, label: "", dimensions: "", version: 1, isWorkflowEntity: false, variables: t2.variables, systemCode: e3.systemCode, uuid: e3.uuid, allChartUuids: [], backendUrl: e3.backendUrl, rules: {}, pageType: "chart", beanName: t2.beanName, initChartServiceConfigs: [t2.initChartServiceConfigs], entity: { data: {}, task: {}, request: {}, page: {}, context: e3.contextParam, system: e3.systemParam } };
|
|
23
|
+
if (((_a = b.value.pushHomepage) == null ? void 0 : _a.searchConditions) && ((_b = b.value.pushHomepage) == null ? void 0 : _b.searchConditions.length) > 0 && (n2.showHomepageSearch = true), t2.variables) {
|
|
23
24
|
const e4 = n2.entity.page;
|
|
24
25
|
for (const a3 of t2.variables) a3.name && (a3.isArrayElement ? e4[a3.name] = [] : a3.defaultValue ? e4[a3.name] = a3.defaultValue : e4[a3.name] = void 0);
|
|
25
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-page-runtime",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.29",
|
|
4
4
|
"description": "AgileBuilder super page runtime",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/es/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
49
49
|
"@vue/eslint-config-prettier": "^8.0.0",
|
|
50
50
|
"@vue/test-utils": "^2.4.4",
|
|
51
|
-
"agilebuilder-ui": "1.1.
|
|
51
|
+
"agilebuilder-ui": "1.1.12",
|
|
52
52
|
"axios": "^1.6.8",
|
|
53
53
|
"cypress": "^13.6.6",
|
|
54
54
|
"element-plus": "^2.6.1",
|