super-page-runtime 2.1.933 → 2.2.3

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 +6 -7
  2. package/dist/es/assets/chart-themes/theme1.js +2 -6
  3. package/dist/es/assets/chart-themes/theme2.js +2 -6
  4. package/dist/es/assets/chart-themes/theme3.js +2 -6
  5. package/dist/es/components/runtime/utils/api/api-util.js +4 -7
  6. package/dist/es/components/runtime/utils/api/page-expose-util.js +137 -433
  7. package/dist/es/components/runtime/utils/assemblys-config.js +12 -366
  8. package/dist/es/components/runtime/utils/barcode-util.js +10 -33
  9. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +138 -300
  10. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +29 -66
  11. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +71 -147
  12. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +52 -122
  13. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +40 -98
  14. package/dist/es/components/runtime/utils/charts/chart-util.js +237 -478
  15. package/dist/es/components/runtime/utils/common-util.js +82 -152
  16. package/dist/es/components/runtime/utils/eventBus.js +3 -9
  17. package/dist/es/components/runtime/utils/events/event-util.js +361 -727
  18. package/dist/es/components/runtime/utils/events/print-label.js +73 -140
  19. package/dist/es/components/runtime/utils/events/standard-event.d.ts +2 -2
  20. package/dist/es/components/runtime/utils/events/standard-event.js +846 -2285
  21. package/dist/es/components/runtime/utils/events/validator-util.js +237 -536
  22. package/dist/es/components/runtime/utils/form/date-shortcuts.js +29 -88
  23. package/dist/es/components/runtime/utils/form/scan-util.js +60 -154
  24. package/dist/es/components/runtime/utils/global-refs.js +45 -69
  25. package/dist/es/components/runtime/utils/i18n-util.js +12 -20
  26. package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +2 -0
  27. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +2 -7
  28. package/dist/es/components/runtime/utils/page-helper-util.js +296 -630
  29. package/dist/es/components/runtime/utils/page-init-util.d.ts +6 -1
  30. package/dist/es/components/runtime/utils/page-init-util.js +137 -368
  31. package/dist/es/components/runtime/utils/page-permission-util.js +24 -531
  32. package/dist/es/components/runtime/utils/page-store.js +8 -12
  33. package/dist/es/components/runtime/utils/store-util.js +9 -13
  34. package/dist/es/components/runtime/utils/store.js +2 -2
  35. package/dist/es/components/runtime/utils/table-utils.js +49 -84
  36. package/dist/es/components/runtime/utils/tree-utils.js +18 -36
  37. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
  38. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +19 -75
  39. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
  40. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +14 -46
  41. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
  42. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +37 -132
  43. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
  44. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +4 -18
  45. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
  46. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +17 -107
  47. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
  48. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +54 -198
  49. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +12 -42
  50. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
  51. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +7 -60
  52. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +48 -169
  54. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
  55. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  56. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +32 -107
  57. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  58. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +43 -164
  59. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  60. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +32 -115
  61. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  62. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +32 -116
  63. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.d.ts +1 -0
  64. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +242 -439
  65. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +4 -42
  66. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +8 -62
  68. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  69. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +37 -231
  70. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  71. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +13 -62
  72. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  73. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  74. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +191 -511
  75. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +29 -139
  76. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  77. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +23 -125
  78. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +16 -102
  80. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  81. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  82. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +18 -81
  83. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  84. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +17 -82
  85. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +14 -86
  87. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  88. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +21 -79
  89. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +16 -61
  91. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +10 -37
  93. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +38 -127
  95. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +28 -76
  97. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  98. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +61 -178
  99. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +310 -800
  100. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  101. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +255 -592
  102. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  103. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +43 -115
  105. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  106. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +56 -215
  107. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +3 -21
  108. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  109. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  110. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +44 -154
  111. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +36 -98
  112. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  113. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +54 -200
  115. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  116. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +69 -239
  117. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +31 -104
  119. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  120. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +22 -59
  121. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +52 -173
  123. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  124. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +22 -103
  125. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  126. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +58 -249
  127. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  128. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +34 -174
  129. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  130. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +28 -107
  131. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +5 -5
  132. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +13 -50
  133. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.js +1 -0
  134. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  135. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +66 -189
  136. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  137. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +91 -243
  138. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  139. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +82 -261
  140. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  141. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +13 -57
  142. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  143. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +30 -155
  144. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  145. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +41 -129
  146. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +22 -107
  148. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +133 -252
  149. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  150. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  151. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +19 -46
  152. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  153. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +22 -49
  154. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  155. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +21 -58
  156. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  157. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +16 -53
  158. package/dist/es/components/runtime/views/super-page-dialog.vue.js +20 -134
  159. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  160. package/dist/es/components/runtime/views/super-page.vue.d.ts +9 -0
  161. package/dist/es/components/runtime/views/super-page.vue.js +235 -708
  162. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  163. package/dist/es/i18n/langs/cn.js +2 -55
  164. package/dist/es/i18n/langs/en.js +2 -55
  165. package/package.json +74 -73
@@ -2,540 +2,343 @@ import { getParamNames, getValueFromVariable } from "../../../../utils/page-help
2
2
  import { getCustomFunc } from "../../../../utils/events/event-util.js";
3
3
  import { getMinValue, getMaxValue, getSumValue, getAvgValue } from "../../../../utils/charts/chart-util.js";
