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