super-page-runtime 2.1.933 → 2.2.0

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 (160) 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 -300
  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 +838 -2285
  20. package/dist/es/components/runtime/utils/events/validator-util.js +237 -536
  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 +298 -628
  27. package/dist/es/components/runtime/utils/page-init-util.js +134 -368
  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 -512
  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 -215
  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 +5 -5
  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/placeholder/placeholder-runtime.vue3.js +1 -0
  130. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  131. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +66 -189
  132. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  133. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +91 -243
  134. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  135. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +82 -261
  136. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  137. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +13 -57
  138. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  139. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +30 -155
  140. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  141. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +41 -129
  142. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  143. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +22 -107
  144. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +133 -252
  145. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  146. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +19 -46
  148. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  149. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +22 -49
  150. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  151. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +21 -58
  152. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  153. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +16 -53
  154. package/dist/es/components/runtime/views/super-page-dialog.vue.js +18 -134
  155. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  156. package/dist/es/components/runtime/views/super-page.vue.js +233 -708
  157. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  158. package/dist/es/i18n/langs/cn.js +2 -55
  159. package/dist/es/i18n/langs/en.js +2 -55
  160. package/package.json +74 -73
@@ -1,532 +1,291 @@
1
- import theme1 from "../../../../assets/chart-themes/theme1.js";
2
- import theme2 from "../../../../assets/chart-themes/theme2.js";
3
- import theme3 from "../../../../assets/chart-themes/theme3.js";
4
- import { getValueFromSource, setValueForVariableName, formatVariableValue, getParamNames, getValueFromVariable } from "../page-helper-util.js";
5
- import { appendDefaultMethods } from "../events/event-util.js";
6
- var CommonName = /* @__PURE__ */ ((CommonName2) => {
7
- CommonName2["X_FIELD_NAME"] = "__x";
8
- CommonName2["Y_TEMP_NAME"] = "__y";
9
- return CommonName2;
10
- })(CommonName || {});
11
- const themeMap = {
12
- theme1,
13
- theme2,
14
- theme3
15
- };
16
- function getCustomTheme(themeName) {
17
- return themeMap[themeName];
1
+ import e from "../../../../assets/chart-themes/theme1.js";
2
+ import t from "../../../../assets/chart-themes/theme2.js";
3
+ import n from "../../../../assets/chart-themes/theme3.js";
4
+ import { getValueFromSource as i, setValueForVariableName as s, formatVariableValue as o, getParamNames as r, getValueFromVariable as a } from "../page-helper-util.js";
5
+ import { appendDefaultMethods as l } from "../events/event-util.js";
6
+ var c = ((e2) => (e2.X_FIELD_NAME = "__x", e2.Y_TEMP_NAME = "__y", e2))(c || {});
7
+ const f = { theme1: e, theme2: t, theme3: n };
8
+ function u(e2) {
9
+ return f[e2];
18
10
  }
19
- function getCustomThemeOptions() {
20
- return [
21
- {
22
- value: "theme1",
23
- label: "主题1"
24
- },
25
- {
26
- value: "theme2",
27
- label: "主题2"
28
- },
29
- {
30
- value: "theme3",
31
- label: "主题3"
32
- }
33
- ];
11
+ function d() {
12
+ return [{ value: "theme1", label: "主题1" }, { value: "theme2", label: "主题2" }, { value: "theme3", label: "主题3" }];
34
13
  }
35
- function getNumFormatter(labelNumFormat, numPrecision, numPrefix, numAppend, isValueFormatter) {
36
- const func = function(params) {
37
- let labelValue = params.value;
38
- if (isValueFormatter) {
39
- labelValue = params;
40
- }
41
- if (labelValue == void 0 || labelValue == null) {
42
- return labelValue;
43
- }
44
- if (Array.isArray(labelValue)) {
45
- console.log("numformatter is array", labelValue);
46
- return labelValue;
47
- }
48
- if (isNaN(labelValue) || !labelNumFormat || !labelNumFormat.indexOf) {
49
- return labelValue;
50
- }
51
- if (labelNumFormat.indexOf("precision") > -1) {
52
- let precision = parseInt(numPrecision);
53
- if (precision == null || isNaN(precision)) {
54
- precision = 2;
55
- }
56
- labelValue = parseFloat(parseFloat(labelValue).toFixed(precision));
57
- }
58
- let prefix = "";
59
- if (labelNumFormat.indexOf("prefix") > -1 && numPrefix) {
60
- prefix = numPrefix;
61
- }
62
- let append = "";
63
- if (labelNumFormat.indexOf("append") > -1 && numAppend) {
64
- append = numAppend;
14
+ function p(e2, t2, n2, i2, s2) {
15
+ return function(o2) {
16
+ let r2 = o2.value;
17
+ if (s2 && (r2 = o2), null == r2 || null == r2)
18
+ return r2;
19
+ if (Array.isArray(r2))
20
+ return r2;
21
+ if (isNaN(r2) || !e2 || !e2.indexOf)
22
+ return r2;
23
+ if (e2.indexOf("precision") > -1) {
24
+ let e3 = parseInt(t2);
25
+ (null == e3 || isNaN(e3)) && (e3 = 2), r2 = parseFloat(parseFloat(r2).toFixed(e3));
65
26
  }
66
- return prefix + labelValue.toLocaleString() + append;
27
+ let a2 = "";
28
+ e2.indexOf("prefix") > -1 && n2 && (a2 = n2);
29
+ let l2 = "";
30
+ return e2.indexOf("append") > -1 && i2 && (l2 = i2), a2 + r2.toLocaleString() + l2;
67
31
  };
68
- return func;
69
32
  }
70
- function initChartOption(configure, chartOption) {
71
- if (!chartOption) {
33
+ function h(e2, t2) {
34
+ if (!t2)
72
35
  return;
73
- }
74
- if (chartOption.tooltipFormatterArgs) {
75
- if (!chartOption.tooltip) {
76
- chartOption.tooltip = {};
77
- }
78
- chartOption.tooltip.valueFormatter = getNumFormatter.apply(
79
- chartOption,
80
- chartOption.tooltipFormatterArgs
81
- );
82
- }
83
- if (chartOption.series) {
84
- const enableDrill = configure.props ? configure.props.enableDrill : null;
85
- for (const s of chartOption.series) {
86
- if (!chartOption.radar) {
87
- s.data = [];
88
- }
89
- if (s.labelFormatterArgs) {
90
- if (!s.label) {
91
- s.label = {};
92
- }
93
- s.label.formatter = getNumFormatter.apply(s, s.labelFormatterArgs);
94
- }
95
- if (!enableDrill && configure.clickSet && configure.clickSet.selected) {
96
- if (s.emphasis) {
97
- s.emphasis.disabled = false;
98
- }
99
- }
100
- if (s.type === "pie" && configure.clickSet) {
101
- if (configure.clickSet.selected) {
102
- if (configure.clickSet.multiple) {
103
- s.selectedMode = "multiple";
104
- } else {
105
- s.selectedMode = "single";
106
- }
107
- }
108
- }
109
- }
110
- }
111
- if (chartOption.radar) {
112
- for (const r of chartOption.radar) {
113
- r.indicator = [];
114
- }
115
- }
116
- const defaultSeries = chartOption.series;
117
- configure.defaultSeries = defaultSeries;
118
- const defaultXaxis = chartOption.xAxis;
119
- if (defaultXaxis && defaultXaxis.length > 0 && defaultXaxis[0].data) {
120
- defaultXaxis[0].data = [];
121
- }
122
- configure.defaultXaxis = defaultXaxis;
123
- const defaultYaxis = chartOption.yAxis;
124
- if (defaultYaxis) {
125
- for (const yAxis of defaultYaxis) {
126
- if (yAxis.data) {
127
- yAxis.data = [];
128
- }
129
- if (yAxis._dataMin === "auto") {
130
- yAxis.min = function(value) {
131
- if (value.min) {
132
- return Math.floor(value.min / 10) * 10;
133
- }
134
- };
135
- }
136
- if (yAxis._dataMax === "auto") {
137
- yAxis.max = function(value) {
138
- if (value.max) {
139
- return Math.ceil(value.max / 10) * 10;
140
- }
141
- };
142
- }
143
- }
144
- }
145
- configure.defaultYaxis = defaultYaxis;
36
+ if (t2.tooltipFormatterArgs && (t2.tooltip || (t2.tooltip = {}), t2.tooltip.valueFormatter = p.apply(t2, t2.tooltipFormatterArgs)), t2.series) {
37
+ const n3 = e2.props ? e2.props.enableDrill : null;
38
+ for (const i3 of t2.series)
39
+ t2.radar || (i3.data = []), i3.labelFormatterArgs && (i3.label || (i3.label = {}), i3.label.formatter = p.apply(i3, i3.labelFormatterArgs)), !n3 && e2.clickSet && e2.clickSet.selected && i3.emphasis && (i3.emphasis.disabled = false), "pie" === i3.type && e2.clickSet && e2.clickSet.selected && (e2.clickSet.multiple ? i3.selectedMode = "multiple" : i3.selectedMode = "single");
40
+ }
41
+ if (t2.radar)
42
+ for (const e3 of t2.radar)
43
+ e3.indicator = [];
44
+ const n2 = t2.series;
45
+ e2.defaultSeries = n2;
46
+ const i2 = t2.xAxis;
47
+ i2 && i2.length > 0 && i2[0].data && (i2[0].data = []), e2.defaultXaxis = i2;
48
+ const s2 = t2.yAxis;
49
+ if (s2)
50
+ for (const e3 of s2)
51
+ e3.data && (e3.data = []), "auto" === e3._dataMin && (e3.min = function(e4) {
52
+ if (e4.min)
53
+ return 10 * Math.floor(e4.min / 10);
54
+ }), "auto" === e3._dataMax && (e3.max = function(e4) {
55
+ if (e4.max)
56
+ return 10 * Math.ceil(e4.max / 10);
57
+ });
58
+ e2.defaultYaxis = s2;
146
59
  }
147
- function monitorChartClickToVariable(pageContext, configure, chart) {
148
- if (!chart || !configure || !configure.clickSet || !pageContext) {
60
+ function m(e2, t2, n2) {
61
+ if (!(n2 && t2 && t2.clickSet && e2))
149
62
  return;
150
- }
151
- const clickSet = configure.clickSet;
152
- chart.on("click", function(params) {
153
- let highlightInfos = configure.highlightInfos ? configure.highlightInfos : [];
154
- console.log("highlightInfos", highlightInfos, params);
155
- let hisSelectIndex = -1;
156
- if (highlightInfos) {
157
- const newInfos = [];
158
- for (let i = 0; i < highlightInfos.length; i++) {
159
- const info = highlightInfos[i];
160
- const hisSelected = info.seriesIndex === params.seriesIndex && info.dataIndex === params.dataIndex;
161
- if (hisSelected || !clickSet.multiple) {
162
- if (clickSet.selected) {
163
- const typeName = configure.name === "chart-pie" ? "unselect" : "downplay";
164
- chart.dispatchAction({
165
- type: typeName,
166
- seriesIndex: info.seriesIndex,
167
- dataIndex: info.dataIndex
168
- });
63
+ const i2 = t2.clickSet;
64
+ n2.on("click", function(s2) {
65
+ let o2 = t2.highlightInfos ? t2.highlightInfos : [], r2 = -1;
66
+ if (o2) {
67
+ const e3 = [];
68
+ for (let a2 = 0; a2 < o2.length; a2++) {
69
+ const l2 = o2[a2], c2 = l2.seriesIndex === s2.seriesIndex && l2.dataIndex === s2.dataIndex;
70
+ if (c2 || !i2.multiple) {
71
+ if (i2.selected) {
72
+ const e4 = "chart-pie" === t2.name ? "unselect" : "downplay";
73
+ n2.dispatchAction({ type: e4, seriesIndex: l2.seriesIndex, dataIndex: l2.dataIndex });
169
74
  }
170
- } else {
171
- newInfos.push(info);
172
- }
173
- if (hisSelected) {
174
- hisSelectIndex = i;
175
- }
75
+ } else
76
+ e3.push(l2);
77
+ c2 && (r2 = a2);
176
78
  }
177
- highlightInfos = newInfos;
79
+ o2 = e3;
178
80
  }
179
- if (hisSelectIndex === -1) {
180
- if (clickSet.selected) {
181
- const typeName = configure.name === "chart-pie" ? "select" : "highlight";
182
- chart.dispatchAction({
183
- type: typeName,
184
- seriesIndex: params.seriesIndex,
185
- dataIndex: params.dataIndex
186
- });
81
+ if (-1 === r2) {
82
+ if (i2.selected) {
83
+ const e3 = "chart-pie" === t2.name ? "select" : "highlight";
84
+ n2.dispatchAction({ type: e3, seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
187
85
  }
188
- highlightInfos.push({
189
- seriesIndex: params.seriesIndex,
190
- dataIndex: params.dataIndex
191
- });
86
+ o2.push({ seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
192
87
  }
193
- configure.highlightInfos = highlightInfos;
194
- updateClickVariablesForSelected(pageContext, configure);
88
+ t2.highlightInfos = o2, x(e2, t2);
195
89
  });
196
90
  }
197
- function clearChartSelected(pageContext, configure, chart) {
198
- if (!chart || !configure || !pageContext) {
91
+ function g(e2, t2, n2) {
92
+ if (!n2 || !t2 || !e2)
199
93
  return;
94
+ const i2 = t2.highlightInfos ? t2.highlightInfos : [];
95
+ for (let e3 = 0; e3 < i2.length; e3++) {
96
+ const s2 = i2[e3], o2 = "chart-pie" === t2.name ? "unselect" : "downplay";
97
+ n2.dispatchAction({ type: o2, seriesIndex: s2.seriesIndex, dataIndex: s2.dataIndex });
200
98
  }
201
- const highlightInfos = configure.highlightInfos ? configure.highlightInfos : [];
202
- for (let i = 0; i < highlightInfos.length; i++) {
203
- const info = highlightInfos[i];
204
- const typeName = configure.name === "chart-pie" ? "unselect" : "downplay";
205
- chart.dispatchAction({
206
- type: typeName,
207
- seriesIndex: info.seriesIndex,
208
- dataIndex: info.dataIndex
209
- });
210
- }
211
- configure.highlightInfos = [];
212
- updateClickVariablesForSelected(pageContext, configure);
99
+ t2.highlightInfos = [], x(e2, t2);
213
100
  }
214
- function updateClickVariablesForSelected(pageContext, configure) {
215
- if (!configure.clickSet) {
101
+ function x(e2, t2) {
102
+ if (!t2.clickSet)
216
103
  return;
217
- }
218
- const clickSet = configure.clickSet;
219
- const variables = clickSet.variables;
220
- if (!variables || variables.length == 0) {
104
+ const n2 = t2.clickSet, o2 = n2.variables;
105
+ if (!o2 || 0 == o2.length)
221
106
  return;
222
- }
223
- const highlightInfos = configure.highlightInfos ? configure.highlightInfos : [];
224
- const caheDatas = configure.cacheDatas ? configure.cacheDatas : [];
225
- const selDatas = [];
226
- const existIndexs = [];
227
- for (const highlightInfo of highlightInfos) {
228
- if (existIndexs.includes(highlightInfo.dataIndex)) {
107
+ const r2 = t2.highlightInfos ? t2.highlightInfos : [], a2 = t2.cacheDatas ? t2.cacheDatas : [], l2 = [], c2 = [];
108
+ for (const e3 of r2)
109
+ c2.includes(e3.dataIndex) || (c2.push(e3.dataIndex), e3.dataIndex < a2.length && l2.push(a2[e3.dataIndex]));
110
+ for (const t3 of o2) {
111
+ if (!t3.fieldName || !t3.variable)
229
112
  continue;
113
+ const o3 = [];
114
+ for (const e3 of l2) {
115
+ const n3 = i(e3, t3.fieldName, void 0);
116
+ null != n3 && o3.push(n3);
230
117
  }
231
- existIndexs.push(highlightInfo.dataIndex);
232
- if (highlightInfo.dataIndex < caheDatas.length) {
233
- selDatas.push(caheDatas[highlightInfo.dataIndex]);
234
- }
235
- }
236
- for (const v of variables) {
237
- if (!v.fieldName || !v.variable) {
238
- continue;
239
- }
240
- const values = [];
241
- for (const data of selDatas) {
242
- const value = getValueFromSource(data, v.fieldName, void 0);
243
- if (value == void 0) {
244
- continue;
245
- }
246
- values.push(value);
247
- }
248
- if (clickSet.multiple) {
249
- setValueForVariableName(pageContext.entity, v.variable, values);
250
- } else {
251
- setValueForVariableName(
252
- pageContext.entity,
253
- v.variable,
254
- values.length > 0 ? values[0] : void 0
255
- );
256
- }
118
+ n2.multiple ? s(e2.entity, t3.variable, o3) : s(e2.entity, t3.variable, o3.length > 0 ? o3[0] : void 0);
257
119
  }
258
120
  }
259
- function sortDatas(pageContext, configure, datas) {
260
- const itemConfs = configure.items ? configure.items : [];
261
- const orderByTarget = configure.props ? configure.props.orderByTarget : "";
262
- let orderField = null;
263
- if (orderByTarget == "x" || orderByTarget == "X") {
264
- orderField = "__x";
265
- } else if (orderByTarget) {
266
- for (const item of itemConfs) {
267
- if (item.uuid == orderByTarget) {
268
- const itemProps = item.props ? item.props : {};
269
- const sourceType = itemProps.yaxisSource;
270
- const yaxisField = itemProps.yaxisField;
271
- if (yaxisField && (!sourceType || sourceType == "variable")) {
272
- orderField = yaxisField;
121
+ function I(e2, t2, n2) {
122
+ const s2 = t2.items ? t2.items : [], r2 = t2.props ? t2.props.orderByTarget : "";
123
+ let a2 = null;
124
+ if ("x" == r2 || "X" == r2)
125
+ a2 = "__x";
126
+ else if (r2) {
127
+ for (const e3 of s2)
128
+ if (e3.uuid == r2) {
129
+ const t3 = e3.props ? e3.props : {}, n3 = t3.yaxisSource, i2 = t3.yaxisField;
130
+ if (i2 && (!n3 || "variable" == n3)) {
131
+ a2 = i2;
273
132
  break;
274
133
  }
275
134
  }
276
- }
277
135
  }
278
- if (!orderField) {
136
+ if (!a2)
279
137
  return;
280
- }
281
- const orderSource = configure.props ? configure.props.orderSource : "";
282
- let orderValue = configure.props ? configure.props.orderFix : "";
283
- if (orderSource == "variable") {
284
- const orderVariable = configure.props ? configure.props.orderVariable : "";
285
- orderValue = formatVariableValue(pageContext, orderVariable);
286
- }
287
- orderValue = orderValue == "desc" || orderValue == "DESC" ? "desc" : "asc";
288
- const maxLen = datas.length;
289
- for (let i = 0; i < maxLen - 1; i++) {
290
- const vali = getValueFromSource(datas[i], orderField, void 0);
291
- for (let j = i + 1; j < maxLen; j++) {
292
- const valj = getValueFromSource(datas[j], orderField, void 0);
293
- let isSwap = false;
294
- if ("desc" == orderValue) {
295
- if (vali < valj) {
296
- isSwap = true;
297
- }
298
- } else {
299
- if (vali > valj) {
300
- isSwap = true;
301
- }
302
- }
303
- if (isSwap) {
304
- [datas[i], datas[j]] = [datas[j], datas[i]];
305
- }
138
+ const l2 = t2.props ? t2.props.orderSource : "";
139
+ let c2 = t2.props ? t2.props.orderFix : "";
140
+ if ("variable" == l2) {
141
+ const n3 = t2.props ? t2.props.orderVariable : "";
142
+ c2 = o(e2, n3);
143
+ }
144
+ c2 = "desc" == c2 || "DESC" == c2 ? "desc" : "asc";
145
+ const f2 = n2.length;
146
+ for (let e3 = 0; e3 < f2 - 1; e3++) {
147
+ const t3 = i(n2[e3], a2, void 0);
148
+ for (let s3 = e3 + 1; s3 < f2; s3++) {
149
+ const o2 = i(n2[s3], a2, void 0);
150
+ let r3 = false;
151
+ "desc" == c2 ? t3 < o2 && (r3 = true) : t3 > o2 && (r3 = true), r3 && ([n2[e3], n2[s3]] = [n2[s3], n2[e3]]);
306
152
  }
307
153
  }
308
154
  }
309
- function limitDatas(pageContext, configure, datas, groupFields, numFields) {
310
- if (!datas) {
311
- return datas;
312
- }
313
- const confProps = configure.props ? configure.props : {};
314
- if (!confProps.limitQuantity) {
315
- return datas;
316
- }
317
- let limitNum = null;
318
- if (confProps.itemNumVariable) {
319
- limitNum = formatVariableValue(pageContext, confProps.itemNumVariable);
320
- limitNum = parseInt(limitNum);
321
- } else {
322
- limitNum = confProps.itemNumFix ? confProps.itemNumFix : 10;
323
- }
324
- if (limitNum == null || limitNum == void 0 || isNaN(limitNum)) {
325
- return datas;
326
- }
327
- if (datas.length < limitNum) {
328
- return datas;
329
- }
330
- const overItemAlias = confProps.overItemAlias;
331
- const newDatas = [];
332
- const otherData = {};
333
- groupFields = groupFields ? groupFields : [];
334
- numFields = numFields ? numFields : [];
335
- for (let i = 0; i < datas.length; i++) {
336
- const data = datas[i];
337
- if (i < limitNum) {
338
- newDatas.push(data);
339
- continue;
340
- }
341
- if (!overItemAlias) {
342
- break;
343
- }
344
- for (const groupField of groupFields) {
345
- if (!groupField) {
346
- continue;
347
- }
348
- let value = getValueFromSource(data, groupField, void 0);
349
- value = value == null || value == void 0 ? "" : value;
350
- if (!otherData[groupField]) {
351
- otherData[groupField] = [];
352
- }
353
- const existValues = otherData[groupField];
354
- if (!existValues.includes(value)) {
355
- existValues.push(value);
356
- }
357
- }
358
- for (const numField of numFields) {
359
- if (!numField) {
360
- continue;
361
- }
362
- const value = getValueFromSource(data, numField, void 0);
363
- if (isNaN(value)) {
364
- continue;
155
+ function b(e2, t2, n2, s2, r2) {
156
+ if (!n2)
157
+ return n2;
158
+ const a2 = t2.props ? t2.props : {};
159
+ if (!a2.limitQuantity)
160
+ return n2;
161
+ let l2 = null;
162
+ if (a2.itemNumVariable ? (l2 = o(e2, a2.itemNumVariable), l2 = parseInt(l2)) : l2 = a2.itemNumFix ? a2.itemNumFix : 10, null == l2 || null == l2 || isNaN(l2))
163
+ return n2;
164
+ if (n2.length < l2)
165
+ return n2;
166
+ const c2 = a2.overItemAlias, f2 = [], u2 = {};
167
+ s2 = s2 || [], r2 = r2 || [];
168
+ for (let e3 = 0; e3 < n2.length; e3++) {
169
+ const t3 = n2[e3];
170
+ if (e3 < l2)
171
+ f2.push(t3);
172
+ else {
173
+ if (!c2)
174
+ break;
175
+ for (const e4 of s2) {
176
+ if (!e4)
177
+ continue;
178
+ let n3 = i(t3, e4, void 0);
179
+ n3 = null == n3 || null == n3 ? "" : n3, u2[e4] || (u2[e4] = []);
180
+ const s3 = u2[e4];
181
+ s3.includes(n3) || s3.push(n3);
365
182
  }
366
- const hisValue = otherData[numField];
367
- if (isNaN(hisValue)) {
368
- otherData[numField] = value;
369
- } else {
370
- otherData[numField] = value + hisValue;
183
+ for (const e4 of r2) {
184
+ if (!e4)
185
+ continue;
186
+ const n3 = i(t3, e4, void 0);
187
+ if (isNaN(n3))
188
+ continue;
189
+ const s3 = u2[e4];
190
+ isNaN(s3) ? u2[e4] = n3 : u2[e4] = n3 + s3;
371
191
  }
372
192
  }
373
193
  }
374
- if (overItemAlias) {
375
- otherData[
376
- "__x"
377
- /* X_FIELD_NAME */
378
- ] = overItemAlias;
379
- newDatas.push(otherData);
380
- }
381
- return newDatas;
194
+ return c2 && (u2.__x = c2, f2.push(u2)), f2;
382
195
  }
383
- function caculateFormulaValue(itemConfs, datas, accumulateFields) {
384
- const totalValueMap = {};
385
- for (const item of itemConfs) {
386
- const itemProps = item.props ? item.props : {};
387
- const sourceType = itemProps.yaxisSource;
388
- if (sourceType === "formula") {
389
- const paramNames = getParamNames(itemProps.formula);
390
- for (const paramName of paramNames) {
391
- if (paramName in totalValueMap) {
392
- continue;
393
- }
394
- if (paramName.startsWith("${min.")) {
395
- totalValueMap[paramName] = getMinValue(
396
- datas,
397
- paramName.substring(6, paramName.length - 1)
398
- );
399
- } else if (paramName.startsWith("${max.")) {
400
- totalValueMap[paramName] = getMaxValue(
401
- datas,
402
- paramName.substring(6, paramName.length - 1)
403
- );
404
- } else if (paramName.startsWith("${sum.")) {
405
- totalValueMap[paramName] = getSumValue(
406
- datas,
407
- paramName.substring(6, paramName.length - 1)
408
- );
409
- } else if (paramName.startsWith("${avg.")) {
410
- totalValueMap[paramName] = getAvgValue(
411
- datas,
412
- paramName.substring(6, paramName.length - 1)
413
- );
414
- } else if (paramName.startsWith("${add.")) {
415
- const fieldName = paramName.substring(6, paramName.length - 1);
416
- accumulateFields.push(fieldName);
196
+ function v(e2, t2, n2) {
197
+ const i2 = {};
198
+ for (const s2 of e2) {
199
+ const e3 = s2.props ? s2.props : {};
200
+ if ("formula" === e3.yaxisSource) {
201
+ const s3 = r(e3.formula);
202
+ for (const e4 of s3)
203
+ if (!(e4 in i2)) {
204
+ if (e4.startsWith("${min."))
205
+ i2[e4] = N(t2, e4.substring(6, e4.length - 1));
206
+ else if (e4.startsWith("${max."))
207
+ i2[e4] = y(t2, e4.substring(6, e4.length - 1));
208
+ else if (e4.startsWith("${sum."))
209
+ i2[e4] = F(t2, e4.substring(6, e4.length - 1));
210
+ else if (e4.startsWith("${avg."))
211
+ i2[e4] = S(t2, e4.substring(6, e4.length - 1));
212
+ else if (e4.startsWith("${add.")) {
213
+ const t3 = e4.substring(6, e4.length - 1);
214
+ n2.push(t3);
215
+ }
417
216
  }
418
- }
419
217
  }
420
218
  }
421
- return totalValueMap;
219
+ return i2;
422
220
  }
423
- function getMinValue(datas, fieldName) {
424
- let minValue = void 0;
425
- for (const d of datas) {
426
- const value = parseFloat(getValueFromSource(d, fieldName, null));
427
- if (minValue === void 0) {
428
- minValue = value;
429
- } else if (!isNaN(value) && value < minValue) {
430
- minValue = value;
431
- }
221
+ function N(e2, t2) {
222
+ let n2;
223
+ for (const s2 of e2) {
224
+ const e3 = parseFloat(i(s2, t2, null));
225
+ (void 0 === n2 || !isNaN(e3) && e3 < n2) && (n2 = e3);
432
226
  }
433
- return minValue;
227
+ return n2;
434
228
  }
435
- function getMaxValue(datas, fieldName) {
436
- let maxValue = void 0;
437
- for (const d of datas) {
438
- const value = parseFloat(getValueFromSource(d, fieldName, null));
439
- if (maxValue === void 0) {
440
- maxValue = value;
441
- } else if (!isNaN(value) && value > maxValue) {
442
- maxValue = value;
443
- }
229
+ function y(e2, t2) {
230
+ let n2;
231
+ for (const s2 of e2) {
232
+ const e3 = parseFloat(i(s2, t2, null));
233
+ (void 0 === n2 || !isNaN(e3) && e3 > n2) && (n2 = e3);
444
234
  }
445
- return maxValue;
235
+ return n2;
446
236
  }
447
- function getSumValue(datas, fieldName) {
448
- let sumValue = void 0;
449
- for (const d of datas) {
450
- const value = parseFloat(getValueFromSource(d, fieldName, null));
451
- if (sumValue === void 0) {
452
- sumValue = value;
453
- } else if (!isNaN(value)) {
454
- sumValue += value;
455
- }
237
+ function F(e2, t2) {
238
+ let n2;
239
+ for (const s2 of e2) {
240
+ const e3 = parseFloat(i(s2, t2, null));
241
+ void 0 === n2 ? n2 = e3 : isNaN(e3) || (n2 += e3);
456
242
  }
457
- return sumValue;
243
+ return n2;
458
244
  }
459
- function getAvgValue(datas, fieldName) {
460
- const sumValue = getSumValue(datas, fieldName);
461
- if (sumValue === void 0 || datas.length === 0) {
462
- return sumValue;
463
- }
464
- return parseFloat((sumValue / datas.length).toFixed(5));
245
+ function S(e2, t2) {
246
+ const n2 = F(e2, t2);
247
+ return void 0 === n2 || 0 === e2.length ? n2 : parseFloat((n2 / e2.length).toFixed(5));
465
248
  }
466
- function executeChartFormula(formulaStr, accumulateMap, rowData, pageContext) {
467
- if (!formulaStr) {
468
- return void 0;
469
- }
470
- if (accumulateMap) {
471
- for (const accumulateField in accumulateMap) {
472
- formulaStr = formulaStr.replace(
473
- new RegExp("\\${add." + accumulateField + "}", "g"),
474
- accumulateMap[accumulateField]
475
- );
476
- }
477
- }
478
- const paramNames = getParamNames(formulaStr);
479
- for (const paramName of paramNames) {
480
- let value = null;
481
- if (paramName.startsWith("${row.")) {
482
- value = getValueFromSource(rowData, paramName.substring(6, paramName.length - 1), null);
483
- } else {
484
- value = getValueFromVariable(pageContext.entity, paramName);
485
- }
486
- formulaStr = formulaStr.replace(new RegExp(paramName.replace("$", "\\$"), "g"), value);
487
- }
488
- if (!formulaStr.includes("return ")) {
489
- formulaStr = "return " + formulaStr;
490
- }
491
- const newFunc = new Function("params", formulaStr);
492
- appendDefaultMethods(newFunc, pageContext);
493
- return newFunc({
494
- pageContext,
495
- row: rowData
496
- });
249
+ function A(e2, t2, n2, s2) {
250
+ if (!e2)
251
+ return;
252
+ if (t2)
253
+ for (const n3 in t2)
254
+ e2 = e2.replace(new RegExp("\\${add." + n3 + "}", "g"), t2[n3]);
255
+ const o2 = r(e2);
256
+ for (const t3 of o2) {
257
+ let o3 = null;
258
+ o3 = t3.startsWith("${row.") ? i(n2, t3.substring(6, t3.length - 1), null) : a(s2.entity, t3), e2 = e2.replace(new RegExp(t3.replace("$", "\\$"), "g"), o3);
259
+ }
260
+ e2.includes("return ") || (e2 = "return " + e2);
261
+ const c2 = new Function("params", e2);
262
+ return l(c2, s2), c2({ pageContext: s2, row: n2 });
497
263
  }
498
- function exportCommonChart(chartRef) {
499
- if (!chartRef || !chartRef.$el) {
264
+ function _(e2) {
265
+ if (!e2 || !e2.$el)
500
266
  return;
501
- }
502
- const canvasDoms = chartRef.$el.getElementsByTagName("canvas");
503
- if (!canvasDoms || canvasDoms.length === 0) {
267
+ const t2 = e2.$el.getElementsByTagName("canvas");
268
+ if (!t2 || 0 === t2.length)
504
269
  return;
505
- }
506
- const canvasDom = canvasDoms[0];
507
- const fileSize = canvasDom.width + ":" + canvasDom.height;
508
- return {
509
- isTable: false,
510
- fileContent: canvasDom.toDataURL(),
511
- fileSize
512
- };
270
+ const n2 = t2[0], i2 = n2.width + ":" + n2.height;
271
+ return { isTable: false, fileContent: n2.toDataURL(), fileSize: i2 };
513
272
  }
514
273
  export {
515
- CommonName,
516
- caculateFormulaValue,
517
- clearChartSelected,
518
- executeChartFormula,
519
- exportCommonChart,
520
- getAvgValue,
521
- getCustomTheme,
522
- getCustomThemeOptions,
523
- getMaxValue,
524
- getMinValue,
525
- getNumFormatter,
526
- getSumValue,
527
- initChartOption,
528
- limitDatas,
529
- monitorChartClickToVariable,
530
- sortDatas,
531
- updateClickVariablesForSelected
274
+ c as CommonName,
275
+ v as caculateFormulaValue,
276
+ g as clearChartSelected,
277
+ A as executeChartFormula,
278
+ _ as exportCommonChart,
279
+ S as getAvgValue,
280
+ u as getCustomTheme,
281
+ d as getCustomThemeOptions,
282
+ y as getMaxValue,
283
+ N as getMinValue,
284
+ p as getNumFormatter,
285
+ F as getSumValue,
286
+ h as initChartOption,
287
+ b as limitDatas,
288
+ m as monitorChartClickToVariable,
289
+ I as sortDatas,
290
+ x as updateClickVariablesForSelected
532
291
  };