super-page-runtime 2.2.77-sit8 → 2.2.78
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/components/runtime/utils/api/page-expose-util.js +56 -56
- package/dist/es/components/runtime/utils/barcode-util.js +5 -5
- package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +74 -74
- package/dist/es/components/runtime/utils/charts/chart-pie-util.js +46 -45
- package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +16 -14
- package/dist/es/components/runtime/utils/charts/chart-util.d.ts +1 -1
- package/dist/es/components/runtime/utils/charts/chart-util.js +9 -7
- package/dist/es/components/runtime/utils/events/event-util.js +113 -113
- package/dist/es/components/runtime/utils/events/print-label.js +38 -37
- package/dist/es/components/runtime/utils/events/standard-event.js +523 -508
- package/dist/es/components/runtime/utils/events/validator-util.js +62 -72
- package/dist/es/components/runtime/utils/form/scan-util.js +4 -3
- package/dist/es/components/runtime/utils/page-helper-util.js +210 -210
- package/dist/es/components/runtime/utils/page-init-util.js +50 -47
- package/dist/es/components/runtime/utils/page-permission-util.js +16 -16
- package/dist/es/components/runtime/utils/page-store.js +1 -1
- package/dist/es/components/runtime/utils/table-utils.js +23 -23
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +13 -16
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +1 -4
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +11 -15
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +16 -12
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +10 -6
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +11 -9
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +13 -12
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +14 -13
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +15 -14
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +17 -16
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +122 -131
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +57 -90
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +26 -22
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +4 -4
- package/dist/es/components/runtime/views/assemblys/common/save-chart-condition-dialog.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +6 -6
- package/dist/es/components/runtime/views/assemblys/container/fixed/YxAffix.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/container/fixed/YxAffix.vue2.js +35 -38
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +12 -10
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +94 -92
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +124 -123
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +14 -16
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +77 -80
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +1 -0
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +29 -34
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +41 -39
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +22 -22
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +51 -50
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +8 -6
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +10 -9
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +1 -0
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +1 -0
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +8 -8
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +4 -5
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +1 -4
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +7 -7
- package/dist/es/components/runtime/views/home-chart.vue.js +7 -7
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +10 -9
- package/dist/es/components/runtime/views/{super-page-dialog.vue3.js → super-page-dialog.vue2.js} +0 -1
- package/dist/es/components/runtime/views/super-page.vue.js +1 -1
- package/dist/es/components/runtime/views/super-page.vue2.js +126 -126
- package/dist/es/index.js +0 -1
- package/dist/es/style.css +99 -225
- package/package.json +2 -2
|
@@ -2,20 +2,20 @@ 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(e, t,
|
|
6
|
-
const
|
|
7
|
-
return this.evaluateExpression(
|
|
5
|
+
static evaluate(e, t, o) {
|
|
6
|
+
const r = t.map((t2) => this.createExpression(e, t2, o)).join(" ");
|
|
7
|
+
return this.evaluateExpression(r);
|
|
8
8
|
}
|
|
9
|
-
static createExpression(e, t,
|
|
10
|
-
const { propName:
|
|
11
|
-
if (!
|
|
12
|
-
const u = getValueFromVariable(e.entity,
|
|
13
|
-
let p = `${s} ${this.getComparisonExpression(u, a, getValueFromVariable(e.entity, n,
|
|
9
|
+
static createExpression(e, t, o) {
|
|
10
|
+
const { propName: r, operator: a, propValue: n, leftBracket: s, rightBracket: l, joinSign: i, dataType: c } = t;
|
|
11
|
+
if (!r || "" === r) return "";
|
|
12
|
+
const u = getValueFromVariable(e.entity, r, o);
|
|
13
|
+
let p = `${s} ${this.getComparisonExpression(u, a, getValueFromVariable(e.entity, n, o), c)} ${l}`;
|
|
14
14
|
return i && ("and" === i || "AND" === i ? p += "&&" : "or" !== i && "OR" !== i || (p += "||")), p.trim();
|
|
15
15
|
}
|
|
16
|
-
static getComparisonExpression(e, t,
|
|
16
|
+
static getComparisonExpression(e, t, o, r) {
|
|
17
17
|
t || (t = "EQ");
|
|
18
|
-
const a = this.parseValue(e,
|
|
18
|
+
const a = this.parseValue(e, r), n = this.parseValue(o, r);
|
|
19
19
|
switch (t) {
|
|
20
20
|
case "EQ":
|
|
21
21
|
return `${a} === ${n}`;
|
|
@@ -37,8 +37,6 @@ class ExpressionEvaluator {
|
|
|
37
37
|
return `${a} === null`;
|
|
38
38
|
case "IS_NOT_NULL":
|
|
39
39
|
return `${a} !== null`;
|
|
40
|
-
case "IN":
|
|
41
|
-
return `[${n}].includes(${a})`;
|
|
42
40
|
default:
|
|
43
41
|
throw new Error(`比较符号不匹配: ${t}`);
|
|
44
42
|
}
|
|
@@ -50,7 +48,7 @@ class ExpressionEvaluator {
|
|
|
50
48
|
static parseValue(e, t) {
|
|
51
49
|
switch (t = this.changeDataType(t)) {
|
|
52
50
|
case "number":
|
|
53
|
-
return
|
|
51
|
+
return Number(e);
|
|
54
52
|
case "date":
|
|
55
53
|
return new Date(e).getTime();
|
|
56
54
|
case "string":
|
|
@@ -63,22 +61,10 @@ class ExpressionEvaluator {
|
|
|
63
61
|
try {
|
|
64
62
|
return eval(expression);
|
|
65
63
|
} catch (e) {
|
|
66
|
-
return false;
|
|
64
|
+
return console.error("表达式错误:", expression, e), false;
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
|
-
function getNumberValue(e) {
|
|
71
|
-
if (isNumber(e)) return Number(e);
|
|
72
|
-
if (e && e.indexOf(",") > 0) {
|
|
73
|
-
const t = e.split(","), r = [];
|
|
74
|
-
for (let e2 = 0; e2 < t.length; e2++) r.push(Number(t[e2]));
|
|
75
|
-
return r;
|
|
76
|
-
}
|
|
77
|
-
return e;
|
|
78
|
-
}
|
|
79
|
-
function isNumber(e) {
|
|
80
|
-
return "number" == typeof e && !isNaN(e);
|
|
81
|
-
}
|
|
82
68
|
function getSummaryTitleColumn(e) {
|
|
83
69
|
var _a;
|
|
84
70
|
const t = {};
|
|
@@ -88,22 +74,23 @@ function getSummaryTitleColumn(e) {
|
|
|
88
74
|
}
|
|
89
75
|
function getSummaryDataColumn(e, t) {
|
|
90
76
|
var _a;
|
|
91
|
-
const
|
|
92
|
-
return ((_a = e.props.summaries) == null ? void 0 : _a.dataColumn) && e.props.summaries.dataColumn.length > 0 && e.props.summaries.dataColumn.forEach((
|
|
77
|
+
const o = {};
|
|
78
|
+
return ((_a = e.props.summaries) == null ? void 0 : _a.dataColumn) && e.props.summaries.dataColumn.length > 0 && e.props.summaries.dataColumn.forEach((r) => {
|
|
93
79
|
var _a2;
|
|
94
|
-
const a = (_a2 = e.items) == null ? void 0 : _a2.find((e2) =>
|
|
95
|
-
a && ("table" === t && a.props.base.tableSummary || "group" === t && a.props.base.groupSummary) && (r
|
|
96
|
-
}),
|
|
80
|
+
const a = (_a2 = e.items) == null ? void 0 : _a2.find((e2) => r.prop === e2.props.base.prop);
|
|
81
|
+
a && ("table" === t && a.props.base.tableSummary || "group" === t && a.props.base.groupSummary) && (o[r.prop] = r);
|
|
82
|
+
}), o;
|
|
97
83
|
}
|
|
98
|
-
function summaryStatistics(e, t,
|
|
84
|
+
function summaryStatistics(e, t, o, r) {
|
|
99
85
|
let a = "";
|
|
100
|
-
const n = e.summaryMode, s = t.map((e2) => Number(e2[
|
|
86
|
+
const n = e.summaryMode, s = t.map((e2) => Number(e2[o])).filter((e2) => !Number.isNaN(e2));
|
|
101
87
|
if (s.length > 0) if ("custom" === n) {
|
|
102
|
-
const n2 = getCustomFunc(
|
|
88
|
+
const n2 = getCustomFunc(r, e.customFunc);
|
|
103
89
|
if (n2) try {
|
|
104
|
-
const e2 = n2.apply(n2, [{ data: t, prop:
|
|
90
|
+
const e2 = n2.apply(n2, [{ data: t, prop: o }]);
|
|
105
91
|
a = e2 ? ` ${e2}` : " N/A";
|
|
106
92
|
} catch (e2) {
|
|
93
|
+
console.error("自定义函数脚本错误:", t, e2);
|
|
107
94
|
}
|
|
108
95
|
else a = " N/A";
|
|
109
96
|
} else switch (n) {
|
|
@@ -126,64 +113,67 @@ function summaryStatistics(e, t, r, o) {
|
|
|
126
113
|
return a;
|
|
127
114
|
}
|
|
128
115
|
function replacePlaceholders(e, t) {
|
|
129
|
-
if (e) return e.replace(/\$\{row\.(\w+)\}/g, (e2,
|
|
116
|
+
if (e) return e.replace(/\$\{row\.(\w+)\}/g, (e2, o) => Object.prototype.hasOwnProperty.call(t, o) ? t[o] : "");
|
|
130
117
|
}
|
|
131
|
-
function getHeaderCellStyleUtil(e, t,
|
|
118
|
+
function getHeaderCellStyleUtil(e, t, o) {
|
|
132
119
|
var _a;
|
|
133
|
-
const
|
|
120
|
+
const r = {};
|
|
134
121
|
e.column.property && ((_a = t.titleStyle) == null ? void 0 : _a.forEach((t2) => {
|
|
135
122
|
if (t2.field && t2.field.includes(e.column.property)) if (t2.scopeFunc) {
|
|
136
|
-
const a2 = getCustomFunc(
|
|
123
|
+
const a2 = getCustomFunc(o.pageContext, t2.scopeFunc);
|
|
137
124
|
if (a2) try {
|
|
138
|
-
false !== a2.apply(a2, [{ item: t2, data: e }]) && copyStyle(
|
|
139
|
-
} catch (
|
|
125
|
+
false !== a2.apply(a2, [{ item: t2, data: e }]) && copyStyle(r, t2);
|
|
126
|
+
} catch (o2) {
|
|
127
|
+
console.error("自定义函数脚本错误:", t2, e, o2);
|
|
140
128
|
}
|
|
141
|
-
} else copyStyle(
|
|
129
|
+
} else copyStyle(r, t2);
|
|
142
130
|
}));
|
|
143
|
-
const a = getCellStyleUtil(e, t.cellTitleStyle,
|
|
144
|
-
return a && Object.assign(
|
|
131
|
+
const a = getCellStyleUtil(e, t.cellTitleStyle, o);
|
|
132
|
+
return a && Object.assign(r, a), r;
|
|
145
133
|
}
|
|
146
|
-
function getRowStyleUtil(e, t,
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
const a =
|
|
134
|
+
function getRowStyleUtil(e, t, o) {
|
|
135
|
+
const r = {};
|
|
136
|
+
if (o.configure.style.rowStyle) for (let t2 = 0; t2 < o.configure.style.rowStyle.length; t2++) {
|
|
137
|
+
const a = o.configure.style.rowStyle[t2];
|
|
150
138
|
if (a.scopeFunc) {
|
|
151
|
-
const t3 = getCustomFunc(
|
|
139
|
+
const t3 = getCustomFunc(o.pageContext, a.scopeFunc);
|
|
152
140
|
if (t3) try {
|
|
153
|
-
const
|
|
154
|
-
null !=
|
|
155
|
-
} catch (
|
|
141
|
+
const o2 = t3.apply(t3, [{ data: e }]);
|
|
142
|
+
null != o2 && false !== o2 && copyStyle(r, a);
|
|
143
|
+
} catch (t4) {
|
|
144
|
+
console.error("自定义函数脚本错误:", e, t4);
|
|
156
145
|
}
|
|
157
146
|
} else if (a.matchingCondition) {
|
|
158
|
-
const t3 = ExpressionEvaluator.evaluate(
|
|
159
|
-
(t3 || void 0 === t3) && copyStyle(
|
|
160
|
-
} else copyStyle(
|
|
147
|
+
const t3 = ExpressionEvaluator.evaluate(o.pageContext, a.matchingCondition, e.row);
|
|
148
|
+
(t3 || void 0 === t3) && copyStyle(r, a);
|
|
149
|
+
} else copyStyle(r, a);
|
|
161
150
|
}
|
|
162
151
|
if (t && t.length > 0 && -1 !== t.indexOf(e.rowIndex)) {
|
|
163
152
|
const e2 = {};
|
|
164
|
-
if (
|
|
165
|
-
copyStyle(e2,
|
|
153
|
+
if (o.configure.style.collectStyle && o.configure.style.collectStyle.length > 0) for (let t2 = 0; t2 < o.configure.style.collectStyle.length; t2++) {
|
|
154
|
+
copyStyle(e2, o.configure.style.collectStyle[t2]);
|
|
166
155
|
}
|
|
167
156
|
return 0 === Object.keys(e2).length && (e2["background-color"] = "var(--el-table-row-hover-bg-color)"), e2;
|
|
168
157
|
}
|
|
169
|
-
return
|
|
158
|
+
return r;
|
|
170
159
|
}
|
|
171
|
-
function getCellStyleUtil(e, t,
|
|
172
|
-
const
|
|
160
|
+
function getCellStyleUtil(e, t, o) {
|
|
161
|
+
const r = {};
|
|
173
162
|
if (t) for (let a = 0; a < t.length; a++) {
|
|
174
163
|
const n = t[a];
|
|
175
164
|
if (isSetStyle(n)) if (n.scopeFunc) {
|
|
176
|
-
const t2 = getCustomFunc(
|
|
165
|
+
const t2 = getCustomFunc(o.pageContext, n.scopeFunc);
|
|
177
166
|
if (t2) try {
|
|
178
|
-
false !== t2.apply(t2, [{ data: e }]) && copyStyle(
|
|
179
|
-
} catch (
|
|
167
|
+
false !== t2.apply(t2, [{ data: e }]) && copyStyle(r, n);
|
|
168
|
+
} catch (t3) {
|
|
169
|
+
console.error("自定义函数脚本错误:", e, t3);
|
|
180
170
|
}
|
|
181
171
|
} else if (n.matchingCondition) {
|
|
182
|
-
const t2 = ExpressionEvaluator.evaluate(
|
|
183
|
-
(t2 || void 0 === t2) && copyStyle(
|
|
184
|
-
} else copyStyle(
|
|
172
|
+
const t2 = ExpressionEvaluator.evaluate(o.pageContext, n.matchingCondition, e.row);
|
|
173
|
+
(t2 || void 0 === t2) && copyStyle(r, n);
|
|
174
|
+
} else copyStyle(r, n);
|
|
185
175
|
}
|
|
186
|
-
return
|
|
176
|
+
return r;
|
|
187
177
|
}
|
|
188
178
|
function isSetStyle(e) {
|
|
189
179
|
let t;
|
|
@@ -192,96 +182,96 @@ function isSetStyle(e) {
|
|
|
192
182
|
function copyStyle(e, t) {
|
|
193
183
|
Object.assign(e, t.style), t.customStyle && Object.assign(e, JSON.parse(t.customStyle));
|
|
194
184
|
}
|
|
195
|
-
function rowDataToColumn(e, t,
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
const t2 =
|
|
185
|
+
function rowDataToColumn(e, t, o) {
|
|
186
|
+
const r = t.props.dataOrigin.groupField, a = t.props.dataOrigin.rowToColumn.titleColumns, n = t.props.dataOrigin.rowToColumn.dataColumns, s = [], l = {};
|
|
187
|
+
if (r && r.length > 0) e.forEach((e2) => {
|
|
188
|
+
const t2 = r.map((t3) => e2[t3]).join("|");
|
|
199
189
|
if (!l[t2]) {
|
|
200
|
-
const
|
|
201
|
-
|
|
190
|
+
const o2 = {};
|
|
191
|
+
r.forEach((t3) => o2[t3] = e2[t3]), l[t2] = o2, s.push(o2);
|
|
202
192
|
}
|
|
203
|
-
n.forEach((
|
|
204
|
-
const
|
|
205
|
-
l[t2][
|
|
193
|
+
n.forEach((o2) => {
|
|
194
|
+
const r2 = `${a.map((t3) => e2[t3]).join("")}${o2}`;
|
|
195
|
+
l[t2][r2] = e2[o2];
|
|
206
196
|
});
|
|
207
197
|
});
|
|
208
198
|
else {
|
|
209
199
|
const t2 = [];
|
|
210
200
|
e.forEach((e2) => {
|
|
211
|
-
a.forEach((
|
|
212
|
-
e2[
|
|
201
|
+
a.forEach((o2) => {
|
|
202
|
+
e2[o2] && t2.push(e2[o2]);
|
|
213
203
|
});
|
|
214
204
|
}), n.forEach((t3) => {
|
|
215
|
-
const
|
|
205
|
+
const r2 = {}, n2 = o.find((e2) => {
|
|
216
206
|
var _a, _b;
|
|
217
207
|
return ((_b = (_a = e2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop) === t3;
|
|
218
208
|
});
|
|
219
|
-
n2 && (
|
|
220
|
-
a.forEach((
|
|
221
|
-
const a2 = e2[
|
|
222
|
-
|
|
209
|
+
n2 && (r2.$GroupColumn = n2.props.base.name), e.forEach((e2) => {
|
|
210
|
+
a.forEach((o2) => {
|
|
211
|
+
const a2 = e2[o2], n3 = e2[t3];
|
|
212
|
+
r2[a2] = n3;
|
|
223
213
|
});
|
|
224
|
-
}), s.push(
|
|
214
|
+
}), s.push(r2);
|
|
225
215
|
});
|
|
226
216
|
}
|
|
227
217
|
return s;
|
|
228
218
|
}
|
|
229
219
|
function colDataToRow(e, t) {
|
|
230
|
-
const
|
|
220
|
+
const o = t.props.dataOrigin.groupField, r = t.props.dataOrigin.columnToRow.titleColumns, a = t.props.dataOrigin.columnToRow.dataColumns, n = t.props.dataOrigin.columnToRow.transColumns, s = t.props.dataOrigin.columnToRow.dataColumnsMapping;
|
|
231
221
|
if (0 === e.length) return e;
|
|
232
|
-
const l = [], i = groupBy(e,
|
|
233
|
-
e2[
|
|
222
|
+
const l = [], i = groupBy(e, o), c = a.reduce((e2, t2) => t2.columns.length > e2.columns.length ? t2 : e2, a[0]), u = a.reduce((e2, t2) => (t2.columns.forEach((o2) => {
|
|
223
|
+
e2[o2] = t2.prop;
|
|
234
224
|
}), e2), {});
|
|
235
225
|
return i.forEach((e2) => {
|
|
236
226
|
c.columns.forEach((t2) => {
|
|
237
227
|
const i2 = c.prop, p = {};
|
|
238
|
-
if (
|
|
228
|
+
if (o.forEach((t3) => {
|
|
239
229
|
p[t3] = e2[t3];
|
|
240
230
|
}), p[i2] = e2[t2], a.length > 1) {
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
231
|
+
const o2 = s.find((e3) => e3.props.includes(t2));
|
|
232
|
+
o2 && o2.props.length > 1 && o2.props.forEach((o3) => {
|
|
233
|
+
o3 !== t2 && u[o3] && (p[u[o3]] = e2[o3]);
|
|
244
234
|
});
|
|
245
235
|
}
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
let
|
|
249
|
-
|
|
250
|
-
if (
|
|
251
|
-
}),
|
|
236
|
+
r.forEach((e3) => {
|
|
237
|
+
const o2 = n.filter((t3) => t3.relatedTitle === e3.prop);
|
|
238
|
+
let r2 = false;
|
|
239
|
+
o2 && o2.length > 0 && o2.forEach((o3) => {
|
|
240
|
+
if (o3.columns.includes(t2)) return p[e3.prop] = o3.label, void (r2 = true);
|
|
241
|
+
}), r2 || (p[e3.prop] = t2);
|
|
252
242
|
}), l.push(p);
|
|
253
243
|
});
|
|
254
244
|
}), l;
|
|
255
245
|
}
|
|
256
246
|
function getColumnToRowTableConfig(e) {
|
|
257
|
-
const t = e.items,
|
|
258
|
-
|
|
247
|
+
const t = e.items, o = e.props.dataOrigin.groupField, r = e.props.dataOrigin.columnToRow.titleColumns, a = e.props.dataOrigin.columnToRow.dataColumns, n = [];
|
|
248
|
+
o && o.length > 0 && o.forEach((e2) => {
|
|
259
249
|
if (t) {
|
|
260
|
-
const
|
|
261
|
-
|
|
250
|
+
const o2 = t.find((t2) => t2.props.base.prop === e2);
|
|
251
|
+
o2 && n.push(o2);
|
|
262
252
|
}
|
|
263
253
|
});
|
|
264
|
-
return [...
|
|
254
|
+
return [...r, ...a].forEach((e2) => {
|
|
265
255
|
if (t) {
|
|
266
|
-
const
|
|
267
|
-
|
|
256
|
+
const o2 = t.find((t2) => t2.props.base.prop === e2);
|
|
257
|
+
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: "" } } } });
|
|
268
258
|
}
|
|
269
259
|
}), n;
|
|
270
260
|
}
|
|
271
261
|
function groupBy(e, t) {
|
|
272
|
-
const
|
|
262
|
+
const o = {};
|
|
273
263
|
return e.forEach((e2) => {
|
|
274
|
-
const
|
|
275
|
-
r
|
|
276
|
-
r
|
|
277
|
-
})), r
|
|
278
|
-
}), Object.values(
|
|
264
|
+
const r = t.map((t2) => e2[t2]).join("|");
|
|
265
|
+
o[r] || (o[r] = { ...e2, records: [] }, t.forEach((t2, a) => {
|
|
266
|
+
o[r][t2] = e2[t2];
|
|
267
|
+
})), o[r].records.push(e2);
|
|
268
|
+
}), Object.values(o).map((e2) => ({ ...e2, records: void 0 }));
|
|
279
269
|
}
|
|
280
270
|
function getIndexColumn() {
|
|
281
271
|
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: "" } };
|
|
282
272
|
}
|
|
283
|
-
function getNewColumnConfig(e, t,
|
|
284
|
-
return { uuid: (/* @__PURE__ */ new Date()).getTime(), name: "", props: { base: { prop: e, name: t, displayOrder:
|
|
273
|
+
function getNewColumnConfig(e, t, o, r) {
|
|
274
|
+
return { uuid: (/* @__PURE__ */ new Date()).getTime(), name: "", props: { base: { prop: e, name: t, displayOrder: o, sortable: true, headerAlign: "center", align: "center", fixed: false, visible: true, dataType: r }, format: {}, size: { pc: {} } }, style: {}, componentIndex: 0, runtime: { common: { class: "", style: { pc_style: {}, pc_class: "" } } } };
|
|
285
275
|
}
|
|
286
276
|
function computeFormula(itemConfs, datas, entity) {
|
|
287
277
|
Object.keys(itemConfs).forEach((key) => {
|
|
@@ -294,15 +284,15 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
294
284
|
else if (e.startsWith("${avg.")) totalValueMap[e] = getAvgValue(datas, getFieldName(e));
|
|
295
285
|
else if (e.startsWith("${add.")) {
|
|
296
286
|
const t = getFieldName(e);
|
|
297
|
-
let
|
|
287
|
+
let o = 0;
|
|
298
288
|
try {
|
|
299
|
-
|
|
300
|
-
|
|
289
|
+
o = Number(data[t]), datas.slice(0, index).forEach((e2) => {
|
|
290
|
+
o += Number(e2[t]);
|
|
301
291
|
});
|
|
302
292
|
} catch (e2) {
|
|
303
|
-
|
|
293
|
+
console.error("计算错误:", e2), o = 0;
|
|
304
294
|
}
|
|
305
|
-
totalValueMap[e] =
|
|
295
|
+
totalValueMap[e] = o;
|
|
306
296
|
} else (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));
|
|
307
297
|
let expr = itemConfs[key];
|
|
308
298
|
Object.keys(totalValueMap).forEach((e) => {
|
|
@@ -312,7 +302,7 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
312
302
|
try {
|
|
313
303
|
data[key] = eval(expr);
|
|
314
304
|
} catch (e) {
|
|
315
|
-
data[key] = 0;
|
|
305
|
+
console.error(itemConfs[key] + " 计算错误, 替换后表达式为:" + expr, e), data[key] = 0;
|
|
316
306
|
}
|
|
317
307
|
});
|
|
318
308
|
});
|
|
@@ -320,8 +310,8 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
320
310
|
function getFieldName(e) {
|
|
321
311
|
return e.substring(6, e.length - 1);
|
|
322
312
|
}
|
|
323
|
-
function formatColContent(e, t,
|
|
324
|
-
const n = e[
|
|
313
|
+
function formatColContent(e, t, o, r, a) {
|
|
314
|
+
const n = e[o.props.base.prop];
|
|
325
315
|
switch (t.type) {
|
|
326
316
|
case "number":
|
|
327
317
|
return formatNumber(n, t);
|
|
@@ -330,29 +320,30 @@ function formatColContent(e, t, r, o, a) {
|
|
|
330
320
|
case "percent":
|
|
331
321
|
return formatPercent(n, t);
|
|
332
322
|
case "custom":
|
|
333
|
-
return formatCustomFunc(e, t,
|
|
323
|
+
return formatCustomFunc(e, t, o, r, a);
|
|
334
324
|
default:
|
|
335
325
|
return n;
|
|
336
326
|
}
|
|
337
327
|
}
|
|
338
328
|
function formatNumber(e, t) {
|
|
339
|
-
let
|
|
340
|
-
return
|
|
329
|
+
let o = e;
|
|
330
|
+
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;
|
|
341
331
|
}
|
|
342
332
|
function formatCurrency(e, t) {
|
|
343
|
-
let
|
|
344
|
-
return
|
|
333
|
+
let o = e;
|
|
334
|
+
return o || (o = 0), t.decimalDigit && (o = Number(e).toFixed(t.decimalDigit)), t.symbol && (o = `${t.symbol} ${o}`), o;
|
|
345
335
|
}
|
|
346
336
|
function formatPercent(e, t) {
|
|
347
|
-
let
|
|
348
|
-
return
|
|
337
|
+
let o = e;
|
|
338
|
+
return o || (o = 0), t.decimalDigit && (o = Number(e).toFixed(t.decimalDigit)), o + " %";
|
|
349
339
|
}
|
|
350
|
-
function formatCustomFunc(e, t,
|
|
351
|
-
const n = getCustomFunc(
|
|
340
|
+
function formatCustomFunc(e, t, o, r, a) {
|
|
341
|
+
const n = getCustomFunc(r, t.customFunc);
|
|
352
342
|
if (n) {
|
|
353
343
|
try {
|
|
354
|
-
return n.apply(n, [{ pageContext:
|
|
355
|
-
} catch (
|
|
344
|
+
return n.apply(n, [{ pageContext: r, configureObj: a, row: e, prop: o.props.base.prop }]);
|
|
345
|
+
} catch (t2) {
|
|
346
|
+
console.error("自定义函数脚本错误:", e, t2);
|
|
356
347
|
}
|
|
357
348
|
return "";
|
|
358
349
|
}
|