super-page-runtime 2.3.27 → 2.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +105 -95
- package/dist/es/components/runtime/utils/charts/chart-util.js +117 -113
- package/dist/es/components/runtime/utils/events/data-backfill-util.d.ts +27 -0
- package/dist/es/components/runtime/utils/events/data-backfill-util.js +39 -0
- package/dist/es/components/runtime/utils/events/standard-event.js +577 -558
- package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +13 -1
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +9 -9
- package/dist/es/components/runtime/views/assemblys/common/event-call-component.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/file-task-notice.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/format-file-task-notice-message.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-table.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/remove-transactor-dialog.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/save-chart-condition-dialog.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/fixed/FixedBox.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/fixed/YxAffix.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +11 -8
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +5 -5
- package/dist/es/components/runtime/views/assemblys/error-render.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +53 -51
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +95 -95
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/page-bottom.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/component/workflow-opinion-box.vue2.js +4 -4
- package/dist/es/components/runtime/views/assemblys/workflow/extract-workflow/extract-workflow-runtime-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/extract-workflow/extract-workflow-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/home-chart.vue.js +2 -2
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +2 -2
- package/dist/es/components/runtime/views/super-page.vue2.js +3 -3
- package/dist/es/style.css +57 -53
- package/package.json +2 -2
|
@@ -1,140 +1,150 @@
|
|
|
1
|
-
import { getValueFromSource as e, formatVariableValue as
|
|
2
|
-
import { deepCopy as
|
|
3
|
-
import { setDefaultGrid as
|
|
4
|
-
import { handleChartEvent as
|
|
1
|
+
import { getValueFromSource as e, formatVariableValue as i, setValueForVariableName as t } from "../page-helper-util.js";
|
|
2
|
+
import { deepCopy as o } from "../common-util.js";
|
|
3
|
+
import { setDefaultGrid as s, CommonName as a, caculateFormulaValue as l, executeChartFormula as n, sortDatas as r, limitDatas as u, formatToolboxI18n as d } from "./chart-util.js";
|
|
4
|
+
import { handleChartEvent as c } from "../events/event-util.js";
|
|
5
5
|
function f(f2, p, m, h) {
|
|
6
6
|
if (!h || !h.result) return;
|
|
7
|
-
|
|
7
|
+
s(m), m.tooltip || (m.tooltip = {}), c(f2, p, "beforeUpdateChart", m, { resultData: h });
|
|
8
8
|
const y = h && h.result ? h.result : {};
|
|
9
|
-
let
|
|
10
|
-
const
|
|
9
|
+
let v = h && h.groupValue ? h.groupValue : void 0;
|
|
10
|
+
const g = p.serviceDataField;
|
|
11
11
|
let F = null;
|
|
12
|
-
|
|
12
|
+
g ? F = y[g] : y && (F = Array.isArray(y) ? y : [y]), F || (F = []), p.runtime.dataConfig.runtimeData = F;
|
|
13
13
|
let S = p.props ? p.props.groups : null;
|
|
14
|
-
if (S || (S = []), !
|
|
15
|
-
|
|
16
|
-
for (const e2 of S)
|
|
14
|
+
if (S || (S = []), !v || 0 === v.length) {
|
|
15
|
+
v = [];
|
|
16
|
+
for (const e2 of S) v.push(e2.group);
|
|
17
17
|
}
|
|
18
18
|
const D = {}, x = [], N = [];
|
|
19
|
-
for (const e2 of S) D[e2.group] = e2.target, e2.target && !x.includes(e2.target) && (x.push(e2.target),
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
for (const
|
|
23
|
-
if (!
|
|
24
|
-
const
|
|
25
|
-
for (const
|
|
26
|
-
const
|
|
27
|
-
a2 &&
|
|
19
|
+
for (const e2 of S) D[e2.group] = e2.target, e2.target && !x.includes(e2.target) && (x.push(e2.target), v.includes(e2.group) && N.push(e2.target));
|
|
20
|
+
let _ = p.props ? p.props.mulGroupShow : "";
|
|
21
|
+
_ = "break" == _ ? "\r\n" : " ";
|
|
22
|
+
for (const i2 of F) {
|
|
23
|
+
if (!i2) continue;
|
|
24
|
+
const t2 = [];
|
|
25
|
+
for (const o3 of v) {
|
|
26
|
+
const s2 = D[o3], a2 = e(i2, s2, void 0);
|
|
27
|
+
a2 && t2.push(a2);
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
|
|
29
|
+
const o2 = t2.join(_);
|
|
30
|
+
i2[a.X_FIELD_NAME] = o2;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const E = p.items ? p.items : [], A = [], b = {}, w = [], C = {}, I = [], X = [], L = /* @__PURE__ */ new Set(), M = l(E, F, L);
|
|
33
33
|
for (const e2 of L) I.push(e2);
|
|
34
|
-
for (const e2 of
|
|
35
|
-
const
|
|
34
|
+
for (const e2 of E) {
|
|
35
|
+
const i2 = e2.props ? e2.props : {}, t2 = i2.yaxisSource, o2 = i2.yaxisField, s2 = i2.isCumulative;
|
|
36
36
|
let a2 = null;
|
|
37
|
-
if (!
|
|
38
|
-
let
|
|
39
|
-
for (const e3 in M)
|
|
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:
|
|
43
|
-
null != a2 && (
|
|
37
|
+
if (!o2 || t2 && "variable" != t2) if ("formula" == t2) {
|
|
38
|
+
let t3 = i2.formula ? i2.formula : "";
|
|
39
|
+
for (const e3 in M) t3 = t3.replace(new RegExp(e3.replace("$", "\\$"), "g"), M[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: o2, isCumulative: s2, data: [], dynamicDatas: [] }, o2 && !I.includes(o2) && I.push(o2), o2 && !X.includes(o2) && X.push(o2), s2 && !L.has(o2) && L.add(o2);
|
|
43
|
+
null != a2 && (A.push(a2), b[e2.uuid] = a2), i2.dynamicSeriesField && !w.includes(i2.dynamicSeriesField) && a2 && (a2.dynamicField = i2.dynamicSeriesField, a2.dynamicSeriesTitle = i2.dynamicSeriesTitle, a2.dynamicShowStack = i2.dynamicShowStack, w.push(i2.dynamicSeriesField), C[i2.dynamicSeriesField] = o2);
|
|
44
44
|
}
|
|
45
45
|
const j = {};
|
|
46
46
|
if (w.length > 0) {
|
|
47
|
-
const
|
|
48
|
-
for (const
|
|
49
|
-
const l2 =
|
|
50
|
-
let n2 =
|
|
47
|
+
const i2 = [], t2 = {};
|
|
48
|
+
for (const o2 of F) if (o2) for (const s2 of I) {
|
|
49
|
+
const l2 = o2[a.X_FIELD_NAME];
|
|
50
|
+
let n2 = t2[l2];
|
|
51
51
|
if (!n2) {
|
|
52
52
|
n2 = {};
|
|
53
|
-
for (const e2 of x) n2[e2] =
|
|
54
|
-
n2[a.X_FIELD_NAME] =
|
|
53
|
+
for (const e2 of x) n2[e2] = o2[e2];
|
|
54
|
+
n2[a.X_FIELD_NAME] = o2[a.X_FIELD_NAME], t2[l2] = n2, i2.push(n2);
|
|
55
55
|
}
|
|
56
|
-
let r2 = e(
|
|
56
|
+
let r2 = e(o2, s2, void 0);
|
|
57
57
|
if (!isNaN(r2)) {
|
|
58
|
-
const e2 = n2[
|
|
59
|
-
isNaN || (r2 += e2), n2[
|
|
58
|
+
const e2 = n2[s2];
|
|
59
|
+
isNaN || (r2 += e2), n2[s2] = r2;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
for (const
|
|
63
|
-
const
|
|
64
|
-
for (const
|
|
65
|
-
if (!
|
|
66
|
-
const l2 =
|
|
62
|
+
for (const i3 of w) {
|
|
63
|
+
const o2 = [];
|
|
64
|
+
for (const s2 of F) {
|
|
65
|
+
if (!s2) continue;
|
|
66
|
+
const l2 = t2[s2[a.X_FIELD_NAME]];
|
|
67
67
|
if (!l2) continue;
|
|
68
|
-
let n2 = e(
|
|
69
|
-
n2 = null == n2 || null == n2 ? "" : n2,
|
|
70
|
-
const r2 = C[
|
|
68
|
+
let n2 = e(s2, i3, void 0);
|
|
69
|
+
n2 = null == n2 || null == n2 ? "" : n2, o2.includes(n2) || (o2.push(n2), X.push(n2), L.add(n2));
|
|
70
|
+
const r2 = C[i3];
|
|
71
71
|
if (void 0 !== r2) {
|
|
72
|
-
const
|
|
73
|
-
let
|
|
74
|
-
void 0 ===
|
|
72
|
+
const i4 = e(s2, 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
|
-
j[
|
|
77
|
+
j[i3] = o2;
|
|
78
78
|
}
|
|
79
|
-
F =
|
|
79
|
+
F = i2;
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
void 0 === s2 || isNaN(s2) || (void 0 === o2 ? o2 = s2 : o2 += s2), T[i2] = o2;
|
|
81
|
+
let k = {};
|
|
82
|
+
for (const i2 of F) if (i2) {
|
|
83
|
+
for (const t2 of L) {
|
|
84
|
+
const o2 = e(i2, t2, void 0);
|
|
85
|
+
let s2 = k[t2];
|
|
86
|
+
void 0 === o2 || isNaN(o2) || (void 0 === s2 ? s2 = o2 : s2 += o2), k[t2] = s2;
|
|
88
87
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
for (const e2 of A) if ("formula" === e2.type) {
|
|
89
|
+
const t2 = n(e2.formula, k, i2, f2);
|
|
90
|
+
i2[e2.uuid + "_field"] = t2;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
r(f2, p, F), F = u(f2, p, F, x, X);
|
|
94
|
+
const T = [];
|
|
95
|
+
k = {};
|
|
96
|
+
for (const i2 of F) if (i2) {
|
|
97
|
+
for (const t2 of L) {
|
|
98
|
+
const o2 = e(i2, t2, void 0);
|
|
99
|
+
let s2 = k[t2];
|
|
100
|
+
void 0 === o2 || isNaN(o2) || (void 0 === s2 ? s2 = o2 : s2 += o2), k[t2] = s2;
|
|
101
|
+
}
|
|
102
|
+
T.push(i2[a.X_FIELD_NAME]);
|
|
103
|
+
for (const t2 of A) {
|
|
104
|
+
let o2 = t2.data;
|
|
105
|
+
const s2 = t2.dynamicDatas;
|
|
106
|
+
if (t2.dynamicField) {
|
|
107
|
+
let a2 = j[t2.dynamicField];
|
|
95
108
|
a2 = a2 || [];
|
|
96
109
|
for (let l2 = 0; l2 < a2.length; l2++) {
|
|
97
|
-
l2 >=
|
|
110
|
+
l2 >= s2.length && s2.push([]), o2 = s2[l2];
|
|
98
111
|
const n2 = a2[l2];
|
|
99
|
-
let r2 = e(
|
|
100
|
-
|
|
112
|
+
let r2 = e(i2, n2, void 0);
|
|
113
|
+
t2.isCumulative && (r2 = k[n2]), o2.push(r2);
|
|
101
114
|
}
|
|
102
|
-
} else if ("fixed" ===
|
|
103
|
-
else if ("variable" ===
|
|
104
|
-
let
|
|
105
|
-
|
|
106
|
-
} else
|
|
107
|
-
const e2 = u(i2.formula, T, t2, f2);
|
|
108
|
-
s2.push(e2);
|
|
109
|
-
} else s2.push(void 0);
|
|
115
|
+
} else if ("fixed" === t2.type) o2.push(t2.field);
|
|
116
|
+
else if ("variable" === t2.type) {
|
|
117
|
+
let s3 = e(i2, t2.field, void 0);
|
|
118
|
+
t2.isCumulative && (s3 = k[t2.field]), o2.push(s3);
|
|
119
|
+
} else "formula" === t2.type ? o2.push(i2[t2.uuid + "_field"]) : o2.push(void 0);
|
|
110
120
|
}
|
|
111
121
|
}
|
|
112
|
-
const V = p.defaultSeries, $ =
|
|
122
|
+
const V = p.defaultSeries, $ = o(null == V ? [] : V), G = [];
|
|
113
123
|
for (const e2 of $) {
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
const a2 =
|
|
119
|
-
for (let l2 = 0; l2 <
|
|
120
|
-
const n2 =
|
|
121
|
-
if (
|
|
122
|
-
const e3 =
|
|
123
|
-
r2.name =
|
|
124
|
+
const t2 = b[e2.uuid];
|
|
125
|
+
if (t2.dynamicField) {
|
|
126
|
+
let s2 = j[t2.dynamicField];
|
|
127
|
+
s2 = s2 || [];
|
|
128
|
+
const a2 = t2.dynamicDatas ? t2.dynamicDatas : [];
|
|
129
|
+
for (let l2 = 0; l2 < s2.length; l2++) {
|
|
130
|
+
const n2 = s2[l2], r2 = o(e2);
|
|
131
|
+
if (t2.dynamicSeriesTitle) {
|
|
132
|
+
const e3 = t2.dynamicSeriesTitle.replace("${name}", n2);
|
|
133
|
+
r2.name = i(f2, e3);
|
|
124
134
|
} else r2.name = n2;
|
|
125
|
-
r2.data = l2 < a2.length ? a2[l2] : [], "bar" == e2.type &&
|
|
135
|
+
r2.data = l2 < a2.length ? a2[l2] : [], "bar" == e2.type && t2.dynamicShowStack && (r2.stack = e2.uuid), G.push(r2);
|
|
126
136
|
}
|
|
127
|
-
} else e2.data =
|
|
137
|
+
} else e2.data = t2 ? t2.data : [], G.push(e2);
|
|
128
138
|
}
|
|
129
139
|
m.series = G;
|
|
130
140
|
const R = p.defaultXaxis, U = p.defaultYaxis;
|
|
131
141
|
if (m.isBar) {
|
|
132
|
-
if (U) for (const e2 of U) e2.data =
|
|
142
|
+
if (U) for (const e2 of U) e2.data = T;
|
|
133
143
|
m.xAxis = R, m.yAxis = U;
|
|
134
|
-
} else R && R.length > 0 && (R[0].data =
|
|
135
|
-
|
|
144
|
+
} else R && R.length > 0 && (R[0].data = T), m.xAxis = R, m.yAxis = U;
|
|
145
|
+
d(m);
|
|
136
146
|
const B = p.props ? p.props.selGroupVariable : null;
|
|
137
|
-
!(p.props ? p.props.enableDrill : null) && B && (p.highlightInfos = [],
|
|
147
|
+
!(p.props ? p.props.enableDrill : null) && B && (p.highlightInfos = [], t(f2.entity, B, null)), c(f2, p, "afterUpdateChart", m, { resultData: h }), p.groupFields = N, p.cacheDatas = F, p.rawResult = h;
|
|
138
148
|
}
|
|
139
149
|
export {
|
|
140
150
|
f as updateChartOption
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import t from "../../../../assets/chart-themes/bar-theme.js";
|
|
2
2
|
import e from "../../../../assets/chart-themes/gauge-theme.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import i from "../../../../assets/chart-themes/pie-theme.js";
|
|
4
|
+
import n from "../../../../assets/chart-themes/radar-theme.js";
|
|
5
5
|
import s from "../../../../assets/chart-themes/scatter-theme.js";
|
|
6
6
|
import { getDefaultValue as r } from "../page-init-util.js";
|
|
7
|
-
import { getValueFromSource as o, setValueForVariableName as a, getParamNames as l,
|
|
7
|
+
import { getValueFromSource as o, setValueForVariableName as a, getParamNames as l, getValueFromVariable as c, formatVariableValue as f, setVariableValue as u } from "../page-helper-util.js";
|
|
8
8
|
import { getI18n as d } from "agilebuilder-ui/src/utils/util";
|
|
9
9
|
import { appendDefaultMethods as p } from "../events/event-util.js";
|
|
10
10
|
var h = ((t2) => (t2.X_FIELD_NAME = "__x", t2.Y_TEMP_NAME = "__y", t2))(h || {});
|
|
11
11
|
function g(r2, o2 = "bar") {
|
|
12
|
-
return "bar" === o2 ? t[r2] : "gauge" === o2 ? e[r2] : "pie" === o2 ?
|
|
12
|
+
return "bar" === o2 ? t[r2] : "gauge" === o2 ? e[r2] : "pie" === o2 ? i[r2] : "radar" === o2 ? n[r2] : "scatter" === o2 ? s[r2] : t[r2];
|
|
13
13
|
}
|
|
14
14
|
function m() {
|
|
15
15
|
return [{ value: "theme1", label: "主题1" }, { value: "theme2", label: "主题2" }, { value: "theme3", label: "主题3" }];
|
|
16
16
|
}
|
|
17
|
-
function x(t2, e2,
|
|
17
|
+
function x(t2, e2, i2, n2, s2) {
|
|
18
18
|
return function(r2) {
|
|
19
19
|
let o2 = r2 == null ? void 0 : r2.value;
|
|
20
20
|
if (s2 && (o2 = r2), null == o2 || null == o2) return o2;
|
|
@@ -25,22 +25,22 @@ function x(t2, e2, n2, i2, s2) {
|
|
|
25
25
|
(null == t3 || isNaN(t3)) && (t3 = 2), o2 = parseFloat(parseFloat(o2).toFixed(t3));
|
|
26
26
|
}
|
|
27
27
|
let a2 = "";
|
|
28
|
-
t2.indexOf("prefix") > -1 &&
|
|
28
|
+
t2.indexOf("prefix") > -1 && i2 && (a2 = i2);
|
|
29
29
|
let l2 = "";
|
|
30
|
-
return t2.indexOf("append") > -1 &&
|
|
30
|
+
return t2.indexOf("append") > -1 && n2 && (l2 = n2), a2 + o2.toLocaleString() + l2;
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
function b(t2, e2) {
|
|
34
34
|
if (!e2) return;
|
|
35
35
|
if (e2.tooltipFormatterArgs && (e2.tooltip || (e2.tooltip = {}), e2.tooltip.valueFormatter = x.apply(e2, e2.tooltipFormatterArgs)), e2.series) {
|
|
36
|
-
const
|
|
37
|
-
for (const
|
|
36
|
+
const i3 = t2.props ? t2.props.enableDrill : null;
|
|
37
|
+
for (const n3 of e2.series) e2.radar || (n3.data = []), n3.labelFormatterArgs && (n3.label || (n3.label = {}), n3.label.formatter = x.apply(n3, n3.labelFormatterArgs)), !i3 && t2.clickSet && t2.clickSet.selected && n3.emphasis && (n3.emphasis.disabled = false), "pie" === n3.type && t2.clickSet && t2.clickSet.selected && (t2.clickSet.multiple ? n3.selectedMode = "multiple" : n3.selectedMode = "single");
|
|
38
38
|
}
|
|
39
39
|
if (e2.radar) for (const t3 of e2.radar) t3.indicator = [];
|
|
40
|
-
const
|
|
41
|
-
t2.defaultSeries =
|
|
42
|
-
const
|
|
43
|
-
|
|
40
|
+
const i2 = e2.series;
|
|
41
|
+
t2.defaultSeries = i2;
|
|
42
|
+
const n2 = e2.xAxis;
|
|
43
|
+
n2 && n2.length > 0 && n2[0].data && (n2[0].data = []), t2.defaultXaxis = n2;
|
|
44
44
|
const s2 = e2.yAxis;
|
|
45
45
|
if (s2) for (const t3 of s2) t3.data && (t3.data = []), "auto" === t3._dataMin && (t3.min = function(t4) {
|
|
46
46
|
if (t4.min) return 10 * Math.floor(t4.min / 10);
|
|
@@ -49,19 +49,19 @@ function b(t2, e2) {
|
|
|
49
49
|
});
|
|
50
50
|
t2.defaultYaxis = s2;
|
|
51
51
|
}
|
|
52
|
-
function I(t2, e2,
|
|
53
|
-
if (!(
|
|
54
|
-
const
|
|
55
|
-
|
|
52
|
+
function I(t2, e2, i2) {
|
|
53
|
+
if (!(i2 && e2 && e2.clickSet && t2)) return;
|
|
54
|
+
const n2 = e2.clickSet;
|
|
55
|
+
i2.on("click", function(s2) {
|
|
56
56
|
let r2 = e2.highlightInfos ? e2.highlightInfos : [], o2 = -1;
|
|
57
57
|
if (r2) {
|
|
58
58
|
const t3 = [];
|
|
59
59
|
for (let a2 = 0; a2 < r2.length; a2++) {
|
|
60
60
|
const l2 = r2[a2], c2 = l2.seriesIndex === s2.seriesIndex && l2.dataIndex === s2.dataIndex;
|
|
61
|
-
if (c2 || !
|
|
62
|
-
if (
|
|
61
|
+
if (c2 || !n2.multiple) {
|
|
62
|
+
if (n2.selected) {
|
|
63
63
|
const t4 = "chart-pie" === e2.name ? "unselect" : "downplay";
|
|
64
|
-
|
|
64
|
+
i2.dispatchAction({ type: t4, seriesIndex: l2.seriesIndex, dataIndex: l2.dataIndex });
|
|
65
65
|
}
|
|
66
66
|
} else t3.push(l2);
|
|
67
67
|
c2 && (o2 = a2);
|
|
@@ -69,49 +69,53 @@ function I(t2, e2, n2) {
|
|
|
69
69
|
r2 = t3;
|
|
70
70
|
}
|
|
71
71
|
if (-1 === o2) {
|
|
72
|
-
if (
|
|
72
|
+
if (n2.selected) {
|
|
73
73
|
const t3 = "chart-pie" === e2.name ? "select" : "highlight";
|
|
74
|
-
|
|
74
|
+
i2.dispatchAction({ type: t3, seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
|
|
75
75
|
}
|
|
76
76
|
r2.push({ seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
|
|
77
77
|
}
|
|
78
78
|
e2.highlightInfos = r2, N(t2, e2);
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
function v(t2, e2,
|
|
82
|
-
if (!
|
|
83
|
-
const
|
|
84
|
-
for (let t3 = 0; t3 <
|
|
85
|
-
const s2 =
|
|
86
|
-
|
|
81
|
+
function v(t2, e2, i2) {
|
|
82
|
+
if (!i2 || !e2 || !t2) return;
|
|
83
|
+
const n2 = e2.highlightInfos ? e2.highlightInfos : [];
|
|
84
|
+
for (let t3 = 0; t3 < n2.length; t3++) {
|
|
85
|
+
const s2 = n2[t3], r2 = "chart-pie" === e2.name ? "unselect" : "downplay";
|
|
86
|
+
i2.dispatchAction({ type: r2, seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
|
|
87
87
|
}
|
|
88
88
|
e2.highlightInfos = [], N(t2, e2);
|
|
89
89
|
}
|
|
90
90
|
function N(t2, e2) {
|
|
91
91
|
if (!e2.clickSet) return;
|
|
92
|
-
const
|
|
93
|
-
if (!
|
|
92
|
+
const i2 = e2.clickSet, n2 = i2.variables;
|
|
93
|
+
if (!n2 || 0 == n2.length) return;
|
|
94
94
|
const s2 = e2.highlightInfos ? e2.highlightInfos : [], r2 = e2.cacheDatas ? e2.cacheDatas : [], l2 = [], c2 = [];
|
|
95
95
|
for (const t3 of s2) c2.includes(t3.dataIndex) || (c2.push(t3.dataIndex), t3.dataIndex < r2.length && l2.push(r2[t3.dataIndex]));
|
|
96
|
-
for (const e3 of
|
|
96
|
+
for (const e3 of n2) {
|
|
97
97
|
if (!e3.fieldName || !e3.variable) continue;
|
|
98
|
-
const
|
|
98
|
+
const n3 = [];
|
|
99
99
|
for (const t3 of l2) {
|
|
100
|
-
const
|
|
101
|
-
null !=
|
|
100
|
+
const i3 = o(t3, e3.fieldName, void 0);
|
|
101
|
+
null != i3 && n3.push(i3);
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
i2.multiple ? a(t2.entity, e3.variable, n3) : a(t2.entity, e3.variable, n3.length > 0 ? n3[0] : void 0);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
function y(t2, e2,
|
|
107
|
-
const
|
|
106
|
+
function y(t2, e2, i2) {
|
|
107
|
+
const n2 = e2.items ? e2.items : [], s2 = e2.props ? e2.props.orderByTarget : "";
|
|
108
108
|
let r2 = null;
|
|
109
109
|
if ("x" == s2 || "X" == s2) r2 = "__x";
|
|
110
110
|
else if (s2) {
|
|
111
|
-
for (const t3 of
|
|
112
|
-
const e3 = t3.props ? t3.props : {},
|
|
113
|
-
if (
|
|
114
|
-
r2 =
|
|
111
|
+
for (const t3 of n2) if (t3.uuid == s2) {
|
|
112
|
+
const e3 = t3.props ? t3.props : {}, i3 = e3.yaxisSource, n3 = e3.yaxisField;
|
|
113
|
+
if (n3 && (!i3 || "variable" == i3)) {
|
|
114
|
+
r2 = n3;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
if ("formula" == i3 && e3.formula) {
|
|
118
|
+
r2 = t3.uuid + "_field";
|
|
115
119
|
break;
|
|
116
120
|
}
|
|
117
121
|
}
|
|
@@ -120,137 +124,137 @@ function y(t2, e2, n2) {
|
|
|
120
124
|
const a2 = e2.props ? e2.props.orderSource : "";
|
|
121
125
|
let l2 = e2.props ? e2.props.orderFix : "";
|
|
122
126
|
if ("variable" == a2) {
|
|
123
|
-
const
|
|
124
|
-
l2 =
|
|
127
|
+
const i3 = e2.props ? e2.props.orderVariable : "";
|
|
128
|
+
l2 = f(t2, i3);
|
|
125
129
|
}
|
|
126
|
-
l2 = "desc" == l2 || "DESC" == l2 ? "desc" : "asc",
|
|
127
|
-
const
|
|
128
|
-
return "desc" === l2 ?
|
|
130
|
+
l2 = "desc" == l2 || "DESC" == l2 ? "desc" : "asc", i2.sort((t3, e3) => {
|
|
131
|
+
const i3 = o(t3, r2, void 0), n3 = o(e3, r2, void 0);
|
|
132
|
+
return "desc" === l2 ? n3 - i3 : i3 - n3;
|
|
129
133
|
});
|
|
130
134
|
}
|
|
131
|
-
function S(t2, e2,
|
|
132
|
-
if (!
|
|
135
|
+
function S(t2, e2, i2, n2, s2) {
|
|
136
|
+
if (!i2) return i2;
|
|
133
137
|
const r2 = e2.props ? e2.props : {};
|
|
134
|
-
if (!r2.limitQuantity) return
|
|
138
|
+
if (!r2.limitQuantity) return i2;
|
|
135
139
|
let a2 = null;
|
|
136
|
-
if (r2.itemNumVariable ? (a2 =
|
|
137
|
-
if (
|
|
138
|
-
const l2 = r2.overItemAlias,
|
|
139
|
-
|
|
140
|
-
for (let t3 = 0; t3 <
|
|
141
|
-
const e3 =
|
|
142
|
-
if (t3 < a2)
|
|
140
|
+
if (r2.itemNumVariable ? (a2 = f(t2, r2.itemNumVariable), a2 = parseInt(a2)) : a2 = r2.itemNumFix ? r2.itemNumFix : 10, null == a2 || null == a2 || isNaN(a2)) return i2;
|
|
141
|
+
if (i2.length < a2) return i2;
|
|
142
|
+
const l2 = r2.overItemAlias, c2 = [], u2 = {};
|
|
143
|
+
n2 = n2 || [], s2 = s2 || [];
|
|
144
|
+
for (let t3 = 0; t3 < i2.length; t3++) {
|
|
145
|
+
const e3 = i2[t3];
|
|
146
|
+
if (t3 < a2) c2.push(e3);
|
|
143
147
|
else {
|
|
144
148
|
if (!l2) break;
|
|
145
|
-
for (const t4 of
|
|
149
|
+
for (const t4 of n2) {
|
|
146
150
|
if (!t4) continue;
|
|
147
|
-
let
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
+
let i3 = o(e3, t4, void 0);
|
|
152
|
+
i3 = null == i3 || null == i3 ? "" : i3, u2[t4] || (u2[t4] = []);
|
|
153
|
+
const n3 = u2[t4];
|
|
154
|
+
n3.includes(i3) || n3.push(i3);
|
|
151
155
|
}
|
|
152
156
|
for (const t4 of s2) {
|
|
153
157
|
if (!t4) continue;
|
|
154
|
-
const
|
|
155
|
-
if (isNaN(
|
|
156
|
-
const
|
|
157
|
-
isNaN(
|
|
158
|
+
const i3 = o(e3, t4, void 0);
|
|
159
|
+
if (isNaN(i3)) continue;
|
|
160
|
+
const n3 = u2[t4];
|
|
161
|
+
isNaN(n3) ? u2[t4] = i3 : u2[t4] = i3 + n3;
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
164
|
}
|
|
161
|
-
return l2 && (u2.__x = l2,
|
|
165
|
+
return l2 && (u2.__x = l2, c2.push(u2)), c2;
|
|
162
166
|
}
|
|
163
|
-
function F(t2, e2,
|
|
164
|
-
const
|
|
167
|
+
function F(t2, e2, i2) {
|
|
168
|
+
const n2 = {};
|
|
165
169
|
for (const s2 of t2) {
|
|
166
170
|
const t3 = s2.props ? s2.props : {};
|
|
167
171
|
if ("formula" === t3.yaxisSource) {
|
|
168
172
|
const s3 = l(t3.formula);
|
|
169
|
-
for (const t4 of s3) if (!(t4 in
|
|
170
|
-
if (t4.startsWith("${min."))
|
|
171
|
-
else if (t4.startsWith("${max."))
|
|
172
|
-
else if (t4.startsWith("${sum."))
|
|
173
|
-
else if (t4.startsWith("${avg."))
|
|
173
|
+
for (const t4 of s3) if (!(t4 in n2)) {
|
|
174
|
+
if (t4.startsWith("${min.")) n2[t4] = _(e2, t4.substring(6, t4.length - 1));
|
|
175
|
+
else if (t4.startsWith("${max.")) n2[t4] = A(e2, t4.substring(6, t4.length - 1));
|
|
176
|
+
else if (t4.startsWith("${sum.")) n2[t4] = M(e2, t4.substring(6, t4.length - 1));
|
|
177
|
+
else if (t4.startsWith("${avg.")) n2[t4] = k(e2, t4.substring(6, t4.length - 1));
|
|
174
178
|
else if (t4.startsWith("${add.")) {
|
|
175
179
|
const e3 = t4.substring(6, t4.length - 1);
|
|
176
|
-
|
|
180
|
+
i2.add(e3);
|
|
177
181
|
}
|
|
178
182
|
}
|
|
179
183
|
}
|
|
180
184
|
}
|
|
181
|
-
return
|
|
185
|
+
return n2;
|
|
182
186
|
}
|
|
183
187
|
function _(t2, e2) {
|
|
184
|
-
let
|
|
185
|
-
for (const
|
|
186
|
-
const t3 = parseFloat(o(
|
|
187
|
-
(void 0 ===
|
|
188
|
+
let i2;
|
|
189
|
+
for (const n2 of t2) {
|
|
190
|
+
const t3 = parseFloat(o(n2, e2, null));
|
|
191
|
+
(void 0 === i2 || !isNaN(t3) && t3 < i2) && (i2 = t3);
|
|
188
192
|
}
|
|
189
|
-
return
|
|
193
|
+
return i2;
|
|
190
194
|
}
|
|
191
195
|
function A(t2, e2) {
|
|
192
|
-
let
|
|
193
|
-
for (const
|
|
194
|
-
const t3 = parseFloat(o(
|
|
195
|
-
(void 0 ===
|
|
196
|
+
let i2;
|
|
197
|
+
for (const n2 of t2) {
|
|
198
|
+
const t3 = parseFloat(o(n2, e2, null));
|
|
199
|
+
(void 0 === i2 || !isNaN(t3) && t3 > i2) && (i2 = t3);
|
|
196
200
|
}
|
|
197
|
-
return
|
|
201
|
+
return i2;
|
|
198
202
|
}
|
|
199
203
|
function M(t2, e2) {
|
|
200
|
-
let
|
|
201
|
-
for (const
|
|
202
|
-
const t3 = parseFloat(o(
|
|
203
|
-
void 0 ===
|
|
204
|
+
let i2;
|
|
205
|
+
for (const n2 of t2) {
|
|
206
|
+
const t3 = parseFloat(o(n2, e2, null));
|
|
207
|
+
void 0 === i2 ? i2 = t3 : isNaN(t3) || (i2 += t3);
|
|
204
208
|
}
|
|
205
|
-
return
|
|
209
|
+
return i2;
|
|
206
210
|
}
|
|
207
211
|
function k(t2, e2) {
|
|
208
|
-
const
|
|
209
|
-
return void 0 ===
|
|
212
|
+
const i2 = M(t2, e2);
|
|
213
|
+
return void 0 === i2 || 0 === t2.length ? i2 : parseFloat((i2 / t2.length).toFixed(5));
|
|
210
214
|
}
|
|
211
|
-
function w(t2, e2,
|
|
215
|
+
function w(t2, e2, i2, n2) {
|
|
212
216
|
if (!t2) return;
|
|
213
|
-
if (e2) for (const
|
|
217
|
+
if (e2) for (const i3 in e2) t2 = t2.replace(new RegExp("\\${add." + i3 + "}", "g"), e2[i3]);
|
|
214
218
|
const s2 = l(t2);
|
|
215
219
|
for (const e3 of s2) {
|
|
216
220
|
let s3 = null;
|
|
217
|
-
s3 = e3.startsWith("${row.") ? o(
|
|
221
|
+
s3 = e3.startsWith("${row.") ? o(i2, e3.substring(6, e3.length - 1), null) : c(n2.entity, e3), t2 = t2.replace(new RegExp(e3.replace("$", "\\$"), "g"), s3);
|
|
218
222
|
}
|
|
219
223
|
t2.includes("return ") || (t2 = "return " + t2);
|
|
220
224
|
const r2 = new Function("params", t2);
|
|
221
|
-
return p(r2,
|
|
225
|
+
return p(r2, n2), r2({ pageContext: n2, row: i2 });
|
|
222
226
|
}
|
|
223
227
|
function $(t2, e2) {
|
|
224
228
|
if (!t2 || !t2.$el) return;
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
227
|
-
const
|
|
228
|
-
return { isTable: false, fileContent:
|
|
229
|
+
const i2 = t2.$el.getElementsByTagName("canvas");
|
|
230
|
+
if (!i2 || 0 === i2.length) return;
|
|
231
|
+
const n2 = i2[0], s2 = n2.width + ":" + n2.height;
|
|
232
|
+
return { isTable: false, fileContent: n2.toDataURL(), fileSize: s2, title: e2 == null ? void 0 : e2.title };
|
|
229
233
|
}
|
|
230
|
-
function j(t2, e2,
|
|
231
|
-
const
|
|
234
|
+
function j(t2, e2, i2) {
|
|
235
|
+
const n2 = window.localStorage.getItem("HOME_MY_CHARTS_CONDITIONS");
|
|
232
236
|
let s2 = true;
|
|
233
|
-
if (
|
|
234
|
-
const t3 = JSON.parse(
|
|
235
|
-
if (t3[
|
|
236
|
-
const
|
|
237
|
-
if (Object.keys(
|
|
237
|
+
if (n2) {
|
|
238
|
+
const t3 = JSON.parse(n2);
|
|
239
|
+
if (t3[i2]) {
|
|
240
|
+
const n3 = t3[i2];
|
|
241
|
+
if (Object.keys(n3).length > 0) {
|
|
238
242
|
s2 = false;
|
|
239
|
-
for (const t4 in
|
|
243
|
+
for (const t4 in n3) null !== n3[t4] && void 0 !== n3[t4] && a(e2.entity, t4, n3[t4]);
|
|
240
244
|
}
|
|
241
245
|
}
|
|
242
246
|
}
|
|
243
247
|
if (s2 && t2) {
|
|
244
|
-
for (const
|
|
245
|
-
const t3 = r(e2,
|
|
246
|
-
null != t3 && u(e2.entity,
|
|
248
|
+
for (const i3 of t2) if (i3.prop && i3.value) {
|
|
249
|
+
const t3 = r(e2, i3.value, "input-text", false), n3 = i3.prop.substring(2, i3.prop.length - 1).split(".");
|
|
250
|
+
null != t3 && u(e2.entity, n3, t3);
|
|
247
251
|
}
|
|
248
252
|
}
|
|
249
253
|
}
|
|
250
254
|
function O(t2) {
|
|
251
255
|
if (t2 == null ? void 0 : t2.grid) {
|
|
252
|
-
const e2 = t2.grid,
|
|
253
|
-
|
|
256
|
+
const e2 = t2.grid, i2 = (t3) => !t3 || "0" === t3;
|
|
257
|
+
i2(e2.top) && i2(e2.right) && i2(e2.bottom) && i2(e2.left) && Object.assign(e2, { right: "10%", bottom: "60", left: "10%" });
|
|
254
258
|
}
|
|
255
259
|
}
|
|
256
260
|
function E(t2) {
|