super-page-runtime 2.1.933 → 2.2.1

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 (183) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +5 -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/index.d.ts +2 -1
  6. package/dist/es/components/runtime/utils/api/api-util.js +4 -7
  7. package/dist/es/components/runtime/utils/api/page-expose-util.js +137 -435
  8. package/dist/es/components/runtime/utils/assemblys-config.js +11 -367
  9. package/dist/es/components/runtime/utils/barcode-util.js +9 -33
  10. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +122 -306
  11. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +29 -68
  12. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +68 -152
  13. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +46 -124
  14. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +36 -99
  15. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +1 -0
  16. package/dist/es/components/runtime/utils/charts/chart-util.js +226 -485
  17. package/dist/es/components/runtime/utils/common-util.js +76 -153
  18. package/dist/es/components/runtime/utils/eventBus.js +3 -9
  19. package/dist/es/components/runtime/utils/events/event-util.js +343 -727
  20. package/dist/es/components/runtime/utils/events/print-label.js +72 -140
  21. package/dist/es/components/runtime/utils/events/standard-event.d.ts +2 -2
  22. package/dist/es/components/runtime/utils/events/standard-event.js +810 -2299
  23. package/dist/es/components/runtime/utils/events/validator-util.js +222 -552
  24. package/dist/es/components/runtime/utils/form/date-shortcuts.js +28 -88
  25. package/dist/es/components/runtime/utils/form/scan-util.js +61 -162
  26. package/dist/es/components/runtime/utils/global-refs.js +53 -84
  27. package/dist/es/components/runtime/utils/i18n-util.js +11 -20
  28. package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +2 -0
  29. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +2 -7
  30. package/dist/es/components/runtime/utils/page-helper-util.js +278 -658
  31. package/dist/es/components/runtime/utils/page-init-util.d.ts +6 -1
  32. package/dist/es/components/runtime/utils/page-init-util.js +132 -370
  33. package/dist/es/components/runtime/utils/page-permission-util.js +22 -531
  34. package/dist/es/components/runtime/utils/page-store.d.ts +2 -2
  35. package/dist/es/components/runtime/utils/page-store.js +8 -12
  36. package/dist/es/components/runtime/utils/store-util.js +9 -13
  37. package/dist/es/components/runtime/utils/store.js +2 -2
  38. package/dist/es/components/runtime/utils/table-utils.js +45 -84
  39. package/dist/es/components/runtime/utils/tree-utils.js +17 -37
  40. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
  41. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +19 -75
  42. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
  43. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +14 -46
  44. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
  45. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +36 -132
  46. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
  47. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +4 -18
  48. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
  49. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +17 -107
  50. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
  51. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +50 -198
  52. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +12 -42
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
  54. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +7 -60
  55. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
  56. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +52 -169
  57. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
  58. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +44 -0
  59. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +4 -0
  60. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  61. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +32 -107
  62. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  63. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +43 -164
  64. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  65. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +32 -115
  66. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +32 -116
  68. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.d.ts +34 -1
  69. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +253 -449
  70. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +4 -42
  71. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  72. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +8 -62
  73. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  74. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +37 -231
  75. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  76. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +13 -62
  77. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  78. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +197 -510
  80. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.d.ts +4 -4
  81. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +29 -139
  82. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  83. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.d.ts +6 -6
  84. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +21 -125
  85. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.d.ts +6 -6
  87. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +16 -102
  88. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  89. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +18 -81
  91. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +17 -82
  93. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +14 -86
  95. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +21 -79
  97. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  98. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +16 -61
  99. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  100. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +10 -37
  101. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  102. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +38 -127
  103. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +28 -76
  105. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  106. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +61 -178
  107. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +302 -803
  108. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  109. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +249 -594
  110. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  111. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  112. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +40 -115
  113. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +56 -215
  115. package/dist/es/components/runtime/views/assemblys/error-render.vue.d.ts +4 -4
  116. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +3 -21
  117. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  119. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +42 -154
  120. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +34 -98
  121. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  123. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +52 -200
  124. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  125. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +66 -239
  126. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  127. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +31 -104
  128. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  129. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +21 -59
  130. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  131. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +51 -173
  132. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  133. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +22 -103
  134. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  135. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +57 -249
  136. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  137. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +32 -174
  138. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  139. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +28 -107
  140. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
  141. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +13 -50
  142. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  143. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +61 -189
  144. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  145. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +87 -244
  146. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +77 -261
  148. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  149. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +13 -57
  150. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  151. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +30 -155
  152. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  153. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +40 -129
  154. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  155. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +22 -107
  156. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.d.ts +17 -0
  157. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +97 -0
  158. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +4 -0
  159. package/dist/es/components/runtime/views/assemblys/object-render.vue.d.ts +1 -1
  160. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +125 -254
  161. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  162. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  163. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +18 -46
  164. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  165. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +21 -49
  166. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  167. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +20 -58
  168. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  169. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +16 -53
  170. package/dist/es/components/runtime/views/home-chart.vue.d.ts +23 -0
  171. package/dist/es/components/runtime/views/home-chart.vue.js +36 -0
  172. package/dist/es/components/runtime/views/home-chart.vue2.js +4 -0
  173. package/dist/es/components/runtime/views/super-page-dialog.vue.d.ts +3 -3
  174. package/dist/es/components/runtime/views/super-page-dialog.vue.js +20 -134
  175. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  176. package/dist/es/components/runtime/views/super-page.vue.d.ts +15 -6
  177. package/dist/es/components/runtime/views/super-page.vue.js +222 -708
  178. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  179. package/dist/es/i18n/langs/cn.js +2 -55
  180. package/dist/es/i18n/langs/en.js +2 -55
  181. package/dist/es/index.d.ts +2 -2
  182. package/dist/es/index.js +6 -4
  183. package/package.json +3 -2
