super-page-runtime 2.1.92 → 2.1.95

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 (159) 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 -303
  10. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +29 -66
  11. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +71 -147
  12. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +52 -122
  13. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +40 -98
  14. package/dist/es/components/runtime/utils/charts/chart-util.js +237 -478
  15. package/dist/es/components/runtime/utils/common-util.js +82 -152
  16. package/dist/es/components/runtime/utils/eventBus.js +3 -9
  17. package/dist/es/components/runtime/utils/events/event-util.js +361 -727
  18. package/dist/es/components/runtime/utils/events/print-label.js +73 -140
  19. package/dist/es/components/runtime/utils/events/standard-event.js +835 -2283
  20. package/dist/es/components/runtime/utils/events/validator-util.js +236 -555
  21. package/dist/es/components/runtime/utils/form/date-shortcuts.js +29 -88
  22. package/dist/es/components/runtime/utils/form/scan-util.js +60 -154
  23. package/dist/es/components/runtime/utils/global-refs.js +45 -69
  24. package/dist/es/components/runtime/utils/i18n-util.js +12 -20
  25. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +2 -7
  26. package/dist/es/components/runtime/utils/page-helper-util.js +295 -603
  27. package/dist/es/components/runtime/utils/page-init-util.js +134 -369
  28. package/dist/es/components/runtime/utils/page-permission-util.js +24 -531
  29. package/dist/es/components/runtime/utils/page-store.js +8 -12
  30. package/dist/es/components/runtime/utils/store-util.js +9 -13
  31. package/dist/es/components/runtime/utils/store.js +2 -2
  32. package/dist/es/components/runtime/utils/table-utils.js +49 -84
  33. package/dist/es/components/runtime/utils/tree-utils.js +18 -36
  34. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
  35. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +19 -75
  36. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
  37. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +14 -46
  38. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
  39. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +37 -132
  40. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
  41. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +4 -18
  42. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
  43. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +17 -107
  44. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
  45. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +54 -198
  46. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +12 -42
  47. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
  48. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +7 -60
  49. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
  50. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +48 -169
  51. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
  52. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  53. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +32 -107
  54. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  55. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +43 -164
  56. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  57. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +32 -115
  58. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  59. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +32 -116
  60. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +208 -439
  61. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +4 -42
  62. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  63. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +8 -62
  64. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  65. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +63 -226
  66. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +13 -62
  68. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  69. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  70. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +168 -513
  71. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +29 -139
  72. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  73. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +23 -125
  74. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  75. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +16 -102
  76. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  77. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  78. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +18 -81
  79. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  80. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +17 -82
  81. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  82. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +14 -86
  83. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  84. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +21 -79
  85. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +16 -61
  87. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  88. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +10 -37
  89. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +38 -127
  91. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +28 -76
  93. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +61 -178
  95. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +311 -800
  96. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  97. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +251 -592
  98. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  99. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  100. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +43 -115
  101. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  102. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +56 -216
  103. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +3 -21
  104. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  105. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  106. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +44 -154
  107. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +36 -98
  108. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  109. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  110. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +54 -200
  111. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  112. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +69 -239
  113. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +28 -98
  115. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  116. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +22 -59
  117. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +52 -173
  119. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  120. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +22 -103
  121. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +58 -249
  123. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  124. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +34 -174
  125. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  126. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +28 -107
  127. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
  128. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +13 -50
  129. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  130. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +66 -189
  131. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  132. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +91 -243
  133. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  134. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +82 -261
  135. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  136. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +13 -57
  137. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  138. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +30 -155
  139. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  140. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +41 -129
  141. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  142. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +22 -107
  143. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +133 -252
  144. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  145. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  146. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +19 -46
  147. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  148. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +22 -49
  149. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  150. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +21 -58
  151. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  152. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +16 -53
  153. package/dist/es/components/runtime/views/super-page-dialog.vue.js +18 -134
  154. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  155. package/dist/es/components/runtime/views/super-page.vue.js +232 -708
  156. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  157. package/dist/es/i18n/langs/cn.js +2 -55
  158. package/dist/es/i18n/langs/en.js +2 -55
  159. package/package.json +74 -73
