super-page-runtime 2.0.4 → 2.0.9

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/assets/chart-themes/theme1.d.ts +4 -0
  2. package/dist/es/assets/chart-themes/theme2.d.ts +4 -0
  3. package/dist/es/assets/chart-themes/theme3.d.ts +4 -0
  4. package/dist/es/components/runtime/index.d.ts +4 -0
  5. package/dist/es/components/runtime/utils/api/api-util.d.ts +11 -0
  6. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +11 -0
  7. package/dist/es/components/runtime/utils/common-util.d.ts +16 -0
  8. package/dist/es/components/runtime/utils/eventBus.d.ts +7 -0
  9. package/dist/es/components/runtime/utils/events/event-util.d.ts +48 -0
  10. package/dist/es/components/runtime/utils/events/standard-event.d.ts +61 -0
  11. package/dist/es/components/runtime/utils/events/validator-util.d.ts +4 -0
  12. package/dist/es/components/runtime/utils/global-refs.d.ts +59 -0
  13. package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +223 -0
  14. package/dist/es/components/runtime/utils/page-helper-util.d.ts +106 -0
  15. package/dist/es/components/runtime/utils/page-helper-util.js +4 -1
  16. package/dist/es/components/runtime/utils/page-init-util.d.ts +38 -0
  17. package/dist/es/components/runtime/utils/page-permission-util.d.ts +26 -0
  18. package/dist/es/components/runtime/utils/store-util.d.ts +15 -0
  19. package/dist/es/components/runtime/utils/store.d.ts +2 -0
  20. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +196 -18
  21. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +44 -0
  22. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +4 -0
  23. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +76 -6
  24. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.d.ts +24 -0
  25. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.d.ts +35 -0
  26. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.d.ts +26 -0
  27. package/dist/es/components/runtime/views/assemblys/error-render.vue.d.ts +22 -0
  28. package/dist/es/components/runtime/views/assemblys/object-render.vue.d.ts +17 -0
  29. package/dist/es/components/runtime/views/super-page-dialog.vue.d.ts +36 -0
  30. package/dist/es/components/runtime/views/super-page.vue.d.ts +91 -0
  31. package/dist/es/index.d.ts +2 -2
  32. package/dist/es/index.js +2 -2
  33. package/dist/lib/_virtual/AttributeMap.js +4 -0
  34. package/dist/lib/_virtual/Delta.js +4 -0
  35. package/dist/lib/_virtual/Op.js +4 -0
  36. package/dist/lib/_virtual/OpIterator.js +4 -0
  37. package/dist/lib/_virtual/__vite-browser-external.js +3 -0
  38. package/dist/lib/_virtual/_commonjsHelpers.js +8 -0
  39. package/dist/lib/_virtual/_plugin-vue_export-helper.js +9 -0
  40. package/dist/lib/_virtual/dayjs.min.js +4 -0
  41. package/dist/lib/_virtual/index.js +4 -0
  42. package/dist/lib/_virtual/index2.js +4 -0
  43. package/dist/lib/_virtual/index3.js +4 -0
  44. package/dist/lib/assets/chart-themes/theme1.d.ts +4 -0
  45. package/dist/lib/assets/chart-themes/theme1.js +7 -0
  46. package/dist/lib/assets/chart-themes/theme2.d.ts +4 -0
  47. package/dist/lib/assets/chart-themes/theme2.js +7 -0
  48. package/dist/lib/assets/chart-themes/theme3.d.ts +4 -0
  49. package/dist/lib/assets/chart-themes/theme3.js +7 -0
  50. package/dist/lib/components/runtime/index.d.ts +4 -0
  51. package/dist/lib/components/runtime/utils/api/api-util.d.ts +11 -0
  52. package/dist/lib/components/runtime/utils/api/api-util.js +128 -0
  53. package/dist/lib/components/runtime/utils/assemblys-config.js +258 -0
  54. package/dist/lib/components/runtime/utils/charts/chart-util.d.ts +11 -0
  55. package/dist/lib/components/runtime/utils/charts/chart-util.js +28 -0
  56. package/dist/lib/components/runtime/utils/common-util.d.ts +16 -0
  57. package/dist/lib/components/runtime/utils/common-util.js +94 -0
  58. package/dist/lib/components/runtime/utils/eventBus.d.ts +7 -0
  59. package/dist/lib/components/runtime/utils/eventBus.js +10 -0
  60. package/dist/lib/components/runtime/utils/events/event-util.d.ts +48 -0
  61. package/dist/lib/components/runtime/utils/events/event-util.js +526 -0
  62. package/dist/lib/components/runtime/utils/events/standard-event.d.ts +61 -0
  63. package/dist/lib/components/runtime/utils/events/standard-event.js +1625 -0
  64. package/dist/lib/components/runtime/utils/events/validator-util.d.ts +4 -0
  65. package/dist/lib/components/runtime/utils/events/validator-util.js +389 -0
  66. package/dist/lib/components/runtime/utils/global-refs.d.ts +59 -0
  67. package/dist/lib/components/runtime/utils/global-refs.js +65 -0
  68. package/dist/lib/components/runtime/utils/interfaces/page-design-types.d.ts +223 -0
  69. package/dist/lib/components/runtime/utils/interfaces/page-design-types.js +9 -0
  70. package/dist/lib/components/runtime/utils/page-helper-util.d.ts +106 -0
  71. package/dist/lib/components/runtime/utils/page-helper-util.js +622 -0
  72. package/dist/lib/components/runtime/utils/page-init-util.d.ts +38 -0
  73. package/dist/lib/components/runtime/utils/page-init-util.js +200 -0
  74. package/dist/lib/components/runtime/utils/page-permission-util.d.ts +26 -0
  75. package/dist/lib/components/runtime/utils/page-permission-util.js +525 -0
  76. package/dist/lib/components/runtime/utils/store-util.d.ts +15 -0
  77. package/dist/lib/components/runtime/utils/store-util.js +17 -0
  78. package/dist/lib/components/runtime/utils/store.d.ts +2 -0
  79. package/dist/lib/components/runtime/utils/store.js +3 -0
  80. package/dist/lib/components/runtime/utils/table-utils.js +24 -0
  81. package/dist/lib/components/runtime/views/assemblys/button/button/button-runtime.vue.js +3 -0
  82. package/dist/lib/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +54 -0
  83. package/dist/lib/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +3 -0
  84. package/dist/lib/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +35 -0
  85. package/dist/lib/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +3 -0
  86. package/dist/lib/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +110 -0
  87. package/dist/lib/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +3 -0
  88. package/dist/lib/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +432 -0
  89. package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +43 -0
  90. package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +3 -0
  91. package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +61 -0
  92. package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +3 -0
  93. package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +126 -0
  94. package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +3 -0
  95. package/dist/lib/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +3 -0
  96. package/dist/lib/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +52 -0
  97. package/dist/lib/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +3 -0
  98. package/dist/lib/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +54 -0
  99. package/dist/lib/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +3 -0
  100. package/dist/lib/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +54 -0
  101. package/dist/lib/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +3 -0
  102. package/dist/lib/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +56 -0
  103. package/dist/lib/components/runtime/views/assemblys/common/export-form-report-dialog.vue.d.ts +24 -0
  104. package/dist/lib/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +147 -0
  105. package/dist/lib/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +3 -0
  106. package/dist/lib/components/runtime/views/assemblys/common/remove-signer-dialog.vue.d.ts +35 -0
  107. package/dist/lib/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +127 -0
  108. package/dist/lib/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +3 -0
  109. package/dist/lib/components/runtime/views/assemblys/common/task-informition-dialog.vue.d.ts +26 -0
  110. package/dist/lib/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +104 -0
  111. package/dist/lib/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +3 -0
  112. package/dist/lib/components/runtime/views/assemblys/container/card/card-runtime.vue.js +3 -0
  113. package/dist/lib/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +72 -0
  114. package/dist/lib/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +3 -0
  115. package/dist/lib/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +74 -0
  116. package/dist/lib/components/runtime/views/assemblys/container/container/container-runtime.vue.js +3 -0
  117. package/dist/lib/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +79 -0
  118. package/dist/lib/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +3 -0
  119. package/dist/lib/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +43 -0
  120. package/dist/lib/components/runtime/views/assemblys/container/form/form-runtime.vue.js +3 -0
  121. package/dist/lib/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +44 -0
  122. package/dist/lib/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +3 -0
  123. package/dist/lib/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +30 -0
  124. package/dist/lib/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +3 -0
  125. package/dist/lib/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +69 -0
  126. package/dist/lib/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +3 -0
  127. package/dist/lib/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +75 -0
  128. package/dist/lib/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +642 -0
  129. package/dist/lib/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +3 -0
  130. package/dist/lib/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +453 -0
  131. package/dist/lib/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +3 -0
  132. package/dist/lib/components/runtime/views/assemblys/data/table/table-runtime.vue.js +3 -0
  133. package/dist/lib/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +88 -0
  134. package/dist/lib/components/runtime/views/assemblys/error-render.vue.d.ts +22 -0
  135. package/dist/lib/components/runtime/views/assemblys/error-render.vue.js +22 -0
  136. package/dist/lib/components/runtime/views/assemblys/error-render.vue2.js +3 -0
  137. package/dist/lib/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +3 -0
  138. package/dist/lib/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +156 -0
  139. package/dist/lib/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +3 -0
  140. package/dist/lib/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +82 -0
  141. package/dist/lib/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +3 -0
  142. package/dist/lib/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +64 -0
  143. package/dist/lib/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +3 -0
  144. package/dist/lib/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +40 -0
  145. package/dist/lib/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +3 -0
  146. package/dist/lib/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +74 -0
  147. package/dist/lib/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +3 -0
  148. package/dist/lib/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +63 -0
  149. package/dist/lib/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +3 -0
  150. package/dist/lib/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +127 -0
  151. package/dist/lib/components/runtime/views/assemblys/form/label/label-runtime.vue.js +3 -0
  152. package/dist/lib/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +127 -0
  153. package/dist/lib/components/runtime/views/assemblys/form/link/link-runtime.vue.js +3 -0
  154. package/dist/lib/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +77 -0
  155. package/dist/lib/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +3 -0
  156. package/dist/lib/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +29 -0
  157. package/dist/lib/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +3 -0
  158. package/dist/lib/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +157 -0
  159. package/dist/lib/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +3 -0
  160. package/dist/lib/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +164 -0
  161. package/dist/lib/components/runtime/views/assemblys/form/select/select-runtime.vue.js +3 -0
  162. package/dist/lib/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +201 -0
  163. package/dist/lib/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +3 -0
  164. package/dist/lib/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +63 -0
  165. package/dist/lib/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +3 -0
  166. package/dist/lib/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +63 -0
  167. package/dist/lib/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +3 -0
  168. package/dist/lib/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +65 -0
  169. package/dist/lib/components/runtime/views/assemblys/object-render.vue.d.ts +17 -0
  170. package/dist/lib/components/runtime/views/assemblys/object-render.vue.js +142 -0
  171. package/dist/lib/components/runtime/views/assemblys/object-render.vue2.js +3 -0
  172. package/dist/lib/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +3 -0
  173. package/dist/lib/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +61 -0
  174. package/dist/lib/components/runtime/views/super-page-dialog.vue.d.ts +36 -0
  175. package/dist/lib/components/runtime/views/super-page-dialog.vue.js +73 -0
  176. package/dist/lib/components/runtime/views/super-page-dialog.vue2.js +3 -0
  177. package/dist/lib/components/runtime/views/super-page.vue.d.ts +91 -0
  178. package/dist/lib/components/runtime/views/super-page.vue.js +496 -0
  179. package/dist/lib/components/runtime/views/super-page.vue2.js +3 -0
  180. package/dist/lib/favicon.ico +0 -0
  181. package/dist/lib/index.d.ts +8 -0
  182. package/dist/lib/index.js +15 -0
  183. package/package.json +1 -2