4
4
  class ExpressionEvaluator {
5
- static evaluate(pageContext, conditions, data2) {
6
- const expressions = conditions.map(
7
- (condition) => this.createExpression(pageContext, condition, data2)
8
- );
9
- const joinedExpression = expressions.join(" ");
10
- return this.evaluateExpression(joinedExpression);
5
+ static evaluate(e, t, o) {
6
+ const a = t.map((t2) => this.createExpression(e, t2, o)).join(" ");
7
+ return this.evaluateExpression(a);
11
8
  }
12
- static createExpression(pageContext, condition, data2) {
13
- const { propName, operator, propValue, leftBracket, rightBracket, joinSign, dataType } = condition;
14
- if (!propName || propName === "") {
9
+ static createExpression(e, t, o) {
10
+ const { propName: a, operator: r, propValue: n, leftBracket: s, rightBracket: l, joinSign: i, dataType: c } = t;
11
+ if (!a || "" === a)
15
12
  return "";
16
- }
17
- const value = getValueFromVariable(pageContext.entity, propName, data2);
18
- let expression2 = `${leftBracket} ${this.getComparisonExpression(value, operator, getValueFromVariable(pageContext.entity, propValue, data2), dataType)} ${rightBracket}`;
19
- if (joinSign) {
20
- if (joinSign === "and" || joinSign === "AND") {
21
- expression2 += "&&";
22
- } else if (joinSign === "or" || joinSign === "OR") {
23
- expression2 += "||";
24
- }
25
- }
26
- return expression2.trim();
13
+ const u = getValueFromVariable(e.entity, a, o);
14
+ let p = `${s} ${this.getComparisonExpression(u, r, getValueFromVariable(e.entity, n, o), c)} ${l}`;
15
+ return i && ("and" === i || "AND" === i ? p += "&&" : "or" !== i && "OR" !== i || (p += "||")), p.trim();
27
16
  }
28
- static getComparisonExpression(value, operator, propValue, dataType) {
29
- if (!operator) {
30
- operator = "EQ";
31
- }
32
- const parsedValue = this.parseValue(value, dataType);
33
- const parsedPropValue = this.parseValue(propValue, dataType);
34
- switch (operator) {
17
+ static getComparisonExpression(e, t, o, a) {
18
+ t || (t = "EQ");
19
+ const r = this.parseValue(e, a), n = this.parseValue(o, a);
20
+ switch (t) {
35
21
  case "EQ":
36
- return `${parsedValue} === ${parsedPropValue}`;
22
+ return `${r} === ${n}`;
37
23
  case "GT":
38
- return `${parsedValue} > ${parsedPropValue}`;
24
+ return `${r} > ${n}`;
39
25
  case "LT":
40
- return `${parsedValue} < ${parsedPropValue}`;
26
+ return `${r} < ${n}`;
41
27
  case "GET":
42
- return `${parsedValue} >= ${parsedPropValue}`;
28
+ return `${r} >= ${n}`;
43
29
  case "LET":
44
- return `${parsedValue} <= ${parsedPropValue}`;
30
+ return `${r} <= ${n}`;
45
31
  case "NET":
46
- return `${parsedValue} !== ${parsedPropValue}`;
32
+ return `${r} !== ${n}`;
47
33
  case "CONTAIN":
48
- return `${parsedValue}.includes(${parsedPropValue})`;
34
+ return `${r}.includes(${n})`;
49
35
  case "NOT_CONTAIN":
50
- return `!${parsedValue}.includes(${parsedPropValue})`;
36
+ return `!${r}.includes(${n})`;
51
37
  case "IS_NULL":
52
- return `${parsedValue} === null`;
38
+ return `${r} === null`;
53
39
  case "IS_NOT_NULL":
54
- return `${parsedValue} !== null`;
40
+ return `${r} !== null`;
55
41
  default:
56
- throw new Error(`比较符号不匹配: ${operator}`);
42
+ throw new Error(`比较符号不匹配: ${t}`);
57
43
  }
58
44
  }
59
- static changeDataType(dataType) {
60
- let resultDataType = dataType;
61
- if (dataType) {
62
- if (dataType === "TEXT") {
63
- resultDataType = "string";
64
- } else if (dataType === "DATE" || dataType === "TIME") {
65
- resultDataType = "date";
66
- } else if (dataType === "DOUBLE" || dataType === "FLOAT" || dataType === "INTEGER" || dataType === "LONG" || dataType === "BOOLEAN") {
67
- resultDataType = "number";
68
- }
69
- }
70
- return resultDataType;
45
+ static changeDataType(e) {
46
+ let t = e;
47
+ return e && ("TEXT" === e ? t = "string" : "DATE" === e || "TIME" === e ? t = "date" : "DOUBLE" !== e && "FLOAT" !== e && "INTEGER" !== e && "LONG" !== e && "BOOLEAN" !== e || (t = "number")), t;
71
48
  }
72
- static parseValue(value, dataType) {
73
- dataType = this.changeDataType(dataType);
74
- switch (dataType) {
49
+ static parseValue(e, t) {
50
+ switch (t = this.changeDataType(t)) {
75
51
  case "number":
76
- return Number(value);
52
+ return Number(e);
77
53
  case "date":
78
- return new Date(value).getTime();
54
+ return new Date(e).getTime();
79
55
  case "string":
80
- return `"${value}"`;
56
+ return `"${e}"`;
81
57
  default:
82
- throw new Error(`数据类型解析错误: ${dataType}`);
58
+ throw new Error(`数据类型解析错误: ${t}`);
83
59
  }
84
60
  }
85
61
  static evaluateExpression(expression) {
86
62
  try {
87
63
  return eval(expression);
88
- } catch (error) {
89
- console.error("表达式错误:", expression, error);
64
+ } catch (e) {
90
65
  return false;
91
66
  }
92
67
  }
93
68
  }
94
- function getSummaryTitleColumn(configure) {
69
+ function getSummaryTitleColumn(e) {
95
70
  var _a;
96
- const result = {};
97
- if (((_a = configure.props.summaries) == null ? void 0 : _a.titleColumn) && configure.props.summaries.titleColumn.length > 0) {
98
- configure.props.summaries.titleColumn.forEach((item) => {
99
- result[item.prop] = item;
100
- });
101
- }
102
- return result;
71
+ const t = {};
72
+ return ((_a = e.props.summaries) == null ? void 0 : _a.titleColumn) && e.props.summaries.titleColumn.length > 0 && e.props.summaries.titleColumn.forEach((e2) => {
73
+ t[e2.prop] = e2;
74
+ }), t;
103
75
  }
104
- function getSummaryDataColumn(configure, type) {
76
+ function getSummaryDataColumn(e, t) {
105
77
  var _a;
106
- const result = {};
107
- if (((_a = configure.props.summaries) == null ? void 0 : _a.dataColumn) && configure.props.summaries.dataColumn.length > 0) {
108
- configure.props.summaries.dataColumn.forEach((item) => {
109
- var _a2;
110
- const columnConfigs = (_a2 = configure.items) == null ? void 0 : _a2.find(
111
- (columnItem) => item.prop === columnItem.props.base.prop
112
- );
113
- if (columnConfigs) {
114
- if (type === "table" && columnConfigs.props.base.tableSummary) {
115
- result[item.prop] = item;
116
- } else if (type === "group" && columnConfigs.props.base.groupSummary) {
117
- result[item.prop] = item;
118
- }
119
- }
120
- });
121
- }
122
- return result;
78
+ const o = {};
79
+ return ((_a = e.props.summaries) == null ? void 0 : _a.dataColumn) && e.props.summaries.dataColumn.length > 0 && e.props.summaries.dataColumn.forEach((a) => {
80
+ var _a2;
81
+ const r = (_a2 = e.items) == null ? void 0 : _a2.find((e2) => a.prop === e2.props.base.prop);
82
+ r && ("table" === t && r.props.base.tableSummary || "group" === t && r.props.base.groupSummary) && (o[a.prop] = a);
83
+ }), o;
123
84
  }
124
- function summaryStatistics(summaryColumn, data2, prop, pageContext) {
125
- let sumsIndex = "";
126
- const summaryMode = summaryColumn.summaryMode;
127
- const values = data2.map((item) => Number(item[prop])).filter((value) => !Number.isNaN(value));
128
- if (values.length > 0) {
129
- if (summaryMode === "custom") {
130
- const func = getCustomFunc(pageContext, summaryColumn.customFunc);
131
- if (func) {
132
- const resultValue = func.apply(func, [{ data: data2, prop }]);
133
- if (resultValue) {
134
- sumsIndex = ` ${resultValue}`;
135
- } else {
136
- sumsIndex = " N/A";
137
- }
138
- } else {
139
- sumsIndex = " N/A";
140
- }
141
- } else {
142
- switch (summaryMode) {
85
+ function summaryStatistics(e, t, o, a) {
86
+ let r = "";
87
+ const n = e.summaryMode, s = t.map((e2) => Number(e2[o])).filter((e2) => !Number.isNaN(e2));
88
+ if (s.length > 0)
89
+ if ("custom" === n) {
90
+ const n2 = getCustomFunc(a, e.customFunc);
91
+ if (n2) {
92
+ const e2 = n2.apply(n2, [{ data: t, prop: o }]);
93
+ r = e2 ? ` ${e2}` : " N/A";
94
+ } else
95
+ r = " N/A";
96
+ } else
97
+ switch (n) {
143
98
  case "sum":
144
- sumsIndex = ` ${values.reduce((prev, curr) => prev + curr, 0)}`;
99
+ r = ` ${s.reduce((e2, t2) => e2 + t2, 0)}`;
145
100
  break;
146
101
  case "avg":
147
- sumsIndex = ` ${values.reduce((prev, curr) => prev + curr, 0) / values.length}`;
102
+ r = " " + s.reduce((e2, t2) => e2 + t2, 0) / s.length;
148
103
  break;
149
104
  case "min":
150
- sumsIndex = ` ${Math.min(...values)}`;
105
+ r = ` ${Math.min(...s)}`;
151
106
  break;
152
107
  case "max":
153
- sumsIndex = ` ${Math.max(...values)}`;
108
+ r = ` ${Math.max(...s)}`;
154
109
  break;
155
110
  default:
156
- sumsIndex = " N/A";
111
+ r = " N/A";
157
112
  }
158
- }
159
- } else {
160
- sumsIndex = " N/A";
161
- }
162
- return sumsIndex;
113
+ else
114
+ r = " N/A";
115
+ return r;
163
116
  }
164
- function replacePlaceholders(template, data2) {
165
- if (template) {
166
- return template.replace(/\$\{row\.(\w+)\}/g, (match, p1) => {
167
- return Object.prototype.hasOwnProperty.call(data2, p1) ? data2[p1] : "";
168
- });
169
- }
117
+ function replacePlaceholders(e, t) {
118
+ if (e)
119
+ return e.replace(/\$\{row\.(\w+)\}/g, (e2, o) => Object.prototype.hasOwnProperty.call(t, o) ? t[o] : "");
170
120
  }
171
- function getHeaderCellStyleUtil(data2, runtimeStyle, props) {
121
+ function getHeaderCellStyleUtil(e, t, o) {
172
122
  var _a;
173
- const headerStyle = {};
174
- if (data2.column.property) {
175
- (_a = runtimeStyle.titleStyle) == null ? void 0 : _a.forEach((item) => {
176
- if (item.field && item.field.includes(data2.column.property)) {
177
- if (item.scopeFunc) {
178
- const func = getCustomFunc(props.pageContext, item.scopeFunc);
179
- if (func) {
180
- const funcResult = func.apply(func, [{ item, data: data2 }]);
181
- if (funcResult !== false) {
182
- copyStyle(headerStyle, item);
183
- }
184
- }
185
- } else {
186
- copyStyle(headerStyle, item);
123
+ const a = {};
124
+ e.column.property && ((_a = t.titleStyle) == null ? void 0 : _a.forEach((t2) => {
125
+ if (t2.field && t2.field.includes(e.column.property))
126
+ if (t2.scopeFunc) {
127
+ const r2 = getCustomFunc(o.pageContext, t2.scopeFunc);
128
+ if (r2) {
129
+ false !== r2.apply(r2, [{ item: t2, data: e }]) && copyStyle(a, t2);
187
130
  }
188
- }
189
- });
190
- }
191
- const cellTitleStytle = getCellStyleUtil(data2, runtimeStyle.cellTitleStyle, props);
192
- if (cellTitleStytle) {
193
- Object.assign(headerStyle, cellTitleStytle);
194
- }
195
- return headerStyle;
131
+ } else
132
+ copyStyle(a, t2);
133
+ }));
134
+ const r = getCellStyleUtil(e, t.cellTitleStyle, o);
135
+ return r && Object.assign(a, r), a;
196
136
  }
197
- function getRowStyleUtil(data2, groupSummaryDataRowIndex, props) {
198
- const returnStyle = {};
199
- if (props.configure.style.rowStyle) {
200
- for (let i = 0; i < props.configure.style.rowStyle.length; i++) {
201
- const rowStyle = props.configure.style.rowStyle[i];
202
- if (rowStyle.scopeFunc) {
203
- const func = getCustomFunc(props.pageContext, rowStyle.scopeFunc);
204
- if (func) {
205
- const funcResult = func.apply(func, [{ data: data2 }]);
206
- if (funcResult !== void 0 && funcResult !== null && funcResult !== false) {
207
- copyStyle(returnStyle, rowStyle);
208
- }
137
+ function getRowStyleUtil(e, t, o) {
138
+ const a = {};
139
+ if (o.configure.style.rowStyle)
140
+ for (let t2 = 0; t2 < o.configure.style.rowStyle.length; t2++) {
141
+ const r = o.configure.style.rowStyle[t2];
142
+ if (r.scopeFunc) {
143
+ const t3 = getCustomFunc(o.pageContext, r.scopeFunc);
144
+ if (t3) {
145
+ const o2 = t3.apply(t3, [{ data: e }]);
146
+ null != o2 && false !== o2 && copyStyle(a, r);
209
147
  }
210
- } else if (rowStyle.matchingCondition) {
211
- const result = ExpressionEvaluator.evaluate(
212
- props.pageContext,
213
- rowStyle.matchingCondition,
214
- data2.row
215
- );
216
- if (result || result === void 0) {
217
- copyStyle(returnStyle, rowStyle);
218
- }
219
- } else {
220
- copyStyle(returnStyle, rowStyle);
221
- }
148
+ } else if (r.matchingCondition) {
149
+ const t3 = ExpressionEvaluator.evaluate(o.pageContext, r.matchingCondition, e.row);
150
+ (t3 || void 0 === t3) && copyStyle(a, r);
151
+ } else
152
+ copyStyle(a, r);
222
153
  }
223
- }
224
- if (groupSummaryDataRowIndex && groupSummaryDataRowIndex.length > 0 && groupSummaryDataRowIndex.indexOf(data2.rowIndex) !== -1) {
225
- const result = {};
226
- if (props.configure.style.collectStyle && props.configure.style.collectStyle.length > 0) {
227
- for (let i = 0; i < props.configure.style.collectStyle.length; i++) {
228
- const collectStyle = props.configure.style.collectStyle[i];
229
- copyStyle(result, collectStyle);
154
+ if (t && t.length > 0 && -1 !== t.indexOf(e.rowIndex)) {
155
+ const e2 = {};
156
+ if (o.configure.style.collectStyle && o.configure.style.collectStyle.length > 0)
157
+ for (let t2 = 0; t2 < o.configure.style.collectStyle.length; t2++) {
158
+ copyStyle(e2, o.configure.style.collectStyle[t2]);
230
159
  }
231
- }
232
- if (Object.keys(result).length === 0) {
233
- result["background-color"] = "var(--el-table-row-hover-bg-color)";
234
- }
235
- return result;
160
+ return 0 === Object.keys(e2).length && (e2["background-color"] = "var(--el-table-row-hover-bg-color)"), e2;
236
161
  }
237
- return returnStyle;
162
+ return a;
238
163
  }
239
- function getCellStyleUtil(data2, cellStyles, props) {
240
- const cellStyle = {};
241
- if (cellStyles) {
242
- for (let i = 0; i < cellStyles.length; i++) {
243
- const columnsStyleSetting = cellStyles[i];
244
- if (isSetStyle(columnsStyleSetting)) {
245
- if (columnsStyleSetting.scopeFunc) {
246
- const func = getCustomFunc(props.pageContext, columnsStyleSetting.scopeFunc);
247
- if (func) {
248
- const funcResult = func.apply(func, [{ data: data2 }]);
249
- if (funcResult !== false) {
250
- copyStyle(cellStyle, columnsStyleSetting);
251
- }
252
- }
253
- } else if (columnsStyleSetting.matchingCondition) {
254
- const result = ExpressionEvaluator.evaluate(
255
- props.pageContext,
256
- columnsStyleSetting.matchingCondition,
257
- data2.row
258
- );
259
- if (result || result === void 0) {
260
- copyStyle(cellStyle, columnsStyleSetting);
164
+ function getCellStyleUtil(e, t, o) {
165
+ const a = {};
166
+ if (t)
167
+ for (let r = 0; r < t.length; r++) {
168
+ const n = t[r];
169
+ if (isSetStyle(n))
170
+ if (n.scopeFunc) {
171
+ const t2 = getCustomFunc(o.pageContext, n.scopeFunc);
172
+ if (t2) {
173
+ false !== t2.apply(t2, [{ data: e }]) && copyStyle(a, n);
261
174
  }
262
- } else {
263
- copyStyle(cellStyle, columnsStyleSetting);
264
- }
265
- }
175
+ } else if (n.matchingCondition) {
176
+ const t2 = ExpressionEvaluator.evaluate(o.pageContext, n.matchingCondition, e.row);
177
+ (t2 || void 0 === t2) && copyStyle(a, n);
178
+ } else
179
+ copyStyle(a, n);
266
180
  }
267
- }
268
- return cellStyle;
181
+ return a;
269
182
  }
270
- function isSetStyle(columnsStyleSetting) {
271
- let customStyle;
272
- if (columnsStyleSetting.customStyle) {
273
- customStyle = JSON.parse(columnsStyleSetting.customStyle);
274
- }
275
- if (columnsStyleSetting.style && Object.keys(columnsStyleSetting.style).length > 0 || customStyle && Object.keys(customStyle).length > 0) {
276
- return true;
277
- }
278
- return false;
183
+ function isSetStyle(e) {
184
+ let t;
185
+ return e.customStyle && (t = JSON.parse(e.customStyle)), !!(e.style && Object.keys(e.style).length > 0 || t && Object.keys(t).length > 0);
279
186
  }
280
- function copyStyle(target, source) {
281
- Object.assign(target, source.style);
282
- if (source.customStyle) {
283
- Object.assign(target, JSON.parse(source.customStyle));
284
- }
187
+ function copyStyle(e, t) {
188
+ Object.assign(e, t.style), t.customStyle && Object.assign(e, JSON.parse(t.customStyle));
285
189
  }
286
- function rowDataToColumn(data2, configure) {
287
- const groupByFields = configure.props.dataOrigin.groupField;
288
- const titleColumns = configure.props.dataOrigin.rowToColumn.titleColumns;
289
- const dataColumns = configure.props.dataOrigin.rowToColumn.dataColumns;
290
- const result = [];
291
- const groupedData = {};
292
- data2.forEach((item) => {
293
- const key2 = groupByFields.map((field) => item[field]).join("|");
294
- if (!groupedData[key2]) {
295
- const group = {};
296
- groupByFields.forEach((field) => group[field] = item[field]);
297
- groupedData[key2] = group;
298
- result.push(group);
190
+ function rowDataToColumn(e, t) {
191
+ const o = t.props.dataOrigin.groupField, a = t.props.dataOrigin.rowToColumn.titleColumns, r = t.props.dataOrigin.rowToColumn.dataColumns, n = [], s = {};
192
+ return e.forEach((e2) => {
193
+ const t2 = o.map((t3) => e2[t3]).join("|");
194
+ if (!s[t2]) {
195
+ const a2 = {};
196
+ o.forEach((t3) => a2[t3] = e2[t3]), s[t2] = a2, n.push(a2);
299
197
  }
300
- dataColumns.forEach((valueField) => {
301
- const columnNameParts = titleColumns.map((field) => item[field]);
302
- const columnName = `${columnNameParts.join("")}${valueField}`;
303
- groupedData[key2][columnName] = item[valueField];
198
+ r.forEach((o2) => {
199
+ const r2 = `${a.map((t3) => e2[t3]).join("")}${o2}`;
200
+ s[t2][r2] = e2[o2];
304
201
  });
305
- });
306
- return result;
202
+ }), n;
307
203
  }
308
- function colDataToRow(data2, configure) {
309
- const groupByFields = configure.props.dataOrigin.groupField;
310
- const titleColumns = configure.props.dataOrigin.columnToRow.titleColumns;
311
- const dataColumns = configure.props.dataOrigin.columnToRow.dataColumns;
312
- const transColumns = configure.props.dataOrigin.columnToRow.transColumns;
313
- const dataColumnsMapping = configure.props.dataOrigin.columnToRow.dataColumnsMapping;
314
- if (data2.length === 0) {
315
- return data2;
316
- }
317
- const result = [];
318
- const newData = groupBy(data2, groupByFields);
319
- const dataColumnsConfig = dataColumns.reduce((max, current) => {
320
- return current.columns.length > max.columns.length ? current : max;
321
- }, dataColumns[0]);
322
- const dataColumnsAndNewColumnMapping = dataColumns.reduce((acc, item) => {
323
- item.columns.forEach((column) => {
324
- acc[column] = item.prop;
325
- });
326
- return acc;
327
- }, {});
328
- newData.forEach((item) => {
329
- dataColumnsConfig.columns.forEach((col) => {
330
- const newColumnsProp = dataColumnsConfig.prop;
331
- const dataRow = {};
332
- groupByFields.forEach((field) => {
333
- dataRow[field] = item[field];
334
- });
335
- dataRow[newColumnsProp] = item[col];
336
- if (dataColumns.length > 1) {
337
- const columnMapping = dataColumnsMapping.find((item2) => item2.props.includes(col));
338
- if (columnMapping && columnMapping.props.length > 1) {
339
- columnMapping.props.forEach((prop) => {
340
- if (prop !== col && dataColumnsAndNewColumnMapping[prop]) {
341
- dataRow[dataColumnsAndNewColumnMapping[prop]] = item[prop];
342
- }
343
- });
344
- }
204
+ function colDataToRow(e, t) {
205
+ const o = t.props.dataOrigin.groupField, a = t.props.dataOrigin.columnToRow.titleColumns, r = t.props.dataOrigin.columnToRow.dataColumns, n = t.props.dataOrigin.columnToRow.transColumns, s = t.props.dataOrigin.columnToRow.dataColumnsMapping;
206
+ if (0 === e.length)
207
+ return e;
208
+ const l = [], i = groupBy(e, o), c = r.reduce((e2, t2) => t2.columns.length > e2.columns.length ? t2 : e2, r[0]), u = r.reduce((e2, t2) => (t2.columns.forEach((o2) => {
209
+ e2[o2] = t2.prop;
210
+ }), e2), {});
211
+ return i.forEach((e2) => {
212
+ c.columns.forEach((t2) => {
213
+ const i2 = c.prop, p = {};
214
+ if (o.forEach((t3) => {
215
+ p[t3] = e2[t3];
216
+ }), p[i2] = e2[t2], r.length > 1) {
217
+ const o2 = s.find((e3) => e3.props.includes(t2));
218
+ o2 && o2.props.length > 1 && o2.props.forEach((o3) => {
219
+ o3 !== t2 && u[o3] && (p[u[o3]] = e2[o3]);
220
+ });
345
221
  }
346
- titleColumns.forEach((titleCol) => {
347
- const sourceTitleRenameConfigs = transColumns.filter(
348
- (transCol) => transCol.relatedTitle === titleCol.prop
349
- );
350
- let rename = false;
351
- if (sourceTitleRenameConfigs && sourceTitleRenameConfigs.length > 0) {
352
- sourceTitleRenameConfigs.forEach((item2) => {
353
- if (item2.columns.includes(col)) {
354
- dataRow[titleCol.prop] = item2.label;
355
- rename = true;
356
- return;
357
- }
358
- });
359
- }
360
- if (!rename) {
361
- dataRow[titleCol.prop] = col;
362
- }
363
- });
364
- result.push(dataRow);
222
+ a.forEach((e3) => {
223
+ const o2 = n.filter((t3) => t3.relatedTitle === e3.prop);
224
+ let a2 = false;
225
+ o2 && o2.length > 0 && o2.forEach((o3) => {
226
+ if (o3.columns.includes(t2))
227
+ return p[e3.prop] = o3.label, void (a2 = true);
228
+ }), a2 || (p[e3.prop] = t2);
229
+ }), l.push(p);
365
230
  });
366
- });
367
- return result;
231
+ }), l;
368
232
  }
369
- function getColumnToRowTableConfig(configure) {
370
- const sourceConfig = configure.items;
371
- const groupField = configure.props.dataOrigin.groupField;
372
- const titleColumns = configure.props.dataOrigin.columnToRow.titleColumns;
373
- const dataColumns = configure.props.dataOrigin.columnToRow.dataColumns;
374
- const newTableColumns = [];
375
- groupField.forEach((field) => {
376
- if (sourceConfig) {
377
- const column = sourceConfig.find((item) => item.props.base.prop === field);
378
- if (column) {
379
- newTableColumns.push(column);
380
- }
233
+ function getColumnToRowTableConfig(e) {
234
+ const t = e.items, o = e.props.dataOrigin.groupField, a = e.props.dataOrigin.columnToRow.titleColumns, r = e.props.dataOrigin.columnToRow.dataColumns, n = [];
235
+ o.forEach((e2) => {
236
+ if (t) {
237
+ const o2 = t.find((t2) => t2.props.base.prop === e2);
238
+ o2 && n.push(o2);
381
239
  }
382
240
  });
383
- const newCols = [...titleColumns, ...dataColumns];
384
- newCols.forEach((field) => {
385
- if (sourceConfig) {
386
- const column = sourceConfig.find((item) => item.props.base.prop === field);
387
- if (column) {
388
- newTableColumns.push(column);
389
- } else {
390
- newTableColumns.push({
391
- uuid: (/* @__PURE__ */ new Date()).getTime(),
392
- // 生成新的UUID
393
- name: "",
394
- props: {
395
- base: {
396
- prop: field.prop,
397
- name: field.title,
398
- sortable: true,
399
- headerAlign: "center",
400
- align: "center",
401
- fixed: false,
402
- visible: true,
403
- dataType: "string"
404
- },
405
- format: {},
406
- size: {
407
- pc: {}
408
- }
409
- },
410
- style: {},
411
- componentIndex: 0,
412
- // 根据实际情况设置
413
- runtime: {
414
- common: {
415
- class: "",
416
- style: {
417
- pc_style: {},
418
- pc_class: ""
419
- }
420
- }
421
- }
422
- });
423
- }
241
+ return [...a, ...r].forEach((e2) => {
242
+ if (t) {
243
+ const o2 = t.find((t2) => t2.props.base.prop === e2);
244
+ o2 ? n.push(o2) : n.push({ uuid: (/* @__PURE__ */ new Date()).getTime(), name: "", props: { base: { prop: e2.prop, name: e2.title, sortable: true, headerAlign: "center", align: "center", fixed: false, visible: true, dataType: "string" }, format: {}, size: { pc: {} } }, style: {}, componentIndex: 0, runtime: { common: { class: "", style: { pc_style: {}, pc_class: "" } } } });
424
245
  }
425
- });
426
- return newTableColumns;
246
+ }), n;
427
247
  }
428
- function groupBy(data2, groupFields) {
429
- const grouped = {};
430
- data2.forEach((item) => {
431
- const key2 = groupFields.map((field) => item[field]).join("|");
432
- if (!grouped[key2]) {
433
- grouped[key2] = {
434
- ...item,
435
- // 复制所有字段
436
- records: []
437
- // 初始化记录数组
438
- };
439
- groupFields.forEach((field, index2) => {
440
- grouped[key2][field] = item[field];
441
- });
442
- }
443
- grouped[key2].records.push(item);
444
- });
445
- return Object.values(grouped).map((group) => ({
446
- ...group,
447
- // 复制所有分组信息
448
- records: void 0
449
- // 移除records字段,因为不需要展示
450
- }));
248
+ function groupBy(e, t) {
249
+ const o = {};
250
+ return e.forEach((e2) => {
251
+ const a = t.map((t2) => e2[t2]).join("|");
252
+ o[a] || (o[a] = { ...e2, records: [] }, t.forEach((t2, r) => {
253
+ o[a][t2] = e2[t2];
254
+ })), o[a].records.push(e2);
255
+ }), Object.values(o).map((e2) => ({ ...e2, records: void 0 }));
451
256
  }
452
257
  function getIndexColumn() {
453
- return {
454
- props: {
455
- base: {
456
- name: "序号",
457
- prop: "$index",
458
- columnWidth: 80,
459
- sortable: true,
460
- visible: true,
461
- displayOrder: 1,
462
- alignTitle: "center",
463
- alignContent: "center"
464
- }
465
- },
466
- events: [],
467
- style: {
468
- titleFont: {},
469
- contentFont: {},
470
- width: {},
471
- background: {},
472
- tableCell: [{ type: "", model: "" }],
473
- conentPadding: {},
474
- tittlePadding: {},
475
- border: {},
476
- shadow: {},
477
- tittleClass: ""
478
- }
479
- };
258
+ return { props: { base: { name: "序号", prop: "$index", columnWidth: 80, sortable: true, visible: true, displayOrder: 1, alignTitle: "center", alignContent: "center" } }, events: [], style: { titleFont: {}, contentFont: {}, width: {}, background: {}, tableCell: [{ type: "", model: "" }], conentPadding: {}, tittlePadding: {}, border: {}, shadow: {}, tittleClass: "" } };
480
259
  }
481
260
  function computeFormula(itemConfs, datas, entity) {
482
261
  Object.keys(itemConfs).forEach((key) => {
483
262
  const paramNames = getParamNames(itemConfs[key]);
484
263
  datas.forEach((data, index) => {
485
264
  const totalValueMap = {};
486
- for (const paramName of paramNames) {
487
- if (paramName.startsWith("${min.")) {
488
- totalValueMap[paramName] = getMinValue(datas, getFieldName(paramName));
489
- } else if (paramName.startsWith("${max.")) {
490
- totalValueMap[paramName] = getMaxValue(datas, getFieldName(paramName));
491
- } else if (paramName.startsWith("${sum.")) {
492
- totalValueMap[paramName] = getSumValue(datas, getFieldName(paramName));
493
- } else if (paramName.startsWith("${avg.")) {
494
- totalValueMap[paramName] = getAvgValue(datas, getFieldName(paramName));
495
- } else if (paramName.startsWith("${add.")) {
496
- const fieldName = getFieldName(paramName);
497
- let currentRowValue = 0;
265
+ for (const e of paramNames)
266
+ if (e.startsWith("${min."))
267
+ totalValueMap[e] = getMinValue(datas, getFieldName(e));
268
+ else if (e.startsWith("${max."))
269
+ totalValueMap[e] = getMaxValue(datas, getFieldName(e));
270
+ else if (e.startsWith("${sum."))
271
+ totalValueMap[e] = getSumValue(datas, getFieldName(e));
272
+ else if (e.startsWith("${avg."))
273
+ totalValueMap[e] = getAvgValue(datas, getFieldName(e));
274
+ else if (e.startsWith("${add.")) {
275
+ const t = getFieldName(e);
276
+ let o = 0;
498
277
  try {
499
- currentRowValue = Number(data[fieldName]);
500
- datas.slice(0, index).forEach((item) => {
501
- currentRowValue += Number(item[fieldName]);
278
+ o = Number(data[t]), datas.slice(0, index).forEach((e2) => {
279
+ o += Number(e2[t]);
502
280
  });
503
- } catch (e) {
504
- console.error("计算错误:", e);
505
- currentRowValue = 0;
281
+ } catch (e2) {
282
+ o = 0;
506
283
  }
507
- totalValueMap[paramName] = currentRowValue;
508
- } else if (paramName.startsWith("${page.") || paramName.startsWith("${data.") || paramName.startsWith("${row.") || paramName.startsWith("${request.") || paramName.startsWith("${context.") || paramName.startsWith("${system.") || paramName.startsWith("${fixed.")) {
509
- totalValueMap[paramName] = getValueFromVariable(entity, paramName, data);
510
- }
511
- }
284
+ totalValueMap[e] = o;
285
+ } else
286
+ (e.startsWith("${page.") || e.startsWith("${data.") || e.startsWith("${row.") || e.startsWith("${request.") || e.startsWith("${context.") || e.startsWith("${system.") || e.startsWith("${fixed.")) && (totalValueMap[e] = getValueFromVariable(entity, e, data));
512
287
  let expr = itemConfs[key];
513
- Object.keys(totalValueMap).forEach((exprParam) => {
514
- if (expr.indexOf(exprParam) > -1) {
515
- expr = expr.replaceAll(exprParam, totalValueMap[exprParam]);
516
- }
288
+ Object.keys(totalValueMap).forEach((e) => {
289
+ expr.indexOf(e) > -1 && (expr = expr.replaceAll(e, totalValueMap[e]));
517
290
  });
518
- for (const paramName of paramNames) {
519
- if (expr.indexOf(paramName) > -1) {
520
- expr = expr.replaceAll(paramName, 0);
521
- }
522
- }
291
+ for (const e of paramNames)
292
+ expr.indexOf(e) > -1 && (expr = expr.replaceAll(e, 0));
523
293
  try {
524
294
  data[key] = eval(expr);
525
295
  } catch (e) {
526
- console.error(itemConfs[key] + " 计算错误, 替换后表达式为:" + expr, e);
527
296
  data[key] = 0;
528
297
  }
529
298
  });
530
299
  });
531
300
  }
532
- function getFieldName(paramName) {
533
- return paramName.substring(6, paramName.length - 1);
301
+ function getFieldName(e) {
302
+ return e.substring(6, e.length - 1);
303
+ }
304
+ function formatColContent(e, t, o, a, r) {
305
+ const n = e[o.props.base.prop];
306
+ switch (t.type) {
307
+ case "number":
308
+ return formatNumber(n, t);
309
+ case "currency":
310
+ return formatCurrency(n, t);
311
+ case "percent":
312
+ return formatPercent(n, t);
313
+ case "custom":
314
+ return formatCustomFunc(e, t, o, a, r);
315
+ default:
316
+ return n;
317
+ }
318
+ }
319
+ function formatNumber(e, t) {
320
+ let o = e;
321
+ return o || (o = 0), t.scientific && (o = Number(e).toExponential(t.scientificNum)), t.decimalDigit && (o = Number(e).toFixed(t.decimalDigit)), t.thousandsSeparator && (o = o.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")), t.symbol && (o = `${t.symbol} ${o}`), o;
322
+ }
323
+ function formatCurrency(e, t) {
324
+ let o = e;
325
+ return o || (o = 0), t.decimalDigit && (o = Number(e).toFixed(t.decimalDigit)), t.symbol && (o = `${t.symbol} ${o}`), o;
326
+ }
327
+ function formatPercent(e, t) {
328
+ let o = e;
329
+ return o || (o = 0), t.decimalDigit && (o = Number(e).toFixed(t.decimalDigit)), o + " %";
330
+ }
331
+ function formatCustomFunc(e, t, o, a, r) {
332
+ const n = getCustomFunc(a, t.customFunc);
333
+ if (n) {
334
+ return n.apply(n, [{ pageContext: a, configureObj: r, row: e, prop: o.props.base.prop }]);
335
+ }
534
336
  }
535
337
  export {
536
338
  ExpressionEvaluator,
537
339
  colDataToRow,
538
340
  computeFormula,
341
+ formatColContent,
539
342
  getCellStyleUtil,
540
343
  getColumnToRowTableConfig,
541
344
  getHeaderCellStyleUtil,