@@ -2,535 +2,304 @@ 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, a) {
6
+ const o = t.map((t2) => this.createExpression(e, t2, a)).join(" ");
7
+ return this.evaluateExpression(o);
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, a) {
10
+ const { propName: o, operator: r, propValue: s, leftBracket: n, rightBracket: l, joinSign: i, dataType: c } = t;
11
+ if (!o || "" === o)
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, o, a);
14
+ let p = `${n} ${this.getComparisonExpression(u, r, getValueFromVariable(e.entity, s, a), 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, a, o) {
18
+ t || (t = "EQ");
19
+ const r = this.parseValue(e, o), s = this.parseValue(a, o);
20
+ switch (t) {
35
21
  case "EQ":
36
- return `${parsedValue} === ${parsedPropValue}`;
22
+ return `${r} === ${s}`;
37
23
  case "GT":
38
- return `${parsedValue} > ${parsedPropValue}`;
24
+ return `${r} > ${s}`;
39
25
  case "LT":
40
- return `${parsedValue} < ${parsedPropValue}`;
26
+ return `${r} < ${s}`;
41
27
  case "GET":
42
- return `${parsedValue} >= ${parsedPropValue}`;
28
+ return `${r} >= ${s}`;
43
29
  case "LET":
44
- return `${parsedValue} <= ${parsedPropValue}`;
30
+ return `${r} <= ${s}`;
45
31
  case "NET":
46
- return `${parsedValue} !== ${parsedPropValue}`;
32
+ return `${r} !== ${s}`;
47
33
  case "CONTAIN":
48
- return `${parsedValue}.includes(${parsedPropValue})`;
34
+ return `${r}.includes(${s})`;
49
35
  case "NOT_CONTAIN":
50
- return `!${parsedValue}.includes(${parsedPropValue})`;
36
+ return `!${r}.includes(${s})`;
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 a = {};
79
+ return ((_a = e.props.summaries) == null ? void 0 : _a.dataColumn) && e.props.summaries.dataColumn.length > 0 && e.props.summaries.dataColumn.forEach((o) => {
80
+ var _a2;
81
+ const r = (_a2 = e.items) == null ? void 0 : _a2.find((e2) => o.prop === e2.props.base.prop);
82
+ r && ("table" === t && r.props.base.tableSummary || "group" === t && r.props.base.groupSummary) && (a[o.prop] = o);
83
+ }), a;
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, a, o) {
86
+ let r = "";
87
+ const s = e.summaryMode, n = t.map((e2) => Number(e2[a])).filter((e2) => !Number.isNaN(e2));
88
+ if (n.length > 0)
89
+ if ("custom" === s) {
90
+ const s2 = getCustomFunc(o, e.customFunc);
91
+ if (s2) {
92
+ const e2 = s2.apply(s2, [{ data: t, prop: a }]);
93
+ r = e2 ? ` ${e2}` : " N/A";
94
+ } else
95
+ r = " N/A";
96
+ } else
97
+ switch (s) {
143
98
  case "sum":
144
- sumsIndex = ` ${values.reduce((prev, curr) => prev + curr, 0)}`;
99
+ r = ` ${n.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 = " " + n.reduce((e2, t2) => e2 + t2, 0) / n.length;
148
103
  break;
149
104
  case "min":
150
- sumsIndex = ` ${Math.min(...values)}`;
105
+ r = ` ${Math.min(...n)}`;
151
106
  break;
152
107
  case "max":
153
- sumsIndex = ` ${Math.max(...values)}`;
108
+ r = ` ${Math.max(...n)}`;
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, a) => Object.prototype.hasOwnProperty.call(t, a) ? t[a] : "");
170
120
  }
171
- function getHeaderCellStyleUtil(data2, runtimeStyle, props) {
121
+ function getHeaderCellStyleUtil(e, t, a) {
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 o = {};
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(a.pageContext, t2.scopeFunc);
128
+ if (r2) {
129
+ false !== r2.apply(r2, [{ item: t2, data: e }]) && copyStyle(o, 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(o, t2);
133
+ }));
134
+ const r = getCellStyleUtil(e, t.cellTitleStyle, a);
135
+ return r && Object.assign(o, r), o;
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
- }
209
- }
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);
137
+ function getRowStyleUtil(e, t, a) {
138
+ const o = {};
139
+ if (a.configure.style.rowStyle)
140
+ for (let t2 = 0; t2 < a.configure.style.rowStyle.length; t2++) {
141
+ const r = a.configure.style.rowStyle[t2];
142
+ if (r.scopeFunc) {
143
+ const t3 = getCustomFunc(a.pageContext, r.scopeFunc);
144
+ if (t3) {
145
+ const a2 = t3.apply(t3, [{ data: e }]);
146
+ null != a2 && false !== a2 && copyStyle(o, r);
218
147
  }
219
- } else {
220
- copyStyle(returnStyle, rowStyle);
221
- }
148
+ } else if (r.matchingCondition) {
149
+ const t3 = ExpressionEvaluator.evaluate(a.pageContext, r.matchingCondition, e.row);
150
+ (t3 || void 0 === t3) && copyStyle(o, r);
151
+ } else
152
+ copyStyle(o, 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 (a.configure.style.collectStyle && a.configure.style.collectStyle.length > 0)
157
+ for (let t2 = 0; t2 < a.configure.style.collectStyle.length; t2++) {
158
+ copyStyle(e2, a.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 o;
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
- }
164
+ function getCellStyleUtil(e, t, a) {
165
+ const o = {};
166
+ if (t)
167
+ for (let r = 0; r < t.length; r++) {
168
+ const s = t[r];
169
+ if (isSetStyle(s))
170
+ if (s.scopeFunc) {
171
+ const t2 = getCustomFunc(a.pageContext, s.scopeFunc);
172
+ if (t2) {
173
+ false !== t2.apply(t2, [{ data: e }]) && copyStyle(o, s);
252
174
  }
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);
261
- }
262
- } else {
263
- copyStyle(cellStyle, columnsStyleSetting);
264
- }
265
- }
175
+ } else if (s.matchingCondition) {
176
+ const t2 = ExpressionEvaluator.evaluate(a.pageContext, s.matchingCondition, e.row);
177
+ (t2 || void 0 === t2) && copyStyle(o, s);
178
+ } else
179
+ copyStyle(o, s);
266
180
  }