@@ -1,7 +1,7 @@
1
- import { defineComponent, ref, onMounted, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow } from "vue";
1
+ import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow } from "vue";
2
2
  import { getCustomTheme } from "../../../../utils/charts/chart-util.js";
3
3
  import { deepCopy } from "../../../../utils/common-util.js";
4
- import { getChartDatasFromPage, getValueFromSource, formatVariableValue } from "../../../../utils/page-helper-util.js";
4
+ import { getChartDatasFromPage, updateChartDatasources, getValueFromSource, formatVariableValue } from "../../../../utils/page-helper-util.js";
5
5
  import _sfc_main$1 from "../common/common-chart-header.vue.js";
6
6
  import { use } from "echarts/core";
7
7
  import { CanvasRenderer } from "echarts/renderers";
@@ -28,10 +28,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
28
28
  ]);
29
29
  const props = __props;
30
30
  const thisRef = ref(null);
31
+ const chartRef = ref(null);
32
+ const headerRef = ref(null);
33
+ const enableDrill = props.configure.props ? props.configure.props.enableDrill : null;
31
34
  const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
32
35
  const runtimeStyle = runtimeInfo.style;
33
36
  const runtimeClass = runtimeInfo.class;
37
+ const dataConfig = runtimeInfo.dataConfig;
34
38
  const headerInfo = runtimeInfo.headerInfo ? runtimeInfo.headerInfo : {};
