super-page-runtime 2.2.26 → 2.2.29-tmp2
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/_virtual/_plugin-vue_export-helper.js +7 -5
- package/dist/es/assets/chart-themes/theme1.js +6 -2
- package/dist/es/assets/chart-themes/theme2.js +6 -2
- package/dist/es/assets/chart-themes/theme3.js +6 -2
- package/dist/es/components/runtime/utils/api/api-util.js +7 -4
- package/dist/es/components/runtime/utils/api/page-expose-util.js +443 -135
- package/dist/es/components/runtime/utils/assemblys-config.js +369 -13
- package/dist/es/components/runtime/utils/barcode-util.js +33 -9
- package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +306 -122
- package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +68 -29
- package/dist/es/components/runtime/utils/charts/chart-pie-util.js +152 -68
- package/dist/es/components/runtime/utils/charts/chart-radar-util.js +124 -46
- package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +99 -36
- package/dist/es/components/runtime/utils/charts/chart-util.js +522 -224
- package/dist/es/components/runtime/utils/common-util.js +156 -76
- package/dist/es/components/runtime/utils/eventBus.js +8 -3
- package/dist/es/components/runtime/utils/events/event-util.js +775 -362
- package/dist/es/components/runtime/utils/events/print-label.js +140 -72
- package/dist/es/components/runtime/utils/events/standard-event.js +2320 -808
- package/dist/es/components/runtime/utils/events/validator-util.js +560 -224
- package/dist/es/components/runtime/utils/form/date-shortcuts.js +88 -28
- package/dist/es/components/runtime/utils/form/scan-util.js +162 -61
- package/dist/es/components/runtime/utils/global-refs.js +84 -53
- package/dist/es/components/runtime/utils/i18n-util.js +20 -11
- package/dist/es/components/runtime/utils/interfaces/page-design-types.js +7 -2
- package/dist/es/components/runtime/utils/page-helper-util.js +660 -279
- package/dist/es/components/runtime/utils/page-init-util.js +406 -141
- package/dist/es/components/runtime/utils/page-permission-util.js +531 -22
- package/dist/es/components/runtime/utils/page-store.js +68 -23
- package/dist/es/components/runtime/utils/store-util.js +13 -9
- package/dist/es/components/runtime/utils/store.js +2 -2
- package/dist/es/components/runtime/utils/table-utils.js +81 -40
- package/dist/es/components/runtime/utils/tree-utils.js +37 -17
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +83 -21
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +46 -14
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +132 -36
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +18 -4
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +107 -17
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +198 -50
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +42 -12
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +60 -7
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +203 -52
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +4 -4
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +162 -46
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +109 -32
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +166 -43
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +117 -32
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +118 -32
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +597 -246
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +42 -4
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +62 -8
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +160 -29
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +62 -13
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +594 -212
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +139 -29
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +125 -21
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +102 -16
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +81 -18
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +82 -17
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +86 -14
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +79 -21
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +61 -16
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +37 -10
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +127 -38
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +76 -28
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +178 -61
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +810 -302
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +635 -262
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +115 -40
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +215 -56
- package/dist/es/components/runtime/views/assemblys/error-render.vue.js +21 -3
- package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +154 -42
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +98 -34
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +200 -52
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +239 -68
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +109 -31
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +59 -21
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +188 -56
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +103 -22
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +245 -57
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +174 -32
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +107 -28
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +50 -13
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +194 -64
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +249 -88
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +263 -80
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +57 -13
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +155 -30
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +129 -40
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +107 -22
- package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +188 -89
- package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +272 -133
- package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +46 -18
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +49 -21
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +58 -20
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +53 -16
- package/dist/es/components/runtime/views/home-chart.vue.js +160 -40
- package/dist/es/components/runtime/views/home-chart.vue2.js +2 -2
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +139 -20
- package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/super-page.vue.js +754 -226
- package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
- package/dist/es/i18n/langs/cn.js +55 -2
- package/dist/es/i18n/langs/en.js +55 -2
- package/package.json +2 -2
|
@@ -1,140 +1,324 @@
|
|
|
1
|
-
import { getValueFromSource
|
|
2
|
-
import { deepCopy
|
|
3
|
-
import { CommonName
|
|
4
|
-
import { handleChartEvent
|
|
5
|
-
function
|
|
6
|
-
if (!
|
|
7
|
-
|
|
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);
|
|
1
|
+
import { getValueFromSource, formatVariableValue, setValueForVariableName } from "../page-helper-util.js";
|
|
2
|
+
import { deepCopy } from "../common-util.js";
|
|
3
|
+
import { CommonName, caculateFormulaValue, sortDatas, limitDatas, executeChartFormula } from "./chart-util.js";
|
|
4
|
+
import { handleChartEvent } from "../events/event-util.js";
|
|
5
|
+
function updateChartOption(pageContext, configure, chartOption, resultData) {
|
|
6
|
+
if (!resultData || !resultData.result) {
|
|
7
|
+
return;
|
|
17
8
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
handleChartEvent(pageContext, configure, "beforeUpdateChart", chartOption, {
|
|
10
|
+
resultData
|
|
11
|
+
});
|
|
12
|
+
const result = resultData && resultData.result ? resultData.result : {};
|
|
13
|
+
let groupValue = resultData && resultData.groupValue ? resultData.groupValue : void 0;
|
|
14
|
+
const dataSetField = configure.serviceDataField;
|
|
15
|
+
let datas = null;
|
|
16
|
+
if (dataSetField) {
|
|
17
|
+
datas = result[dataSetField];
|
|
18
|
+
} else {
|
|
19
|
+
if (result) {
|
|
20
|
+
if (Array.isArray(result)) {
|
|
21
|
+
datas = result;
|
|
22
|
+
} else {
|
|
23
|
+
datas = [result];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (!datas) {
|
|
28
|
+
datas = [];
|
|
29
|
+
}
|
|
30
|
+
configure.runtime.dataConfig.runtimeData = datas;
|
|
31
|
+
let confGroups = configure.props ? configure.props.groups : null;
|
|
32
|
+
if (!confGroups) {
|
|
33
|
+
confGroups = [];
|
|
34
|
+
}
|
|
35
|
+
if (!groupValue || groupValue.length === 0) {
|
|
36
|
+
groupValue = [];
|
|
37
|
+
for (const g of confGroups) {
|
|
38
|
+
groupValue.push(g.group);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const groupMap = {};
|
|
42
|
+
const groupFields = [];
|
|
43
|
+
const realGroupFilds = [];
|
|
44
|
+
for (const g of confGroups) {
|
|
45
|
+
groupMap[g.group] = g.target;
|
|
46
|
+
if (g.target && !groupFields.includes(g.target)) {
|
|
47
|
+
groupFields.push(g.target);
|
|
48
|
+
if (groupValue.includes(g.group)) {
|
|
49
|
+
realGroupFilds.push(g.target);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
let mulGroupShow = configure.props ? configure.props.mulGroupShow : "";
|
|
54
|
+
mulGroupShow = mulGroupShow == "break" ? "\r\n" : " ";
|
|
55
|
+
for (const d of datas) {
|
|
56
|
+
if (!d) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const xValues2 = [];
|
|
60
|
+
for (const g of groupValue) {
|
|
61
|
+
const fieldName = groupMap[g];
|
|
62
|
+
const value = getValueFromSource(d, fieldName, void 0);
|
|
63
|
+
if (value) {
|
|
64
|
+
xValues2.push(value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const xValue = xValues2.join(mulGroupShow);
|
|
68
|
+
d[CommonName.X_FIELD_NAME] = xValue;
|
|
31
69
|
}
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
null != a2 && (E.push(a2), A[e2.uuid] = a2), i2.dynamicSeriesField && !_.includes(i2.dynamicSeriesField) && a2 && (a2.dynamicField = i2.dynamicSeriesField, a2.dynamicSeriesTitle = i2.dynamicSeriesTitle, a2.dynamicShowStack = i2.dynamicShowStack, _.push(i2.dynamicSeriesField), b[i2.dynamicSeriesField] = s2);
|
|
70
|
+
const itemConfs = configure.items ? configure.items : [];
|
|
71
|
+
const serieValues = [];
|
|
72
|
+
const serieValueMap = {};
|
|
73
|
+
const dynamicFileds = [];
|
|
74
|
+
const dynamicValueField = {};
|
|
75
|
+
const allValueFields = [];
|
|
76
|
+
const limitValueFields = [];
|
|
77
|
+
const accumulateFields = [];
|
|
78
|
+
const totalValueMap = caculateFormulaValue(itemConfs, datas, accumulateFields);
|
|
79
|
+
for (const f of accumulateFields) {
|
|
80
|
+
allValueFields.push(f);
|
|
44
81
|
}
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
82
|
+
for (const item of itemConfs) {
|
|
83
|
+
const itemProps = item.props ? item.props : {};
|
|
84
|
+
const sourceType = itemProps.yaxisSource;
|
|
85
|
+
const yaxisField = itemProps.yaxisField;
|
|
86
|
+
const isCumulative = itemProps.isCumulative;
|
|
87
|
+
let serieValue = null;
|
|
88
|
+
if (yaxisField && (!sourceType || sourceType == "variable")) {
|
|
89
|
+
serieValue = {
|
|
90
|
+
uuid: item.uuid,
|
|
91
|
+
type: "variable",
|
|
92
|
+
field: yaxisField,
|
|
93
|
+
isCumulative,
|
|
94
|
+
data: [],
|
|
95
|
+
dynamicDatas: []
|
|
96
|
+
//动态系列数据
|
|
97
|
+
};
|
|
98
|
+
if (yaxisField && !allValueFields.includes(yaxisField)) {
|
|
99
|
+
allValueFields.push(yaxisField);
|
|
100
|
+
limitValueFields.push(yaxisField);
|
|
55
101
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const e2 = n2[a2];
|
|
59
|
-
isNaN || (u2 += e2), n2[a2] = u2;
|
|
102
|
+
if (isCumulative && !accumulateFields.includes(yaxisField)) {
|
|
103
|
+
accumulateFields.push(yaxisField);
|
|
60
104
|
}
|
|
105
|
+
} else if (sourceType == "formula") {
|
|
106
|
+
let formula = itemProps.formula ? itemProps.formula : "";
|
|
107
|
+
for (const paramName in totalValueMap) {
|
|
108
|
+
formula = formula.replace(
|
|
109
|
+
new RegExp(paramName.replace("$", "\\$"), "g"),
|
|
110
|
+
totalValueMap[paramName]
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
serieValue = {
|
|
114
|
+
uuid: item.uuid,
|
|
115
|
+
type: "formula",
|
|
116
|
+
formula,
|
|
117
|
+
data: [],
|
|
118
|
+
dynamicDatas: []
|
|
119
|
+
//动态系列数据
|
|
120
|
+
};
|
|
121
|
+
} else {
|
|
122
|
+
serieValue = {
|
|
123
|
+
uuid: item.uuid,
|
|
124
|
+
type: "fixed",
|
|
125
|
+
field: itemProps.yaxisFix,
|
|
126
|
+
data: [],
|
|
127
|
+
dynamicDatas: []
|
|
128
|
+
//动态系列数据
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (serieValue != null) {
|
|
132
|
+
serieValues.push(serieValue);
|
|
133
|
+
serieValueMap[item.uuid] = serieValue;
|
|
61
134
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
135
|
+
if (itemProps.dynamicSeriesField && !dynamicFileds.includes(itemProps.dynamicSeriesField) && serieValue) {
|
|
136
|
+
serieValue.dynamicField = itemProps.dynamicSeriesField;
|
|
137
|
+
serieValue.dynamicSeriesTitle = itemProps.dynamicSeriesTitle;
|
|
138
|
+
serieValue.dynamicShowStack = itemProps.dynamicShowStack;
|
|
139
|
+
dynamicFileds.push(itemProps.dynamicSeriesField);
|
|
140
|
+
dynamicValueField[itemProps.dynamicSeriesField] = yaxisField;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const dynamicLabelMap = {};
|
|
144
|
+
if (dynamicFileds.length > 0) {
|
|
145
|
+
const newDatas = [];
|
|
146
|
+
const dataMap = {};
|
|
147
|
+
for (const d of datas) {
|
|
148
|
+
if (!d) {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
for (const valueField of allValueFields) {
|
|
152
|
+
const groupValue2 = d[CommonName.X_FIELD_NAME];
|
|
153
|
+
let newData = dataMap[groupValue2];
|
|
154
|
+
if (!newData) {
|
|
155
|
+
newData = {};
|
|
156
|
+
for (const gField of groupFields) {
|
|
157
|
+
newData[gField] = d[gField];
|
|
158
|
+
}
|
|
159
|
+
newData[CommonName.X_FIELD_NAME] = d[CommonName.X_FIELD_NAME];
|
|
160
|
+
dataMap[groupValue2] = newData;
|
|
161
|
+
newDatas.push(newData);
|
|
162
|
+
}
|
|
163
|
+
let newValue = getValueFromSource(d, valueField, void 0);
|
|
164
|
+
if (!isNaN(newValue)) {
|
|
165
|
+
const hisValue = newData[valueField];
|
|
166
|
+
if (!isNaN) {
|
|
167
|
+
newValue += hisValue;
|
|
168
|
+
}
|
|
169
|
+
newData[valueField] = newValue;
|
|
75
170
|
}
|
|
76
171
|
}
|
|
77
|
-
L[i3] = s2;
|
|
78
172
|
}
|
|
79
|
-
|
|
173
|
+
for (const dynamicField of dynamicFileds) {
|
|
174
|
+
const dynamicLabels = [];
|
|
175
|
+
for (const d of datas) {
|
|
176
|
+
if (!d) {
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
const groupValue2 = d[CommonName.X_FIELD_NAME];
|
|
180
|
+
const newData = dataMap[groupValue2];
|
|
181
|
+
if (!newData) {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
let dynamicLabel = getValueFromSource(d, dynamicField, void 0);
|
|
185
|
+
dynamicLabel = dynamicLabel == null || dynamicLabel == void 0 ? "" : dynamicLabel;
|
|
186
|
+
if (!dynamicLabels.includes(dynamicLabel)) {
|
|
187
|
+
dynamicLabels.push(dynamicLabel);
|
|
188
|
+
limitValueFields.push(dynamicLabel);
|
|
189
|
+
accumulateFields.push(dynamicLabel);
|
|
190
|
+
}
|
|
191
|
+
const valueField = dynamicValueField[dynamicField];
|
|
192
|
+
if (valueField !== void 0) {
|
|
193
|
+
const newValue = getValueFromSource(d, valueField, void 0);
|
|
194
|
+
let hisValue = newData[dynamicLabel];
|
|
195
|
+
if (hisValue === void 0) {
|
|
196
|
+
hisValue = newValue;
|
|
197
|
+
} else if (!isNaN(newValue)) {
|
|
198
|
+
hisValue += newValue;
|
|
199
|
+
}
|
|
200
|
+
newData[dynamicLabel] = hisValue;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
dynamicLabelMap[dynamicField] = dynamicLabels;
|
|
204
|
+
}
|
|
205
|
+
datas = newDatas;
|
|
80
206
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
let
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
l2 >= o2.length && o2.push([]), s2 = o2[l2];
|
|
98
|
-
const n2 = a2[l2];
|
|
99
|
-
let u2 = e(i2, n2, void 0);
|
|
100
|
-
t2.isCumulative && (u2 = j[n2]), s2.push(u2);
|
|
207
|
+
sortDatas(pageContext, configure, datas);
|
|
208
|
+
datas = limitDatas(pageContext, configure, datas, groupFields, limitValueFields);
|
|
209
|
+
const xValues = [];
|
|
210
|
+
const cumulativeMap = {};
|
|
211
|
+
for (const data of datas) {
|
|
212
|
+
if (!data) {
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
for (const cumulativeField of accumulateFields) {
|
|
216
|
+
const value = getValueFromSource(data, cumulativeField, void 0);
|
|
217
|
+
let hisValue = cumulativeMap[cumulativeField];
|
|
218
|
+
if (value !== void 0 && !isNaN(value)) {
|
|
219
|
+
if (hisValue === void 0) {
|
|
220
|
+
hisValue = value;
|
|
221
|
+
} else {
|
|
222
|
+
hisValue = hisValue + value;
|
|
101
223
|
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
224
|
+
}
|
|
225
|
+
cumulativeMap[cumulativeField] = hisValue;
|
|
226
|
+
}
|
|
227
|
+
xValues.push(data[CommonName.X_FIELD_NAME]);
|
|
228
|
+
for (const item of serieValues) {
|
|
229
|
+
let serieData = item.data;
|
|
230
|
+
const dynamicDatas = item.dynamicDatas;
|
|
231
|
+
if (item.dynamicField) {
|
|
232
|
+
let dynamicLabels = dynamicLabelMap[item.dynamicField];
|
|
233
|
+
dynamicLabels = dynamicLabels ? dynamicLabels : [];
|
|
234
|
+
for (let i = 0; i < dynamicLabels.length; i++) {
|
|
235
|
+
if (i >= dynamicDatas.length) {
|
|
236
|
+
dynamicDatas.push([]);
|
|
237
|
+
}
|
|
238
|
+
serieData = dynamicDatas[i];
|
|
239
|
+
const fieldName = dynamicLabels[i];
|
|
240
|
+
let value = getValueFromSource(data, fieldName, void 0);
|
|
241
|
+
if (item.isCumulative) {
|
|
242
|
+
value = cumulativeMap[fieldName];
|
|
243
|
+
}
|
|
244
|
+
serieData.push(value);
|
|
245
|
+
}
|
|
246
|
+
} else if (item.type === "fixed") {
|
|
247
|
+
serieData.push(item.field);
|
|
248
|
+
} else if (item.type === "variable") {
|
|
249
|
+
let value = getValueFromSource(data, item.field, void 0);
|
|
250
|
+
if (item.isCumulative) {
|
|
251
|
+
value = cumulativeMap[item.field];
|
|
252
|
+
}
|
|
253
|
+
serieData.push(value);
|
|
254
|
+
} else if (item.type === "formula") {
|
|
255
|
+
const value = executeChartFormula(item.formula, cumulativeMap, data, pageContext);
|
|
256
|
+
serieData.push(value);
|
|
257
|
+
} else {
|
|
258
|
+
serieData.push(void 0);
|
|
259
|
+
}
|
|
110
260
|
}
|
|
111
261
|
}
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
262
|
+
const defaultSeries = configure.defaultSeries;
|
|
263
|
+
const tempSeries = deepCopy(defaultSeries == null ? [] : defaultSeries);
|
|
264
|
+
const newSeries = [];
|
|
265
|
+
for (const serie of tempSeries) {
|
|
266
|
+
const serieValue = serieValueMap[serie.uuid];
|
|
267
|
+
if (serieValue.dynamicField) {
|
|
268
|
+
let dynamicLabels = dynamicLabelMap[serieValue.dynamicField];
|
|
269
|
+
dynamicLabels = dynamicLabels ? dynamicLabels : [];
|
|
270
|
+
const dynamicDatas = serieValue.dynamicDatas ? serieValue.dynamicDatas : [];
|
|
271
|
+
for (let i = 0; i < dynamicLabels.length; i++) {
|
|
272
|
+
const label = dynamicLabels[i];
|
|
273
|
+
const newSerie = deepCopy(serie);
|
|
274
|
+
if (serieValue.dynamicSeriesTitle) {
|
|
275
|
+
const dynamicSeriesTitle = serieValue.dynamicSeriesTitle.replace("${name}", label);
|
|
276
|
+
newSerie.name = formatVariableValue(pageContext, dynamicSeriesTitle);
|
|
277
|
+
} else {
|
|
278
|
+
newSerie.name = label;
|
|
279
|
+
}
|
|
280
|
+
newSerie.data = i < dynamicDatas.length ? dynamicDatas[i] : [];
|
|
281
|
+
if (serie.type == "bar" && serieValue.dynamicShowStack) {
|
|
282
|
+
newSerie.stack = serie.uuid;
|
|
283
|
+
}
|
|
284
|
+
newSeries.push(newSerie);
|
|
126
285
|
}
|
|
127
|
-
} else
|
|
286
|
+
} else {
|
|
287
|
+
serie.data = serieValue ? serieValue.data : [];
|
|
288
|
+
newSeries.push(serie);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
chartOption.series = newSeries;
|
|
292
|
+
const defaultXaxis = configure.defaultXaxis;
|
|
293
|
+
const defaultYaxis = configure.defaultYaxis;
|
|
294
|
+
if (chartOption.isBar) {
|
|
295
|
+
if (defaultYaxis) {
|
|
296
|
+
for (const tempYaxis of defaultYaxis) {
|
|
297
|
+
tempYaxis.data = xValues;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
chartOption.xAxis = defaultXaxis;
|
|
301
|
+
chartOption.yAxis = defaultYaxis;
|
|
302
|
+
} else {
|
|
303
|
+
if (defaultXaxis && defaultXaxis.length > 0) {
|
|
304
|
+
defaultXaxis[0].data = xValues;
|
|
305
|
+
}
|
|
306
|
+
chartOption.xAxis = defaultXaxis;
|
|
307
|
+
chartOption.yAxis = defaultYaxis;
|
|
308
|
+
}
|
|
309
|
+
const selGroupVariable = configure.props ? configure.props.selGroupVariable : null;
|
|
310
|
+
const enableDrill = configure.props ? configure.props.enableDrill : null;
|
|
311
|
+
if (!enableDrill && selGroupVariable) {
|
|
312
|
+
configure.highlightInfos = [];
|
|
313
|
+
setValueForVariableName(pageContext.entity, selGroupVariable, null);
|
|
128
314
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const R = d.props ? d.props.selGroupVariable : null;
|
|
136
|
-
!(d.props ? d.props.enableDrill : null) && R && (d.highlightInfos = [], t(c2.entity, R, null)), r(c2, d, "afterUpdateChart", f, { resultData: p }), d.groupFields = S, d.cacheDatas = g, d.rawResult = p;
|
|
315
|
+
handleChartEvent(pageContext, configure, "afterUpdateChart", chartOption, {
|
|
316
|
+
resultData
|
|
317
|
+
});
|
|
318
|
+
configure.groupFields = realGroupFilds;
|
|
319
|
+
configure.cacheDatas = datas;
|
|
320
|
+
configure.rawResult = resultData;
|
|
137
321
|
}
|
|
138
322
|
export {
|
|
139
|
-
|
|
323
|
+
updateChartOption
|
|
140
324
|
};
|
|
@@ -1,35 +1,74 @@
|
|
|
1
|
-
import { formatVariableValue
|
|
2
|
-
import { deepCopy
|
|
3
|
-
function
|
|
4
|
-
if (!
|
|
5
|
-
|
|
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) {
|
|
10
|
-
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);
|
|
1
|
+
import { formatVariableValue, getValueFromSource } from "../page-helper-util.js";
|
|
2
|
+
import { deepCopy } from "../common-util.js";
|
|
3
|
+
function updateChartOption(pageContext, configure, chartOption, resultData) {
|
|
4
|
+
if (!resultData || !resultData.result) {
|
|
5
|
+
return;
|
|
15
6
|
}
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (e2 < F.length || x[o2.name]) {
|
|
25
|
-
let t2 = x[o2.name];
|
|
26
|
-
t2 || (t2 = F[e2]), t2 && (o2.itemStyle = { color: t2 });
|
|
7
|
+
const result = resultData && resultData.result ? resultData.result : {};
|
|
8
|
+
const dataSetField = configure.serviceDataField;
|
|
9
|
+
let datas = null;
|
|
10
|
+
if (dataSetField) {
|
|
11
|
+
datas = result[dataSetField];
|
|
12
|
+
} else {
|
|
13
|
+
if (result) {
|
|
14
|
+
datas = [result];
|
|
27
15
|
}
|
|
28
|
-
S.push(o2);
|
|
29
16
|
}
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
if (!datas) {
|
|
18
|
+
datas = [];
|
|
19
|
+
}
|
|
20
|
+
const nameSource = configure.props ? configure.props.nameSource : void 0;
|
|
21
|
+
const nameField = configure.props ? configure.props.nameField : void 0;
|
|
22
|
+
const nameFixed = configure.props ? configure.props.nameFixed : void 0;
|
|
23
|
+
const valueField = configure.props ? configure.props.yaxisField : void 0;
|
|
24
|
+
const groupFields = [nameField];
|
|
25
|
+
const xValues = [];
|
|
26
|
+
const yValues = [];
|
|
27
|
+
for (let d of datas) {
|
|
28
|
+
if (!d) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
let xValue = null;
|
|
32
|
+
if (nameSource == "fixed") {
|
|
33
|
+
xValue = formatVariableValue(pageContext, nameFixed);
|
|
34
|
+
} else {
|
|
35
|
+
xValue = getValueFromSource(d, nameField, void 0);
|
|
36
|
+
}
|
|
37
|
+
xValues.push(xValue);
|
|
38
|
+
const yValue = getValueFromSource(d, valueField, void 0);
|
|
39
|
+
yValues.push(yValue);
|
|
40
|
+
}
|
|
41
|
+
const defaultSeries = configure.defaultSeries;
|
|
42
|
+
let allColors = defaultSeries[0].pieColors;
|
|
43
|
+
allColors = allColors ? allColors : [];
|
|
44
|
+
let colorMap = defaultSeries[0].pieColorMap;
|
|
45
|
+
colorMap = colorMap ? colorMap : {};
|
|
46
|
+
const gaugeDatas = [];
|
|
47
|
+
for (let index = 0; index < xValues.length && index < yValues.length; index++) {
|
|
48
|
+
const data = {
|
|
49
|
+
value: yValues[index],
|
|
50
|
+
name: xValues[index]
|
|
51
|
+
};
|
|
52
|
+
if (index < allColors.length || colorMap[data.name]) {
|
|
53
|
+
let color = colorMap[data.name];
|
|
54
|
+
if (!color) {
|
|
55
|
+
color = allColors[index];
|
|
56
|
+
}
|
|
57
|
+
if (color) {
|
|
58
|
+
data.itemStyle = {
|
|
59
|
+
color
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
gaugeDatas.push(data);
|
|
64
|
+
}
|
|
65
|
+
const tempSeries = deepCopy(defaultSeries);
|
|
66
|
+
tempSeries[0].data = gaugeDatas;
|
|
67
|
+
chartOption.series = [tempSeries[0]];
|
|
68
|
+
configure.groupFields = groupFields;
|
|
69
|
+
configure.cacheDatas = datas;
|
|
70
|
+
configure.rawResult = resultData;
|
|
32
71
|
}
|
|
33
72
|
export {
|
|
34
|
-
|
|
73
|
+
updateChartOption
|
|
35
74
|
};
|