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.
- package/dist/es/_virtual/_plugin-vue_export-helper.js +6 -7
- package/dist/es/assets/chart-themes/theme1.js +2 -6
- package/dist/es/assets/chart-themes/theme2.js +2 -6
- package/dist/es/assets/chart-themes/theme3.js +2 -6
- package/dist/es/components/runtime/utils/api/api-util.js +4 -7
- package/dist/es/components/runtime/utils/api/page-expose-util.js +137 -433
- package/dist/es/components/runtime/utils/assemblys-config.js +12 -366
- package/dist/es/components/runtime/utils/barcode-util.js +10 -33
- package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +138 -303
- package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +29 -66
- package/dist/es/components/runtime/utils/charts/chart-pie-util.js +71 -147
- package/dist/es/components/runtime/utils/charts/chart-radar-util.js +52 -122
- package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +40 -98
- package/dist/es/components/runtime/utils/charts/chart-util.js +237 -478
- package/dist/es/components/runtime/utils/common-util.js +82 -152
- package/dist/es/components/runtime/utils/eventBus.js +3 -9
- package/dist/es/components/runtime/utils/events/event-util.js +361 -727
- package/dist/es/components/runtime/utils/events/print-label.js +73 -140
- package/dist/es/components/runtime/utils/events/standard-event.js +835 -2283
- package/dist/es/components/runtime/utils/events/validator-util.js +236 -555
- package/dist/es/components/runtime/utils/form/date-shortcuts.js +29 -88
- package/dist/es/components/runtime/utils/form/scan-util.js +60 -154
- package/dist/es/components/runtime/utils/global-refs.js +45 -69
- package/dist/es/components/runtime/utils/i18n-util.js +12 -20
- package/dist/es/components/runtime/utils/interfaces/page-design-types.js +2 -7
- package/dist/es/components/runtime/utils/page-helper-util.js +295 -603
- package/dist/es/components/runtime/utils/page-init-util.js +134 -369
- package/dist/es/components/runtime/utils/page-permission-util.js +24 -531
- package/dist/es/components/runtime/utils/page-store.js +8 -12
- package/dist/es/components/runtime/utils/store-util.js +9 -13
- package/dist/es/components/runtime/utils/store.js +2 -2
- package/dist/es/components/runtime/utils/table-utils.js +49 -84
- package/dist/es/components/runtime/utils/tree-utils.js +18 -36
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +19 -75
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +14 -46
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +37 -132
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +4 -18
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +17 -107
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +54 -198
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +12 -42
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +7 -60
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +48 -169
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +32 -107
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +43 -164
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +32 -115
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +32 -116
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +208 -439
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +4 -42
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +8 -62
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +63 -226
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +13 -62
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +168 -513
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +29 -139
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +23 -125
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +16 -102
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +18 -81
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +17 -82
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +14 -86
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +21 -79
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +16 -61
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +10 -37
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +38 -127
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +28 -76
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +61 -178
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +311 -800
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +251 -592
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +43 -115
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +56 -216
- package/dist/es/components/runtime/views/assemblys/error-render.vue.js +3 -21
- package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +44 -154
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +36 -98
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +54 -200
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +69 -239
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +28 -98
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +22 -59
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +52 -173
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +22 -103
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +58 -249
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +34 -174
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +28 -107
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +13 -50
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +66 -189
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +91 -243
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +82 -261
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +13 -57
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +30 -155
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +41 -129
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +22 -107
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +133 -252
- package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +19 -46
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +22 -49
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +21 -58
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +16 -53
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +18 -134
- package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/super-page.vue.js +232 -708
- package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
- package/dist/es/i18n/langs/cn.js +2 -55
- package/dist/es/i18n/langs/en.js +2 -55
- 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(
|
|
6
|
-
const
|
|
7
|
-
|
|
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(
|
|
13
|
-
const { propName, operator, propValue, leftBracket, rightBracket, joinSign, dataType } =
|
|
14
|
-
if (!
|
|
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
|
-
|
|
18
|
-
|
|
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(
|
|
29
|
-
|
|
30
|
-
|
|
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 `${
|
|
22
|
+
return `${r} === ${s}`;
|
|
37
23
|
case "GT":
|
|
38
|
-
return `${
|
|
24
|
+
return `${r} > ${s}`;
|
|
39
25
|
case "LT":
|
|
40
|
-
return `${
|
|
26
|
+
return `${r} < ${s}`;
|
|
41
27
|
case "GET":
|
|
42
|
-
return `${
|
|
28
|
+
return `${r} >= ${s}`;
|
|
43
29
|
case "LET":
|
|
44
|
-
return `${
|
|
30
|
+
return `${r} <= ${s}`;
|
|
45
31
|
case "NET":
|
|
46
|
-
return `${
|
|
32
|
+
return `${r} !== ${s}`;
|
|
47
33
|
case "CONTAIN":
|
|
48
|
-
return `${
|
|
34
|
+
return `${r}.includes(${s})`;
|
|
49
35
|
case "NOT_CONTAIN":
|
|
50
|
-
return `!${
|
|
36
|
+
return `!${r}.includes(${s})`;
|
|
51
37
|
case "IS_NULL":
|
|
52
|
-
return `${
|
|
38
|
+
return `${r} === null`;
|
|
53
39
|
case "IS_NOT_NULL":
|
|
54
|
-
return `${
|
|
40
|
+
return `${r} !== null`;
|
|
55
41
|
default:
|
|
56
|
-
throw new Error(`比较符号不匹配: ${
|
|
42
|
+
throw new Error(`比较符号不匹配: ${t}`);
|
|
57
43
|
}
|
|
58
44
|
}
|
|
59
|
-
static changeDataType(
|
|
60
|
-
let
|
|
61
|
-
|
|
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(
|
|
73
|
-
|
|
74
|
-
switch (dataType) {
|
|
49
|
+
static parseValue(e, t) {
|
|
50
|
+
switch (t = this.changeDataType(t)) {
|
|
75
51
|
case "number":
|
|
76
|
-
return Number(
|
|
52
|
+
return Number(e);
|
|
77
53
|
case "date":
|
|
78
|
-
return new Date(
|
|
54
|
+
return new Date(e).getTime();
|
|
79
55
|
case "string":
|
|
80
|
-
return `"${
|
|
56
|
+
return `"${e}"`;
|
|
81
57
|
default:
|
|
82
|
-
throw new Error(`数据类型解析错误: ${
|
|
58
|
+
throw new Error(`数据类型解析错误: ${t}`);
|
|
83
59
|
}
|
|
84
60
|
}
|
|
85
61
|
static evaluateExpression(expression) {
|
|
86
62
|
try {
|
|
87
63
|
return eval(expression);
|
|
88
|
-
} catch (
|
|
89
|
-
console.error("表达式错误:", expression, error);
|
|
64
|
+
} catch (e) {
|
|
90
65
|
return false;
|
|
91
66
|
}
|
|
92
67
|
}
|
|
93
68
|
}
|
|
94
|
-
function getSummaryTitleColumn(
|
|
69
|
+
function getSummaryTitleColumn(e) {
|
|
95
70
|
var _a;
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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(
|
|
76
|
+
function getSummaryDataColumn(e, t) {
|
|
105
77
|
var _a;
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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(
|
|
125
|
-
let
|
|
126
|
-
const summaryMode =
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
99
|
+
r = ` ${n.reduce((e2, t2) => e2 + t2, 0)}`;
|
|
145
100
|
break;
|
|
146
101
|
case "avg":
|
|
147
|
-
|
|
102
|
+
r = " " + n.reduce((e2, t2) => e2 + t2, 0) / n.length;
|
|
148
103
|
break;
|
|
149
104
|
case "min":
|
|
150
|
-
|
|
105
|
+
r = ` ${Math.min(...n)}`;
|
|
151
106
|
break;
|
|
152
107
|
case "max":
|
|
153
|
-
|
|
108
|
+
r = ` ${Math.max(...n)}`;
|
|
154
109
|
break;
|
|
155
110
|
default:
|
|
156
|
-
|
|
111
|
+
r = " N/A";
|
|
157
112
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
return sumsIndex;
|
|
113
|
+
else
|
|
114
|
+
r = " N/A";
|
|
115
|
+
return r;
|
|
163
116
|
}
|
|
164
|
-
function replacePlaceholders(
|
|
165
|
-
if (
|
|
166
|
-
return
|
|
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(
|
|
121
|
+
function getHeaderCellStyleUtil(e, t, a) {
|
|
172
122
|
var _a;
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
(
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
|
192
|
-
|
|
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(
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
for (let
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
-
const
|
|
206
|
-
|
|
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
|
-
|
|
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
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
|
162
|
+
return o;
|
|
238
163
|
}
|
|
239
|
-
function getCellStyleUtil(
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
242
|
-
for (let
|
|
243
|
-
const
|
|
244
|
-
if (isSetStyle(
|
|
245
|
-
if (
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
248
|
-
|
|
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 (
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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(
|
|
271
|
-
let
|
|
272
|
-
|
|
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(
|
|
281
|
-
Object.assign(
|
|
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(
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
-
|
|
301
|
-
const
|
|
302
|
-
|
|
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(
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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
|
-
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
)
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
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(
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
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
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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(
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
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
|
|
487
|
-
if (
|
|
488
|
-
totalValueMap[
|
|
489
|
-
|
|
490
|
-
totalValueMap[
|
|
491
|
-
|
|
492
|
-
totalValueMap[
|
|
493
|
-
|
|
494
|
-
totalValueMap[
|
|
495
|
-
|
|
496
|
-
const
|
|
497
|
-
let
|
|
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
|
-
|
|
500
|
-
|
|
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 (
|
|
504
|
-
|
|
505
|
-
currentRowValue = 0;
|
|
281
|
+
} catch (e2) {
|
|
282
|
+
a = 0;
|
|
506
283
|
}
|
|
507
|
-
totalValueMap[
|
|
508
|
-
} else
|
|
509
|
-
totalValueMap[
|
|
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((
|
|
514
|
-
|
|
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
|
|
519
|
-
|
|
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(
|
|
533
|
-
return
|
|
301
|
+
function getFieldName(e) {
|
|
302
|
+
return e.substring(6, e.length - 1);
|
|
534
303
|
}
|
|
535
304
|
export {
|
|
536
305
|
ExpressionEvaluator,
|