39
+ let cacheDatas = null;
35
40
  const chartOption = runtimeInfo.chartOption;
36
41
  const defaultSeries = chartOption.series;
37
42
  if (defaultSeries && defaultSeries.length > 0) {
@@ -40,10 +45,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
40
45
  }
41
46
  }
42
47
  const defaultXaxis = chartOption.xAxis;
43
- if (defaultXaxis && defaultXaxis.length > 0) {
48
+ if (defaultXaxis && defaultXaxis.length > 0 && defaultXaxis[0].data) {
44
49
  defaultXaxis[0].data = [];
45
50
  }
46
51
  const defaultYaxis = chartOption.yAxis;
52
+ if (defaultYaxis) {
53
+ for (let yAxis of defaultYaxis) {
54
+ if (yAxis.data) {
55
+ yAxis.data = [];
56
+ }
57
+ }
58
+ }
59
+ console.log("chartOption", chartOption);
47
60
  const configureProps = props.configure.props ? props.configure.props : {};
48
61
  const customTheme = getCustomTheme(configureProps.customTheme);
49
62
  function updateChartDatas(resultData) {
@@ -67,7 +80,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
67
80
  if (resultData) {
68
81
  updateChartDatas(resultData);
69
82
  }
83
+ if (enableDrill && chartRef.value) {
84
+ chartRef.value.chart.on("click", function(params) {
85
+ if (headerRef.value && headerRef.value.drill) {
86
+ headerRef.value.drill(params, cacheDatas);
87
+ }
88
+ });
89
+ }
70
90
  });
