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,164 +1,88 @@
1
- import { getValueFromSource, setValueForVariableName } from "../page-helper-util.js";
2
- import { deepCopy } from "../common-util.js";
3
- import { CommonName, caculateFormulaValue, executeChartFormula, sortDatas, limitDatas } from "./chart-util.js";
4
- function updateChartOption(pageContext, configure, chartOption, resultData) {
5
- if (!resultData || !resultData.result) {
1
+ import { getValueFromSource as o, setValueForVariableName as t } from "../page-helper-util.js";
2
+ import { deepCopy as r } from "../common-util.js";
3
+ import { CommonName as s, caculateFormulaValue as e, executeChartFormula as l, sortDatas as n, limitDatas as p } from "./chart-util.js";
4
+ function i(i2, u, c, a) {
5
+ if (!a || !a.result)
6
6
  return;
7
+ const f = a && a.result ? a.result : {};
8
+ let g = a && a.groupValue ? a.groupValue : void 0;
9
+ const m = u.serviceDataField;
10
+ let h = null;
11
+ m ? h = f[m] : f && (h = Array.isArray(f) ? f : [f]), h || (h = []);
12
+ let d = u.props ? u.props.groups : null;
13
+ if (d || (d = []), !g || 0 === g.length) {
14
+ g = [];
15
+ for (const o2 of d)
16
+ g.push(o2.group);
7
17
  }
8
- const result = resultData && resultData.result ? resultData.result : {};
9
- let groupValue = resultData && resultData.groupValue ? resultData.groupValue : void 0;
10
- const dataSetField = configure.serviceDataField;
11
- let datas = null;
12
- if (dataSetField) {
13
- datas = result[dataSetField];
14
- } else {
15
- if (result) {
16
- if (Array.isArray(result)) {
17
- datas = result;
18
- } else {
19
- datas = [result];
20
- }
21
- }
22
- }
23
- if (!datas) {
24
- datas = [];
25
- }
26
- let confGroups = configure.props ? configure.props.groups : null;
27
- if (!confGroups) {
28
- confGroups = [];
29
- }
30
- if (!groupValue || groupValue.length === 0) {
31
- groupValue = [];
32
- for (const g of confGroups) {
33
- groupValue.push(g.group);
34
- }
35
- }
36
- const groupMap = {};
37
- const groupFields = [];
38
- const realGroupFilds = [];
39
- for (const g of confGroups) {
40
- groupMap[g.group] = g.target;
41
- if (g.target && !groupFields.includes(g.target)) {
42
- groupFields.push(g.target);
43
- if (groupValue.includes(g.group)) {
44
- realGroupFilds.push(g.target);
45
- }
46
- }
47
- }
48
- let mulGroupShow = configure.props ? configure.props.mulGroupShow : "";
49
- mulGroupShow = mulGroupShow == "break" ? "\r\n" : " ";
50
- console.log("groupValue", groupValue);
51
- for (const d of datas) {
52
- if (!d) {
18
+ const y = {}, x = [], v = [];
19
+ for (const o2 of d)
20
+ y[o2.group] = o2.target, o2.target && !x.includes(o2.target) && (x.push(o2.target), g.includes(o2.group) && v.push(o2.target));
21
+ let E = u.props ? u.props.mulGroupShow : "";
22
+ E = "break" == E ? "\r\n" : " ";
23
+ for (const t2 of h) {
24
+ if (!t2)
53
25
  continue;
26
+ const r2 = [];
27
+ for (const s2 of g) {
28
+ const e3 = y[s2], l2 = o(t2, e3, void 0);
29
+ l2 && r2.push(l2);
54
30
  }
55
- const xValues2 = [];
56
- for (const g of groupValue) {
57
- const fieldName = groupMap[g];
58
- const value = getValueFromSource(d, fieldName, void 0);
59
- if (value) {
60
- xValues2.push(value);
61
- }
62
- }
63
- const xValue = xValues2.join(mulGroupShow);
64
- d[CommonName.X_FIELD_NAME] = xValue;
31
+ const e2 = r2.join(E);
32
+ t2[s.X_FIELD_NAME] = e2;
65
33
  }
66
- const itemConfs = configure.items ? configure.items : [];
67
- if (itemConfs.length == 0) {
68
- console.log("饼图的系列为空,操作失败!", configure);
34
+ const F = u.items ? u.items : [];
35
+ if (0 == F.length)
69
36
  return;
70
- }
71
- const confProps = configure.props ? configure.props : {};
72
- let valueField = confProps.yaxisField;
73
- console.log("valueField", valueField);
74
- itemConfs[0].props.yaxisField = valueField;
75
- itemConfs[0].props.yaxisSource = confProps.yaxisSource;
76
- itemConfs[0].props.formula = confProps.formula;
77
- if (confProps.yaxisSource === "formula") {
78
- const accumulateFields = [];
79
- const totalValueMap = caculateFormulaValue(itemConfs, datas, accumulateFields);
80
- let formula = confProps.formula ? confProps.formula : "";
81
- for (const paramName in totalValueMap) {
82
- formula = formula.replace(
83
- new RegExp(paramName.replace("$", "\\$"), "g"),
84
- totalValueMap[paramName]
85
- );
86
- }
87
- valueField = CommonName.Y_TEMP_NAME;
88
- const cumulativeMap = {};
89
- for (const data of datas) {
90
- if (!data) {
37
+ const S = u.props ? u.props : {};
38
+ let _ = S.yaxisField;
39
+ if (F[0].props.yaxisField = _, F[0].props.yaxisSource = S.yaxisSource, F[0].props.formula = S.formula, "formula" === S.yaxisSource) {
40
+ const t2 = [], r2 = e(F, h, t2);
41
+ let n2 = S.formula ? S.formula : "";
42
+ for (const o2 in r2)
43
+ n2 = n2.replace(new RegExp(o2.replace("$", "\\$"), "g"), r2[o2]);
44
+ _ = s.Y_TEMP_NAME;
45
+ const p2 = {};
46
+ for (const r3 of h) {
47
+ if (!r3)
91
48
  continue;
49
+ for (const s3 of t2) {
50
+ const t3 = o(r3, s3, void 0);
51
+ let e2 = p2[s3];
52
+ void 0 === t3 || isNaN(t3) || (void 0 === e2 ? e2 = t3 : e2 += t3), p2[s3] = e2;
92
53
  }
93
- for (const cumulativeField of accumulateFields) {
94
- const value2 = getValueFromSource(data, cumulativeField, void 0);
95
- let hisValue = cumulativeMap[cumulativeField];
96
- if (value2 !== void 0 && !isNaN(value2)) {
97
- if (hisValue === void 0) {
98
- hisValue = value2;
99
- } else {
100
- hisValue = hisValue + value2;
101
- }
102
- }
103
- cumulativeMap[cumulativeField] = hisValue;
104
- }
105
- console.log("formula", formula);
106
- const value = executeChartFormula(formula, cumulativeMap, data, pageContext);
107
- console.log("formula-result", value);
108
- data[valueField] = value;
54
+ const s2 = l(n2, p2, r3, i2);
55
+ r3[_] = s2;
109
56
  }
110
57
  }
111
- itemConfs[0].props.yaxisField = valueField;
112
- itemConfs[0].props.yaxisSource = "";
113
- sortDatas(pageContext, configure, datas);
114
- datas = limitDatas(pageContext, configure, datas, groupFields, [valueField]);
115
- const xValues = [];
116
- const yValues = [];
117
- for (const data of datas) {
118
- if (!data) {
58
+ F[0].props.yaxisField = _, F[0].props.yaxisSource = "", n(i2, u, h), h = p(i2, u, h, x, [_]);
59
+ const A = [], D = [];
60
+ for (const t2 of h) {
61
+ if (!t2)
119
62
  continue;
120
- }
121
- xValues.push(data[CommonName.X_FIELD_NAME]);
122
- const value = getValueFromSource(data, valueField, void 0);
123
- yValues.push(value);
63
+ A.push(t2[s.X_FIELD_NAME]);
64
+ const r2 = o(t2, _, void 0);
65
+ D.push(r2);
124
66
  }
125
- const defaultSeries = configure.defaultSeries;
126
- let pieColors = defaultSeries[0].pieColors;
127
- pieColors = pieColors ? pieColors : [];
128
- let pieColorMap = defaultSeries[0].pieColorMap;
129
- pieColorMap = pieColorMap ? pieColorMap : {};
130
- const pieDatas = [];
131
- for (let index = 0; index < xValues.length && index < yValues.length; index++) {
132
- const data = {
133
- value: yValues[index],
134
- name: xValues[index]
135
- };
136
- if (index < pieColors.length || pieColorMap[data.name]) {
137
- let color = pieColorMap[data.name];
138
- if (!color) {
139
- color = pieColors[index];
140
- }
141
- if (color) {
142
- data.itemStyle = {
143
- color
144
- };
145
- }
67
+ const M = u.defaultSeries;
68
+ let N = M[0].pieColors;
69
+ N = N || [];
70
+ let j = M[0].pieColorMap;
71
+ j = j || {};
72
+ const b = [];
73
+ for (let o2 = 0; o2 < A.length && o2 < D.length; o2++) {
74
+ const t2 = { value: D[o2], name: A[o2] };
75
+ if (o2 < N.length || j[t2.name]) {
76
+ let r2 = j[t2.name];
77
+ r2 || (r2 = N[o2]), r2 && (t2.itemStyle = { color: r2 });
146
78
  }
147
- pieDatas.push(data);
148
- }
149
- const tempSeries = deepCopy(defaultSeries);
150
- tempSeries[0].data = pieDatas;
151
- chartOption.series = [tempSeries[0]];
152
- const selGroupVariable = configure.props ? configure.props.selGroupVariable : null;
153
- const enableDrill = configure.props ? configure.props.enableDrill : null;
154
- if (!enableDrill && selGroupVariable) {
155
- configure.highlightInfos = [];
156
- setValueForVariableName(pageContext.entity, selGroupVariable, null);
79
+ b.push(t2);
157
80
  }
158
- configure.groupFields = realGroupFilds;
159
- configure.cacheDatas = datas;
160
- configure.rawResult = resultData;
81
+ const w = r(M);
82
+ w[0].data = b, c.series = [w[0]];
83
+ const I = u.props ? u.props.selGroupVariable : null;
84
+ !(u.props ? u.props.enableDrill : null) && I && (u.highlightInfos = [], t(i2.entity, I, null)), u.groupFields = v, u.cacheDatas = h, u.rawResult = a;
161
85
  }
162
86
  export {
163
- updateChartOption
87
+ i as updateChartOption
164
88
  };
@@ -1,132 +1,62 @@
1
- import { getValueFromSource } from "../page-helper-util.js";
2
- import { deepCopy } from "../common-util.js";
3
- import { caculateFormulaValue, executeChartFormula } from "./chart-util.js";
4
- function updateChartOption(pageContext, configure, chartOption, resultData) {
5
- if (!resultData || !resultData.result) {
1
+ import { getValueFromSource as e } from "../page-helper-util.js";
2
+ import { deepCopy as o } from "../common-util.js";
3
+ import { caculateFormulaValue as i, executeChartFormula as t } from "./chart-util.js";
4
+ function a(a2, s, r, l) {
5
+ if (!l || !l.result)
6
6
  return;
7
+ const u = l && l.result ? l.result : {}, f = s.serviceDataField;
8
+ let d = null;
9
+ f ? d = u[f] : u && (d = Array.isArray(u) ? u : [u]), d || (d = []);
10
+ const n = s.items ? s.items : [], c = [], p = {}, m = [], x = i(n, d, m);
11
+ for (const e2 of n) {
12
+ const o2 = e2.props ? e2.props : {}, i2 = o2.yaxisSource, t2 = o2.yaxisField;
13
+ let a3 = null;
14
+ if (!t2 || i2 && "variable" != i2)
15
+ if ("formula" == i2) {
16
+ let i3 = o2.formula ? o2.formula : "";
17
+ for (const e3 in x)
18
+ i3 = i3.replace(new RegExp(e3.replace("$", "\\$"), "g"), x[e3]);
19
+ a3 = { uuid: e2.uuid, type: "formula", formula: i3, data: [] };
20
+ } else
21
+ a3 = { uuid: e2.uuid, type: "fixed", field: o2.yaxisFix, data: [] };
22
+ else
23
+ a3 = { uuid: e2.uuid, type: "variable", field: t2, data: [] };
24
+ a3 && (c.push(a3), p[a3.uuid] = a3);
7
25
  }
8
- const result = resultData && resultData.result ? resultData.result : {};
9
- const dataSetField = configure.serviceDataField;
10
- let datas = null;
11
- if (dataSetField) {
12
- datas = result[dataSetField];
13
- } else {
14
- if (result) {
15
- if (Array.isArray(result)) {
16
- datas = result;
17
- } else {
18
- datas = [result];
19
- }
20
- }
21
- }
22
- if (!datas) {
23
- datas = [];
24
- }
25
- const itemConfs = configure.items ? configure.items : [];
26
- const dataConfs = [];
27
- const dataValueMap = {};
28
- const accumulateFields = [];
29
- const totalValueMap = caculateFormulaValue(itemConfs, datas, accumulateFields);
30
- for (const item of itemConfs) {
31
- const itemProps = item.props ? item.props : {};
32
- const sourceType = itemProps.yaxisSource;
33
- const yaxisField = itemProps.yaxisField;
34
- let dataConf = null;
35
- if (yaxisField && (!sourceType || sourceType == "variable")) {
36
- dataConf = {
37
- uuid: item.uuid,
38
- type: "variable",
39
- field: yaxisField,
40
- data: []
41
- };
42
- } else if (sourceType == "formula") {
43
- let formula = itemProps.formula ? itemProps.formula : "";
44
- for (const paramName in totalValueMap) {
45
- formula = formula.replace(
46
- new RegExp(paramName.replace("$", "\\$"), "g"),
47
- totalValueMap[paramName]
48
- );
49
- }
50
- dataConf = {
51
- uuid: item.uuid,
52
- type: "formula",
53
- formula,
54
- data: []
55
- };
56
- } else {
57
- dataConf = {
58
- uuid: item.uuid,
59
- type: "fixed",
60
- field: itemProps.yaxisFix,
61
- data: []
62
- };
63
- }
64
- if (dataConf) {
65
- dataConfs.push(dataConf);
66
- dataValueMap[dataConf.uuid] = dataConf;
67
- }
68
- }
69
- const confProps = configure.props ? configure.props : {};
70
- const nameField = confProps.nameField;
71
- const maxSource = confProps.maxSource;
72
- const maxField = confProps.maxField;
73
- const maxFixed = confProps.maxFixed;
74
- const indicators = [];
75
- const cumulativeMap = {};
76
- for (const d of datas) {
77
- if (!d) {
26
+ const v = s.props ? s.props : {}, y = v.nameField, h = v.maxSource, F = v.maxField, b = v.maxFixed, g = [], j = {};
27
+ for (const o2 of d) {
28
+ if (!o2)
78
29
  continue;
30
+ const i2 = e(o2, y, void 0);
31
+ let s2 = null;
32
+ s2 = h && "variable" != h ? b : e(o2, F, void 0), g.push({ text: i2, max: s2 });
33
+ for (const i3 of m) {
34
+ const t2 = e(o2, i3, void 0);
35
+ let a3 = j[i3];
36
+ void 0 === t2 || isNaN(t2) || (void 0 === a3 ? a3 = t2 : a3 += t2), j[i3] = a3;
79
37
  }
80
- const name = getValueFromSource(d, nameField, void 0);
81
- let maxValue = null;
82
- if (!maxSource || maxSource == "variable") {
83
- maxValue = getValueFromSource(d, maxField, void 0);
84
- } else {
85
- maxValue = maxFixed;
86
- }
87
- indicators.push({
88
- text: name,
89
- max: maxValue
90
- });
91
- for (const cumulativeField of accumulateFields) {
92
- const value = getValueFromSource(d, cumulativeField, void 0);
93
- let hisValue = cumulativeMap[cumulativeField];
94
- if (value !== void 0 && !isNaN(value)) {
95
- if (hisValue === void 0) {
96
- hisValue = value;
97
- } else {
98
- hisValue = hisValue + value;
99
- }
100
- }
101
- cumulativeMap[cumulativeField] = hisValue;
102
- }
103
- for (const item of dataConfs) {
104
- const data = item.data;
105
- if (item.type == "fixed") {
106
- data.push(item.field);
107
- } else if (item.type == "variable") {
108
- const value = getValueFromSource(d, item.field, void 0);
109
- data.push(value);
110
- } else if (item.type == "formula") {
111
- const value = executeChartFormula(item.formula, cumulativeMap, d, pageContext);
112
- data.push(value);
113
- } else {
114
- data.push(void 0);
115
- }
38
+ for (const i3 of c) {
39
+ const s3 = i3.data;
40
+ if ("fixed" == i3.type)
41
+ s3.push(i3.field);
42
+ else if ("variable" == i3.type) {
43
+ const t2 = e(o2, i3.field, void 0);
44
+ s3.push(t2);
45
+ } else if ("formula" == i3.type) {
46
+ const e2 = t(i3.formula, j, o2, a2);
47
+ s3.push(e2);
48
+ } else
49
+ s3.push(void 0);
116
50
  }
117
51
  }
118
- chartOption.radar[0].indicator = indicators;
119
- const defaultSeries = configure.defaultSeries;
120
- const tempSeries = deepCopy(defaultSeries);
121
- const serieDatas = tempSeries[0].data;
122
- for (const serieData of serieDatas) {
123
- const dataValue = dataValueMap[serieData.uuid];
124
- serieData.value = dataValue.data;
52
+ r.radar[0].indicator = g;
53
+ const S = s.defaultSeries, w = o(S), A = w[0].data;
54
+ for (const e2 of A) {
55
+ const o2 = p[e2.uuid];
56
+ e2.value = o2.data;
125
57
  }
126
- chartOption.series = tempSeries;
127
- configure.cacheDatas = datas;
128
- configure.rawResult = resultData;
58
+ r.series = w, s.cacheDatas = d, s.rawResult = l;
129
59
  }
130
60
  export {
131
- updateChartOption
61
+ a as updateChartOption
132
62
  };
@@ -1,108 +1,50 @@
1
- import { getValueFromSource } from "../page-helper-util.js";
2
- import { deepCopy } from "../common-util.js";
3
- import { caculateFormulaValue, executeChartFormula } from "./chart-util.js";
4
- function updateChartOption(pageContext, configure, chartOption, resultData) {
5
- if (!resultData || !resultData.result) {
1
+ import { getValueFromSource as o } from "../page-helper-util.js";
2
+ import { deepCopy as s } from "../common-util.js";
3
+ import { caculateFormulaValue as i, executeChartFormula as e } from "./chart-util.js";
4
+ function r(r2, t, a, l) {
5
+ if (!l || !l.result)
6
6
  return;
7
+ const u = l && l.result ? l.result : {}, f = t.serviceDataField;
8
+ let c = null;
9
+ f ? c = u[f] : u && (c = Array.isArray(u) ? u : [u]), c || (c = []);
10
+ const d = t.items ? t.items : [], n = [], p = {};
11
+ for (const o2 of d) {
12
+ const s2 = o2.props ? o2.props : {}, i2 = o2.props ? o2.style : {}, e2 = s2.xaxisField, r3 = s2.sizeField, t2 = { uuid: o2.uuid, xaxisField: e2, yaxisField: s2.yaxisField, yaxisSource: s2.yaxisSource, formula: s2.formula, sizeField: r3, symbolSize: i2.symbolSize, data: [] };
13
+ n.push(t2), p[t2.uuid] = t2;
7
14
  }
8
- const result = resultData && resultData.result ? resultData.result : {};
9
- const dataSetField = configure.serviceDataField;
10
- let datas = null;
11
- if (dataSetField) {
12
- datas = result[dataSetField];
13
- } else {
14
- if (result) {
15
- if (Array.isArray(result)) {
16
- datas = result;
17
- } else {
18
- datas = [result];
19
- }
15
+ const m = [], x = i(d, c, m);
16
+ for (const o2 of n)
17
+ if ("formula" === o2.yaxisSource) {
18
+ let s2 = o2.formula ? o2.formula : "";
19
+ for (const o3 in x)
20
+ s2 = s2.replace(new RegExp(o3.replace("$", "\\$"), "g"), x[o3]);
21
+ o2.formula = s2;
20
22
  }
21
- }
22
- if (!datas) {
23
- datas = [];
24
- }
25
- const itemConfs = configure.items ? configure.items : [];
26
- const dataConfs = [];
27
- const dataValueMap = {};
28
- for (const item of itemConfs) {
29
- const itemProps = item.props ? item.props : {};
30
- const itemStyle = item.props ? item.style : {};
31
- const xaxisField = itemProps.xaxisField;
32
- const sizeField = itemProps.sizeField;
33
- const dataConf = {
34
- uuid: item.uuid,
35
- xaxisField,
36
- yaxisField: itemProps.yaxisField,
37
- yaxisSource: itemProps.yaxisSource,
38
- formula: itemProps.formula,
39
- sizeField,
40
- symbolSize: itemStyle.symbolSize,
41
- data: []
42
- };
43
- dataConfs.push(dataConf);
44
- dataValueMap[dataConf.uuid] = dataConf;
45
- }
46
- const accumulateFields = [];
47
- const totalValueMap = caculateFormulaValue(itemConfs, datas, accumulateFields);
48
- for (const dataConf of dataConfs) {
49
- if (dataConf.yaxisSource === "formula") {
50
- let formula = dataConf.formula ? dataConf.formula : "";
51
- for (const paramName in totalValueMap) {
52
- formula = formula.replace(
53
- new RegExp(paramName.replace("$", "\\$"), "g"),
54
- totalValueMap[paramName]
55
- );
23
+ const y = {};
24
+ for (const s2 of c)
25
+ if (s2) {
26
+ for (const i2 of m) {
27
+ const e2 = o(s2, i2, void 0);
28
+ let r3 = y[i2];
29
+ void 0 === e2 || isNaN(e2) || (void 0 === r3 ? r3 = e2 : r3 += e2), y[i2] = r3;
56
30
  }
57
- dataConf.formula = formula;
58
- }
59
- }
60
- const cumulativeMap = {};
61
- for (const d of datas) {
62
- if (!d) {
63
- continue;
64
- }
65
- for (const cumulativeField of accumulateFields) {
66
- const value = getValueFromSource(d, cumulativeField, void 0);
67
- let hisValue = cumulativeMap[cumulativeField];
68
- if (value !== void 0 && !isNaN(value)) {
69
- if (hisValue === void 0) {
70
- hisValue = value;
71
- } else {
72
- hisValue = hisValue + value;
73
- }
31
+ for (const i2 of n) {
32
+ const t2 = i2.data, a2 = [];
33
+ if (a2.push(o(s2, i2.xaxisField, void 0)), "formula" === i2.yaxisSource) {
34
+ const o2 = e(i2.formula, y, s2, r2);
35
+ a2.push(o2);
36
+ } else
37
+ a2.push(o(s2, i2.yaxisField, void 0));
38
+ i2.sizeField ? a2.push(o(s2, i2.xaxisField, void 0)) : a2.push(i2.symbolSize), t2.push(a2);
74
39
  }
75
- cumulativeMap[cumulativeField] = hisValue;
76
40
  }
77
- for (const item of dataConfs) {
78
- const data = item.data;
79
- const values = [];
80
- values.push(getValueFromSource(d, item.xaxisField, void 0));
81
- if (item.yaxisSource === "formula") {
82
- const value = executeChartFormula(item.formula, cumulativeMap, d, pageContext);
83
- values.push(value);
84
- } else {
85
- values.push(getValueFromSource(d, item.yaxisField, void 0));
86
- }
87
- if (item.sizeField) {
88
- values.push(getValueFromSource(d, item.xaxisField, void 0));
89
- } else {
90
- values.push(item.symbolSize);
91
- }
92
- data.push(values);
93
- }
94
- }
95
- const defaultSeries = configure.defaultSeries;
96
- console.log("defaultSeries", defaultSeries);
97
- const tempSeries = deepCopy(defaultSeries);
98
- for (const serie of tempSeries) {
99
- const dataValue = dataValueMap[serie.uuid];
100
- serie.data = dataValue.data;
41
+ const F = t.defaultSeries, h = s(F);
42
+ for (const o2 of h) {
43
+ const s2 = p[o2.uuid];
44
+ o2.data = s2.data;
101
45
  }
102
- chartOption.series = tempSeries;
103
- configure.cacheDatas = datas;
104
- configure.rawResult = resultData;
46
+ a.series = h, t.cacheDatas = c, t.rawResult = l;
105
47
  }
106
48
  export {
107
- updateChartOption
49
+ r as updateChartOption
108
50
  };