@@ -1,164 +1,80 @@
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) {
6
- return;
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) return;
6
+ const f = a && a.result ? a.result : {};
7
+ let g = a && a.groupValue ? a.groupValue : void 0;
8
+ const m = u.serviceDataField;
9
+ let h = null;
10
+ m ? h = f[m] : f && (h = Array.isArray(f) ? f : [f]), h || (h = []);
11
+ let d = u.props ? u.props.groups : null;
12
+ if (d || (d = []), !g || 0 === g.length) {
13
+ g = [];
14
+ for (const o2 of d) g.push(o2.group);
7
15
  }
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);
16
+ const y = {}, x = [], v = [];
17
+ for (const o2 of d) y[o2.group] = o2.target, o2.target && !x.includes(o2.target) && (x.push(o2.target), g.includes(o2.group) && v.push(o2.target));
18
+ let E = u.props ? u.props.mulGroupShow : "";
19
+ E = "break" == E ? "\r\n" : " ";
20
+ for (const t2 of h) {
21
+ if (!t2) continue;
22
+ const r2 = [];
23
+ for (const s2 of g) {
24
+ const e3 = y[s2], l2 = o(t2, e3, void 0);
25
+ l2 && r2.push(l2);
34
26
  }
27
+ const e2 = r2.join(E);
28
+ t2[s.X_FIELD_NAME] = e2;
35
29
  }
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);
30
+ const F = u.items ? u.items : [];
31
+ if (0 == F.length) return;
32
+ const S = u.props ? u.props : {};
33
+ let _ = S.yaxisField;
34
+ if (F[0].props.yaxisField = _, F[0].props.yaxisSource = S.yaxisSource, F[0].props.formula = S.formula, "formula" === S.yaxisSource) {
35
+ const t2 = [], r2 = e(F, h, t2);
36
+ let n2 = S.formula ? S.formula : "";
37
+ for (const o2 in r2) n2 = n2.replace(new RegExp(o2.replace("$", "\\$"), "g"), r2[o2]);
38
+ _ = s.Y_TEMP_NAME;
39
+ const p2 = {};
40
+ for (const r3 of h) {
41
+ if (!r3) continue;
42
+ for (const s3 of t2) {
43
+ const t3 = o(r3, s3, void 0);
44
+ let e2 = p2[s3];
45
+ void 0 === t3 || isNaN(t3) || (void 0 === e2 ? e2 = t3 : e2 += t3), p2[s3] = e2;
45
46
  }
47
+ const s2 = l(n2, p2, r3, i2);
48
+ r3[_] = s2;
46
49
  }
47
50
  }
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) {
53
- continue;
54
- }
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;
51
+ F[0].props.yaxisField = _, F[0].props.yaxisSource = "", n(i2, u, h), h = p(i2, u, h, x, [_]);
52
+ const A = [], D = [];
53
+ for (const t2 of h) {
54
+ if (!t2) continue;
55
+ A.push(t2[s.X_FIELD_NAME]);
56
+ const r2 = o(t2, _, void 0);
57
+ D.push(r2);
65
58
  }