267
- }
268
- return cellStyle;
181
+ return o;
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 a = t.props.dataOrigin.groupField, o = t.props.dataOrigin.rowToColumn.titleColumns, r = t.props.dataOrigin.rowToColumn.dataColumns, s = [], n = {};
192
+ return e.forEach((e2) => {
193
+ const t2 = a.map((t3) => e2[t3]).join("|");
194
+ if (!n[t2]) {
195
+ const o2 = {};
196
+ a.forEach((t3) => o2[t3] = e2[t3]), n[t2] = o2, s.push(o2);
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((a2) => {
199
+ const r2 = `${o.map((t3) => e2[t3]).join("")}${a2}`;
200
+ n[t2][r2] = e2[a2];
304
201
  });
305
- });
306
- return result;
202
+ }), s;
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 a = t.props.dataOrigin.groupField, o = t.props.dataOrigin.columnToRow.titleColumns, r = t.props.dataOrigin.columnToRow.dataColumns, s = t.props.dataOrigin.columnToRow.transColumns, n = t.props.dataOrigin.columnToRow.dataColumnsMapping;
206
+ if (0 === e.length)
207
+ return e;
208
+ const l = [], i = groupBy(e, a), c = r.reduce((e2, t2) => t2.columns.length > e2.columns.length ? t2 : e2, r[0]), u = r.reduce((e2, t2) => (t2.columns.forEach((a2) => {
209
+ e2[a2] = t2.prop;
210
+ }), e2), {});
211
+ return i.forEach((e2) => {
212
+ c.columns.forEach((t2) => {
213
+ const i2 = c.prop, p = {};
214
+ if (a.forEach((t3) => {
215
+ p[t3] = e2[t3];
216
+ }), p[i2] = e2[t2], r.length > 1) {
217
+ const a2 = n.find((e3) => e3.props.includes(t2));
218
+ a2 && a2.props.length > 1 && a2.props.forEach((a3) => {
219
+ a3 !== t2 && u[a3] && (p[u[a3]] = e2[a3]);
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
+ o.forEach((e3) => {
223
+ const a2 = s.filter((t3) => t3.relatedTitle === e3.prop);
224
+ let o2 = false;
225
+ a2 && a2.length > 0 && a2.forEach((a3) => {
226
+ if (a3.columns.includes(t2))
227
+ return p[e3.prop] = a3.label, void (o2 = true);
228
+ }), o2 || (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, a = e.props.dataOrigin.groupField, o = e.props.dataOrigin.columnToRow.titleColumns, r = e.props.dataOrigin.columnToRow.dataColumns, s = [];
235
+ a.forEach((e2) => {
236
+ if (t) {
237
+ const a2 = t.find((t2) => t2.props.base.prop === e2);
238
+ a2 && s.push(a2);
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 [...o, ...r].forEach((e2) => {
242
+ if (t) {
243
+ const a2 = t.find((t2) => t2.props.base.prop === e2);
244
+ a2 ? s.push(a2) : s.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
+ }), s;
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 a = {};
250
+ return e.forEach((e2) => {
251
+ const o = t.map((t2) => e2[t2]).join("|");
252
+ a[o] || (a[o] = { ...e2, records: [] }, t.forEach((t2, r) => {
253
+ a[o][t2] = e2[t2];
254
+ })), a[o].records.push(e2);
255
+ }), Object.values(a).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 a = 0;
498
277
  try {
499
- currentRowValue = Number(data[fieldName]);
500
- datas.slice(0, index).forEach((item) => {
501
- currentRowValue += Number(item[fieldName]);
278
+ a = Number(data[t]), datas.slice(0, index).forEach((e2) => {
279
+ a += Number(e2[t]);
502
280
  });
503
- } catch (e) {
504
- console.error("计算错误:", e);
505
- currentRowValue = 0;
281
+ } catch (e2) {
282
+ a = 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] = a;
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);
534
303
  }
535
304
  export {
536
305
  ExpressionEvaluator,