super-page-runtime 2.3.7 → 2.3.8

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.
Files changed (23) hide show
  1. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +76 -76
  2. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +26 -24
  3. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +59 -58
  4. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +38 -37
  5. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +28 -27
  6. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +1 -0
  7. package/dist/es/components/runtime/utils/charts/chart-util.js +29 -22
  8. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +4 -1
  9. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +4 -4
  10. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +4 -1
  11. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +15 -15
  12. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +4 -1
  13. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +7 -7
  14. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +4 -1
  15. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +8 -8
  16. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +4 -1
  17. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +7 -7
  18. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +86 -82
  19. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +18 -15
  20. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +4 -1
  21. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +32 -29
  22. package/dist/es/style.css +30 -0
  23. package/package.json +2 -2
@@ -1,140 +1,140 @@
1
1
  import { getValueFromSource as e, formatVariableValue as t, setValueForVariableName as i } from "../page-helper-util.js";
2
2
  import { deepCopy as s } from "../common-util.js";
3
- import { CommonName as o, caculateFormulaValue as a, sortDatas as l, limitDatas as n, executeChartFormula as r } from "./chart-util.js";
4
- import { handleChartEvent as u } from "../events/event-util.js";
5
- function c(c2, d, f, p) {
6
- if (!p || !p.result) return;
7
- u(c2, d, "beforeUpdateChart", f, { resultData: p });
8
- const m = p && p.result ? p.result : {};
9
- let h = p && p.groupValue ? p.groupValue : void 0;
10
- const y = d.serviceDataField;
11
- let g = null;
12
- y ? g = m[y] : m && (g = Array.isArray(m) ? m : [m]), g || (g = []), d.runtime.dataConfig.runtimeData = g;
13
- let v = d.props ? d.props.groups : null;
14
- if (v || (v = []), !h || 0 === h.length) {
15
- h = [];
16
- for (const e2 of v) h.push(e2.group);
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
+ import { handleChartEvent as c } from "../events/event-util.js";
5
+ function d(d2, f, p, m) {
6
+ if (!m || !m.result) return;
7
+ o(p), c(d2, f, "beforeUpdateChart", p, { resultData: m });
8
+ const h = m && m.result ? m.result : {};
9
+ let y = m && m.groupValue ? m.groupValue : void 0;
10
+ const g = f.serviceDataField;
11
+ let v = null;
12
+ g ? v = h[g] : h && (v = Array.isArray(h) ? h : [h]), v || (v = []), f.runtime.dataConfig.runtimeData = v;
13
+ let F = f.props ? f.props.groups : null;
14
+ if (F || (F = []), !y || 0 === y.length) {
15
+ y = [];
16
+ for (const e2 of F) y.push(e2.group);
17
17
  }
18
- const F = {}, S = [], D = [];
19
- for (const e2 of v) F[e2.group] = e2.target, e2.target && !S.includes(e2.target) && (S.push(e2.target), h.includes(e2.group) && D.push(e2.target));
20
- let x = d.props ? d.props.mulGroupShow : "";
21
- x = "break" == x ? "\r\n" : " ";
22
- for (const t2 of g) {
18
+ const S = {}, D = [], x = [];
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
+ let N = f.props ? f.props.mulGroupShow : "";
21
+ N = "break" == N ? "\r\n" : " ";
22
+ for (const t2 of v) {
23
23
  if (!t2) continue;
24
24
  const i2 = [];
25
- for (const s3 of h) {
26
- const o2 = F[s3], a2 = e(t2, o2, void 0);
25
+ for (const s3 of y) {
26
+ const o2 = S[s3], a2 = e(t2, o2, void 0);
27
27
  a2 && i2.push(a2);
28
28
  }
29
- const s2 = i2.join(x);
30
- t2[o.X_FIELD_NAME] = s2;
29
+ const s2 = i2.join(N);
30
+ t2[a.X_FIELD_NAME] = s2;
31
31
  }
32
- const N = d.items ? d.items : [], E = [], A = {}, _ = [], b = {}, w = [], C = [], I = /* @__PURE__ */ new Set(), X = a(N, g, I);
33
- for (const e2 of I) w.push(e2);
34
- for (const e2 of N) {
32
+ const E = f.items ? f.items : [], A = [], _ = {}, b = [], w = {}, C = [], I = [], X = /* @__PURE__ */ new Set(), L = l(E, v, X);
33
+ for (const e2 of X) C.push(e2);
34
+ for (const e2 of E) {
35
35
  const t2 = e2.props ? e2.props : {}, i2 = t2.yaxisSource, s2 = t2.yaxisField, o2 = t2.isCumulative;
36
36
  let a2 = null;
37
37
  if (!s2 || i2 && "variable" != i2) if ("formula" == i2) {
38
38
  let i3 = t2.formula ? t2.formula : "";
39
- for (const e3 in X) i3 = i3.replace(new RegExp(e3.replace("$", "\\$"), "g"), X[e3]);
39
+ for (const e3 in L) i3 = i3.replace(new RegExp(e3.replace("$", "\\$"), "g"), L[e3]);
40
40
  a2 = { uuid: e2.uuid, type: "formula", formula: i3, data: [], dynamicDatas: [] };
41
41
  } else a2 = { uuid: e2.uuid, type: "fixed", field: t2.yaxisFix, data: [], dynamicDatas: [] };
42
- else a2 = { uuid: e2.uuid, type: "variable", field: s2, isCumulative: o2, data: [], dynamicDatas: [] }, s2 && !w.includes(s2) && (w.push(s2), C.push(s2)), o2 && !I.has(s2) && I.add(s2);
43
- null != a2 && (E.push(a2), A[e2.uuid] = a2), t2.dynamicSeriesField && !_.includes(t2.dynamicSeriesField) && a2 && (a2.dynamicField = t2.dynamicSeriesField, a2.dynamicSeriesTitle = t2.dynamicSeriesTitle, a2.dynamicShowStack = t2.dynamicShowStack, _.push(t2.dynamicSeriesField), b[t2.dynamicSeriesField] = s2);
42
+ else a2 = { uuid: e2.uuid, type: "variable", field: s2, isCumulative: o2, data: [], dynamicDatas: [] }, s2 && !C.includes(s2) && (C.push(s2), I.push(s2)), o2 && !X.has(s2) && X.add(s2);
43
+ null != a2 && (A.push(a2), _[e2.uuid] = a2), t2.dynamicSeriesField && !b.includes(t2.dynamicSeriesField) && a2 && (a2.dynamicField = t2.dynamicSeriesField, a2.dynamicSeriesTitle = t2.dynamicSeriesTitle, a2.dynamicShowStack = t2.dynamicShowStack, b.push(t2.dynamicSeriesField), w[t2.dynamicSeriesField] = s2);
44
44
  }
45
- const L = {};
46
- if (_.length > 0) {
45
+ const M = {};
46
+ if (b.length > 0) {
47
47
  const t2 = [], i2 = {};
48
- for (const s2 of g) if (s2) for (const a2 of w) {
49
- const l2 = s2[o.X_FIELD_NAME];
48
+ for (const s2 of v) if (s2) for (const o2 of C) {
49
+ const l2 = s2[a.X_FIELD_NAME];
50
50
  let n2 = i2[l2];
51
51
  if (!n2) {
52
52
  n2 = {};
53
- for (const e2 of S) n2[e2] = s2[e2];
54
- n2[o.X_FIELD_NAME] = s2[o.X_FIELD_NAME], i2[l2] = n2, t2.push(n2);
53
+ for (const e2 of D) n2[e2] = s2[e2];
54
+ n2[a.X_FIELD_NAME] = s2[a.X_FIELD_NAME], i2[l2] = n2, t2.push(n2);
55
55
  }
56
- let r2 = e(s2, a2, void 0);
56
+ let r2 = e(s2, o2, void 0);
57
57
  if (!isNaN(r2)) {
58
- const e2 = n2[a2];
59
- isNaN || (r2 += e2), n2[a2] = r2;
58
+ const e2 = n2[o2];
59
+ isNaN || (r2 += e2), n2[o2] = r2;
60
60
  }
61
61
  }
62
- for (const t3 of _) {
62
+ for (const t3 of b) {
63
63
  const s2 = [];
64
- for (const a2 of g) {
65
- if (!a2) continue;
66
- const l2 = i2[a2[o.X_FIELD_NAME]];
64
+ for (const o2 of v) {
65
+ if (!o2) continue;
66
+ const l2 = i2[o2[a.X_FIELD_NAME]];
67
67
  if (!l2) continue;
68
- let n2 = e(a2, t3, void 0);
69
- n2 = null == n2 || null == n2 ? "" : n2, s2.includes(n2) || (s2.push(n2), C.push(n2), I.add(n2));
70
- const r2 = b[t3];
68
+ let n2 = e(o2, t3, void 0);
69
+ n2 = null == n2 || null == n2 ? "" : n2, s2.includes(n2) || (s2.push(n2), I.push(n2), X.add(n2));
70
+ const r2 = w[t3];
71
71
  if (void 0 !== r2) {
72
- const t4 = e(a2, r2, void 0);
72
+ const t4 = e(o2, r2, void 0);
73
73
  let i3 = l2[n2];
74
74
  void 0 === i3 ? i3 = t4 : isNaN(t4) || (i3 += t4), l2[n2] = i3;
75
75
  }
76
76
  }
77
- L[t3] = s2;
77
+ M[t3] = s2;
78
78
  }
79
- g = t2;
79
+ v = t2;
80
80
  }
81
- l(c2, d, g), g = n(c2, d, g, S, C);
82
- const M = [], j = {};
83
- for (const t2 of g) if (t2) {
84
- for (const i2 of I) {
81
+ n(d2, f, v), v = r(d2, f, v, D, I);
82
+ const j = [], k = {};
83
+ for (const t2 of v) if (t2) {
84
+ for (const i2 of X) {
85
85
  const s2 = e(t2, i2, void 0);
86
- let o2 = j[i2];
87
- void 0 === s2 || isNaN(s2) || (void 0 === o2 ? o2 = s2 : o2 += s2), j[i2] = o2;
86
+ let o2 = k[i2];
87
+ void 0 === s2 || isNaN(s2) || (void 0 === o2 ? o2 = s2 : o2 += s2), k[i2] = o2;
88
88
  }
89
- M.push(t2[o.X_FIELD_NAME]);
90
- for (const i2 of E) {
89
+ j.push(t2[a.X_FIELD_NAME]);
90
+ for (const i2 of A) {
91
91
  let s2 = i2.data;
92
92
  const o2 = i2.dynamicDatas;
93
93
  if (i2.dynamicField) {
94
- let a2 = L[i2.dynamicField];
94
+ let a2 = M[i2.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
99
  let r2 = e(t2, n2, void 0);
100
- i2.isCumulative && (r2 = j[n2]), s2.push(r2);
100
+ i2.isCumulative && (r2 = k[n2]), s2.push(r2);
101
101
  }
102
102
  } else if ("fixed" === i2.type) s2.push(i2.field);
103
103
  else if ("variable" === i2.type) {
104
104
  let o3 = e(t2, i2.field, void 0);
105
- i2.isCumulative && (o3 = j[i2.field]), s2.push(o3);
105
+ i2.isCumulative && (o3 = k[i2.field]), s2.push(o3);
106
106
  } else if ("formula" === i2.type) {
107
- const e2 = r(i2.formula, j, t2, c2);
107
+ const e2 = u(i2.formula, k, t2, d2);
108
108
  s2.push(e2);
109
109
  } else s2.push(void 0);
110
110
  }
111
111
  }
112
- const k = d.defaultSeries, T = s(null == k ? [] : k), V = [];
113
- for (const e2 of T) {
114
- const i2 = A[e2.uuid];
112
+ const T = f.defaultSeries, V = s(null == T ? [] : T), $ = [];
113
+ for (const e2 of V) {
114
+ const i2 = _[e2.uuid];
115
115
  if (i2.dynamicField) {
116
- let o2 = L[i2.dynamicField];
116
+ let o2 = M[i2.dynamicField];
117
117
  o2 = o2 || [];
118
118
  const a2 = i2.dynamicDatas ? i2.dynamicDatas : [];
119
119
  for (let l2 = 0; l2 < o2.length; l2++) {
120
120
  const n2 = o2[l2], r2 = s(e2);
121
121
  if (i2.dynamicSeriesTitle) {
122
122
  const e3 = i2.dynamicSeriesTitle.replace("${name}", n2);
123
- r2.name = t(c2, e3);
123
+ r2.name = t(d2, e3);
124
124
  } else r2.name = n2;
125
- r2.data = l2 < a2.length ? a2[l2] : [], "bar" == e2.type && i2.dynamicShowStack && (r2.stack = e2.uuid), V.push(r2);
125
+ r2.data = l2 < a2.length ? a2[l2] : [], "bar" == e2.type && i2.dynamicShowStack && (r2.stack = e2.uuid), $.push(r2);
126
126
  }
127
- } else e2.data = i2 ? i2.data : [], V.push(e2);
127
+ } else e2.data = i2 ? i2.data : [], $.push(e2);
128
128
  }
129
- f.series = V;
130
- const $ = d.defaultXaxis, G = d.defaultYaxis;
131
- if (f.isBar) {
132
- if (G) for (const e2 of G) e2.data = M;
133
- f.xAxis = $, f.yAxis = G;
134
- } else $ && $.length > 0 && ($[0].data = M), f.xAxis = $, f.yAxis = G;
135
- const R = d.props ? d.props.selGroupVariable : null;
136
- !(d.props ? d.props.enableDrill : null) && R && (d.highlightInfos = [], i(c2.entity, R, null)), u(c2, d, "afterUpdateChart", f, { resultData: p }), d.groupFields = D, d.cacheDatas = g, d.rawResult = p;
129
+ p.series = $;
130
+ const G = f.defaultXaxis, R = f.defaultYaxis;
131
+ if (p.isBar) {
132
+ if (R) for (const e2 of R) e2.data = j;
133
+ p.xAxis = G, p.yAxis = R;
134
+ } else G && G.length > 0 && (G[0].data = j), p.xAxis = G, p.yAxis = R;
135
+ const U = f.props ? f.props.selGroupVariable : null;
136
+ !(f.props ? f.props.enableDrill : null) && U && (f.highlightInfos = [], i(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
- c as updateChartOption
139
+ d as updateChartOption
140
140
  };
@@ -1,35 +1,37 @@
1
1
  import { formatVariableValue as e, getValueFromSource as o } from "../page-helper-util.js";
2
2
  import { deepCopy as t } from "../common-util.js";
3
- function s(s2, l, r, i) {
4
- if (!i || !i.result) return;
5
- const p = i && i.result ? i.result : {}, n = l.serviceDataField;
6
- let a = null;
7
- n ? a = p[n] : p && (a = [p]), a || (a = []);
8
- const u = l.props ? l.props.nameSource : void 0, c = l.props ? l.props.nameField : void 0, d = l.props ? l.props.nameFixed : void 0, m = l.props ? l.props.yaxisField : void 0, f = [c], h = [], v = [];
9
- for (let t2 of a) {
3
+ import { setDefaultGrid as s } from "./chart-util.js";
4
+ function r(r2, l, i, p) {
5
+ if (!p || !p.result) return;
6
+ s(i);
7
+ const n = p && p.result ? p.result : {}, a = l.serviceDataField;
8
+ let u = null;
9
+ a ? u = n[a] : n && (u = [n]), u || (u = []);
10
+ const c = l.props ? l.props.nameSource : void 0, m = l.props ? l.props.nameField : void 0, d = l.props ? l.props.nameFixed : void 0, f = l.props ? l.props.yaxisField : void 0, h = [m], v = [], g = [];
11
+ for (const t2 of u) {
10
12
  if (!t2) continue;
11
- let l2 = null;
12
- l2 = "fixed" == u ? e(s2, d) : o(t2, c, void 0), h.push(l2);
13
- const r2 = o(t2, m, void 0);
14
- v.push(r2);
13
+ let s2 = null;
14
+ s2 = "fixed" == c ? e(r2, d) : o(t2, m, void 0), v.push(s2);
15
+ const l2 = o(t2, f, void 0);
16
+ g.push(l2);
15
17
  }
16
- const g = l.defaultSeries;
17
- let F = g[0].pieColors;
18
- F = F || [];
19
- let x = g[0].pieColorMap;
20
- x = x || {};
18
+ const F = l.defaultSeries;
19
+ let x = F[0].pieColors;
20
+ x = x || [];
21
+ let j = F[0].pieColorMap;
22
+ j = j || {};
21
23
  const S = [];
22
- for (let e2 = 0; e2 < h.length && e2 < v.length; e2++) {
23
- const o2 = { value: v[e2], name: h[e2] };
24
- if (e2 < F.length || x[o2.name]) {
25
- let t2 = x[o2.name];
26
- t2 || (t2 = F[e2]), t2 && (o2.itemStyle = { color: t2 });
24
+ for (let e2 = 0; e2 < v.length && e2 < g.length; e2++) {
25
+ const o2 = { value: g[e2], name: v[e2] };
26
+ if (e2 < x.length || j[o2.name]) {
27
+ let t2 = j[o2.name];
28
+ t2 || (t2 = x[e2]), t2 && (o2.itemStyle = { color: t2 });
27
29
  }
28
30
  S.push(o2);
29
31
  }
30
- const j = t(g);
31
- j[0].data = S, r.series = [j[0]], l.groupFields = f, l.cacheDatas = a, l.rawResult = i;
32
+ const y = t(F);
33
+ y[0].data = S, i.series = [y[0]], l.groupFields = h, l.cacheDatas = u, l.rawResult = p;
32
34
  }
33
35
  export {
34
- s as updateChartOption
36
+ r as updateChartOption
35
37
  };
@@ -1,80 +1,81 @@
1
1
  import { getValueFromSource as o, setValueForVariableName as t } from "../page-helper-util.js";
2
2
  import { deepCopy as r } from "../common-util.js";
3
- import { CommonName as s, caculateFormulaValue as e, executeChartFormula as l, sortDatas as n, limitDatas as p } from "./chart-util.js";
4
- function i(i2, u, c, a) {
5
- if (!a || !a.result) return;
6
- const f = a && a.result ? a.result : {};
7
- let g = a && a.groupValue ? a.groupValue : void 0;
8
- const m = u.serviceDataField;
9
- let h = null;
10
- m ? h = f[m] : f && (h = Array.isArray(f) ? f : [f]), h || (h = []);
11
- let d = u.props ? u.props.groups : null;
12
- if (d || (d = []), !g || 0 === g.length) {
13
- g = [];
14
- for (const o2 of d) g.push(o2.group);
3
+ import { setDefaultGrid as s, CommonName as e, caculateFormulaValue as l, executeChartFormula as n, sortDatas as p, limitDatas as i } from "./chart-util.js";
4
+ function u(u2, c, a, f) {
5
+ if (!f || !f.result) return;
6
+ s(a);
7
+ const g = f && f.result ? f.result : {};
8
+ let m = f && f.groupValue ? f.groupValue : void 0;
9
+ const h = c.serviceDataField;
10
+ let d = null;
11
+ h ? d = g[h] : g && (d = Array.isArray(g) ? g : [g]), d || (d = []);
12
+ let y = c.props ? c.props.groups : null;
13
+ if (y || (y = []), !m || 0 === m.length) {
14
+ m = [];
15
+ for (const o2 of y) m.push(o2.group);
15
16
  }
16
- const y = {}, x = [], v = [];
17
- for (const o2 of d) y[o2.group] = o2.target, o2.target && !x.includes(o2.target) && (x.push(o2.target), g.includes(o2.group) && v.push(o2.target));
18
- let E = u.props ? u.props.mulGroupShow : "";
19
- E = "break" == E ? "\r\n" : " ";
20
- for (const t2 of h) {
17
+ const x = {}, v = [], E = [];
18
+ for (const o2 of y) x[o2.group] = o2.target, o2.target && !v.includes(o2.target) && (v.push(o2.target), m.includes(o2.group) && E.push(o2.target));
19
+ let F = c.props ? c.props.mulGroupShow : "";
20
+ F = "break" == F ? "\r\n" : " ";
21
+ for (const t2 of d) {
21
22
  if (!t2) continue;
22
23
  const r2 = [];
23
- for (const s2 of g) {
24
- const e3 = y[s2], l2 = o(t2, e3, void 0);
24
+ for (const s3 of m) {
25
+ const e2 = x[s3], l2 = o(t2, e2, void 0);
25
26
  l2 && r2.push(l2);
26
27
  }
27
- const e2 = r2.join(E);
28
- t2[s.X_FIELD_NAME] = e2;
28
+ const s2 = r2.join(F);
29
+ t2[e.X_FIELD_NAME] = s2;
29
30
  }
30
- const F = u.items ? u.items : [];
31
- if (0 == F.length) return;
32
- const S = u.props ? u.props : {};
33
- let _ = S.yaxisField;
34
- if (F[0].props.yaxisField = _, F[0].props.yaxisSource = S.yaxisSource, F[0].props.formula = S.formula, "formula" === S.yaxisSource) {
35
- const t2 = [], r2 = e(F, h, t2);
36
- let n2 = S.formula ? S.formula : "";
37
- for (const o2 in r2) n2 = n2.replace(new RegExp(o2.replace("$", "\\$"), "g"), r2[o2]);
38
- _ = s.Y_TEMP_NAME;
31
+ const S = c.items ? c.items : [];
32
+ if (0 == S.length) return;
33
+ const _ = c.props ? c.props : {};
34
+ let A = _.yaxisField;
35
+ if (S[0].props.yaxisField = A, S[0].props.yaxisSource = _.yaxisSource, S[0].props.formula = _.formula, "formula" === _.yaxisSource) {
36
+ const t2 = [], r2 = l(S, d, t2);
37
+ let s2 = _.formula ? _.formula : "";
38
+ for (const o2 in r2) s2 = s2.replace(new RegExp(o2.replace("$", "\\$"), "g"), r2[o2]);
39
+ A = e.Y_TEMP_NAME;
39
40
  const p2 = {};
40
- for (const r3 of h) {
41
+ for (const r3 of d) {
41
42
  if (!r3) continue;
42
43
  for (const s3 of t2) {
43
44
  const t3 = o(r3, s3, void 0);
44
- let e2 = p2[s3];
45
- void 0 === t3 || isNaN(t3) || (void 0 === e2 ? e2 = t3 : e2 += t3), p2[s3] = e2;
45
+ let e3 = p2[s3];
46
+ void 0 === t3 || isNaN(t3) || (void 0 === e3 ? e3 = t3 : e3 += t3), p2[s3] = e3;
46
47
  }
47
- const s2 = l(n2, p2, r3, i2);
48
- r3[_] = s2;
48
+ const e2 = n(s2, p2, r3, u2);
49
+ r3[A] = e2;
49
50
  }
50
51
  }
51
- F[0].props.yaxisField = _, F[0].props.yaxisSource = "", n(i2, u, h), h = p(i2, u, h, x, [_]);
52
- const A = [], D = [];
53
- for (const t2 of h) {
52
+ S[0].props.yaxisField = A, S[0].props.yaxisSource = "", p(u2, c, d), d = i(u2, c, d, v, [A]);
53
+ const D = [], M = [];
54
+ for (const t2 of d) {
54
55
  if (!t2) continue;
55
- A.push(t2[s.X_FIELD_NAME]);
56
- const r2 = o(t2, _, void 0);
57
- D.push(r2);
56
+ D.push(t2[e.X_FIELD_NAME]);
57
+ const r2 = o(t2, A, void 0);
58
+ M.push(r2);
58
59
  }
59
- const M = u.defaultSeries;
60
- let N = M[0].pieColors;
61
- N = N || [];
62
- let j = M[0].pieColorMap;
63
- j = j || {};
64
- const b = [];
65
- for (let o2 = 0; o2 < A.length && o2 < D.length; o2++) {
66
- const t2 = { value: D[o2], name: A[o2] };
67
- if (o2 < N.length || j[t2.name]) {
68
- let r2 = j[t2.name];
69
- r2 || (r2 = N[o2]), r2 && (t2.itemStyle = { color: r2 });
60
+ const N = c.defaultSeries;
61
+ let j = N[0].pieColors;
62
+ j = j || [];
63
+ let b = N[0].pieColorMap;
64
+ b = b || {};
65
+ const w = [];
66
+ for (let o2 = 0; o2 < D.length && o2 < M.length; o2++) {
67
+ const t2 = { value: M[o2], name: D[o2] };
68
+ if (o2 < j.length || b[t2.name]) {
69
+ let r2 = b[t2.name];
70
+ r2 || (r2 = j[o2]), r2 && (t2.itemStyle = { color: r2 });
70
71
  }
71
- b.push(t2);
72
+ w.push(t2);
72
73
  }
73
- const w = r(M);
74
- w[0].data = b, c.series = [w[0]];
75
- const I = u.props ? u.props.selGroupVariable : null;
76
- !(u.props ? u.props.enableDrill : null) && I && (u.highlightInfos = [], t(i2.entity, I, null)), u.groupFields = v, u.cacheDatas = h, u.rawResult = a;
74
+ const I = r(N);
75
+ I[0].data = w, a.series = [I[0]];
76
+ const V = c.props ? c.props.selGroupVariable : null;
77
+ !(c.props ? c.props.enableDrill : null) && V && (c.highlightInfos = [], t(u2.entity, V, null)), c.groupFields = E, c.cacheDatas = d, c.rawResult = f;
77
78
  }
78
79
  export {
79
- i as updateChartOption
80
+ u as updateChartOption
80
81
  };
@@ -1,54 +1,55 @@
1
1
  import { getValueFromSource as e } from "../page-helper-util.js";
2
2
  import { deepCopy as o } from "../common-util.js";
3
- import { caculateFormulaValue as i, executeChartFormula as t } from "./chart-util.js";
4
- function a(a2, s, r, l) {
5
- if (!l || !l.result) return;
6
- const u = l && l.result ? l.result : {}, f = s.serviceDataField;
7
- let d = null;
8
- f ? d = u[f] : u && (d = Array.isArray(u) ? u : [u]), d || (d = []);
9
- const n = s.items ? s.items : [], c = [], p = {}, m = [], x = i(n, d, m);
10
- for (const e2 of n) {
3
+ import { setDefaultGrid as i, caculateFormulaValue as t, executeChartFormula as a } from "./chart-util.js";
4
+ function s(s2, r, l, u) {
5
+ if (!u || !u.result) return;
6
+ i(l);
7
+ const f = u && u.result ? u.result : {}, d = r.serviceDataField;
8
+ let n = null;
9
+ d ? n = f[d] : f && (n = Array.isArray(f) ? f : [f]), n || (n = []);
10
+ const c = r.items ? r.items : [], p = [], m = {}, x = [], v = t(c, n, x);
11
+ for (const e2 of c) {
11
12
  const o2 = e2.props ? e2.props : {}, i2 = o2.yaxisSource, t2 = o2.yaxisField;
12
- let a3 = null;
13
+ let a2 = null;
13
14
  if (!t2 || i2 && "variable" != i2) if ("formula" == i2) {
14
15
  let i3 = o2.formula ? o2.formula : "";
15
- for (const e3 in x) i3 = i3.replace(new RegExp(e3.replace("$", "\\$"), "g"), x[e3]);
16
- a3 = { uuid: e2.uuid, type: "formula", formula: i3, data: [] };
17
- } else a3 = { uuid: e2.uuid, type: "fixed", field: o2.yaxisFix, data: [] };
18
- else a3 = { uuid: e2.uuid, type: "variable", field: t2, data: [] };
19
- a3 && (c.push(a3), p[a3.uuid] = a3);
16
+ for (const e3 in v) i3 = i3.replace(new RegExp(e3.replace("$", "\\$"), "g"), v[e3]);
17
+ a2 = { uuid: e2.uuid, type: "formula", formula: i3, data: [] };
18
+ } else a2 = { uuid: e2.uuid, type: "fixed", field: o2.yaxisFix, data: [] };
19
+ else a2 = { uuid: e2.uuid, type: "variable", field: t2, data: [] };
20
+ a2 && (p.push(a2), m[a2.uuid] = a2);
20
21
  }
21
- const v = s.props ? s.props : {}, y = v.nameField, h = v.maxSource, F = v.maxField, b = v.maxFixed, g = [], j = {};
22
- for (const o2 of d) {
22
+ const y = r.props ? r.props : {}, h = y.nameField, F = y.maxSource, b = y.maxField, g = y.maxFixed, j = [], S = {};
23
+ for (const o2 of n) {
23
24
  if (!o2) continue;
24
- const i2 = e(o2, y, void 0);
25
- let s2 = null;
26
- s2 = h && "variable" != h ? b : e(o2, F, void 0), g.push({ text: i2, max: s2 });
27
- for (const i3 of m) {
28
- const t2 = e(o2, i3, void 0);
29
- let a3 = j[i3];
30
- void 0 === t2 || isNaN(t2) || (void 0 === a3 ? a3 = t2 : a3 += t2), j[i3] = a3;
25
+ const i2 = e(o2, h, void 0);
26
+ let t2 = null;
27
+ t2 = F && "variable" != F ? g : e(o2, b, void 0), j.push({ text: i2, max: t2 });
28
+ for (const i3 of x) {
29
+ const t3 = e(o2, i3, void 0);
30
+ let a2 = S[i3];
31
+ void 0 === t3 || isNaN(t3) || (void 0 === a2 ? a2 = t3 : a2 += t3), S[i3] = a2;
31
32
  }
32
- for (const i3 of c) {
33
- const s3 = i3.data;
34
- if ("fixed" == i3.type) s3.push(i3.field);
33
+ for (const i3 of p) {
34
+ const t3 = i3.data;
35
+ if ("fixed" == i3.type) t3.push(i3.field);
35
36
  else if ("variable" == i3.type) {
36
- const t2 = e(o2, i3.field, void 0);
37
- s3.push(t2);
37
+ const a2 = e(o2, i3.field, void 0);
38
+ t3.push(a2);
38
39
  } else if ("formula" == i3.type) {
39
- const e2 = t(i3.formula, j, o2, a2);
40
- s3.push(e2);
41
- } else s3.push(void 0);
40
+ const e2 = a(i3.formula, S, o2, s2);
41
+ t3.push(e2);
42
+ } else t3.push(void 0);
42
43
  }
43
44
  }
44
- r.radar[0].indicator = g;
45
- const S = s.defaultSeries, w = o(S), A = w[0].data;
46
- for (const e2 of A) {
47
- const o2 = p[e2.uuid];
45
+ l.radar[0].indicator = j;
46
+ const w = r.defaultSeries, A = o(w), D = A[0].data;
47
+ for (const e2 of D) {
48
+ const o2 = m[e2.uuid];
48
49
  e2.value = o2.data;
49
50
  }
50
- r.series = w, s.cacheDatas = d, s.rawResult = l;
51
+ l.series = A, r.cacheDatas = n, r.rawResult = u;
51
52
  }
52
53
  export {
53
- a as updateChartOption
54
+ s as updateChartOption
54
55
  };
@@ -1,45 +1,46 @@
1
1
  import { getValueFromSource as o } from "../page-helper-util.js";
2
2
  import { deepCopy as s } from "../common-util.js";
3
- import { caculateFormulaValue as i, executeChartFormula as e } from "./chart-util.js";
4
- function r(r2, t, a, l) {
5
- if (!l || !l.result) return;
6
- const u = l && l.result ? l.result : {}, f = t.serviceDataField;
7
- let c = null;
8
- f ? c = u[f] : u && (c = Array.isArray(u) ? u : [u]), c || (c = []);
9
- const d = t.items ? t.items : [], n = [], p = {};
10
- for (const o2 of d) {
11
- const s2 = o2.props ? o2.props : {}, i2 = o2.props ? o2.style : {}, e2 = s2.xaxisField, r3 = s2.sizeField, t2 = { uuid: o2.uuid, xaxisField: e2, yaxisField: s2.yaxisField, yaxisSource: s2.yaxisSource, formula: s2.formula, sizeField: r3, symbolSize: i2.symbolSize, data: [] };
12
- n.push(t2), p[t2.uuid] = t2;
3
+ import { setDefaultGrid as i, caculateFormulaValue as e, executeChartFormula as r } from "./chart-util.js";
4
+ function t(t2, a, l, u) {
5
+ if (!u || !u.result) return;
6
+ i(l);
7
+ const f = u && u.result ? u.result : {}, c = a.serviceDataField;
8
+ let d = null;
9
+ c ? d = f[c] : f && (d = Array.isArray(f) ? f : [f]), d || (d = []);
10
+ const n = a.items ? a.items : [], p = [], m = {};
11
+ for (const o2 of n) {
12
+ const s2 = o2.props ? o2.props : {}, i2 = o2.props ? o2.style : {}, e2 = s2.xaxisField, r2 = s2.sizeField, t3 = { uuid: o2.uuid, xaxisField: e2, yaxisField: s2.yaxisField, yaxisSource: s2.yaxisSource, formula: s2.formula, sizeField: r2, symbolSize: i2.symbolSize, data: [] };
13
+ p.push(t3), m[t3.uuid] = t3;
13
14
  }
14
- const m = [], x = i(d, c, m);
15
- for (const o2 of n) if ("formula" === o2.yaxisSource) {
15
+ const x = [], y = e(n, d, x);
16
+ for (const o2 of p) if ("formula" === o2.yaxisSource) {
16
17
  let s2 = o2.formula ? o2.formula : "";
17
- for (const o3 in x) s2 = s2.replace(new RegExp(o3.replace("$", "\\$"), "g"), x[o3]);
18
+ for (const o3 in y) s2 = s2.replace(new RegExp(o3.replace("$", "\\$"), "g"), y[o3]);
18
19
  o2.formula = s2;
19
20
  }
20
- const y = {};
21
- for (const s2 of c) if (s2) {
22
- for (const i2 of m) {
21
+ const F = {};
22
+ for (const s2 of d) if (s2) {
23
+ for (const i2 of x) {
23
24
  const e2 = o(s2, i2, void 0);
24
- let r3 = y[i2];
25
- void 0 === e2 || isNaN(e2) || (void 0 === r3 ? r3 = e2 : r3 += e2), y[i2] = r3;
25
+ let r2 = F[i2];
26
+ void 0 === e2 || isNaN(e2) || (void 0 === r2 ? r2 = e2 : r2 += e2), F[i2] = r2;
26
27
  }
27
- for (const i2 of n) {
28
- const t2 = i2.data, a2 = [];
28
+ for (const i2 of p) {
29
+ const e2 = i2.data, a2 = [];
29
30
  if (a2.push(o(s2, i2.xaxisField, void 0)), "formula" === i2.yaxisSource) {
30
- const o2 = e(i2.formula, y, s2, r2);
31
+ const o2 = r(i2.formula, F, s2, t2);
31
32
  a2.push(o2);
32
33
  } else a2.push(o(s2, i2.yaxisField, void 0));
33
- i2.sizeField ? a2.push(o(s2, i2.xaxisField, void 0)) : a2.push(i2.symbolSize), t2.push(a2);
34
+ i2.sizeField ? a2.push(o(s2, i2.xaxisField, void 0)) : a2.push(i2.symbolSize), e2.push(a2);
34
35
  }
35
36
  }
36
- const F = t.defaultSeries, h = s(F);
37
- for (const o2 of h) {
38
- const s2 = p[o2.uuid];
37
+ const h = a.defaultSeries, S = s(h);
38
+ for (const o2 of S) {
39
+ const s2 = m[o2.uuid];
39
40
  o2.data = s2.data;
40
41
  }
41
- a.series = h, t.cacheDatas = c, t.rawResult = l;
42
+ l.series = S, a.cacheDatas = d, a.rawResult = u;
42
43
  }
43
44
  export {
44
- r as updateChartOption
45
+ t as updateChartOption
45
46
  };
@@ -110,3 +110,4 @@ export declare function exportCommonChart(chartRef: any): {
110
110
  fileSize: string;
111
111
  };
112
112
  export declare function setHomeChartInitConfigValue(initConfig: any, tempContext: any, homeChartSettingUserId: any): void;
113
+ export declare function setDefaultGrid(chartOption: any): void;