91
+ function onDrillEnd(params) {
92
+ }
93
+ let hisGroupValue = headerInfo.groupValue;
94
+ watch(headerInfo, () => {
95
+ if (hisGroupValue == headerInfo.groupValue) {
96
+ return;
97
+ }
98
+ hisGroupValue = headerInfo.groupValue;
99
+ refresh();
100
+ });
101
+ function refresh() {
102
+ if (!dataConfig) {
103
+ console.log("无数据源配置,不需要查询!");
104
+ return;
105
+ }
106
+ dataConfig.services[0].groupValue = headerInfo.groupValue;
107
+ updateChartDatasources(props.pageContext, [dataConfig], headerInfo.drillParams);
108
+ }
71
109
  function updateChartOption(resultData) {
72
110
  if (!resultData || !resultData.result) {
73
111
  return;
@@ -95,13 +133,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
95
133
  confGroups = [];
96
134
  }
97
135
  const groupMap = {};
136
+ const groupFields = [];
98
137
  for (let g of confGroups) {
99
138
  groupMap[g.group] = g.target;
139
+ if (g.target && !groupFields.includes(g.target)) {
140
+ groupFields.push(g.target);
141
+ }
100
142
  }
101
143
  let mulGroupShow = props.configure.props ? props.configure.props.mulGroupShow : "";
102
144
  mulGroupShow = mulGroupShow == "break" ? "<br/>" : " ";
103
145
  const xFieldName = "__x";
104
146
  for (let d of datas) {
147
+ if (!d) {
148
+ continue;
149
+ }
105
150
  const xValues2 = [];
106
151
  for (let g of groupValue) {
107
152
  const fieldName = groupMap[g];
@@ -113,10 +158,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
113
158
  const xValue = xValues2.join(mulGroupShow);
114
159
  d[xFieldName] = xValue;
115
160
  }
116
- sortDatas(datas);
117
161
  const itemConfs = props.configure.items ? props.configure.items : [];
118
162
  const serieValues = [];
119
163
  const serieValueMap = {};
164
+ const dynamicFileds = [];
165
+ const dynamicValueField = {};
166
+ const allValueFields = [];
120
167
  for (let item of itemConfs) {
121
168
  const itemProps = item.props ? item.props : {};
122
169
  const sourceType = itemProps.yaxisSource;
@@ -127,27 +174,119 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
127
174
  uuid: item.uuid,
128
175
  type: "variable",
129
176
  field: yaxisField,
130
- data: []
177
+ data: [],
178
+ dynamicDatas: []
179
+ //动态系列数据
131
180
  };
181
+ if (yaxisField && !allValueFields.includes(yaxisField)) {
182
+ allValueFields.push(yaxisField);
183
+ }
132
184
  } else {
133
185
  serieValue = {
134
186
  uuid: item.uuid,
135
187
  type: "fixed",
136
188
  field: itemProps.yaxisFix,
137
- data: []
189
+ data: [],
190
+ dynamicDatas: []
191
+ //动态系列数据
138
192
  };
139
193
  }
140
194
  if (serieValue != null) {
141
195
  serieValues.push(serieValue);
142
196
  serieValueMap[item.uuid] = serieValue;
143
197
  }
198
+ if (itemProps.dynamicSeriesField && // !groupFields.includes(itemProps.dynamicSeriesField) &&
199
+ !dynamicFileds.includes(itemProps.dynamicSeriesField) && serieValue && yaxisField) {
200
+ serieValue.dynamicField = itemProps.dynamicSeriesField;
201
+ serieValue.dynamicSeriesTitle = itemProps.dynamicSeriesTitle;
202
+ serieValue.dynamicShowStack = itemProps.dynamicShowStack;
203
+ dynamicFileds.push(itemProps.dynamicSeriesField);
204
+ dynamicValueField[itemProps.dynamicSeriesField] = yaxisField;
205
+ }
206
+ }
207
+ const dynamicLabelMap = {};
208
+ if (dynamicFileds.length > 0) {
209
+ const newDatas = [];
210
+ const dataMap = {};
211
+ for (let d of datas) {
212
+ if (!d) {
213
+ continue;
214
+ }
215
+ for (let valueField of allValueFields) {
216
+ const groupValue2 = d[xFieldName];
217
+ let newData = dataMap[groupValue2];
218
+ if (!newData) {
219
+ newData = {};
220
+ for (let gField of groupFields) {
221
+ newData[gField] = d[gField];
222
+ }
223
+ newData[xFieldName] = d[xFieldName];
224
+ dataMap[groupValue2] = newData;
225
+ newDatas.push(newData);
226
+ }
227
+ let newValue = getValueFromSource(d, valueField, void 0);
228
+ if (!isNaN(newValue)) {
229
+ const hisValue = newData[valueField];
230
+ if (!isNaN) {
231
+ newValue += hisValue;
232
+ }
233
+ newData[valueField] = newValue;
234
+ }
235
+ }
236
+ }
237
+ for (let dynamicField of dynamicFileds) {
238
+ const dynamicLabels = [];
239
+ for (let d of datas) {
240
+ if (!d) {
241
+ continue;
242
+ }
243
+ const groupValue2 = d[xFieldName];
244
+ let newData = dataMap[groupValue2];
245
+ if (!newData) {
246
+ continue;
247
+ }
248
+ let dynamicLabel = getValueFromSource(d, dynamicField, void 0);
249
+ dynamicLabel = dynamicLabel == null || dynamicLabel == void 0 ? "" : dynamicLabel;
250
+ if (!dynamicLabels.includes(dynamicLabel)) {
251
+ dynamicLabels.push(dynamicLabel);
252
+ }
253
+ const valueField = dynamicValueField[dynamicField];
254
+ let newValue = getValueFromSource(d, valueField, void 0);
255
+ if (!isNaN(newValue)) {
256
+ const hisValue = newData[dynamicLabel];
257
+ if (!isNaN) {
258
+ newValue += hisValue;
259
+ }
260
+ newData[dynamicLabel] = newValue;
261
+ }
262
+ }
263
+ dynamicLabelMap[dynamicField] = dynamicLabels;
264
+ }
265
+ datas = newDatas;
144
266
  }
