super-page-runtime 2.3.18 → 2.3.19-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.
Files changed (92) hide show
  1. package/dist/es/components/runtime/utils/api/page-expose-util.js +70 -70
  2. package/dist/es/components/runtime/utils/assemblys-config.js +1 -1
  3. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +67 -66
  4. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +31 -30
  5. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +66 -65
  6. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +47 -46
  7. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +33 -32
  8. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +1 -0
  9. package/dist/es/components/runtime/utils/charts/chart-util.js +73 -64
  10. package/dist/es/components/runtime/utils/events/event-util.js +3 -3
  11. package/dist/es/components/runtime/utils/events/print-label.js +25 -26
  12. package/dist/es/components/runtime/utils/events/standard-event.d.ts +3 -1
  13. package/dist/es/components/runtime/utils/events/standard-event.js +591 -554
  14. package/dist/es/components/runtime/utils/events/validator-util.js +1 -1
  15. package/dist/es/components/runtime/utils/page-init-util.js +5 -7
  16. package/dist/es/components/runtime/utils/page-store.js +10 -10
  17. package/dist/es/components/runtime/utils/table-utils.js +1 -1
  18. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +3 -3
  19. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +3 -3
  20. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +3 -3
  21. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +1 -1
  22. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +3 -3
  23. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +1 -1
  24. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +6 -10
  25. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +6 -8
  26. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +1 -1
  27. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +1 -1
  28. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +1 -1
  29. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +1 -1
  30. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +1 -1
  31. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +93 -98
  32. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +148 -145
  33. package/dist/es/components/runtime/views/assemblys/common/event-call-component.vue.d.ts +5 -0
  34. package/dist/es/components/runtime/views/assemblys/common/event-call-component.vue.js +20 -0
  35. package/dist/es/components/runtime/views/assemblys/common/event-call-component.vue2.js +4 -0
  36. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +9 -11
  37. package/dist/es/components/runtime/views/assemblys/common/save-chart-condition-dialog.vue.js +1 -1
  38. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +3 -3
  39. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +3 -3
  40. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +3 -3
  41. package/dist/es/components/runtime/views/assemblys/container/fixed/YxAffix.vue2.js +0 -2
  42. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +3 -3
  43. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +3 -3
  44. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +1 -1
  45. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +3 -3
  46. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +1 -1
  47. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +36 -24
  48. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +10 -12
  49. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +194 -194
  50. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +1 -1
  51. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +16 -16
  52. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +3 -3
  53. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +3 -3
  54. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +6 -6
  55. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +37 -37
  56. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +3 -3
  57. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +3 -3
  58. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +4 -4
  59. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +3 -3
  60. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +37 -38
  61. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +5 -7
  62. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +3 -4
  63. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +3 -3
  64. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +2 -2
  65. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +4 -5
  66. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +1 -1
  67. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +3 -3
  68. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +11 -11
  69. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +3 -3
  70. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +3 -3
  71. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +11 -13
  72. package/dist/es/components/runtime/views/assemblys/page-bottom.vue.d.ts +14 -0
  73. package/dist/es/components/runtime/views/assemblys/page-bottom.vue.js +6 -0
  74. package/dist/es/components/runtime/views/assemblys/page-bottom.vue2.js +4 -0
  75. package/dist/es/components/runtime/views/assemblys/workflow/component/workflow-opinion-box.vue.d.ts +14 -0
  76. package/dist/es/components/runtime/views/assemblys/workflow/component/workflow-opinion-box.vue.js +7 -0
  77. package/dist/es/components/runtime/views/assemblys/workflow/component/workflow-opinion-box.vue2.js +26 -0
  78. package/dist/es/components/runtime/views/assemblys/workflow/extract-workflow/extract-workflow-runtime-dialog.vue.js +7 -0
  79. package/dist/es/components/runtime/views/assemblys/workflow/extract-workflow/extract-workflow-runtime-dialog.vue2.js +28 -0
  80. package/dist/es/components/runtime/views/assemblys/workflow/extract-workflow/extract-workflow-runtime.vue.js +1 -1
  81. package/dist/es/components/runtime/views/assemblys/workflow/extract-workflow/extract-workflow-runtime.vue2.js +1 -1
  82. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +1 -1
  83. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +9 -9
  84. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +22 -13
  85. package/dist/es/components/runtime/views/home-chart.vue.js +7 -7
  86. package/dist/es/components/runtime/views/super-page-dialog.vue.js +0 -1
  87. package/dist/es/components/runtime/views/super-page.vue.js +1 -1
  88. package/dist/es/components/runtime/views/super-page.vue2.js +165 -161
  89. package/dist/es/i18n/langs/cn.js +1 -1
  90. package/dist/es/i18n/langs/en.js +1 -1
  91. package/dist/es/style.css +134 -86
  92. package/package.json +2 -2