66
- const itemConfs = configure.items ? configure.items : [];
67
- if (itemConfs.length == 0) {
68
- console.log("饼图的系列为空,操作失败!", configure);
69
- 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
- );
59
+ const M = u.defaultSeries;
60
+ let N = M[0].pieColors;
61
+ N = N || [];
62
+ let j = M[0].pieColorMap;
63
+ j = j || {};
64
+ const b = [];
65
+ for (let o2 = 0; o2 < A.length && o2 < D.length; o2++) {
66
+ const t2 = { value: D[o2], name: A[o2] };
67
+ if (o2 < N.length || j[t2.name]) {
68
+ let r2 = j[t2.name];
69
+ r2 || (r2 = N[o2]), r2 && (t2.itemStyle = { color: r2 });
86
70
  }
87
- valueField = CommonName.Y_TEMP_NAME;
88
- const cumulativeMap = {};
89
- for (const data of datas) {
90
- if (!data) {
91
- continue;
92
- }
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;
109
- }
110
- }
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) {
119
- continue;
120
- }
121
- xValues.push(data[CommonName.X_FIELD_NAME]);
122
- const value = getValueFromSource(data, valueField, void 0);
123
- yValues.push(value);
124
- }
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
- }
146
- }
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);
71
+ b.push(t2);
157
72
  }
158
- configure.groupFields = realGroupFilds;
159
- configure.cacheDatas = datas;
160
- configure.rawResult = resultData;
73
+ const w = r(M);
74
+ w[0].data = b, c.series = [w[0]];
75
+ const I = u.props ? u.props.selGroupVariable : null;
76
+ !(u.props ? u.props.enableDrill : null) && I && (u.highlightInfos = [], t(i2.entity, I, null)), u.groupFields = v, u.cacheDatas = h, u.rawResult = a;
161
77
  }
162
78
  export {
163
- updateChartOption
79
+ i as updateChartOption
164
80
  };
@@ -1,132 +1,54 @@
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) {
6
- return;
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) return;
6
+ const u = l && l.result ? l.result : {}, f = s.serviceDataField;
7
+ let d = null;
8
+ f ? d = u[f] : u && (d = Array.isArray(u) ? u : [u]), d || (d = []);
9
+ const n = s.items ? s.items : [], c = [], p = {}, m = [], x = i(n, d, m);
10
+ for (const e2 of n) {
11
+ const o2 = e2.props ? e2.props : {}, i2 = o2.yaxisSource, t2 = o2.yaxisField;
12
+ let a3 = null;
13
+ if (!t2 || i2 && "variable" != i2) if ("formula" == i2) {
14
+ let i3 = o2.formula ? o2.formula : "";
15
+ for (const e3 in x) i3 = i3.replace(new RegExp(e3.replace("$", "\\$"), "g"), x[e3]);
16
+ a3 = { uuid: e2.uuid, type: "formula", formula: i3, data: [] };
17
+ } else a3 = { uuid: e2.uuid, type: "fixed", field: o2.yaxisFix, data: [] };
18
+ else a3 = { uuid: e2.uuid, type: "variable", field: t2, data: [] };
19
+ a3 && (c.push(a3), p[a3.uuid] = a3);
7
20
  }
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
- }
21
+ const v = s.props ? s.props : {}, y = v.nameField, h = v.maxSource, F = v.maxField, b = v.maxFixed, g = [], j = {};
22
+ for (const o2 of d) {
23
+ if (!o2) continue;
24
+ const i2 = e(o2, y, void 0);
25
+ let s2 = null;
26
+ s2 = h && "variable" != h ? b : e(o2, F, void 0), g.push({ text: i2, max: s2 });
27
+ for (const i3 of m) {
28
+ const t2 = e(o2, i3, void 0);
29
+ let a3 = j[i3];
30
+ void 0 === t2 || isNaN(t2) || (void 0 === a3 ? a3 = t2 : a3 += t2), j[i3] = a3;
20
31
  }
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) {
78
- continue;
79
- }
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
- }
32
+ for (const i3 of c) {
33
+ const s3 = i3.data;
34
+ if ("fixed" == i3.type) s3.push(i3.field);
35
+ else if ("variable" == i3.type) {
36
+ const t2 = e(o2, i3.field, void 0);
37
+ s3.push(t2);
38
+ } else if ("formula" == i3.type) {
39
+ const e2 = t(i3.formula, j, o2, a2);
40
+ s3.push(e2);
41
+ } else s3.push(void 0);
116
42
  }