267
+ sortDatas(datas);
145
268
  const xValues = [];
146
269
  for (let data of datas) {
270
+ if (!data) {
271
+ continue;
272
+ }
147
273
  xValues.push(data[xFieldName]);
148
274
  for (let item of serieValues) {
149
- const serieData = item.data;
150
- if (item.type == "fixed") {
275
+ let serieData = item.data;
276
+ const dynamicDatas = item.dynamicDatas;
277
+ if (item.dynamicField) {
278
+ let dynamicLabels = dynamicLabelMap[item.dynamicField];
279
+ dynamicLabels = dynamicLabels ? dynamicLabels : [];
280
+ for (let i = 0; i < dynamicLabels.length; i++) {
281
+ if (i >= dynamicDatas.length) {
282
+ dynamicDatas.push([]);
283
+ }
284
+ serieData = dynamicDatas[i];
285
+ const fieldName = dynamicLabels[i];
286
+ const value = getValueFromSource(data, fieldName, void 0);
287
+ serieData.push(value);
288
+ }
289
+ } else if (item.type == "fixed") {
151
290
  serieData.push(item.field);
152
291
  } else if (item.type == "variable") {
153
292
  const value = getValueFromSource(data, item.field, void 0);
@@ -157,19 +296,52 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
157
296
  }
158
297
  }
159
298
  }
160
- console.log("datas", datas, serieValues);
161
- const newSeries = deepCopy(defaultSeries == null ? [] : defaultSeries);
162
- for (let serie of newSeries) {
299
+ const tempSeries = deepCopy(defaultSeries == null ? [] : defaultSeries);
300
+ const newSeries = [];
301
+ for (let serie of tempSeries) {
163
302
  const serieValue = serieValueMap[serie.uuid];
164
- serie.data = serieValue ? serieValue.data : [];
303
+ if (serieValue.dynamicField) {
304
+ let dynamicLabels = dynamicLabelMap[serieValue.dynamicField];
305
+ dynamicLabels = dynamicLabels ? dynamicLabels : [];
306
+ const dynamicDatas = serieValue.dynamicDatas ? serieValue.dynamicDatas : [];
307
+ for (let i = 0; i < dynamicLabels.length; i++) {
308
+ let label = dynamicLabels[i];
309
+ const newSerie = deepCopy(serie);
310
+ if (serieValue.dynamicSeriesTitle) {
311
+ const dynamicSeriesTitle = serieValue.dynamicSeriesTitle.replace("${name}", label);
312
+ newSerie.name = formatVariableValue(props.pageContext, dynamicSeriesTitle);
313
+ } else {
314
+ newSerie.name = label;
315
+ }
316
+ newSerie.data = i < dynamicDatas.length ? dynamicDatas[i] : [];
317
+ if (serie.type == "bar" && serieValue.dynamicShowStack) {
318
+ newSerie.stack = serie.uuid;
319
+ }
320
+ newSeries.push(newSerie);
321
+ }
322
+ } else {
323
+ serie.data = serieValue ? serieValue.data : [];
324
+ newSeries.push(serie);
325
+ }
165
326
  }
166
327
  chartOption.series = newSeries;
167
- console.log("newSeries", newSeries, xValues);
168
- if (defaultXaxis && defaultXaxis.length > 0) {
169
- defaultXaxis[0].data = xValues;
328
+ if (chartOption.isBar) {
329
+ if (defaultYaxis) {
330
+ for (let tempYaxis of defaultYaxis) {
331
+ tempYaxis.data = xValues;
332
+ }
333
+ }
334
+ chartOption.xAxis = defaultXaxis;
335
+ chartOption.yAxis = defaultYaxis;
336
+ } else {
337
+ if (defaultXaxis && defaultXaxis.length > 0) {
338
+ defaultXaxis[0].data = xValues;
339
+ }
170
340
  chartOption.xAxis = defaultXaxis;
341
+ chartOption.yAxis = defaultYaxis;
171
342
  }
172
- chartOption.yAxis = defaultYaxis;
343
+ cacheDatas = datas;
344
+ console.log("chartOption", chartOption);
173
345
  }
174
346
  function sortDatas(datas) {
175
347
  const itemConfs = props.configure.items ? props.configure.items : [];
@@ -231,11 +403,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
231
403
  ref_key: "thisRef",
232
404
  ref: thisRef
233
405
  }, [
234
- withDirectives(createVNode(_sfc_main$1, { headerInfo: unref(headerInfo) }, null, 8, ["headerInfo"]), [
406
+ withDirectives(createVNode(_sfc_main$1, {
407
+ ref_key: "headerRef",
408
+ ref: headerRef,
409
+ headerInfo: unref(headerInfo),
410
+ onDrillEnd
411
+ }, null, 8, ["headerInfo"]), [
235
412
  [vShow, unref(headerInfo).showHeader]
236
413
  ]),
237
414
  createVNode(unref(VChart), {
238
- ref: "chartRef",
415
+ ref_key: "chartRef",
416
+ ref: chartRef,
239
417
  theme: unref(customTheme),
240
418
  option: unref(chartOption),
241
419
  autoresize: ""
@@ -0,0 +1,44 @@
1
+ import { defineComponent, resolveComponent, openBlock, createBlock, unref, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString } from "vue";
2
+ import { ArrowRight } from "@element-plus/icons-vue";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "common-chart-header-breadcrumb",
5
+ props: {
6
+ headerInfo: {
7
+ type: Object,
8
+ required: true
9
+ }
10
+ },
11
+ emits: ["close-drill"],
12
+ setup(__props, { emit: __emit }) {
13
+ const $emits = __emit;
14
+ function closeDrill(drillIndex) {
15
+ $emits("close-drill", drillIndex);
16
+ }
17
+ return (_ctx, _cache) => {
18
+ const _component_el_tag = resolveComponent("el-tag");
19
+ const _component_el_breadcrumb = resolveComponent("el-breadcrumb");
20
+ return openBlock(), createBlock(_component_el_breadcrumb, { "separator-icon": unref(ArrowRight) }, {
21
+ default: withCtx(() => [
22
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.headerInfo.drillOptions, (tag, index) => {
23
+ return openBlock(), createBlock(_component_el_tag, {
24
+ key: tag.name,
25
+ closable: "",
26
+ type: "success",
27
+ style: { "margin-left": "4px" },
28
+ onClose: ($event) => closeDrill(index)
29
+ }, {
30
+ default: withCtx(() => [
31
+ createTextVNode(toDisplayString(tag.label), 1)
32
+ ]),
33
+ _: 2
34
+ }, 1032, ["onClose"]);
35
+ }), 128))
36
+ ]),
37
+ _: 1
38
+ }, 8, ["separator-icon"]);
39
+ };
40
+ }
41
+ });
42
+ export {
43
+ _sfc_main as default
44
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./common-chart-header-breadcrumb.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -1,5 +1,6 @@
1
- import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, normalizeStyle, toDisplayString, vShow, createBlock, createCommentVNode } from "vue";
2
- import _sfc_main$1 from "./common-chart-header-group.vue.js";
1
+ import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, withDirectives, normalizeStyle, toDisplayString, vShow, createBlock, createCommentVNode } from "vue";
2
+ import _sfc_main$2 from "./common-chart-header-group.vue.js";
3
+ import _sfc_main$1 from "./common-chart-header-breadcrumb.vue.js";
3
4
  const _hoisted_1 = { class: "amb-widget-chart-header" };
4
5
  const _hoisted_2 = { class: "amb-widget-chart-header-item" };
5
6
  const _hoisted_3 = { class: "amb-widget-chart-header-item amb-widget-chart-header-center" };
@@ -12,7 +13,55 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12
13
  required: true
13
14
  }
