super-page-runtime 2.3.10 → 2.3.12-rc1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getValueFromSource as e, formatVariableValue as
|
|
1
|
+
import { getValueFromSource as e, formatVariableValue as i, setValueForVariableName as t } from "../page-helper-util.js";
|
|
2
2
|
import { deepCopy as s } from "../common-util.js";
|
|
3
3
|
import { setDefaultGrid as o, CommonName as a, caculateFormulaValue as l, sortDatas as n, limitDatas as r, executeChartFormula as u } from "./chart-util.js";
|
|
4
4
|
import { handleChartEvent as c } from "../events/event-util.js";
|
|
@@ -19,39 +19,39 @@ function d(d2, f, p, m) {
|
|
|
19
19
|
for (const e2 of F) S[e2.group] = e2.target, e2.target && !D.includes(e2.target) && (D.push(e2.target), y.includes(e2.group) && x.push(e2.target));
|
|
20
20
|
let N = f.props ? f.props.mulGroupShow : "";
|
|
21
21
|
N = "break" == N ? "\r\n" : " ";
|
|
22
|
-
for (const
|
|
23
|
-
if (!
|
|
24
|
-
const
|
|
22
|
+
for (const i2 of v) {
|
|
23
|
+
if (!i2) continue;
|
|
24
|
+
const t2 = [];
|
|
25
25
|
for (const s3 of y) {
|
|
26
|
-
const o2 = S[s3], a2 = e(
|
|
27
|
-
a2 &&
|
|
26
|
+
const o2 = S[s3], a2 = e(i2, o2, void 0);
|
|
27
|
+
a2 && t2.push(a2);
|
|
28
28
|
}
|
|
29
|
-
const s2 =
|
|
30
|
-
|
|
29
|
+
const s2 = t2.join(N);
|
|
30
|
+
i2[a.X_FIELD_NAME] = s2;
|
|
31
31
|
}
|
|
32
32
|
const E = f.items ? f.items : [], A = [], _ = {}, b = [], w = {}, C = [], I = [], X = /* @__PURE__ */ new Set(), L = l(E, v, X);
|
|
33
33
|
for (const e2 of X) C.push(e2);
|
|
34
34
|
for (const e2 of E) {
|
|
35
|
-
const
|
|
35
|
+
const i2 = e2.props ? e2.props : {}, t2 = i2.yaxisSource, s2 = i2.yaxisField, o2 = i2.isCumulative;
|
|
36
36
|
let a2 = null;
|
|
37
|
-
if (!s2 ||
|
|
38
|
-
let
|
|
39
|
-
for (const e3 in L)
|
|
40
|
-
a2 = { uuid: e2.uuid, type: "formula", formula:
|
|
41
|
-
} else a2 = { uuid: e2.uuid, type: "fixed", field:
|
|
42
|
-
else a2 = { uuid: e2.uuid, type: "variable", field: s2, isCumulative: o2, data: [], dynamicDatas: [] }, s2 && !C.includes(s2) &&
|
|
43
|
-
null != a2 && (A.push(a2), _[e2.uuid] = a2),
|
|
37
|
+
if (!s2 || t2 && "variable" != t2) if ("formula" == t2) {
|
|
38
|
+
let t3 = i2.formula ? i2.formula : "";
|
|
39
|
+
for (const e3 in L) t3 = t3.replace(new RegExp(e3.replace("$", "\\$"), "g"), L[e3]);
|
|
40
|
+
a2 = { uuid: e2.uuid, type: "formula", formula: t3, data: [], dynamicDatas: [] };
|
|
41
|
+
} else a2 = { uuid: e2.uuid, type: "fixed", field: i2.yaxisFix, data: [], dynamicDatas: [] };
|
|
42
|
+
else a2 = { uuid: e2.uuid, type: "variable", field: s2, isCumulative: o2, data: [], dynamicDatas: [] }, s2 && !C.includes(s2) && C.push(s2), s2 && !I.includes(s2) && I.push(s2), o2 && !X.has(s2) && X.add(s2);
|
|
43
|
+
null != a2 && (A.push(a2), _[e2.uuid] = a2), i2.dynamicSeriesField && !b.includes(i2.dynamicSeriesField) && a2 && (a2.dynamicField = i2.dynamicSeriesField, a2.dynamicSeriesTitle = i2.dynamicSeriesTitle, a2.dynamicShowStack = i2.dynamicShowStack, b.push(i2.dynamicSeriesField), w[i2.dynamicSeriesField] = s2);
|
|
44
44
|
}
|
|
45
45
|
const M = {};
|
|
46
46
|
if (b.length > 0) {
|
|
47
|
-
const
|
|
47
|
+
const i2 = [], t2 = {};
|
|
48
48
|
for (const s2 of v) if (s2) for (const o2 of C) {
|
|
49
49
|
const l2 = s2[a.X_FIELD_NAME];
|
|
50
|
-
let n2 =
|
|
50
|
+
let n2 = t2[l2];
|
|
51
51
|
if (!n2) {
|
|
52
52
|
n2 = {};
|
|
53
53
|
for (const e2 of D) n2[e2] = s2[e2];
|
|
54
|
-
n2[a.X_FIELD_NAME] = s2[a.X_FIELD_NAME],
|
|
54
|
+
n2[a.X_FIELD_NAME] = s2[a.X_FIELD_NAME], t2[l2] = n2, i2.push(n2);
|
|
55
55
|
}
|
|
56
56
|
let r2 = e(s2, o2, void 0);
|
|
57
57
|
if (!isNaN(r2)) {
|
|
@@ -59,72 +59,72 @@ function d(d2, f, p, m) {
|
|
|
59
59
|
isNaN || (r2 += e2), n2[o2] = r2;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
for (const
|
|
62
|
+
for (const i3 of b) {
|
|
63
63
|
const s2 = [];
|
|
64
64
|
for (const o2 of v) {
|
|
65
65
|
if (!o2) continue;
|
|
66
|
-
const l2 =
|
|
66
|
+
const l2 = t2[o2[a.X_FIELD_NAME]];
|
|
67
67
|
if (!l2) continue;
|
|
68
|
-
let n2 = e(o2,
|
|
68
|
+
let n2 = e(o2, i3, void 0);
|
|
69
69
|
n2 = null == n2 || null == n2 ? "" : n2, s2.includes(n2) || (s2.push(n2), I.push(n2), X.add(n2));
|
|
70
|
-
const r2 = w[
|
|
70
|
+
const r2 = w[i3];
|
|
71
71
|
if (void 0 !== r2) {
|
|
72
|
-
const
|
|
73
|
-
let
|
|
74
|
-
void 0 ===
|
|
72
|
+
const i4 = e(o2, r2, void 0);
|
|
73
|
+
let t3 = l2[n2];
|
|
74
|
+
void 0 === t3 ? t3 = i4 : isNaN(i4) || (t3 += i4), l2[n2] = t3;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
M[
|
|
77
|
+
M[i3] = s2;
|
|
78
78
|
}
|
|
79
|
-
v =
|
|
79
|
+
v = i2;
|
|
80
80
|
}
|
|
81
81
|
n(d2, f, v), v = r(d2, f, v, D, I);
|
|
82
82
|
const j = [], k = {};
|
|
83
|
-
for (const
|
|
84
|
-
for (const
|
|
85
|
-
const s2 = e(
|
|
86
|
-
let o2 = k[
|
|
87
|
-
void 0 === s2 || isNaN(s2) || (void 0 === o2 ? o2 = s2 : o2 += s2), k[
|
|
83
|
+
for (const i2 of v) if (i2) {
|
|
84
|
+
for (const t2 of X) {
|
|
85
|
+
const s2 = e(i2, t2, void 0);
|
|
86
|
+
let o2 = k[t2];
|
|
87
|
+
void 0 === s2 || isNaN(s2) || (void 0 === o2 ? o2 = s2 : o2 += s2), k[t2] = o2;
|
|
88
88
|
}
|
|
89
|
-
j.push(
|
|
90
|
-
for (const
|
|
91
|
-
let s2 =
|
|
92
|
-
const o2 =
|
|
93
|
-
if (
|
|
94
|
-
let a2 = M[
|
|
89
|
+
j.push(i2[a.X_FIELD_NAME]);
|
|
90
|
+
for (const t2 of A) {
|
|
91
|
+
let s2 = t2.data;
|
|
92
|
+
const o2 = t2.dynamicDatas;
|
|
93
|
+
if (t2.dynamicField) {
|
|
94
|
+
let a2 = M[t2.dynamicField];
|
|
95
95
|
a2 = a2 || [];
|
|
96
96
|
for (let l2 = 0; l2 < a2.length; l2++) {
|
|
97
97
|
l2 >= o2.length && o2.push([]), s2 = o2[l2];
|
|
98
98
|
const n2 = a2[l2];
|
|
99
|
-
let r2 = e(
|
|
100
|
-
|
|
99
|
+
let r2 = e(i2, n2, void 0);
|
|
100
|
+
t2.isCumulative && (r2 = k[n2]), s2.push(r2);
|
|
101
101
|
}
|
|
102
|
-
} else if ("fixed" ===
|
|
103
|
-
else if ("variable" ===
|
|
104
|
-
let o3 = e(
|
|
105
|
-
|
|
106
|
-
} else if ("formula" ===
|
|
107
|
-
const e2 = u(
|
|
102
|
+
} else if ("fixed" === t2.type) s2.push(t2.field);
|
|
103
|
+
else if ("variable" === t2.type) {
|
|
104
|
+
let o3 = e(i2, t2.field, void 0);
|
|
105
|
+
t2.isCumulative && (o3 = k[t2.field]), s2.push(o3);
|
|
106
|
+
} else if ("formula" === t2.type) {
|
|
107
|
+
const e2 = u(t2.formula, k, i2, d2);
|
|
108
108
|
s2.push(e2);
|
|
109
109
|
} else s2.push(void 0);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
const T = f.defaultSeries, V = s(null == T ? [] : T), $ = [];
|
|
113
113
|
for (const e2 of V) {
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
116
|
-
let o2 = M[
|
|
114
|
+
const t2 = _[e2.uuid];
|
|
115
|
+
if (t2.dynamicField) {
|
|
116
|
+
let o2 = M[t2.dynamicField];
|
|
117
117
|
o2 = o2 || [];
|
|
118
|
-
const a2 =
|
|
118
|
+
const a2 = t2.dynamicDatas ? t2.dynamicDatas : [];
|
|
119
119
|
for (let l2 = 0; l2 < o2.length; l2++) {
|
|
120
120
|
const n2 = o2[l2], r2 = s(e2);
|
|
121
|
-
if (
|
|
122
|
-
const e3 =
|
|
123
|
-
r2.name =
|
|
121
|
+
if (t2.dynamicSeriesTitle) {
|
|
122
|
+
const e3 = t2.dynamicSeriesTitle.replace("${name}", n2);
|
|
123
|
+
r2.name = i(d2, e3);
|
|
124
124
|
} else r2.name = n2;
|
|
125
|
-
r2.data = l2 < a2.length ? a2[l2] : [], "bar" == e2.type &&
|
|
125
|
+
r2.data = l2 < a2.length ? a2[l2] : [], "bar" == e2.type && t2.dynamicShowStack && (r2.stack = e2.uuid), $.push(r2);
|
|
126
126
|
}
|
|
127
|
-
} else e2.data =
|
|
127
|
+
} else e2.data = t2 ? t2.data : [], $.push(e2);
|
|
128
128
|
}
|
|
129
129
|
p.series = $;
|
|
130
130
|
const G = f.defaultXaxis, R = f.defaultYaxis;
|
|
@@ -133,7 +133,7 @@ function d(d2, f, p, m) {
|
|
|
133
133
|
p.xAxis = G, p.yAxis = R;
|
|
134
134
|
} else G && G.length > 0 && (G[0].data = j), p.xAxis = G, p.yAxis = R;
|
|
135
135
|
const U = f.props ? f.props.selGroupVariable : null;
|
|
136
|
-
!(f.props ? f.props.enableDrill : null) && U && (f.highlightInfos = [],
|
|
136
|
+
!(f.props ? f.props.enableDrill : null) && U && (f.highlightInfos = [], t(d2.entity, U, null)), c(d2, f, "afterUpdateChart", p, { resultData: m }), f.groupFields = x, f.cacheDatas = v, f.rawResult = m;
|
|
137
137
|
}
|
|
138
138
|
export {
|
|
139
139
|
d as updateChartOption
|
|
@@ -1,62 +1,67 @@
|
|
|
1
|
-
import { defineComponent as e,
|
|
1
|
+
import { defineComponent as e, computed as t, ref as o, onMounted as n, nextTick as a, onUnmounted as i, resolveComponent as u, createBlock as l, createElementBlock as r, createCommentVNode as s, openBlock as p, normalizeStyle as c, normalizeClass as f, unref as d, withCtx as m, resolveDynamicComponent as g, toDisplayString as v } from "vue";
|
|
2
2
|
import { getFormModelFields as C } from "../../../../utils/page-init-util.js";
|
|
3
3
|
import { setVariableValue as x, getVariableValue as y, formatVariableValue as b, getFormPropName as h, setVariableValueWithProp as j } from "../../../../utils/page-helper-util.js";
|
|
4
4
|
import { handleAfterInitEvent as R, handleEvent as k } from "../../../../utils/events/event-util.js";
|
|
5
5
|
import { updateFormItemEditState as V } from "../../../../utils/events/validator-util.js";
|
|
6
|
-
import { getListCode as _
|
|
7
|
-
import { getComponentRef as
|
|
6
|
+
import { getListCode as _ } from "../../../../utils/common-util.js";
|
|
7
|
+
import { getComponentRef as D } from "../../../../utils/global-refs.js";
|
|
8
8
|
import { getAdditionalParamMap as w } from "../../../../utils/events/standard-event.js";
|
|
9
|
-
import { $t as
|
|
10
|
-
import
|
|
11
|
-
import { functions as
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
x(
|
|
15
|
-
} }),
|
|
9
|
+
import { $t as E } from "../../../../utils/i18n-util.js";
|
|
10
|
+
import F from "../../../../utils/eventBus.js";
|
|
11
|
+
import { functions as S } from "../../../../utils/api/page-expose-util.js";
|
|
12
|
+
const U = { key: 0, style: { width: "100%", height: "100%" } }, q = { key: 1, style: { width: "100%", height: "100%" }, class: "amb-widget-richtext-single" }, $ = e({ __name: "custom-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: $2 }) {
|
|
13
|
+
const O = e2, z = O.pageContext.entity ? O.pageContext.entity : {}, G = C(O.pageContext, O.configure), H = t({ get: () => y(z, G), set(e3) {
|
|
14
|
+
x(z, G, e3);
|
|
15
|
+
} }), P = O.configure.runtime ? O.configure.runtime : {}, I = P.style, A = P.class, B = P.headerStyle, W = o(P.props ? P.props : {}), J = function(e3) {
|
|
16
16
|
let t2 = {};
|
|
17
17
|
if (e3) for (let o2 in e3) {
|
|
18
|
-
const
|
|
19
|
-
t2[o2] = b(
|
|
18
|
+
const n2 = e3[o2];
|
|
19
|
+
t2[o2] = b(O.pageContext, n2);
|
|
20
20
|
}
|
|
21
21
|
return t2;
|
|
22
|
-
}(
|
|
23
|
-
function
|
|
24
|
-
j(
|
|
22
|
+
}(P.customParams ? P.customParams : {}), K = w(O.pageContext), L = o(O.configure.props && O.configure.props.base ? O.configure.props.base.name : null);
|
|
23
|
+
function M(e3, t2) {
|
|
24
|
+
j(z, e3, t2);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
function N(e3) {
|
|
27
|
+
S.isHasFieldAuthPermission(O.configure) ? V(O.pageContext, e3) : console.error("没有该字段的权限,dynamicFields=", G ? G.join(".") : "");
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const e3 =
|
|
29
|
+
function Q() {
|
|
30
|
+
const e3 = O.pageContext.tableUuids;
|
|
31
31
|
e3 && e3.forEach((e4) => {
|
|
32
|
-
const t2 = _(
|
|
32
|
+
const t2 = _(O.pageContext.code, O.pageContext.version, O.configure.uuid), o2 = D(O.pageContext, e4);
|
|
33
33
|
o2 && o2.restoreGridEdit(t2);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
function
|
|
39
|
-
k(
|
|
36
|
+
O.configure.props.verification.custom && O.configure.props.verification.custom.enabled && (O.pageContext.customValidatorUuids || (O.pageContext.customValidatorUuids = []), O.pageContext.customValidatorUuids.push(O.configure.uuid));
|
|
37
|
+
const T = O.pageContext.code, X = o(G && G.length > 0 ? T + "__" + G.join("__") : null), Y = o(null), Z = o(null), ee = o(null);
|
|
38
|
+
function te(e3) {
|
|
39
|
+
k(H.value, O.pageContext, O.configure, e3);
|
|
40
40
|
}
|
|
41
|
-
return
|
|
42
|
-
|
|
41
|
+
return n(() => {
|
|
42
|
+
F.$on(X.value + "-scanDone", (e3) => {
|
|
43
43
|
const t2 = e3.result;
|
|
44
|
-
x(
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
}),
|
|
48
|
-
const e3 =
|
|
49
|
-
R(e3,
|
|
44
|
+
x(z, G, t2);
|
|
45
|
+
}), F.$on(X.value + "-pickFileDone", (e3) => {
|
|
46
|
+
X.value, Y.value.pickFileDone(e3);
|
|
47
|
+
}), a(() => {
|
|
48
|
+
const e3 = H.value;
|
|
49
|
+
R(e3, O.pageContext, O.configure, { formItemRef: Z.value, componentRef: Y.value, titleRef: ee.value, value: e3, entity: O.pageContext.entity.data, pageData: O.pageContext.entity.page });
|
|
50
50
|
});
|
|
51
51
|
}), i(() => {
|
|
52
|
-
|
|
52
|
+
F.$off(X.value + "-scanDone"), F.$off(X.value + "-pickFileDone");
|
|
53
53
|
}), $2({ getCustomRef: function() {
|
|
54
|
-
return
|
|
54
|
+
return Y.value;
|
|
55
|
+
}, invokeCustomFunction: function(e3, ...t2) {
|
|
56
|
+
if (Y.value && "function" == typeof Y.value[e3]) return Y.value[e3](...t2);
|
|
57
|
+
throw new Error(`执行失败:Function '${e3}' not found in custom component`);
|
|
58
|
+
}, hasCustomFunction: function(e3) {
|
|
59
|
+
return Y.value && "function" == typeof Y.value[e3];
|
|
55
60
|
}, addRequiredClass: function() {
|
|
56
|
-
|
|
61
|
+
requiredClass.value = addRequiredClassUtil();
|
|
57
62
|
} }), (e3, t2) => {
|
|
58
63
|
const o2 = u("el-form-item");
|
|
59
|
-
return
|
|
64
|
+
return W.value.tittleShow ? (p(), l(o2, { key: 0, ref_key: "formItemRef", ref: Z, required: W.value.required, class: f(d(A)), "label-width": W.value.labelWidth, style: c(d(I)) }, { label: m(() => [W.value.tittleShow ? (p(), r("div", { key: 0, ref_key: "titleRef", ref: ee, style: c({ ...d(B) }) }, v(d(E)(W.value.title)), 5)) : s("", true)]), default: m(() => [L.value ? (p(), r("div", U, [(p(), l(g(L.value), { ref_key: "customRef", ref: Y, size: W.value.size, entity: e3.pageContext.entity.data, pageData: e3.pageContext.entity.page, pageContext: e3.pageContext, configureObj: e3.configure, prop: d(h)(e3.configure.props && e3.configure.props.base ? e3.configure.props.base.prop : null), "custom-params": d(J), modelValue: H.value, "onUpdate:modelValue": t2[0] || (t2[0] = (e4) => H.value = e4), disabled: "disabled" === W.value.state, "additional-param-map": d(K), "component-id": X.value, onSetEntityValue: M, onSetCustomRules: N, onRestoreGridEdit: Q, onHandleEvent: te, onChange: t2[1] || (t2[1] = (t3) => d(k)(H.value, e3.pageContext, e3.configure, "change")) }, null, 40, ["size", "entity", "pageData", "pageContext", "configureObj", "prop", "custom-params", "modelValue", "disabled", "additional-param-map", "component-id"]))])) : s("", true)]), _: 1 }, 8, ["required", "class", "label-width", "style"])) : L.value ? (p(), r("div", q, [(p(), l(g(L.value), { ref_key: "customRef", ref: Y, entity: e3.pageContext.entity.data, pageData: e3.pageContext.entity.page, pageContext: e3.pageContext, configureObj: e3.configure, prop: d(h)(e3.configure.props && e3.configure.props.base ? e3.configure.props.base.prop : null), "custom-params": d(J), modelValue: H.value, "onUpdate:modelValue": t2[2] || (t2[2] = (e4) => H.value = e4), disabled: "disabled" === W.value.state, "additional-param-map": d(K), "component-id": X.value, onSetEntityValue: M, onSetCustomRules: N, onRestoreGridEdit: Q, onHandleEvent: te, onChange: t2[3] || (t2[3] = (t3) => d(k)(H.value, e3.pageContext, e3.configure, "change")) }, null, 40, ["entity", "pageData", "pageContext", "configureObj", "prop", "custom-params", "modelValue", "disabled", "additional-param-map", "component-id"]))])) : s("", true);
|
|
60
65
|
};
|
|
61
66
|
} });
|
|
62
67
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-page-runtime",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.12-rc1",
|
|
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.50-rc2",
|
|
52
52
|
"axios": "^1.6.8",
|
|
53
53
|
"cypress": "^13.6.6",
|
|
54
54
|
"element-plus": "^2.6.1",
|
package/dist/es.zip
DELETED
|
Binary file
|