super-page-runtime 2.2.26 → 2.2.29-tmp2

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 (165) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +7 -5
  2. package/dist/es/assets/chart-themes/theme1.js +6 -2
  3. package/dist/es/assets/chart-themes/theme2.js +6 -2
  4. package/dist/es/assets/chart-themes/theme3.js +6 -2
  5. package/dist/es/components/runtime/utils/api/api-util.js +7 -4
  6. package/dist/es/components/runtime/utils/api/page-expose-util.js +443 -135
  7. package/dist/es/components/runtime/utils/assemblys-config.js +369 -13
  8. package/dist/es/components/runtime/utils/barcode-util.js +33 -9
  9. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +306 -122
  10. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +68 -29
  11. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +152 -68
  12. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +124 -46
  13. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +99 -36
  14. package/dist/es/components/runtime/utils/charts/chart-util.js +522 -224
  15. package/dist/es/components/runtime/utils/common-util.js +156 -76
  16. package/dist/es/components/runtime/utils/eventBus.js +8 -3
  17. package/dist/es/components/runtime/utils/events/event-util.js +775 -362
  18. package/dist/es/components/runtime/utils/events/print-label.js +140 -72
  19. package/dist/es/components/runtime/utils/events/standard-event.js +2320 -808
  20. package/dist/es/components/runtime/utils/events/validator-util.js +560 -224
  21. package/dist/es/components/runtime/utils/form/date-shortcuts.js +88 -28
  22. package/dist/es/components/runtime/utils/form/scan-util.js +162 -61
  23. package/dist/es/components/runtime/utils/global-refs.js +84 -53
  24. package/dist/es/components/runtime/utils/i18n-util.js +20 -11
  25. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +7 -2
  26. package/dist/es/components/runtime/utils/page-helper-util.js +660 -279
  27. package/dist/es/components/runtime/utils/page-init-util.js +406 -141
  28. package/dist/es/components/runtime/utils/page-permission-util.js +531 -22
  29. package/dist/es/components/runtime/utils/page-store.js +68 -23
  30. package/dist/es/components/runtime/utils/store-util.js +13 -9
  31. package/dist/es/components/runtime/utils/store.js +2 -2
  32. package/dist/es/components/runtime/utils/table-utils.js +81 -40
  33. package/dist/es/components/runtime/utils/tree-utils.js +37 -17
  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 +83 -21
  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 +46 -14
  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 +132 -36
  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 +18 -4
  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 +107 -17
  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 +198 -50
  46. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +42 -12
  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 +60 -7
  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 +203 -52
  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/common/common-homepage-search.vue.js +4 -4
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +162 -46
  54. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  55. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +109 -32
  56. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  57. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +166 -43
  58. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  59. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +117 -32
  60. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  61. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +118 -32
  62. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +597 -246
  63. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +42 -4
  64. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  65. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +62 -8
  66. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +160 -29
  68. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  69. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +62 -13
  70. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  71. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  72. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +594 -212
  73. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +139 -29
  74. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  75. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +125 -21
  76. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  77. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +102 -16
  78. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  80. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +81 -18
  81. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  82. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +82 -17
  83. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  84. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +86 -14
  85. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +79 -21
  87. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  88. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +61 -16
  89. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +37 -10
  91. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +127 -38
  93. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +76 -28
  95. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +178 -61
  97. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +810 -302
  98. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  99. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +635 -262
  100. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  101. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  102. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +115 -40
  103. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +215 -56
  105. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +21 -3
  106. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  107. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  108. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +154 -42
  109. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +98 -34
  110. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  111. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  112. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +200 -52
  113. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +239 -68
  115. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  116. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +109 -31
  117. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +59 -21
  119. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  120. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +188 -56
  121. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +103 -22
  123. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  124. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +245 -57
  125. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  126. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +174 -32
  127. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  128. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +107 -28
  129. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
  130. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +50 -13
  131. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  132. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +194 -64
  133. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  134. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +249 -88
  135. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  136. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +263 -80
  137. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  138. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +57 -13
  139. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  140. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +155 -30
  141. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  142. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +129 -40
  143. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  144. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +107 -22
  145. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +188 -89
  146. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +272 -133
  148. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  149. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  150. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +46 -18
  151. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  152. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +49 -21
  153. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  154. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +58 -20
  155. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  156. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +53 -16
  157. package/dist/es/components/runtime/views/home-chart.vue.js +160 -40
  158. package/dist/es/components/runtime/views/home-chart.vue2.js +2 -2
  159. package/dist/es/components/runtime/views/super-page-dialog.vue.js +139 -20
  160. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  161. package/dist/es/components/runtime/views/super-page.vue.js +754 -226
  162. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  163. package/dist/es/i18n/langs/cn.js +55 -2
  164. package/dist/es/i18n/langs/en.js +55 -2
  165. package/package.json +2 -2