14
15
  },
15
- setup(__props) {
16
+ emits: ["drill-end"],
17
+ setup(__props, { expose: __expose, emit: __emit }) {
18
+ const props = __props;
19
+ const drillObjRef = ref(null);
20
+ const $emits = __emit;
21
+ if (!props.headerInfo.drillOptions) {
22
+ props.headerInfo.drillOptions = [];
23
+ }
24
+ function closeDrill(closeIndex) {
25
+ const drillLen = props.headerInfo.drillOptions.length;
26
+ if (closeIndex >= drillLen) {
27
+ console.log("无效的取消操作,", closeIndex, props.headerInfo.drillOptions);
28
+ return;
29
+ }
30
+ for (let i = drillLen - 1; i >= closeIndex; i--) {
31
+ props.headerInfo.drillOptions.splice(i, 1);
32
+ }
33
+ toDrillLevel(closeIndex);
34
+ }
35
+ function drill(params, datas) {
36
+ const currentIndex = props.headerInfo.drillOptions.length;
37
+ if (currentIndex + 1 >= props.headerInfo.options.length) {
38
+ console.log("钻取到最底层了!");
39
+ $emits("drill-end", params);
40
+ return;
41
+ }
42
+ console.log("props.headerInfo.options", currentIndex, props.headerInfo.options);
43
+ const targetGroup = props.headerInfo.options[currentIndex];
44
+ const drillOption = {
45
+ fieldName: targetGroup.target ? targetGroup.target.replace(".", "_") : "",
46
+ label: params.name,
47
+ value: params.name
48
+ };
49
+ props.headerInfo.drillOptions.push(drillOption);
50
+ toDrillLevel(currentIndex + 1);
51
+ }
52
+ function toDrillLevel(drillIndex) {
53
+ const drillParams = {};
54
+ for (let o of props.headerInfo.drillOptions) {
55
+ if (o.fieldName) {
56
+ drillParams[o.fieldName] = o.value;
57
+ }
58
+ }
59
+ props.headerInfo.drillParams = drillParams;
60
+ props.headerInfo.groupValue = props.headerInfo.options[drillIndex].value;
61
+ }
62
+ __expose({
63
+ drill
64
+ });
16
65
  return (_ctx, _cache) => {
17
66
  return openBlock(), createElementBlock("div", _hoisted_1, [
18
67
  createElementVNode("div", _hoisted_2, [
@@ -21,8 +70,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
70
  }, toDisplayString(__props.headerInfo.title) + "  ", 5), [
22
71
  [vShow, __props.headerInfo.title && (!__props.headerInfo.textAlign || __props.headerInfo.textAlign == "left")]
23
72
  ]),
24
- __props.headerInfo.showGroup && (!__props.headerInfo.groupPosition || __props.headerInfo.groupPosition == "left") ? (openBlock(), createBlock(_sfc_main$1, {
73
+ __props.headerInfo.showDrill && (!__props.headerInfo.groupPosition || __props.headerInfo.groupPosition == "left") ? (openBlock(), createBlock(_sfc_main$1, {
25
74
  key: 0,
75
+ ref_key: "drillObjRef",
76
+ ref: drillObjRef,
77
+ headerInfo: __props.headerInfo,
78
+ onCloseDrill: closeDrill
79
+ }, null, 8, ["headerInfo"])) : createCommentVNode("", true),
80
+ __props.headerInfo.showGroup && (!__props.headerInfo.groupPosition || __props.headerInfo.groupPosition == "left") ? (openBlock(), createBlock(_sfc_main$2, {
81
+ key: 1,
26
82
  headerInfo: __props.headerInfo
27
83
  }, null, 8, ["headerInfo"])) : createCommentVNode("", true)
28
84
  ]),
@@ -32,8 +88,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32
88
  }, toDisplayString(__props.headerInfo.title) + "  ", 5), [
33
89
  [vShow, __props.headerInfo.title && __props.headerInfo.textAlign == "center"]
34
90
  ]),
35
- __props.headerInfo.showGroup && __props.headerInfo.groupPosition == "center" ? (openBlock(), createBlock(_sfc_main$1, {
91
+ __props.headerInfo.showDrill && __props.headerInfo.groupPosition == "center" ? (openBlock(), createBlock(_sfc_main$1, {
36
92
  key: 0,
93
+ headerInfo: __props.headerInfo,
94
+ onCloseDrill: closeDrill,
95
+ ref_key: "drillObjRef",
96
+ ref: drillObjRef
97
+ }, null, 8, ["headerInfo"])) : createCommentVNode("", true),
98
+ __props.headerInfo.showGroup && __props.headerInfo.groupPosition == "center" ? (openBlock(), createBlock(_sfc_main$2, {
99
+ key: 1,
37
100
  headerInfo: __props.headerInfo
38
101
  }, null, 8, ["headerInfo"])) : createCommentVNode("", true)
39
102
  ]),
@@ -43,8 +106,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
43
106
  }, toDisplayString(__props.headerInfo.title) + "  ", 5), [
44
107
  [vShow, __props.headerInfo.title && __props.headerInfo.textAlign == "right"]
45
108
  ]),
