super-page-runtime 2.1.92 → 2.1.95

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