@@ -1,222 +1,604 @@
1
- import { defineComponent as e, ref as o, onMounted as n, watch as r, resolveComponent as t, createElementBlock as i, openBlock as a, normalizeClass as u, normalizeStyle as p, unref as l, withDirectives as s, createVNode as c, createBlock as g, createCommentVNode as f, vShow as d, withCtx as m, Fragment as h, renderList as v, h as y } from "vue";
2
- import C from "../common/common-chart-header.vue.js";
3
- import { getSizeConfig as x, getChartDatasFromPage as b, getValueFromVariable as O, isPromise as w, setValueForVariableName as S, updateChartDatasourcesByComponent as j, caculateShowCondition as E } from "../../../../utils/page-helper-util.js";
4
- import { getCustomFunc as $ } from "../../../../utils/events/event-util.js";
5
- import k from "./group-column.vue.js";
6
- import F from "./normal-column.vue.js";
7
- import I from "./table-pageination.vue.js";
8
- import { getSummaryTitleColumn as R, getSummaryDataColumn as H, rowDataToColumn as T, getColumnToRowTableConfig as _, colDataToRow as z, computeFormula as D, getNewColumnConfig as P, summaryStatistics as U, replacePlaceholders as G, getIndexColumn as K, getHeaderCellStyleUtil as N, getRowStyleUtil as J, getCellStyleUtil as L, formatColContent as V } from "./chart-table-util.js";
9
- import { deepCopy as A } from "../../../../utils/common-util.js";
10
- const q = e({ __name: "table-runtime", props: { configure: { type: Object, default: () => ({}) }, pageContext: { type: Object, default: () => ({}) } }, setup(e2, { expose: q2 }) {
11
- var _a;
12
- const B = e2, M = B.configure.runtime ? B.configure.runtime : {}, Q = M.style, W = M.class, X = M.dataConfig, Y = M.headerInfo ? M.headerInfo : {}, Z = o(null), ee = o(M.props.isEnableGroupHeader), oe = o([]), ne = o([]), re = o([]), te = o({}), ie = o(false), ae = o({}), ue = o({}), pe = o({}), le = [], se = o({}), ce = o({}), ge = o(null), fe = o(0);
13
- let de = [];
14
- if (!B.configure.props.modelCustom) {
15
- if (ee.value) {
16
- const e3 = [];
17
- B.configure.props.groupHeaders.forEach((o2) => {
18
- o2.parentUuid || e3.push(o2);
19
- }), e3.sort((e4, o2) => e4.displayOrder - o2.displayOrder), re.value = e3, function() {
20
- if (B.configure.props.base.showIndex) {
21
- re.value.unshift({ columnUuid: "$index", displayOrder: 0, isLeaf: true, prop: "$index", titleText: "序号", uuid: "$index" });
22
- const e4 = K();
23
- e4 && (te.value.$index = e4);
24
- }
25
- }();
26
- } else ne.value = B.configure.items;
27
- (_a = B.configure.items) == null ? void 0 : _a.forEach((e3) => {
28
- te.value[e3.uuid] = e3, Object.keys(e3.style).length > 0 && (se.value[e3.props.base.prop] = { cellStyle: e3.style, titleStyle: e3.titleStyle }), e3.formula && "" !== e3.formula.trim() && (ce.value[e3.props.base.prop] = e3.formula);
29
- });
30
- }
31
- ie.value = B.configure.props.base.showSummary, (ie.value || B.configure.props.highOrder.groupField && B.configure.props.highOrder.groupField.length > 0) && (ae.value = R(B.configure), ie.value && (ue.value = H(B.configure, "table")), B.configure.props.highOrder.groupField && B.configure.props.highOrder.groupField.length > 0 && (pe.value = H(B.configure, "group")));
32
- let me = 300, he = x(B.pageContext, B.configure);
33
- function ve() {
34
- const e3 = B.configure.props.dataOrigin.variable.match(/\${(.*?)}/), o2 = e3 ? e3[1].split(".") : [];
35
- r(() => o2.reduce((e4, o3) => e4[o3], B.pageContext.entity), (e4) => {
36
- e4 ? ye(JSON.parse(JSON.stringify(e4))) : (oe.value = [], B.configure.props.modelCustom ? Re(null) : ee.value ? re.value = B.configure.props.groupHeaders : ne.value = B.configure.items);
1
+ import { defineComponent, ref, onMounted, watch, resolveComponent, createElementBlock, openBlock, normalizeClass, normalizeStyle, unref, withDirectives, createVNode, createBlock, createCommentVNode, vShow, withCtx, Fragment, renderList, h } from "vue";
2
+ import _sfc_main$1 from "../common/common-chart-header.vue.js";
3
+ import { getSizeConfig, getChartDatasFromPage, getValueFromVariable, isPromise, setValueForVariableName, updateChartDatasourcesByComponent, caculateShowCondition } from "../../../../utils/page-helper-util.js";
4
+ import { getCustomFunc } from "../../../../utils/events/event-util.js";
5
+ import _sfc_main$2 from "./group-column.vue.js";
6
+ import _sfc_main$3 from "./normal-column.vue.js";
7
+ import _sfc_main$4 from "./table-pageination.vue.js";
8
+ import { getSummaryTitleColumn, getSummaryDataColumn, rowDataToColumn, getColumnToRowTableConfig, colDataToRow, computeFormula, getNewColumnConfig, summaryStatistics, replacePlaceholders, getIndexColumn, getHeaderCellStyleUtil, getRowStyleUtil, getCellStyleUtil, formatColContent } from "./chart-table-util.js";
9
+ import { deepCopy } from "../../../../utils/common-util.js";
10
+ const _sfc_main = /* @__PURE__ */ defineComponent({
11
+ __name: "table-runtime",
12
+ props: {
13
+ configure: {
14
+ type: Object,
15
+ default: () => {
16
+ return {};
17
+ }
18
+ },
19
+ pageContext: {
20
+ type: Object,
21
+ default: () => {
22
+ return {};
23
+ }
24
+ }
25
+ },
26
+ setup(__props, { expose: __expose }) {
27
+ var _a;
28
+ const props = __props;
29
+ const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
30
+ const runtimeStyle = runtimeInfo.style;
31
+ const runtimeClass = runtimeInfo.class;
32
+ const dataConfig = runtimeInfo.dataConfig;
33
+ const headerInfo = runtimeInfo.headerInfo ? runtimeInfo.headerInfo : {};
34
+ const headerRef = ref(null);
35
+ const isEnableGroupHeader = ref(runtimeInfo.props.isEnableGroupHeader);
36
+ const tableData = ref([]);
37
+ const tableColumnsConfig = ref([]);
38
+ const groupColumnsConfig = ref([]);
39
+ const columnsConfigKeyValues = ref({});
40
+ const showSummary = ref(false);
41
+ const tableSummaryTitle = ref({});
42
+ const tableSummaryColumns = ref({});
43
+ const groupSummaryColumns = ref({});
44
+ const groupSummaryDataRowIndex = [];
45
+ const columnStyleSourceConfig = ref({});
46
+ const dataFormulaMapping = ref({});
47
+ const gridRef = ref(null);
48
+ const total = ref(0);
49
+ let tmpTableData = [];
50
+ if (!props.configure.props.modelCustom) {
51
+ if (!isEnableGroupHeader.value) {
52
+ tableColumnsConfig.value = props.configure.items;
53
+ } else {
54
+ const tempGroupHeaders = [];
55
+ props.configure.props.groupHeaders.forEach((item) => {
56
+ if (!item.parentUuid) {
57
+ tempGroupHeaders.push(item);
58
+ }
59
+ });
60
+ tempGroupHeaders.sort((a, b) => a.displayOrder - b.displayOrder);
61
+ groupColumnsConfig.value = tempGroupHeaders;
62
+ pushIdnexColumnToGroupHeaders();
63
+ }
64
+ (_a = props.configure.items) == null ? void 0 : _a.forEach((item) => {
65
+ columnsConfigKeyValues.value[item.uuid] = item;
66
+ if (Object.keys(item.style).length > 0) {
67
+ columnStyleSourceConfig.value[item.props.base.prop] = {
68
+ cellStyle: item.style,
69
+ titleStyle: item.titleStyle
70
+ };
71
+ }
72
+ if (item.formula && item.formula.trim() !== "") {
73
+ dataFormulaMapping.value[item.props.base.prop] = item.formula;
74
+ }
75
+ });
76
+ }
77
+ showSummary.value = props.configure.props.base.showSummary;
78
+ if (showSummary.value || props.configure.props.highOrder.groupField && props.configure.props.highOrder.groupField.length > 0) {
79
+ tableSummaryTitle.value = getSummaryTitleColumn(props.configure);
80
+ if (showSummary.value) {
81
+ tableSummaryColumns.value = getSummaryDataColumn(props.configure, "table");
82
+ }
83
+ if (props.configure.props.highOrder.groupField && props.configure.props.highOrder.groupField.length > 0) {
84
+ groupSummaryColumns.value = getSummaryDataColumn(props.configure, "group");
85
+ }
86
+ }
87
+ let maxHeight = 300;
88
+ let sizeConfig = getSizeConfig(props.pageContext, props.configure);
89
+ if (sizeConfig && sizeConfig.maxHeight) {
90
+ maxHeight = sizeConfig.maxHeight;
91
+ }
92
+ if (!maxHeight && sizeConfig && sizeConfig.fixHeight) {
93
+ maxHeight = sizeConfig.fixHeight;
94
+ }
95
+ if (maxHeight) {
96
+ maxHeight = Number(maxHeight + "");
97
+ }
98
+ onMounted(() => {
99
+ const resultData = getChartDatasFromPage(props.pageContext, props.configure);
100
+ if (resultData) {
101
+ updateChartDatas(resultData);
102
+ } else {
103
+ if (props.configure.props.dataOrigin.dataSource === "variable") {
104
+ watchVariableDataChange();
105
+ const tmpTableData2 = getValueFromVariable(
106
+ props.pageContext.entity,
107
+ props.configure.props.dataOrigin.variable
108
+ );
109
+ if (tmpTableData2) {
110
+ loadTable(tmpTableData2, resultData);
111
+ }
112
+ }
113
+ }
37
114
  });
38
- }
39
- function ye(e3) {
40
- e3 || (e3 = []), (e3 = e3.length > 0 ? e3[0] : {}) || (e3 = {}), e3.hasRender ? e3.hasRender = true : (!function(e4) {
41
- Re(e4), "service" === B.configure.props.dataOrigin.dataSource && e4.result ? de = e4.result[B.configure.props.dataOrigin.service.serviceDataField] : "variable" === B.configure.props.dataOrigin.dataSource && (ve(), de = O(B.pageContext.entity, B.configure.props.dataOrigin.variable));
42
- de && Ce(de, e4);
43
- }(e3), e3.hasRender = true, X && (X.autoRefresh = false));
44
- }
45
- function Ce(e3, o2) {
46
- var _a2;
47
- if (xe("rowToColumn")) {
48
- if (e3 = T(e3, B.configure, ne.value), !ee.value) {
49
- const o3 = function(e4, o4, n2) {
50
- const r2 = B.configure.props.dataOrigin.rowToColumn.titleColumns, t2 = B.configure.props.dataOrigin.rowToColumn.dataColumns, i2 = e4.props.dataOrigin.groupField;
51
- if ((!i2 || 0 === i2.length) && n2.length > 0) {
52
- const e5 = [];
53
- return e5.push(P("$GroupColumn", B.configure.props.dataOrigin.rowToColumn.firstColumnTitle, 0, "string")), Object.keys(n2[0]).forEach((o5, n3) => {
54
- if ("$GroupColumn" === o5) return;
55
- const r3 = P(o5, o5, n3 + 1, "string");
56
- e5.push(r3);
57
- }), e5;
115
+ function watchVariableDataChange() {
116
+ const match = props.configure.props.dataOrigin.variable.match(/\${(.*?)}/);
117
+ const path = match ? match[1].split(".") : [];
118
+ watch(
119
+ () => path.reduce((obj, key) => obj[key], props.pageContext.entity),
120
+ (newVal) => {
121
+ console.log("统计表格监听数据变量的变化 newVal:", newVal);
122
+ if (newVal) {
123
+ updateChartDatas(JSON.parse(JSON.stringify(newVal)));
124
+ } else {
125
+ tableData.value = [];
126
+ resetTableColumns();
58
127
  }
59
- {
60
- const e5 = [...o4].filter((e6) => !r2.includes(e6.props.base.prop) && !t2.includes(e6.props.base.prop)), i3 = new RegExp(`(${t2.join("|")})$`), a2 = /* @__PURE__ */ new Set();
61
- return n2.forEach((e6) => {
62
- Object.keys(e6).forEach((e7) => {
63
- if (t2.some((o5) => e7.includes(o5))) {
64
- const o5 = e7.split(i3)[0];
65
- a2.add(o5);
66
- }
67
- });
68
- }), a2.forEach((o5) => {
69
- t2.forEach((r3) => {
70
- var _a3;
71
- (_a3 = ne.value.find((e6) => e6.props.base.prop === r3)) == null ? void 0 : _a3.props.base.name;
72
- const t3 = P(`${o5}${r3}`, `${o5}${r3}`, e5.length + 1, "number" == typeof n2[0][`${o5}${r3}`] ? "number" : "string");
73
- e5.push(t3);
74
- });
75
- }), e5;
128
+ }
129
+ );
130
+ }
131
+ function updateChartDatas(resultData) {
132
+ if (!resultData) {
133
+ resultData = [];
134
+ }
135
+ resultData = resultData.length > 0 ? resultData[0] : {};
136
+ if (!resultData) {
137
+ resultData = {};
138
+ }
139
+ if (resultData.hasRender) {
140
+ resultData.hasRender = true;
141
+ console.log("重复更新!", resultData);
142
+ return;
143
+ }
144
+ updateTable(resultData);
145
+ resultData.hasRender = true;
146
+ if (dataConfig) {
147
+ dataConfig.autoRefresh = false;
148
+ }
149
+ }
150
+ function updateTable(resultData) {
151
+ setCustomColumns(resultData);
152
+ if (props.configure.props.dataOrigin.dataSource === "service" && resultData.result) {
153
+ tmpTableData = resultData.result[props.configure.props.dataOrigin.service.serviceDataField];
154
+ } else if (props.configure.props.dataOrigin.dataSource === "variable") {
155
+ watchVariableDataChange();
156
+ tmpTableData = getValueFromVariable(
157
+ props.pageContext.entity,
158
+ props.configure.props.dataOrigin.variable
159
+ );
160
+ }
161
+ if (tmpTableData) {
162
+ loadTable(tmpTableData, resultData);
163
+ }
164
+ }
165
+ function loadTable(tmpTableData2, resultData) {
166
+ var _a2;
167
+ if (enableTransition("rowToColumn")) {
168
+ tmpTableData2 = rowDataToColumn(tmpTableData2, props.configure, tableColumnsConfig.value);
169
+ if (!isEnableGroupHeader.value) {
170
+ const updatedColumnConfig = updateColumnConfig(
171
+ props.configure,
172
+ tableColumnsConfig.value,
173
+ tmpTableData2
174
+ );
175
+ tableColumnsConfig.value = updatedColumnConfig;
176
+ }
177
+ } else if (enableTransition("columnToRow")) {
178
+ if (!isEnableGroupHeader.value) {
179
+ tableColumnsConfig.value = getColumnToRowTableConfig(props.configure);
180
+ }
181
+ tmpTableData2 = colDataToRow(tmpTableData2, props.configure);
182
+ }
183
+ if (props.configure.props.dataOrigin.dataFormatting) {
184
+ const func = getCustomFunc(props.pageContext, props.configure.props.dataOrigin.dataFormatting);
185
+ if (func) {
186
+ const resultValue = func.apply(func, [{ tableData: tmpTableData2 }]);
187
+ if (resultValue) {
188
+ tmpTableData2 = resultValue;
76
189
  }
77
- }(B.configure, ne.value, e3);
78
- ne.value = o3;
79
- }
80
- } else xe("columnToRow") && (ee.value || (ne.value = _(B.configure)), e3 = z(e3, B.configure));
81
- if (B.configure.props.dataOrigin.dataFormatting) {
82
- const o3 = $(B.pageContext, B.configure.props.dataOrigin.dataFormatting);
83
- if (o3) {
84
- const n2 = o3.apply(o3, [{ tableData: e3 }]);
85
- n2 && (e3 = n2);
86
- }
87
- }
88
- if (Object.keys(ce.value).length > 0 && e3 && e3.length > 0 && D(ce.value, e3, B.pageContext.entity), ((_a2 = B.configure.pageination) == null ? void 0 : _a2.enable) ? function(e4) {
89
- "frontend" === B.configure.pageination.type ? (fe.value = de.length, ke(1, B.configure.pageination.pageSize)) : "backend" === B.configure.pageination.type && (oe.value = de, B.configure.pageination.totalFrom && (fe.value = e4.result[B.configure.pageination.totalFrom]));
90
- }(o2) : oe.value = e3, B.configure.props.highOrder.groupField && B.configure.props.highOrder.groupField.length > 0) {
91
- const e4 = B.configure.props.highOrder.groupField;
92
- oe.value = function(e5, o3) {
93
- var _a3, _b;
94
- if (0 === pe.value.length) return e5;
95
- const n2 = [], r2 = (_a3 = B.configure.items) == null ? void 0 : _a3.filter((e6) => o3.includes(e6.props.base.prop)), t2 = (_b = B.configure.items) == null ? void 0 : _b.filter((e6) => true === e6.props.base.groupSummary), i2 = {};
96
- e5.forEach((e6) => {
97
- const n3 = o3.map((o4) => e6[o4]).join("|");
98
- i2[n3] || (i2[n3] = []), i2[n3].push(e6);
190
+ }
191
+ }
192
+ if (Object.keys(dataFormulaMapping.value).length > 0 && tmpTableData2 && tmpTableData2.length > 0) {
193
+ computeFormula(dataFormulaMapping.value, tmpTableData2, props.pageContext.entity);
194
+ }
195
+ if ((_a2 = props.configure.pageination) == null ? void 0 : _a2.enable) {
196
+ tableDataPageination(resultData);
197
+ } else {
198
+ tableData.value = tmpTableData2;
199
+ }
200
+ if (props.configure.props.highOrder.groupField && props.configure.props.highOrder.groupField.length > 0) {
201
+ const groupField = props.configure.props.highOrder.groupField;
202
+ tableData.value = groupAndAddTotals(tableData.value, groupField);
203
+ }
204
+ pushTableIndexColumn(tableColumnsConfig.value);
205
+ }
206
+ function enableTransition(type) {
207
+ return props.configure.props.dataOrigin.transition === type && // props.configure.props.dataOrigin.groupField &&
208
+ // props.configure.props.dataOrigin.groupField.length > 0 &&
209
+ props.configure.props.dataOrigin[type].titleColumns && props.configure.props.dataOrigin[type].titleColumns.length > 0 && props.configure.props.dataOrigin[type].dataColumns && props.configure.props.dataOrigin[type].dataColumns.length > 0;
210
+ }
211
+ function getHeaderCellStyle(data) {
212
+ const cellTitleStyle = columnStyleSourceConfig.value[data.column.property] ? columnStyleSourceConfig.value[data.column.property].titleStyle : null;
213
+ const rowTitleStyle = runtimeStyle == null ? void 0 : runtimeStyle.titleStyle;
214
+ return getHeaderCellStyleUtil(
215
+ data,
216
+ { cellTitleStyle, titleStyle: rowTitleStyle },
217
+ props
218
+ );
219
+ }
220
+ function getRowStyle(data) {
221
+ return getRowStyleUtil(data, groupSummaryDataRowIndex, props);
222
+ }
223
+ function getCellStyle(data) {
224
+ const cellStyles = columnStyleSourceConfig.value[data.column.property] ? columnStyleSourceConfig.value[data.column.property].cellStyle : null;
225
+ return getCellStyleUtil(data, cellStyles, props);
226
+ }
227
+ const getSummaries = (param) => {
228
+ const { columns, data } = param;
229
+ const sums = [];
230
+ columns.forEach((column, index) => {
231
+ if (tableSummaryTitle.value[column.property]) {
232
+ const label = tableSummaryTitle.value[column.property].label;
233
+ sums[index] = h("div", {}, [replacePlaceholders(label, data)]);
234
+ return;
235
+ }
236
+ if (tableSummaryColumns.value[column.property]) {
237
+ const scientificData = data.filter((item, index2) => !groupSummaryDataRowIndex.includes(index2));
238
+ sums[index] = summaryStatistics(
239
+ tableSummaryColumns.value[column.property],
240
+ scientificData,
241
+ column.property,
242
+ props.pageContext
243
+ );
244
+ }
245
+ });
246
+ return sums;
247
+ };
248
+ function spanMethod({ row, column, rowIndex, columnIndex }) {
249
+ const property = column.property;
250
+ const highOrder = props.configure.props.highOrder;
251
+ if (highOrder.scopeFunc) {
252
+ const func = getCustomFunc(props.pageContext, highOrder.scopeFunc);
253
+ if (func) {
254
+ const resultValue = func.apply(func, [
255
+ { tableData: tableData.value, row, column, rowIndex, columnIndex }
256
+ ]);
257
+ if (resultValue) {
258
+ return resultValue;
259
+ }
260
+ }
261
+ } else {
262
+ if (highOrder && highOrder.mergeColumn) ;
263
+ if (highOrder && highOrder.mergeRow && highOrder.mergeRow.includes(property)) {
264
+ if (rowIndex === 0) {
265
+ return {
266
+ rowspan: tableData.value.length,
267
+ colspan: 1
268
+ };
269
+ }
270
+ }
271
+ }
272
+ }
273
+ function updateColumnConfig(configure, columnConfigs, pivotedData) {
274
+ const columnFields = props.configure.props.dataOrigin.rowToColumn.titleColumns;
275
+ const valueFields = props.configure.props.dataOrigin.rowToColumn.dataColumns;
276
+ const groupByFields = configure.props.dataOrigin.groupField;
277
+ if ((!groupByFields || groupByFields.length === 0) && pivotedData.length > 0) {
278
+ const newConfig = [];
279
+ newConfig.push(
280
+ getNewColumnConfig(
281
+ "$GroupColumn",
282
+ props.configure.props.dataOrigin.rowToColumn.firstColumnTitle,
283
+ 0,
284
+ "string"
285
+ )
286
+ );
287
+ Object.keys(pivotedData[0]).forEach((key, index) => {
288
+ if (key === "$GroupColumn") {
289
+ return;
290
+ }
291
+ const newConfigItem = getNewColumnConfig(key, key, index + 1, "string");
292
+ newConfig.push(newConfigItem);
99
293
  });
100
- const a2 = Object.values(i2);
101
- for (let e6 = 0; e6 < a2.length; e6++) {
102
- const o4 = a2[e6], i3 = {};
103
- t2 == null ? void 0 : t2.forEach((e7) => {
104
- const n3 = e7.props.base.prop, r3 = U(pe.value[n3], o4, n3, B.pageContext);
105
- i3[n3] = r3;
106
- }), n2.push(...o4), r2 == null ? void 0 : r2.forEach((e7) => {
107
- const n3 = e7.props.base.prop;
108
- i3[n3] = G(e7.props.base.summaryTitle, o4[0]);
109
- }), n2.push(i3), le.push(n2.length - 1);
110
- }
111
- return n2;
112
- }(oe.value, e4);
113
- }
114
- !function(e4) {
115
- if (B.configure.props.base.showIndex && -1 === e4.findIndex((e5) => "$index" === e5.props.base.prop)) {
116
- const o3 = K();
117
- o3 && e4.unshift(o3);
118
- }
119
- }(ne.value);
120
- }
121
- function xe(e3) {
122
- return B.configure.props.dataOrigin.transition === e3 && B.configure.props.dataOrigin[e3].titleColumns && B.configure.props.dataOrigin[e3].titleColumns.length > 0 && B.configure.props.dataOrigin[e3].dataColumns && B.configure.props.dataOrigin[e3].dataColumns.length > 0;
123
- }
124
- function be(e3) {
125
- const o2 = se.value[e3.column.property] ? se.value[e3.column.property].titleStyle : null, n2 = Q == null ? void 0 : Q.titleStyle;
126
- return N(e3, { cellTitleStyle: o2, titleStyle: n2 }, B);
127
- }
128
- function Oe(e3) {
129
- return J(e3, le, B);
130
- }
131
- function we(e3) {
132
- const o2 = se.value[e3.column.property] ? se.value[e3.column.property].cellStyle : null;
133
- return L(e3, o2, B);
134
- }
135
- he && he.maxHeight && (me = he.maxHeight), !me && he && he.fixHeight && (me = he.fixHeight), me && (me = Number(me + "")), n(() => {
136
- const e3 = b(B.pageContext, B.configure);
137
- if (e3) ye(e3);
138
- else if ("variable" === B.configure.props.dataOrigin.dataSource) {
139
- ve();
140
- const o2 = O(B.pageContext.entity, B.configure.props.dataOrigin.variable);
141
- o2 && Ce(o2, e3);
142
- }
143
- });
144
- const Se = (e3) => {
145
- const { columns: o2, data: n2 } = e3, r2 = [];
146
- return o2.forEach((e4, o3) => {
147
- if (ae.value[e4.property]) {
148
- const t2 = ae.value[e4.property].label;
149
- r2[o3] = y("div", {}, [G(t2, n2)]);
150
- } else if (ue.value[e4.property]) {
151
- const t2 = n2.filter((e5, o4) => !le.includes(o4));
152
- r2[o3] = U(ue.value[e4.property], t2, e4.property, B.pageContext);
153
- }
154
- }), r2;
155
- };
156
- function je({ row: e3, column: o2, rowIndex: n2, columnIndex: r2 }) {
157
- const t2 = o2.property, i2 = B.configure.props.highOrder;
158
- if (i2.scopeFunc) {
159
- const t3 = $(B.pageContext, i2.scopeFunc);
160
- if (t3) {
161
- const i3 = t3.apply(t3, [{ tableData: oe.value, row: e3, column: o2, rowIndex: n2, columnIndex: r2 }]);
162
- if (i3) return i3;
163
- }
164
- } else if (i2 && i2.mergeColumn, i2 && i2.mergeRow && i2.mergeRow.includes(t2) && 0 === n2) return { rowspan: oe.value.length, colspan: 1 };
165
- }
166
- function Ee(e3, o2) {
167
- "frontend" === B.configure.pageination.type ? ke(e3, o2) : Fe(e3, o2);
168
- }
169
- function $e(e3, o2) {
170
- "frontend" === B.configure.pageination.type ? ke(e3, o2) : Fe(e3, o2);
171
- }
172
- function ke(e3, o2) {
173
- de && (oe.value = de.slice((e3 - 1) * o2, e3 * o2));
174
- }
175
- function Fe(e3, o2) {
176
- B.configure.pageination.currentPageSet && S(B.pageContext.entity, B.configure.pageination.currentPageSet, e3), B.configure.pageination.pageSizeSet && S(B.pageContext.entity, B.configure.pageination.pageSizeSet, o2), j(B.pageContext, B.configure.uuid);
177
- }
178
- function Ie(e3) {
179
- const o2 = e3.showCondition;
180
- return E(B.pageContext, o2);
181
- }
182
- function Re(e3) {
183
- if (B.configure.props.modelCustom) {
184
- const o2 = $(B.pageContext, B.configure.props.modelCustom);
185
- if (o2) {
186
- const n2 = o2.apply(o2, [{ pageContext: B.pageContext, configureObj: B.configure, value: e3 }]);
187
- w(n2) ? n2.then((e4) => {
188
- ne.value = e4.columns;
189
- }) : ne.value = n2.columns;
294
+ return newConfig;
295
+ } else {
296
+ const updatedConfig = [...columnConfigs].filter(
297
+ (item) => !columnFields.includes(item.props.base.prop) && !valueFields.includes(item.props.base.prop)
298
+ );
299
+ const valueFieldsRegex = new RegExp(`(${valueFields.join("|")})$`);
300
+ const columnCombinations = /* @__PURE__ */ new Set();
301
+ pivotedData.forEach((record) => {
302
+ Object.keys(record).forEach((key) => {
303
+ if (valueFields.some((valueField) => key.includes(valueField))) {
304
+ const parts = key.split(valueFieldsRegex);
305
+ const combination = parts[0];
306
+ columnCombinations.add(combination);
307
+ }
308
+ });
309
+ });
310
+ columnCombinations.forEach((combination) => {
311
+ valueFields.forEach((valueField) => {
312
+ var _a2;
313
+ (_a2 = tableColumnsConfig.value.find(
314
+ (item) => item.props.base.prop === valueField
315
+ )) == null ? void 0 : _a2.props.base.name;
316
+ const newConfigItem = getNewColumnConfig(
317
+ `${combination}${valueField}`,
318
+ `${combination}${valueField}`,
319
+ updatedConfig.length + 1,
320
+ typeof pivotedData[0][`${combination}${valueField}`] === "number" ? "number" : "string"
321
+ );
322
+ updatedConfig.push(newConfigItem);
323
+ });
324
+ });
325
+ return updatedConfig;
190
326
  }
191
327
  }
192
- }
193
- function He(e3, o2, n2) {
194
- e3.forEach((e4) => {
195
- const r2 = e4.props.base.prop, t2 = e4.props.base.name;
196
- let i2 = { name: r2, label: t2, i18nKey: t2 };
197
- e4.children && e4.childern.length > 0 && (i2.children = [], He(e4.children, i2.children, n2)), e4.props.format && e4.props.format.type && n2.push(e4), o2.push(i2);
328
+ function groupAndAddTotals(data, groupFields) {
329
+ var _a2, _b;
330
+ if (groupSummaryColumns.value.length === 0) {
331
+ return data;
332
+ }
333
+ const result = [];
334
+ const groupColumns = (_a2 = props.configure.items) == null ? void 0 : _a2.filter(
335
+ (item) => groupFields.includes(item.props.base.prop)
336
+ );
337
+ const summaryColumns = (_b = props.configure.items) == null ? void 0 : _b.filter(
338
+ (item) => item.props.base.groupSummary === true
339
+ );
340
+ const groupedData = {};
341
+ data.forEach((item) => {
342
+ const key = groupFields.map((field) => item[field]).join("|");
343
+ if (!groupedData[key]) {
344
+ groupedData[key] = [];
345
+ }
346
+ groupedData[key].push(item);
347
+ });
348
+ const groupResult = Object.values(groupedData);
349
+ for (let i = 0; i < groupResult.length; i++) {
350
+ const group = groupResult[i];
351
+ const total2 = {};
352
+ summaryColumns == null ? void 0 : summaryColumns.forEach((column) => {
353
+ const prop = column.props.base.prop;
354
+ const res = summaryStatistics(groupSummaryColumns.value[prop], group, prop, props.pageContext);
355
+ total2[prop] = res;
356
+ });
357
+ result.push(...group);
358
+ groupColumns == null ? void 0 : groupColumns.forEach((column) => {
359
+ const prop = column.props.base.prop;
360
+ total2[prop] = replacePlaceholders(column.props.base.summaryTitle, group[0]);
361
+ });
362
+ result.push(total2);
363
+ groupSummaryDataRowIndex.push(result.length - 1);
364
+ }
365
+ return result;
366
+ }
367
+ function pushTableIndexColumn(tableColumnsConfig2) {
368
+ if (props.configure.props.base.showIndex && tableColumnsConfig2.findIndex((item) => item.props.base.prop === "$index") === -1) {
369
+ const indexColumn = getIndexColumn();
370
+ if (indexColumn) {
371
+ tableColumnsConfig2.unshift(indexColumn);
372
+ }
373
+ }
374
+ }
375
+ function tableDataPageination(resultData) {
376
+ if (props.configure.pageination.type === "frontend") {
377
+ total.value = tmpTableData.length;
378
+ frontendPageination(1, props.configure.pageination.pageSize);
379
+ } else if (props.configure.pageination.type === "backend") {
380
+ tableData.value = tmpTableData;
381
+ if (props.configure.pageination.totalFrom) {
382
+ total.value = resultData.result[props.configure.pageination.totalFrom];
383
+ }
384
+ }
385
+ }
386
+ function pageChange(currentPage, pageSize) {
387
+ if (props.configure.pageination.type === "frontend") {
388
+ frontendPageination(currentPage, pageSize);
389
+ } else {
390
+ backendPageination(currentPage, pageSize);
391
+ }
392
+ }
393
+ function pageSizeChange(currentPage, pageSize) {
394
+ if (props.configure.pageination.type === "frontend") {
395
+ frontendPageination(currentPage, pageSize);
396
+ } else {
397
+ backendPageination(currentPage, pageSize);
398
+ }
399
+ }
400
+ function frontendPageination(currentPage, pageSize) {
401
+ if (tmpTableData) {
402
+ tableData.value = tmpTableData.slice((currentPage - 1) * pageSize, currentPage * pageSize);
403
+ }
404
+ }
405
+ function backendPageination(currentPage, pageSize) {
406
+ if (props.configure.pageination.currentPageSet) {
407
+ setValueForVariableName(
408
+ props.pageContext.entity,
409
+ props.configure.pageination.currentPageSet,
410
+ currentPage
411
+ );
412
+ }
413
+ if (props.configure.pageination.pageSizeSet) {
414
+ setValueForVariableName(
415
+ props.pageContext.entity,
416
+ props.configure.pageination.pageSizeSet,
417
+ pageSize
418
+ );
419
+ }
420
+ updateChartDatasourcesByComponent(props.pageContext, props.configure.uuid);
421
+ }
422
+ function calacShowColumn(column) {
423
+ const showCondition = column.showCondition;
424
+ return caculateShowCondition(props.pageContext, showCondition);
425
+ }
426
+ function resetTableColumns() {
427
+ console.log("重置统计表格列配置");
428
+ if (!props.configure.props.modelCustom) {
429
+ if (!isEnableGroupHeader.value) {
430
+ tableColumnsConfig.value = props.configure.items;
431
+ } else {
432
+ groupColumnsConfig.value = props.configure.props.groupHeaders;
433
+ }
434
+ } else {
435
+ setCustomColumns(null);
436
+ }
437
+ }
438
+ function setCustomColumns(resultData) {
439
+ if (props.configure.props.modelCustom) {
440
+ const func = getCustomFunc(props.pageContext, props.configure.props.modelCustom);
441
+ if (func) {
442
+ const resultValue = func.apply(func, [
443
+ {
444
+ pageContext: props.pageContext,
445
+ configureObj: props.configure,
446
+ value: resultData
447
+ }
448
+ ]);
449
+ if (isPromise(resultValue)) {
450
+ resultValue.then((res) => {
451
+ tableColumnsConfig.value = res.columns;
452
+ });
453
+ } else {
454
+ tableColumnsConfig.value = resultValue.columns;
455
+ }
456
+ }
457
+ }
458
+ }
459
+ function exportChart() {
460
+ let tableColumns = [];
461
+ let columns = [];
462
+ if (!isEnableGroupHeader.value) {
463
+ columns = props.configure.items;
464
+ } else {
465
+ columns = props.configure.props.groupHeaders;
466
+ }
467
+ let formatColumns = [];
468
+ pakcageExportColumn(columns, tableColumns, formatColumns);
469
+ const exportData = formatTableData(formatColumns);
470
+ return {
471
+ isTable: true,
472
+ dataArr: exportData,
473
+ columns: tableColumns
474
+ };
475
+ }
476
+ function pakcageExportColumn(columns, tableColumns, formatColumns) {
477
+ columns.forEach((col) => {
478
+ const propName = col.props.base.prop;
479
+ const label = col.props.base.name;
480
+ const i18nKey = label;
481
+ let tableCol = { name: propName, label, i18nKey };
482
+ if (col.children && col.childern.length > 0) {
483
+ tableCol.children = [];
484
+ pakcageExportColumn(col.children, tableCol.children, formatColumns);
485
+ }
486
+ if (col.props.format && col.props.format.type) {
487
+ formatColumns.push(col);
488
+ }
489
+ tableColumns.push(tableCol);
490
+ });
491
+ }
492
+ function formatTableData(formatColumns) {
493
+ let exportTableData = [];
494
+ if (tableData.value) {
495
+ exportTableData = deepCopy(tableData.value);
496
+ exportTableData.forEach((row) => {
497
+ formatColumns.forEach((col) => {
498
+ const label = formatColContent(
499
+ row,
500
+ col.props.format,
501
+ col,
502
+ props.pageContext,
503
+ props.configure
504
+ );
505
+ row[col.props.base.prop] = label;
506
+ });
507
+ });
508
+ }
509
+ return exportTableData;
510
+ }
511
+ function pushIdnexColumnToGroupHeaders() {
512
+ if (props.configure.props.base.showIndex) {
513
+ groupColumnsConfig.value.unshift({
514
+ columnUuid: "$index",
515
+ displayOrder: 0,
516
+ isLeaf: true,
517
+ prop: "$index",
518
+ titleText: "序号",
519
+ uuid: "$index"
520
+ });
521
+ const indexColumn = getIndexColumn();
522
+ if (indexColumn) {
523
+ columnsConfigKeyValues.value["$index"] = indexColumn;
524
+ }
525
+ }
526
+ }
527
+ __expose({
528
+ updateChartDatas,
529
+ exportChart
198
530
  });
531
+ return (_ctx, _cache) => {
532
+ const _component_el_table = resolveComponent("el-table");
533
+ return openBlock(), createElementBlock("div", {
534
+ style: normalizeStyle([unref(runtimeStyle), { "display": "flex", "flex-direction": "column" }]),
535
+ class: normalizeClass([unref(runtimeClass), "amb-widget-chart amb-widget-flex"]),
536
+ ref: "thisRef"
537
+ }, [
538
+ withDirectives(createVNode(_sfc_main$1, {
539
+ ref_key: "headerRef",
540
+ ref: headerRef,
541
+ headerInfo: unref(headerInfo),
542
+ configure: __props.configure,
543
+ pageContext: __props.pageContext
544
+ }, null, 8, ["headerInfo", "configure", "pageContext"]), [
545
+ [vShow, unref(headerInfo).showHeader || __props.pageContext.showHomepageSearch]
546
+ ]),
547
+ createVNode(_component_el_table, {
548
+ ref_key: "gridRef",
549
+ ref: gridRef,
550
+ data: tableData.value,
551
+ style: { "width": "100%" },
552
+ "max-height": unref(maxHeight),
553
+ "header-cell-style": getHeaderCellStyle,
554
+ "row-style": getRowStyle,
555
+ "cell-style": getCellStyle,
556
+ "show-summary": showSummary.value,
557
+ stripe: __props.configure.props.base.stripe,
558
+ "summary-method": getSummaries,
559
+ "span-method": spanMethod
560
+ }, {
561
+ default: withCtx(() => [
562
+ isEnableGroupHeader.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(groupColumnsConfig.value, (item, index) => {
563
+ return openBlock(), createElementBlock(Fragment, { key: index }, [
564
+ !item.isLeaf ? (openBlock(), createBlock(_sfc_main$2, {
565
+ key: 0,
566
+ configure: __props.configure,
567
+ pageContext: __props.pageContext,
568
+ groupColumn: item,
569
+ columnsConfigKeyValues: columnsConfigKeyValues.value
570
+ }, null, 8, ["configure", "pageContext", "groupColumn", "columnsConfigKeyValues"])) : calacShowColumn(columnsConfigKeyValues.value[item.columnUuid]) ? (openBlock(), createBlock(_sfc_main$3, {
571
+ key: 1,
572
+ configure: __props.configure,
573
+ pageContext: __props.pageContext,
574
+ column: columnsConfigKeyValues.value[item.columnUuid]
575
+ }, null, 8, ["configure", "pageContext", "column"])) : createCommentVNode("", true)
576
+ ], 64);
577
+ }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(tableColumnsConfig.value, (column, index) => {
578
+ return openBlock(), createElementBlock(Fragment, { key: index }, [
579
+ calacShowColumn(column) ? (openBlock(), createBlock(_sfc_main$3, {
580
+ key: 0,
581
+ column,
582
+ configure: __props.configure,
583
+ pageContext: __props.pageContext
584
+ }, null, 8, ["column", "configure", "pageContext"])) : createCommentVNode("", true)
585
+ ], 64);
586
+ }), 128))
587
+ ]),
588
+ _: 1
589
+ }, 8, ["data", "max-height", "show-summary", "stripe"]),
590
+ __props.configure.pageination && __props.configure.pageination.enable ? (openBlock(), createBlock(_sfc_main$4, {
591
+ key: 0,
592
+ configure: __props.configure,
593
+ "table-data": tableData.value,
594
+ total: total.value,
595
+ onPageChange: pageChange,
596
+ onPageSizeChange: pageSizeChange
597
+ }, null, 8, ["configure", "table-data", "total"])) : createCommentVNode("", true)
598
+ ], 6);
599
+ };
199
600
  }
200
- return q2({ updateChartDatas: ye, exportChart: function() {
201
- let e3 = [], o2 = [];
202
- o2 = ee.value ? B.configure.props.groupHeaders : B.configure.items;
203
- let n2 = [];
204
- He(o2, e3, n2);
205
- return { isTable: true, dataArr: function(e4) {
206
- let o3 = [];
207
- oe.value && (o3 = A(oe.value), o3.forEach((o4) => {
208
- e4.forEach((e5) => {
209
- const n3 = V(o4, e5.props.format, e5, B.pageContext, B.configure);
210
- o4[e5.props.base.prop] = n3;
211
- });
212
- }));
213
- return o3;
214
- }(n2), columns: e3 };
215
- } }), (o2, n2) => {
216
- const r2 = t("el-table");
217
- return a(), i("div", { style: p([l(Q), { display: "flex", "flex-direction": "column" }]), class: u([l(W), "amb-widget-chart amb-widget-flex"]), ref: "thisRef" }, [s(c(C, { ref_key: "headerRef", ref: Z, headerInfo: l(Y), configure: e2.configure, pageContext: e2.pageContext }, null, 8, ["headerInfo", "configure", "pageContext"]), [[d, l(Y).showHeader || e2.pageContext.showHomepageSearch]]), c(r2, { ref_key: "gridRef", ref: ge, data: oe.value, style: { width: "100%" }, "max-height": l(me), "header-cell-style": be, "row-style": Oe, "cell-style": we, "show-summary": ie.value, stripe: e2.configure.props.base.stripe, "summary-method": Se, "span-method": je }, { default: m(() => [ee.value ? (a(true), i(h, { key: 0 }, v(re.value, (o3, n3) => (a(), i(h, { key: n3 }, [o3.isLeaf ? Ie(te.value[o3.columnUuid]) ? (a(), g(F, { key: 1, configure: e2.configure, pageContext: e2.pageContext, column: te.value[o3.columnUuid] }, null, 8, ["configure", "pageContext", "column"])) : f("", true) : (a(), g(k, { key: 0, configure: e2.configure, pageContext: e2.pageContext, groupColumn: o3, columnsConfigKeyValues: te.value }, null, 8, ["configure", "pageContext", "groupColumn", "columnsConfigKeyValues"]))], 64))), 128)) : (a(true), i(h, { key: 1 }, v(ne.value, (o3, n3) => (a(), i(h, { key: n3 }, [Ie(o3) ? (a(), g(F, { key: 0, column: o3, configure: e2.configure, pageContext: e2.pageContext }, null, 8, ["column", "configure", "pageContext"])) : f("", true)], 64))), 128))]), _: 1 }, 8, ["data", "max-height", "show-summary", "stripe"]), e2.configure.pageination && e2.configure.pageination.enable ? (a(), g(I, { key: 0, configure: e2.configure, "table-data": oe.value, total: fe.value, onPageChange: Ee, onPageSizeChange: $e }, null, 8, ["configure", "table-data", "total"])) : f("", true)], 6);
218
- };
219
- } });
601
+ });
220
602
  export {
221
- q as default
603
+ _sfc_main as default
222
604
  };