46
- __props.headerInfo.showGroup && __props.headerInfo.groupPosition == "right" ? (openBlock(), createBlock(_sfc_main$1, {
109
+ __props.headerInfo.showDrill && __props.headerInfo.groupPosition == "right" ? (openBlock(), createBlock(_sfc_main$1, {
47
110
  key: 0,
111
+ headerInfo: __props.headerInfo,
112
+ onCloseDrill: closeDrill,
113
+ ref_key: "drillObjRef",
114
+ ref: drillObjRef
115
+ }, null, 8, ["headerInfo"])) : createCommentVNode("", true),
116
+ __props.headerInfo.showGroup && __props.headerInfo.groupPosition == "right" ? (openBlock(), createBlock(_sfc_main$2, {
117
+ key: 1,
48
118
  headerInfo: __props.headerInfo
49
119
  }, null, 8, ["headerInfo"])) : createCommentVNode("", true)
50
120
  ])
@@ -0,0 +1,24 @@
1
+ declare const _default: import('vue').DefineComponent<{
2
+ configure: {
3
+ type: ObjectConstructor;
4
+ required: true;
5
+ };
6
+ pageContext: {
7
+ type: ObjectConstructor;
8
+ };
9
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ close: (...args: any[]) => void;
11
+ export: (...args: any[]) => void;
12
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
13
+ configure: {
14
+ type: ObjectConstructor;
15
+ required: true;
16
+ };
17
+ pageContext: {
18
+ type: ObjectConstructor;
19
+ };
20
+ }>> & {
21
+ onClose?: (...args: any[]) => any;
22
+ onExport?: (...args: any[]) => any;
23
+ }, {}, {}>;
24
+ export default _default;
@@ -0,0 +1,35 @@
1
+ declare const _default: import('vue').DefineComponent<{
2
+ taskId: {
3
+ type: NumberConstructor;
4
+ default: any;
5
+ };
6
+ activeTasks: {
7
+ type: ArrayConstructor;
8
+ default: any;
9
+ };
10
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ close: (...args: any[]) => void;
12
+ result: (...args: any[]) => void;
13
+ open: (...args: any[]) => void;
14
+ opend: (...args: any[]) => void;
15
+ closed: (...args: any[]) => void;
16
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
17
+ taskId: {
18
+ type: NumberConstructor;
19
+ default: any;
20
+ };
21
+ activeTasks: {
22
+ type: ArrayConstructor;
23
+ default: any;
24
+ };
25
+ }>> & {
26
+ onClose?: (...args: any[]) => any;
27
+ onResult?: (...args: any[]) => any;
28
+ onOpen?: (...args: any[]) => any;
29
+ onOpend?: (...args: any[]) => any;
30
+ onClosed?: (...args: any[]) => any;
31
+ }, {
32
+ taskId: number;
33
+ activeTasks: unknown[];
34
+ }, {}>;
35
+ export default _default;
@@ -0,0 +1,26 @@
1
+ declare const _default: import('vue').DefineComponent<{
2
+ taskInformitions: {
3
+ type: ArrayConstructor;
4
+ default: any;
5
+ };
6
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ close: (...args: any[]) => void;
8
+ result: (...args: any[]) => void;
9
+ open: (...args: any[]) => void;
10
+ opend: (...args: any[]) => void;
11
+ closed: (...args: any[]) => void;
12
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
13
+ taskInformitions: {
14
+ type: ArrayConstructor;
15
+ default: any;
16
+ };
17
+ }>> & {
18
+ onClose?: (...args: any[]) => any;
19
+ onResult?: (...args: any[]) => any;
20
+ onOpen?: (...args: any[]) => any;
21
+ onOpend?: (...args: any[]) => any;
22
+ onClosed?: (...args: any[]) => any;
23
+ }, {
24
+ taskInformitions: unknown[];
25
+ }, {}>;
26
+ export default _default;
@@ -0,0 +1,22 @@
1
+ declare const _default: import('vue').DefineComponent<{
2
+ configure: {
3
+ type: ObjectConstructor;
4
+ default: {
5
+ name: string;
6
+ };
7
+ };
8
+ selectWidget: ObjectConstructor;
9
+ indexObj: ObjectConstructor;
10
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
11
+ configure: {
12
+ type: ObjectConstructor;
13
+ default: {
14
+ name: string;
15
+ };
16
+ };
17
+ selectWidget: ObjectConstructor;
18
+ indexObj: ObjectConstructor;
19
+ }>>, {
20
+ configure: Record<string, any>;
21
+ }, {}>;
22
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import { PageContext, Component } from '../../utils/interfaces/page-design-types';
2
+
3
+ interface MyProps {
4
+ pageContext: PageContext;
5
+ configure: Component;
6
+ }
7
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<MyProps>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<MyProps>>>, {}, {}>;
8
+ export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToRuntimeProps<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -0,0 +1,36 @@
1
+ interface MyProps {
2
+ parentPageContext: {
3
+ type: Object;
4
+ default: null;
5
+ };
6
+ parentPageEventParams: {
7
+ type: Object;
8
+ default: null;
9
+ };
10
+ jumpPageSetting: {
11
+ type: Object;
12
+ default: null;
13
+ };
14
+ isTest?: boolean;
15
+ }
16
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<MyProps>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
+ close: (...args: any[]) => void;
18
+ open: (...args: any[]) => void;
19
+ closed: (...args: any[]) => void;
20
+ opened: (...args: any[]) => void;
21
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<MyProps>>> & {
22
+ onClose?: (...args: any[]) => any;
23
+ onOpen?: (...args: any[]) => any;
24
+ onClosed?: (...args: any[]) => any;
25
+ onOpened?: (...args: any[]) => any;
26
+ }, {}, {}>;
27
+ export default _default;
28
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
29
+ type __VLS_TypePropsToRuntimeProps<T> = {
30
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
31
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
32
+ } : {
33
+ type: import('vue').PropType<T[K]>;
34
+ required: true;
35
+ };
36
+ };