117
43
  }
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;
44
+ r.radar[0].indicator = g;
45
+ const S = s.defaultSeries, w = o(S), A = w[0].data;
46
+ for (const e2 of A) {
47
+ const o2 = p[e2.uuid];
48
+ e2.value = o2.data;
125
49
  }
126
- chartOption.series = tempSeries;
127
- configure.cacheDatas = datas;
128
- configure.rawResult = resultData;
50
+ r.series = w, s.cacheDatas = d, s.rawResult = l;
129
51
  }
130
52
  export {
131
- updateChartOption
53
+ a as updateChartOption
132
54
  };
@@ -1,108 +1,45 @@
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) {
6
- return;
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) return;
6
+ const u = l && l.result ? l.result : {}, f = t.serviceDataField;
7
+ let c = null;
8
+ f ? c = u[f] : u && (c = Array.isArray(u) ? u : [u]), c || (c = []);
9
+ const d = t.items ? t.items : [], n = [], p = {};
10
+ for (const o2 of d) {
11
+ 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: [] };
12
+ n.push(t2), p[t2.uuid] = t2;
7
13
  }
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
- 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;
14
+ const m = [], x = i(d, c, m);
15
+ for (const o2 of n) if ("formula" === o2.yaxisSource) {
16
+ let s2 = o2.formula ? o2.formula : "";
17
+ for (const o3 in x) s2 = s2.replace(new RegExp(o3.replace("$", "\\$"), "g"), x[o3]);
18
+ o2.formula = s2;
45
19
  }
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
- );
56
- }
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
- }
74
- }
75
- cumulativeMap[cumulativeField] = hisValue;
20
+ const y = {};
21
+ for (const s2 of c) if (s2) {
22
+ for (const i2 of m) {
23
+ const e2 = o(s2, i2, void 0);
24
+ let r3 = y[i2];
25
+ void 0 === e2 || isNaN(e2) || (void 0 === r3 ? r3 = e2 : r3 += e2), y[i2] = r3;
76
26
  }
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);
27
+ for (const i2 of n) {
28
+ const t2 = i2.data, a2 = [];
29
+ if (a2.push(o(s2, i2.xaxisField, void 0)), "formula" === i2.yaxisSource) {
30
+ const o2 = e(i2.formula, y, s2, r2);
31
+ a2.push(o2);
32
+ } else a2.push(o(s2, i2.yaxisField, void 0));
33
+ i2.sizeField ? a2.push(o(s2, i2.xaxisField, void 0)) : a2.push(i2.symbolSize), t2.push(a2);
93
34
  }
94
35
  }
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;
36
+ const F = t.defaultSeries, h = s(F);
37
+ for (const o2 of h) {
38
+ const s2 = p[o2.uuid];
39
+ o2.data = s2.data;
101
40
  }
102
- chartOption.series = tempSeries;
103
- configure.cacheDatas = datas;
104
- configure.rawResult = resultData;
41
+ a.series = h, t.cacheDatas = c, t.rawResult = l;
105
42
  }
106
43
  export {
107
- updateChartOption
44
+ r as updateChartOption
108
45
  };
@@ -109,3 +109,4 @@ export declare function exportCommonChart(chartRef: any): {
109
109
  fileContent: any;
110
110
  fileSize: string;
111
111
  };
112
+ export declare function setHomeChartInitConfigValue(initConfig: any, tempContext: any, homeChartSettingUserId: any): void;