@@ -1,81 +1,82 @@
1
1
  import { getValueFromSource as o, setValueForVariableName as t } from "../page-helper-util.js";
2
- import { deepCopy as r } from "../common-util.js";
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);
2
+ import { deepCopy as e } from "../common-util.js";
3
+ import { setDefaultGrid as r, CommonName as s, caculateFormulaValue as l, executeChartFormula as n, sortDatas as p, limitDatas as i, formatToolboxI18n as a } from "./chart-util.js";
4
+ import { handleChartEvent as u } from "../events/event-util.js";
5
+ function c(c2, f, g, m) {
6
+ if (!m || !m.result) return;
7
+ u(c2, f, "beforeUpdateChart", g, { resultData: m }), r(g);
8
+ const h = m && m.result ? m.result : {};
9
+ let d = m && m.groupValue ? m.groupValue : void 0;
10
+ const y = f.serviceDataField;
11
+ let v = null;
12
+ y ? v = h[y] : h && (v = Array.isArray(h) ? h : [h]), v || (v = []);
13
+ let x = f.props ? f.props.groups : null;
14
+ if (x || (x = []), !d || 0 === d.length) {
15
+ d = [];
16
+ for (const o2 of x) d.push(o2.group);
16
17
  }
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) {
18
+ const D = {}, E = [], F = [];
19
+ for (const o2 of x) D[o2.group] = o2.target, o2.target && !E.includes(o2.target) && (E.push(o2.target), d.includes(o2.group) && F.push(o2.target));
20
+ let S = f.props ? f.props.mulGroupShow : "";
21
+ S = "break" == S ? "\r\n" : " ";
22
+ for (const t2 of v) {
22
23
  if (!t2) continue;
23
- const r2 = [];
24
- for (const s3 of m) {
25
- const e2 = x[s3], l2 = o(t2, e2, void 0);
26
- l2 && r2.push(l2);
24
+ const e2 = [];
25
+ for (const r3 of d) {
26
+ const s2 = D[r3], l2 = o(t2, s2, void 0);
27
+ l2 && e2.push(l2);
27
28
  }
28
- const s2 = r2.join(F);
29
- t2[e.X_FIELD_NAME] = s2;
29
+ const r2 = e2.join(S);
30
+ t2[s.X_FIELD_NAME] = r2;
30
31
  }
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;
32
+ const _ = f.items ? f.items : [];
33
+ if (0 == _.length) return;
34
+ const j = f.props ? f.props : {};
35
+ let A = j.yaxisField;
36
+ if (_[0].props.yaxisField = A, _[0].props.yaxisSource = j.yaxisSource, _[0].props.formula = j.formula, "formula" === j.yaxisSource) {
37
+ const t2 = [], e2 = l(_, v, t2);
38
+ let r2 = j.formula ? j.formula : "";
39
+ for (const o2 in e2) r2 = r2.replace(new RegExp(o2.replace("$", "\\$"), "g"), e2[o2]);
40
+ A = s.Y_TEMP_NAME;
40
41
  const p2 = {};
41
- for (const r3 of d) {
42
- if (!r3) continue;
43
- for (const s3 of t2) {
44
- const t3 = o(r3, s3, void 0);
45
- let e3 = p2[s3];
46
- void 0 === t3 || isNaN(t3) || (void 0 === e3 ? e3 = t3 : e3 += t3), p2[s3] = e3;
42
+ for (const e3 of v) {
43
+ if (!e3) continue;
44
+ for (const r3 of t2) {
45
+ const t3 = o(e3, r3, void 0);
46
+ let s3 = p2[r3];
47
+ void 0 === t3 || isNaN(t3) || (void 0 === s3 ? s3 = t3 : s3 += t3), p2[r3] = s3;
47
48
  }
48
- const e2 = n(s2, p2, r3, u2);
49
- r3[A] = e2;
49
+ const s2 = n(r2, p2, e3, c2);
50
+ e3[A] = s2;
50
51
  }
51
52
  }
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) {
53
+ _[0].props.yaxisField = A, _[0].props.yaxisSource = "", p(c2, f, v), v = i(c2, f, v, E, [A]);
54
+ const M = [], N = [];
55
+ for (const t2 of v) {
55
56
  if (!t2) continue;
56
- D.push(t2[e.X_FIELD_NAME]);
57
- const r2 = o(t2, A, void 0);
58
- M.push(r2);
57
+ M.push(t2[s.X_FIELD_NAME]);
58
+ const e2 = o(t2, A, void 0);
59
+ N.push(e2);
59
60
  }
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 });
61
+ const b = f.defaultSeries;
62
+ let C = b[0].pieColors;
63
+ C = C || [];
64
+ let w = b[0].pieColorMap;
65
+ w = w || {};
66
+ const I = [];
67
+ for (let o2 = 0; o2 < M.length && o2 < N.length; o2++) {
68
+ const t2 = { value: N[o2], name: M[o2] };
69
+ if (o2 < C.length || w[t2.name]) {
70
+ let e2 = w[t2.name];
71
+ e2 || (e2 = C[o2]), e2 && (t2.itemStyle = { color: e2 });
71
72
  }
72
- w.push(t2);
73
+ I.push(t2);
73
74
  }
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;
75
+ const V = e(b);
76
+ V[0].data = I, g.series = [V[0]], a(g);
77
+ const G = f.props ? f.props.selGroupVariable : null;
78
+ !(f.props ? f.props.enableDrill : null) && G && (f.highlightInfos = [], t(c2.entity, G, null)), u(c2, f, "afterUpdateChart", g, { resultData: m }), f.groupFields = F, f.cacheDatas = v, f.rawResult = m;
78
79
  }
79
80
  export {
80
- u as updateChartOption
81
+ c as updateChartOption
81
82
  };
@@ -1,55 +1,56 @@
1
1
  import { getValueFromSource as e } from "../page-helper-util.js";
2
- import { deepCopy as o } from "../common-util.js";
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) {
12
- const o2 = e2.props ? e2.props : {}, i2 = o2.yaxisSource, t2 = o2.yaxisField;
13
- let a2 = null;
14
- if (!t2 || i2 && "variable" != i2) if ("formula" == i2) {
15
- let i3 = o2.formula ? o2.formula : "";
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);
2
+ import { deepCopy as t } from "../common-util.js";
3
+ import { setDefaultGrid as o, caculateFormulaValue as a, executeChartFormula as i, formatToolboxI18n as r } from "./chart-util.js";
4
+ import { handleChartEvent as s } from "../events/event-util.js";
5
+ function l(l2, u, f, d) {
6
+ if (!d || !d.result) return;
7
+ s(l2, u, "beforeUpdateChart", f, { resultData: d }), o(f);
8
+ const n = d && d.result ? d.result : {}, p = u.serviceDataField;
9
+ let c = null;
10
+ p ? c = n[p] : n && (c = Array.isArray(n) ? n : [n]), c || (c = []);
11
+ const m = u.items ? u.items : [], v = [], x = {}, h = [], y = a(m, c, h);
12
+ for (const e2 of m) {
13
+ const t2 = e2.props ? e2.props : {}, o2 = t2.yaxisSource, a2 = t2.yaxisField;
14
+ let i2 = null;
15
+ if (!a2 || o2 && "variable" != o2) if ("formula" == o2) {
16
+ let o3 = t2.formula ? t2.formula : "";
17
+ for (const e3 in y) o3 = o3.replace(new RegExp(e3.replace("$", "\\$"), "g"), y[e3]);
18
+ i2 = { uuid: e2.uuid, type: "formula", formula: o3, data: [] };
19
+ } else i2 = { uuid: e2.uuid, type: "fixed", field: t2.yaxisFix, data: [] };
20
+ else i2 = { uuid: e2.uuid, type: "variable", field: a2, data: [] };
21
+ i2 && (v.push(i2), x[i2.uuid] = i2);
21
22
  }
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) {
24
- if (!o2) continue;
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;
23
+ const F = u.props ? u.props : {}, b = F.nameField, j = F.maxSource, D = F.maxField, g = F.maxFixed, S = [], w = {};
24
+ for (const t2 of c) {
25
+ if (!t2) continue;
26
+ const o2 = e(t2, b, void 0);
27
+ let a2 = null;
28
+ a2 = j && "variable" != j ? g : e(t2, D, void 0), S.push({ text: o2, max: a2 });
29
+ for (const o3 of h) {
30
+ const a3 = e(t2, o3, void 0);
31
+ let i2 = w[o3];
32
+ void 0 === a3 || isNaN(a3) || (void 0 === i2 ? i2 = a3 : i2 += a3), w[o3] = i2;
32
33
  }
33
- for (const i3 of p) {
34
- const t3 = i3.data;
35
- if ("fixed" == i3.type) t3.push(i3.field);
36
- else if ("variable" == i3.type) {
37
- const a2 = e(o2, i3.field, void 0);
38
- t3.push(a2);
39
- } else if ("formula" == i3.type) {
40
- const e2 = a(i3.formula, S, o2, s2);
41
- t3.push(e2);
42
- } else t3.push(void 0);
34
+ for (const o3 of v) {
35
+ const a3 = o3.data;
36
+ if ("fixed" == o3.type) a3.push(o3.field);
37
+ else if ("variable" == o3.type) {
38
+ const i2 = e(t2, o3.field, void 0);
39
+ a3.push(i2);
40
+ } else if ("formula" == o3.type) {
41
+ const e2 = i(o3.formula, w, t2, l2);
42
+ a3.push(e2);
43
+ } else a3.push(void 0);
43
44
  }
44
45
  }
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];
49
- e2.value = o2.data;
46
+ f.radar[0].indicator = S, r(f);
47
+ const A = u.defaultSeries, C = t(A), N = C[0].data;
48
+ for (const e2 of N) {
49
+ const t2 = x[e2.uuid];
50
+ e2.value = t2.data;
50
51
  }
51
- l.series = A, r.cacheDatas = n, r.rawResult = u;
52
+ f.series = C, s(l2, u, "afterUpdateChart", f, { resultData: d }), u.cacheDatas = c, u.rawResult = d;
52
53
  }
53
54
  export {
54
- s as updateChartOption
55
+ l as updateChartOption
55
56
  };
@@ -1,46 +1,47 @@
1
1
  import { getValueFromSource as o } from "../page-helper-util.js";
2
2
  import { deepCopy as s } from "../common-util.js";
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;
3
+ import { setDefaultGrid as e, caculateFormulaValue as i, executeChartFormula as t, formatToolboxI18n as r } from "./chart-util.js";
4
+ import { handleChartEvent as a } from "../events/event-util.js";
5
+ function l(l2, u, f, c) {
6
+ if (!c || !c.result) return;
7
+ a(l2, u, "beforeUpdateChart", f, { resultData: c }), e(f);
8
+ const d = c && c.result ? c.result : {}, n = u.serviceDataField;
9
+ let p = null;
10
+ n ? p = d[n] : d && (p = Array.isArray(d) ? d : [d]), p || (p = []);
11
+ const m = u.items ? u.items : [], x = [], y = {};
12
+ for (const o2 of m) {
13
+ const s2 = o2.props ? o2.props : {}, e2 = o2.props ? o2.style : {}, i2 = s2.xaxisField, t2 = s2.sizeField, r2 = { uuid: o2.uuid, xaxisField: i2, yaxisField: s2.yaxisField, yaxisSource: s2.yaxisSource, formula: s2.formula, sizeField: t2, symbolSize: e2.symbolSize, data: [] };
14
+ x.push(r2), y[r2.uuid] = r2;
14
15
  }
15
- const x = [], y = e(n, d, x);
16
- for (const o2 of p) if ("formula" === o2.yaxisSource) {
16
+ const h = [], F = i(m, p, h);
17
+ for (const o2 of x) if ("formula" === o2.yaxisSource) {
17
18
  let s2 = o2.formula ? o2.formula : "";
18
- for (const o3 in y) s2 = s2.replace(new RegExp(o3.replace("$", "\\$"), "g"), y[o3]);
19
+ for (const o3 in F) s2 = s2.replace(new RegExp(o3.replace("$", "\\$"), "g"), F[o3]);
19
20
  o2.formula = s2;
20
21
  }
21
- const F = {};
22
- for (const s2 of d) if (s2) {
23
- for (const i2 of x) {
24
- const e2 = o(s2, i2, void 0);
25
- let r2 = F[i2];
26
- void 0 === e2 || isNaN(e2) || (void 0 === r2 ? r2 = e2 : r2 += e2), F[i2] = r2;
22
+ const v = {};
23
+ for (const s2 of p) if (s2) {
24
+ for (const e2 of h) {
25
+ const i2 = o(s2, e2, void 0);
26
+ let t2 = v[e2];
27
+ void 0 === i2 || isNaN(i2) || (void 0 === t2 ? t2 = i2 : t2 += i2), v[e2] = t2;
27
28
  }
28
- for (const i2 of p) {
29
- const e2 = i2.data, a2 = [];
30
- if (a2.push(o(s2, i2.xaxisField, void 0)), "formula" === i2.yaxisSource) {
31
- const o2 = r(i2.formula, F, s2, t2);
32
- a2.push(o2);
33
- } else a2.push(o(s2, i2.yaxisField, void 0));
34
- i2.sizeField ? a2.push(o(s2, i2.xaxisField, void 0)) : a2.push(i2.symbolSize), e2.push(a2);
29
+ for (const e2 of x) {
30
+ const i2 = e2.data, r2 = [];
31
+ if (r2.push(o(s2, e2.xaxisField, void 0)), "formula" === e2.yaxisSource) {
32
+ const o2 = t(e2.formula, v, s2, l2);
33
+ r2.push(o2);
34
+ } else r2.push(o(s2, e2.yaxisField, void 0));
35
+ e2.sizeField ? r2.push(o(s2, e2.xaxisField, void 0)) : r2.push(e2.symbolSize), i2.push(r2);
35
36
  }
36
37
  }
37
- const h = a.defaultSeries, S = s(h);
38
- for (const o2 of S) {
39
- const s2 = m[o2.uuid];
38
+ const S = u.defaultSeries, z = s(S);
39
+ for (const o2 of z) {
40
+ const s2 = y[o2.uuid];
40
41
  o2.data = s2.data;
41
42
  }
42
- l.series = S, a.cacheDatas = d, a.rawResult = u;
43
+ f.series = z, r(f), a(l2, u, "afterUpdateChart", f, { resultData: c }), u.cacheDatas = p, u.rawResult = c;
43
44
  }
44
45
  export {
45
- t as updateChartOption
46
+ l as updateChartOption
46
47
  };
@@ -112,3 +112,4 @@ export declare function exportCommonChart(chartRef: any, headerInfo: any): {
112
112
  };
113
113
  export declare function setHomeChartInitConfigValue(initConfig: any, tempContext: any, homeChartSettingUserId: any): void;
114
114
  export declare function setDefaultGrid(chartOption: any): void;
115
+ export declare function formatToolboxI18n(chartOption: any): void;
@@ -2,14 +2,15 @@ import t from "../../../../assets/chart-themes/theme1.js";
2
2
  import e from "../../../../assets/chart-themes/theme2.js";
3
3
  import n from "../../../../assets/chart-themes/theme3.js";
4
4
  import { getDefaultValue as i } from "../page-init-util.js";
5
- import { getValueFromSource as s, setValueForVariableName as o, getParamNames as r, formatVariableValue as l, getValueFromVariable as a, setVariableValue as c } from "../page-helper-util.js";
6
- import { appendDefaultMethods as f } from "../events/event-util.js";
7
- var u = ((t2) => (t2.X_FIELD_NAME = "__x", t2.Y_TEMP_NAME = "__y", t2))(u || {});
8
- const d = { theme1: t, theme2: e, theme3: n };
9
- function p(t2) {
10
- return d[t2];
5
+ import { getValueFromSource as s, setValueForVariableName as o, getParamNames as r, formatVariableValue as a, getValueFromVariable as l, setVariableValue as c } from "../page-helper-util.js";
6
+ import { getI18n as f } from "agilebuilder-ui/src/utils/util";
7
+ import { appendDefaultMethods as u } from "../events/event-util.js";
8
+ var d = ((t2) => (t2.X_FIELD_NAME = "__x", t2.Y_TEMP_NAME = "__y", t2))(d || {});
9
+ const p = { theme1: t, theme2: e, theme3: n };
10
+ function h(t2) {
11
+ return p[t2];
11
12
  }
12
- function h() {
13
+ function g() {
13
14
  return [{ value: "theme1", label: "主题1" }, { value: "theme2", label: "主题2" }, { value: "theme3", label: "主题3" }];
14
15
  }
15
16
  function m(t2, e2, n2, i2, s2) {
@@ -22,13 +23,13 @@ function m(t2, e2, n2, i2, s2) {
22
23
  let t3 = parseInt(e2);
23
24
  (null == t3 || isNaN(t3)) && (t3 = 2), r2 = parseFloat(parseFloat(r2).toFixed(t3));
24
25
  }
25
- let l2 = "";
26
- t2.indexOf("prefix") > -1 && n2 && (l2 = n2);
27
26
  let a2 = "";
28
- return t2.indexOf("append") > -1 && i2 && (a2 = i2), l2 + r2.toLocaleString() + a2;
27
+ t2.indexOf("prefix") > -1 && n2 && (a2 = n2);
28
+ let l2 = "";
29
+ return t2.indexOf("append") > -1 && i2 && (l2 = i2), a2 + r2.toLocaleString() + l2;
29
30
  };
30
31
  }
31
- function g(t2, e2) {
32
+ function x(t2, e2) {
32
33
  if (!e2) return;
33
34
  if (e2.tooltipFormatterArgs && (e2.tooltip || (e2.tooltip = {}), e2.tooltip.valueFormatter = m.apply(e2, e2.tooltipFormatterArgs)), e2.series) {
34
35
  const n3 = t2.props ? t2.props.enableDrill : null;
@@ -47,22 +48,22 @@ function g(t2, e2) {
47
48
  });
48
49
  t2.defaultYaxis = s2;
49
50
  }
50
- function x(t2, e2, n2) {
51
+ function I(t2, e2, n2) {
51
52
  if (!(n2 && e2 && e2.clickSet && t2)) return;
52
53
  const i2 = e2.clickSet;
53
54
  n2.on("click", function(s2) {
54
55
  let o2 = e2.highlightInfos ? e2.highlightInfos : [], r2 = -1;
55
56
  if (o2) {
56
57
  const t3 = [];
57
- for (let l2 = 0; l2 < o2.length; l2++) {
58
- const a2 = o2[l2], c2 = a2.seriesIndex === s2.seriesIndex && a2.dataIndex === s2.dataIndex;
58
+ for (let a2 = 0; a2 < o2.length; a2++) {
59
+ const l2 = o2[a2], c2 = l2.seriesIndex === s2.seriesIndex && l2.dataIndex === s2.dataIndex;
59
60
  if (c2 || !i2.multiple) {
60
61
  if (i2.selected) {
61
62
  const t4 = "chart-pie" === e2.name ? "unselect" : "downplay";
62
- n2.dispatchAction({ type: t4, seriesIndex: a2.seriesIndex, dataIndex: a2.dataIndex });
63
+ n2.dispatchAction({ type: t4, seriesIndex: l2.seriesIndex, dataIndex: l2.dataIndex });
63
64
  }
64
- } else t3.push(a2);
65
- c2 && (r2 = l2);
65
+ } else t3.push(l2);
66
+ c2 && (r2 = a2);
66
67
  }
67
68
  o2 = t3;
68
69
  }
@@ -73,35 +74,35 @@ function x(t2, e2, n2) {
73
74
  }
74
75
  o2.push({ seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
75
76
  }
76
- e2.highlightInfos = o2, b(t2, e2);
77
+ e2.highlightInfos = o2, v(t2, e2);
77
78
  });
78
79
  }
79
- function I(t2, e2, n2) {
80
+ function b(t2, e2, n2) {
80
81
  if (!n2 || !e2 || !t2) return;
81
82
  const i2 = e2.highlightInfos ? e2.highlightInfos : [];
82
83
  for (let t3 = 0; t3 < i2.length; t3++) {
83
84
  const s2 = i2[t3], o2 = "chart-pie" === e2.name ? "unselect" : "downplay";
84
85
  n2.dispatchAction({ type: o2, seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
85
86
  }
86
- e2.highlightInfos = [], b(t2, e2);
87
+ e2.highlightInfos = [], v(t2, e2);
87
88
  }
88
- function b(t2, e2) {
89
+ function v(t2, e2) {
89
90
  if (!e2.clickSet) return;
90
91
  const n2 = e2.clickSet, i2 = n2.variables;
91
92
  if (!i2 || 0 == i2.length) return;
92
- const r2 = e2.highlightInfos ? e2.highlightInfos : [], l2 = e2.cacheDatas ? e2.cacheDatas : [], a2 = [], c2 = [];
93
- for (const t3 of r2) c2.includes(t3.dataIndex) || (c2.push(t3.dataIndex), t3.dataIndex < l2.length && a2.push(l2[t3.dataIndex]));
93
+ const r2 = e2.highlightInfos ? e2.highlightInfos : [], a2 = e2.cacheDatas ? e2.cacheDatas : [], l2 = [], c2 = [];
94
+ for (const t3 of r2) c2.includes(t3.dataIndex) || (c2.push(t3.dataIndex), t3.dataIndex < a2.length && l2.push(a2[t3.dataIndex]));
94
95
  for (const e3 of i2) {
95
96
  if (!e3.fieldName || !e3.variable) continue;
96
97
  const i3 = [];
97
- for (const t3 of a2) {
98
+ for (const t3 of l2) {
98
99
  const n3 = s(t3, e3.fieldName, void 0);
99
100
  null != n3 && i3.push(n3);
100
101
  }
101
102
  n2.multiple ? o(t2.entity, e3.variable, i3) : o(t2.entity, e3.variable, i3.length > 0 ? i3[0] : void 0);
102
103
  }
103
104
  }
104
- function v(t2, e2, n2) {
105
+ function N(t2, e2, n2) {
105
106
  const i2 = e2.items ? e2.items : [], o2 = e2.props ? e2.props.orderByTarget : "";
106
107
  let r2 = null;
107
108
  if ("x" == o2 || "X" == o2) r2 = "__x";
@@ -115,29 +116,29 @@ function v(t2, e2, n2) {
115
116
  }
116
117
  }
117
118
  if (!r2) return;
118
- const a2 = e2.props ? e2.props.orderSource : "";
119
+ const l2 = e2.props ? e2.props.orderSource : "";
119
120
  let c2 = e2.props ? e2.props.orderFix : "";
120
- if ("variable" == a2) {
121
+ if ("variable" == l2) {
121
122
  const n3 = e2.props ? e2.props.orderVariable : "";
122
- c2 = l(t2, n3);
123
+ c2 = a(t2, n3);
123
124
  }
124
125
  c2 = "desc" == c2 || "DESC" == c2 ? "desc" : "asc", n2.sort((t3, e3) => {
125
126
  const n3 = s(t3, r2, void 0), i3 = s(e3, r2, void 0);
126
127
  return "desc" === c2 ? i3 - n3 : n3 - i3;
127
128
  });
128
129
  }
129
- function N(t2, e2, n2, i2, o2) {
130
+ function y(t2, e2, n2, i2, o2) {
130
131
  if (!n2) return n2;
131
132
  const r2 = e2.props ? e2.props : {};
132
133
  if (!r2.limitQuantity) return n2;
133
- let a2 = null;
134
- if (r2.itemNumVariable ? (a2 = l(t2, r2.itemNumVariable), a2 = parseInt(a2)) : a2 = r2.itemNumFix ? r2.itemNumFix : 10, null == a2 || null == a2 || isNaN(a2)) return n2;
135
- if (n2.length < a2) return n2;
134
+ let l2 = null;
135
+ if (r2.itemNumVariable ? (l2 = a(t2, r2.itemNumVariable), l2 = parseInt(l2)) : l2 = r2.itemNumFix ? r2.itemNumFix : 10, null == l2 || null == l2 || isNaN(l2)) return n2;
136
+ if (n2.length < l2) return n2;
136
137
  const c2 = r2.overItemAlias, f2 = [], u2 = {};
137
138
  i2 = i2 || [], o2 = o2 || [];
138
139
  for (let t3 = 0; t3 < n2.length; t3++) {
139
140
  const e3 = n2[t3];
140
- if (t3 < a2) f2.push(e3);
141
+ if (t3 < l2) f2.push(e3);
141
142
  else {
142
143
  if (!c2) break;
143
144
  for (const t4 of i2) {
@@ -158,17 +159,17 @@ function N(t2, e2, n2, i2, o2) {
158
159
  }
159
160
  return c2 && (u2.__x = c2, f2.push(u2)), f2;
160
161
  }
161
- function y(t2, e2, n2) {
162
+ function S(t2, e2, n2) {
162
163
  const i2 = {};
163
164
  for (const s2 of t2) {
164
165
  const t3 = s2.props ? s2.props : {};
165
166
  if ("formula" === t3.yaxisSource) {
166
167
  const s3 = r(t3.formula);
167
168
  for (const t4 of s3) if (!(t4 in i2)) {
168
- if (t4.startsWith("${min.")) i2[t4] = S(e2, t4.substring(6, t4.length - 1));
169
- else if (t4.startsWith("${max.")) i2[t4] = F(e2, t4.substring(6, t4.length - 1));
170
- else if (t4.startsWith("${sum.")) i2[t4] = _(e2, t4.substring(6, t4.length - 1));
171
- else if (t4.startsWith("${avg.")) i2[t4] = A(e2, t4.substring(6, t4.length - 1));
169
+ if (t4.startsWith("${min.")) i2[t4] = F(e2, t4.substring(6, t4.length - 1));
170
+ else if (t4.startsWith("${max.")) i2[t4] = _(e2, t4.substring(6, t4.length - 1));
171
+ else if (t4.startsWith("${sum.")) i2[t4] = A(e2, t4.substring(6, t4.length - 1));
172
+ else if (t4.startsWith("${avg.")) i2[t4] = M(e2, t4.substring(6, t4.length - 1));
172
173
  else if (t4.startsWith("${add.")) {
173
174
  const e3 = t4.substring(6, t4.length - 1);
174
175
  n2.add(e3);
@@ -178,7 +179,7 @@ function y(t2, e2, n2) {
178
179
  }
179
180
  return i2;
180
181
  }
181
- function S(t2, e2) {
182
+ function F(t2, e2) {
182
183
  let n2;
183
184
  for (const i2 of t2) {
184
185
  const t3 = parseFloat(s(i2, e2, null));
@@ -186,7 +187,7 @@ function S(t2, e2) {
186
187
  }
187
188
  return n2;
188
189
  }
189
- function F(t2, e2) {
190
+ function _(t2, e2) {
190
191
  let n2;
191
192
  for (const i2 of t2) {
192
193
  const t3 = parseFloat(s(i2, e2, null));
@@ -194,7 +195,7 @@ function F(t2, e2) {
194
195
  }
195
196
  return n2;
196
197
  }
197
- function _(t2, e2) {
198
+ function A(t2, e2) {
198
199
  let n2;
199
200
  for (const i2 of t2) {
200
201
  const t3 = parseFloat(s(i2, e2, null));
@@ -202,8 +203,8 @@ function _(t2, e2) {
202
203
  }
203
204
  return n2;
204
205
  }
205
- function A(t2, e2) {
206
- const n2 = _(t2, e2);
206
+ function M(t2, e2) {
207
+ const n2 = A(t2, e2);
207
208
  return void 0 === n2 || 0 === t2.length ? n2 : parseFloat((n2 / t2.length).toFixed(5));
208
209
  }
209
210
  function k(t2, e2, n2, i2) {
@@ -212,13 +213,13 @@ function k(t2, e2, n2, i2) {
212
213
  const o2 = r(t2);
213
214
  for (const e3 of o2) {
214
215
  let o3 = null;
215
- o3 = e3.startsWith("${row.") ? s(n2, e3.substring(6, e3.length - 1), null) : a(i2.entity, e3), t2 = t2.replace(new RegExp(e3.replace("$", "\\$"), "g"), o3);
216
+ o3 = e3.startsWith("${row.") ? s(n2, e3.substring(6, e3.length - 1), null) : l(i2.entity, e3), t2 = t2.replace(new RegExp(e3.replace("$", "\\$"), "g"), o3);
216
217
  }
217
218
  t2.includes("return ") || (t2 = "return " + t2);
218
- const l2 = new Function("params", t2);
219
- return f(l2, i2), l2({ pageContext: i2, row: n2 });
219
+ const a2 = new Function("params", t2);
220
+ return u(a2, i2), a2({ pageContext: i2, row: n2 });
220
221
  }
221
- function M(t2, e2) {
222
+ function w(t2, e2) {
222
223
  if (!t2 || !t2.$el) return;
223
224
  const n2 = t2.$el.getElementsByTagName("canvas");
224
225
  if (!n2 || 0 === n2.length) return;
@@ -245,30 +246,38 @@ function $(t2, e2, n2) {
245
246
  }
246
247
  }
247
248
  }
248
- function w(t2) {
249
+ function O(t2) {
249
250
  if (t2 == null ? void 0 : t2.grid) {
250
251
  const e2 = t2.grid, n2 = (t3) => !t3 || "0" === t3;
251
252
  n2(e2.top) && n2(e2.right) && n2(e2.bottom) && n2(e2.left) && Object.assign(e2, { right: "10%", bottom: "60", left: "10%" });
252
253
  }
253
254
  }
255
+ function E(t2) {
256
+ var _a;
257
+ if ((_a = t2 == null ? void 0 : t2.toolbox) == null ? void 0 : _a.feature) {
258
+ const e2 = t2.toolbox.feature;
259
+ for (const t3 in e2) e2[t3].show && (e2[t3].title = f().t("chartMessage." + t3), "dataView" === t3 && (e2[t3].lang = [f().t("chartMessage.dataView"), f().t("chartMessage.close"), f().t("chartMessage.refresh")]));
260
+ }
261
+ }
254
262
  export {
255
- u as CommonName,
256
- y as caculateFormulaValue,
257
- I as clearChartSelected,
263
+ d as CommonName,
264
+ S as caculateFormulaValue,
265
+ b as clearChartSelected,
258
266
  k as executeChartFormula,
259
- M as exportCommonChart,
260
- A as getAvgValue,
261
- p as getCustomTheme,
262
- h as getCustomThemeOptions,
263
- F as getMaxValue,
264
- S as getMinValue,
267
+ w as exportCommonChart,
268
+ E as formatToolboxI18n,
269
+ M as getAvgValue,
270
+ h as getCustomTheme,
271
+ g as getCustomThemeOptions,
272
+ _ as getMaxValue,
273
+ F as getMinValue,
265
274
  m as getNumFormatter,
266
- _ as getSumValue,
267
- g as initChartOption,
268
- N as limitDatas,
269
- x as monitorChartClickToVariable,
270
- w as setDefaultGrid,
275
+ A as getSumValue,
276
+ x as initChartOption,
277
+ y as limitDatas,
278
+ I as monitorChartClickToVariable,
279
+ O as setDefaultGrid,
271
280
  $ as setHomeChartInitConfigValue,
272
- v as sortDatas,
273
- b as updateClickVariablesForSelected
281
+ N as sortDatas,
282
+ v as updateClickVariablesForSelected
274
283
  };