super-page-runtime 2.3.43 → 2.3.44-sit1
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 +136 -136
- package/dist/es/components/runtime/utils/events/event-util.js +122 -122
- package/dist/es/components/runtime/utils/events/print-label.js +33 -34
- package/dist/es/components/runtime/utils/events/standard-event.js +201 -200
- package/dist/es/components/runtime/utils/events/validator-util.js +81 -84
- package/dist/es/components/runtime/utils/page-init-util.js +41 -43
- package/dist/es/components/runtime/utils/table-utils.js +1 -1
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +6 -10
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +6 -8
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/common/home-chart-condition-render.vue.js +8 -8
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.d.ts +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +98 -94
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +75 -74
- package/dist/es/components/runtime/views/assemblys/common/event-call-component.vue.js +13 -13
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +9 -11
- package/dist/es/components/runtime/views/assemblys/common/save-chart-condition-dialog.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/container/fixed/YxAffix.vue2.js +0 -2
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +5 -5
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +9 -11
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +167 -165
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +16 -16
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +3 -3
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +6 -6
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +22 -22
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +65 -51
- package/dist/es/components/runtime/views/assemblys/form/image-upload/imageupload-runtime.vue2.js +15 -16
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +47 -48
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +4 -6
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +7 -9
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +8 -9
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +11 -11
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +3 -3
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +9 -11
- package/dist/es/components/runtime/views/assemblys/page-bottom.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/component/workflow-opinion-box.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/workflow/extract-workflow/extract-workflow-runtime-dialog.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/workflow/extract-workflow/extract-workflow-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/home-chart.vue.js +7 -7
- package/dist/es/components/runtime/views/super-page-dialog.vue.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 +132 -141
- package/dist/es/style.css +76 -76
- package/package.json +2 -2
|
@@ -11,24 +11,24 @@ class ExpressionEvaluator {
|
|
|
11
11
|
return this.evaluateExpression(o);
|
|
12
12
|
}
|
|
13
13
|
static createExpression(e, t, r) {
|
|
14
|
-
const { propName: o, operator:
|
|
14
|
+
const { propName: o, operator: a, propValue: n, leftBracket: s, rightBracket: l, joinSign: i, dataType: c } = t;
|
|
15
15
|
if (!o || "" === o) return "";
|
|
16
16
|
const u = getValueFromVariable(e.entity, o, r);
|
|
17
|
-
let p = `${s} ${this.getComparisonExpression(u, t, getValueFromVariable(e.entity,
|
|
17
|
+
let p = `${s} ${this.getComparisonExpression(u, t, getValueFromVariable(e.entity, n, r))} ${l}`;
|
|
18
18
|
return i && ("and" === i || "AND" === i ? p += "&&" : "or" !== i && "OR" !== i || (p += "||")), p.trim();
|
|
19
19
|
}
|
|
20
20
|
static getComparisonExpression(e, t, r) {
|
|
21
|
-
const { dataType: o, variableIsNull:
|
|
22
|
-
let
|
|
23
|
-
|
|
21
|
+
const { dataType: o, variableIsNull: a } = t;
|
|
22
|
+
let n = t.operator;
|
|
23
|
+
n || (n = "EQ");
|
|
24
24
|
let s = this.parseValue(e, o);
|
|
25
25
|
const l = this.parseValue(r, o);
|
|
26
|
-
if (null == l &&
|
|
27
|
-
if (null == s && (s = "null"), "null" ===
|
|
28
|
-
if ("ignore" ===
|
|
29
|
-
if ("notequal" ===
|
|
26
|
+
if (null == l && a) {
|
|
27
|
+
if (null == s && (s = "null"), "null" === a) return `${s} === null`;
|
|
28
|
+
if ("ignore" === a) return "1=1";
|
|
29
|
+
if ("notequal" === a) return "1!=1";
|
|
30
30
|
}
|
|
31
|
-
switch (
|
|
31
|
+
switch (n) {
|
|
32
32
|
case "EQ":
|
|
33
33
|
return `${s} === ${l}`;
|
|
34
34
|
case "GT":
|
|
@@ -55,7 +55,7 @@ class ExpressionEvaluator {
|
|
|
55
55
|
}
|
|
56
56
|
return `[${l}].includes(${s})`;
|
|
57
57
|
default:
|
|
58
|
-
throw new Error(`比较符号不匹配: ${
|
|
58
|
+
throw new Error(`比较符号不匹配: ${n}`);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
static changeDataType(e) {
|
|
@@ -86,7 +86,7 @@ class ExpressionEvaluator {
|
|
|
86
86
|
try {
|
|
87
87
|
return eval(expression);
|
|
88
88
|
} catch (e) {
|
|
89
|
-
return
|
|
89
|
+
return false;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -114,39 +114,47 @@ function getSummaryDataColumn(e, t) {
|
|
|
114
114
|
const r = {};
|
|
115
115
|
return ((_a = e.props.summaries) == null ? void 0 : _a.dataColumn) && e.props.summaries.dataColumn.length > 0 && e.props.summaries.dataColumn.forEach((o) => {
|
|
116
116
|
var _a2;
|
|
117
|
-
const
|
|
118
|
-
|
|
117
|
+
const a = (_a2 = e.items) == null ? void 0 : _a2.find((e2) => o.prop === e2.props.base.prop);
|
|
118
|
+
a && ("table" === t && a.props.base.tableSummary || "group" === t && a.props.base.groupSummary) && (r[o.prop] = o);
|
|
119
119
|
}), r;
|
|
120
120
|
}
|
|
121
|
-
function summaryStatistics(e, t, r, o) {
|
|
121
|
+
function summaryStatistics(e, t, r, o, a) {
|
|
122
122
|
let n = "";
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
123
|
+
const s = e.summaryMode, l = t.map((e2) => Number(e2[r])).filter((e2) => !Number.isNaN(e2));
|
|
124
|
+
if (l.length > 0) if ("custom" === s) {
|
|
125
125
|
const a2 = getCustomFunc(o, e.customFunc);
|
|
126
126
|
if (a2) try {
|
|
127
127
|
const e2 = a2.apply(a2, [{ data: t, prop: r }]);
|
|
128
128
|
n = e2 ? ` ${e2}` : " N/A";
|
|
129
129
|
} catch (e2) {
|
|
130
|
-
console.error("自定义函数脚本错误:", t, e2);
|
|
131
130
|
}
|
|
132
131
|
else n = " N/A";
|
|
133
|
-
} else switch (
|
|
132
|
+
} else switch (s) {
|
|
134
133
|
case "sum":
|
|
135
|
-
n =
|
|
134
|
+
n = `${l.reduce((e2, t2) => e2 + t2, 0)}`;
|
|
136
135
|
break;
|
|
137
136
|
case "avg":
|
|
138
|
-
n = "
|
|
137
|
+
n = "" + l.reduce((e2, t2) => e2 + t2, 0) / l.length;
|
|
139
138
|
break;
|
|
140
139
|
case "min":
|
|
141
|
-
n =
|
|
140
|
+
n = `${Math.min(...l)}`;
|
|
142
141
|
break;
|
|
143
142
|
case "max":
|
|
144
|
-
n =
|
|
143
|
+
n = `${Math.max(...l)}`;
|
|
145
144
|
break;
|
|
146
145
|
default:
|
|
147
|
-
n = "
|
|
146
|
+
n = "N/A";
|
|
147
|
+
}
|
|
148
|
+
else n = "N/A";
|
|
149
|
+
if (r && a) {
|
|
150
|
+
const e2 = a.findIndex((e3) => e3.props.base.prop === r);
|
|
151
|
+
if (-1 !== e2 && a[e2].props.format && a[e2].props.format.type) {
|
|
152
|
+
const t2 = {};
|
|
153
|
+
t2[r] = n;
|
|
154
|
+
const s2 = formatColContent(t2, a[e2].props.format, a[e2], o, {});
|
|
155
|
+
Number.isNaN(s2) || (n = ` ${s2}`);
|
|
156
|
+
}
|
|
148
157
|
}
|
|
149
|
-
else n = " N/A";
|
|
150
158
|
return n;
|
|
151
159
|
}
|
|
152
160
|
function replacePlaceholders(e, t) {
|
|
@@ -157,33 +165,31 @@ function getHeaderCellStyleUtil(e, t, r) {
|
|
|
157
165
|
const o = {};
|
|
158
166
|
e.column.property && ((_a = t.titleStyle) == null ? void 0 : _a.forEach((t2) => {
|
|
159
167
|
if (t2.field && t2.field.includes(e.column.property)) if (t2.scopeFunc) {
|
|
160
|
-
const
|
|
161
|
-
if (
|
|
162
|
-
false !==
|
|
163
|
-
} catch (
|
|
164
|
-
console.error("自定义函数脚本错误:", t2, e, r2);
|
|
168
|
+
const a2 = getCustomFunc(r.pageContext, t2.scopeFunc);
|
|
169
|
+
if (a2) try {
|
|
170
|
+
false !== a2.apply(a2, [{ item: t2, data: e }]) && copyStyle(o, t2);
|
|
171
|
+
} catch (e2) {
|
|
165
172
|
}
|
|
166
173
|
} else copyStyle(o, t2);
|
|
167
174
|
}));
|
|
168
|
-
const
|
|
169
|
-
return
|
|
175
|
+
const a = getCellStyleUtil(e, t.cellTitleStyle, r);
|
|
176
|
+
return a && Object.assign(o, a), o;
|
|
170
177
|
}
|
|
171
178
|
function getRowStyleUtil(e, t, r) {
|
|
172
179
|
const o = {};
|
|
173
180
|
if (r.configure.style.rowStyle) for (let t2 = 0; t2 < r.configure.style.rowStyle.length; t2++) {
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const t3 = getCustomFunc(r.pageContext,
|
|
181
|
+
const a = r.configure.style.rowStyle[t2];
|
|
182
|
+
if (a.scopeFunc) {
|
|
183
|
+
const t3 = getCustomFunc(r.pageContext, a.scopeFunc);
|
|
177
184
|
if (t3) try {
|
|
178
185
|
const r2 = t3.apply(t3, [{ data: e }]);
|
|
179
|
-
null != r2 && false !== r2 && copyStyle(o,
|
|
180
|
-
} catch (
|
|
181
|
-
console.error("自定义函数脚本错误:", e, t4);
|
|
186
|
+
null != r2 && false !== r2 && copyStyle(o, a);
|
|
187
|
+
} catch (e2) {
|
|
182
188
|
}
|
|
183
|
-
} else if (
|
|
184
|
-
const t3 = ExpressionEvaluator.evaluate(r.pageContext,
|
|
185
|
-
(t3 || void 0 === t3) && copyStyle(o,
|
|
186
|
-
} else copyStyle(o,
|
|
189
|
+
} else if (a.matchingCondition) {
|
|
190
|
+
const t3 = ExpressionEvaluator.evaluate(r.pageContext, a.matchingCondition, e.row);
|
|
191
|
+
(t3 || void 0 === t3) && copyStyle(o, a);
|
|
192
|
+
} else copyStyle(o, a);
|
|
187
193
|
}
|
|
188
194
|
if (t && t.length > 0 && -1 !== t.indexOf(e.rowIndex)) {
|
|
189
195
|
const e2 = {};
|
|
@@ -196,19 +202,18 @@ function getRowStyleUtil(e, t, r) {
|
|
|
196
202
|
}
|
|
197
203
|
function getCellStyleUtil(e, t, r) {
|
|
198
204
|
const o = {};
|
|
199
|
-
if (t) for (let
|
|
200
|
-
const
|
|
201
|
-
if (isSetStyle(
|
|
202
|
-
const t2 = getCustomFunc(r.pageContext,
|
|
205
|
+
if (t) for (let a = 0; a < t.length; a++) {
|
|
206
|
+
const n = t[a];
|
|
207
|
+
if (isSetStyle(n)) if (n.scopeFunc) {
|
|
208
|
+
const t2 = getCustomFunc(r.pageContext, n.scopeFunc);
|
|
203
209
|
if (t2) try {
|
|
204
|
-
false !== t2.apply(t2, [{ data: e }]) && copyStyle(o,
|
|
205
|
-
} catch (
|
|
206
|
-
console.error("自定义函数脚本错误:", e, t3);
|
|
210
|
+
false !== t2.apply(t2, [{ data: e }]) && copyStyle(o, n);
|
|
211
|
+
} catch (e2) {
|
|
207
212
|
}
|
|
208
|
-
} else if (
|
|
209
|
-
const t2 = ExpressionEvaluator.evaluate(r.pageContext,
|
|
210
|
-
(t2 || void 0 === t2) && copyStyle(o,
|
|
211
|
-
} else copyStyle(o,
|
|
213
|
+
} else if (n.matchingCondition) {
|
|
214
|
+
const t2 = ExpressionEvaluator.evaluate(r.pageContext, n.matchingCondition, e.row);
|
|
215
|
+
(t2 || void 0 === t2) && copyStyle(o, n);
|
|
216
|
+
} else copyStyle(o, n);
|
|
212
217
|
}
|
|
213
218
|
return o;
|
|
214
219
|
}
|
|
@@ -220,35 +225,35 @@ function copyStyle(e, t) {
|
|
|
220
225
|
Object.assign(e, t.style), t.customStyle && Object.assign(e, JSON.parse(t.customStyle));
|
|
221
226
|
}
|
|
222
227
|
function rowDataToColumn(e, t, r) {
|
|
223
|
-
const o = t.props.dataOrigin.groupField,
|
|
228
|
+
const o = t.props.dataOrigin.groupField, a = t.props.dataOrigin.rowToColumn.titleColumns, n = t.props.dataOrigin.rowToColumn.dataColumns, s = [], l = {};
|
|
224
229
|
if (o && o.length > 0) e.forEach((e2) => {
|
|
225
230
|
const t2 = o.map((t3) => e2[t3]).join("|");
|
|
226
231
|
if (!l[t2]) {
|
|
227
232
|
const r2 = {};
|
|
228
233
|
o.forEach((t3) => r2[t3] = e2[t3]), l[t2] = r2, s.push(r2);
|
|
229
234
|
}
|
|
230
|
-
|
|
231
|
-
const o2 = `${
|
|
235
|
+
n.forEach((r2) => {
|
|
236
|
+
const o2 = `${a.map((t3) => e2[t3]).join("")}${r2}`;
|
|
232
237
|
l[t2][o2] = e2[r2];
|
|
233
238
|
});
|
|
234
239
|
});
|
|
235
240
|
else {
|
|
236
241
|
const t2 = [];
|
|
237
242
|
e.forEach((e2) => {
|
|
238
|
-
|
|
243
|
+
a.forEach((r2) => {
|
|
239
244
|
e2[r2] && t2.push(e2[r2]);
|
|
240
245
|
});
|
|
241
|
-
}),
|
|
242
|
-
const o2 = {},
|
|
246
|
+
}), n.forEach((t3) => {
|
|
247
|
+
const o2 = {}, n2 = r.find((e2) => {
|
|
243
248
|
var _a, _b;
|
|
244
249
|
return ((_b = (_a = e2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop) === t3;
|
|
245
250
|
});
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
if (!
|
|
250
|
-
const
|
|
251
|
-
o2[
|
|
251
|
+
n2 && (o2.$GroupColumn = n2.props.base.name), e.forEach((e2) => {
|
|
252
|
+
a.forEach((r2) => {
|
|
253
|
+
const a2 = e2[r2];
|
|
254
|
+
if (!a2) return;
|
|
255
|
+
const n3 = e2[t3];
|
|
256
|
+
o2[a2] = n3;
|
|
252
257
|
});
|
|
253
258
|
}), s.push(o2);
|
|
254
259
|
});
|
|
@@ -256,9 +261,9 @@ function rowDataToColumn(e, t, r) {
|
|
|
256
261
|
return s;
|
|
257
262
|
}
|
|
258
263
|
function colDataToRow(e, t) {
|
|
259
|
-
const r = t.props.dataOrigin.groupField, o = t.props.dataOrigin.columnToRow.titleColumns,
|
|
264
|
+
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;
|
|
260
265
|
if (0 === e.length) return e;
|
|
261
|
-
const l = [], i = groupBy(e, r), c =
|
|
266
|
+
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) => {
|
|
262
267
|
e2[r2] = t2.prop;
|
|
263
268
|
}), e2), {});
|
|
264
269
|
return i.forEach((e2) => {
|
|
@@ -266,14 +271,14 @@ function colDataToRow(e, t) {
|
|
|
266
271
|
const i2 = c.prop, p = {};
|
|
267
272
|
if (r.forEach((t3) => {
|
|
268
273
|
p[t3] = e2[t3];
|
|
269
|
-
}), p[i2] = e2[t2],
|
|
274
|
+
}), p[i2] = e2[t2], a.length > 1) {
|
|
270
275
|
const r2 = s.find((e3) => e3.props.includes(t2));
|
|
271
276
|
r2 && r2.props.length > 1 && r2.props.forEach((r3) => {
|
|
272
277
|
r3 !== t2 && u[r3] && (p[u[r3]] = e2[r3]);
|
|
273
278
|
});
|
|
274
279
|
}
|
|
275
280
|
o.forEach((e3) => {
|
|
276
|
-
const r2 =
|
|
281
|
+
const r2 = n.filter((t3) => t3.relatedTitle === e3.prop);
|
|
277
282
|
let o2 = false;
|
|
278
283
|
r2 && r2.length > 0 && r2.forEach((r3) => {
|
|
279
284
|
if (r3.columns.includes(t2)) return p[e3.prop] = r3.label, void (o2 = true);
|
|
@@ -283,25 +288,25 @@ function colDataToRow(e, t) {
|
|
|
283
288
|
}), l;
|
|
284
289
|
}
|
|
285
290
|
function getColumnToRowTableConfig(e) {
|
|
286
|
-
const t = e.items, r = e.props.dataOrigin.groupField, o = e.props.dataOrigin.columnToRow.titleColumns,
|
|
291
|
+
const t = e.items, r = e.props.dataOrigin.groupField, o = e.props.dataOrigin.columnToRow.titleColumns, a = e.props.dataOrigin.columnToRow.dataColumns, n = [];
|
|
287
292
|
r && r.length > 0 && r.forEach((e2) => {
|
|
288
293
|
if (t) {
|
|
289
294
|
const r2 = t.find((t2) => t2.props.base.prop === e2);
|
|
290
|
-
r2 &&
|
|
295
|
+
r2 && n.push(r2);
|
|
291
296
|
}
|
|
292
297
|
});
|
|
293
|
-
return [...o, ...
|
|
298
|
+
return [...o, ...a].forEach((e2) => {
|
|
294
299
|
if (t) {
|
|
295
300
|
const r2 = t.find((t2) => t2.props.base.prop === e2);
|
|
296
|
-
r2 ?
|
|
301
|
+
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: "" } } } });
|
|
297
302
|
}
|
|
298
|
-
}),
|
|
303
|
+
}), n;
|
|
299
304
|
}
|
|
300
305
|
function groupBy(e, t) {
|
|
301
306
|
const r = {};
|
|
302
307
|
return e.forEach((e2) => {
|
|
303
308
|
const o = t.map((t2) => e2[t2]).join("|");
|
|
304
|
-
r[o] || (r[o] = { ...e2, records: [] }, t.forEach((t2,
|
|
309
|
+
r[o] || (r[o] = { ...e2, records: [] }, t.forEach((t2, a) => {
|
|
305
310
|
r[o][t2] = e2[t2];
|
|
306
311
|
})), r[o].records.push(e2);
|
|
307
312
|
}), Object.values(r).map((e2) => ({ ...e2, records: void 0 }));
|
|
@@ -329,7 +334,7 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
329
334
|
r += Number(e2[t]);
|
|
330
335
|
});
|
|
331
336
|
} catch (e2) {
|
|
332
|
-
|
|
337
|
+
r = 0;
|
|
333
338
|
}
|
|
334
339
|
totalValueMap[e] = r;
|
|
335
340
|
} 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));
|
|
@@ -341,7 +346,7 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
341
346
|
try {
|
|
342
347
|
data[key] = eval(expr);
|
|
343
348
|
} catch (e) {
|
|
344
|
-
|
|
349
|
+
data[key] = 0;
|
|
345
350
|
}
|
|
346
351
|
});
|
|
347
352
|
});
|
|
@@ -349,19 +354,19 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
349
354
|
function getFieldName(e) {
|
|
350
355
|
return e.substring(6, e.length - 1);
|
|
351
356
|
}
|
|
352
|
-
function formatColContent(e, t, r, o,
|
|
353
|
-
const
|
|
357
|
+
function formatColContent(e, t, r, o, a) {
|
|
358
|
+
const n = e[r.props.base.prop];
|
|
354
359
|
switch (t.type) {
|
|
355
360
|
case "number":
|
|
356
|
-
return formatNumber(
|
|
361
|
+
return formatNumber(n, t);
|
|
357
362
|
case "currency":
|
|
358
|
-
return formatCurrency(
|
|
363
|
+
return formatCurrency(n, t);
|
|
359
364
|
case "percent":
|
|
360
|
-
return formatPercent(
|
|
365
|
+
return formatPercent(n, t);
|
|
361
366
|
case "custom":
|
|
362
|
-
return formatCustomFunc(e, t, r, o,
|
|
367
|
+
return formatCustomFunc(e, t, r, o, a);
|
|
363
368
|
default:
|
|
364
|
-
return
|
|
369
|
+
return n;
|
|
365
370
|
}
|
|
366
371
|
}
|
|
367
372
|
function formatNumber(e, t) {
|
|
@@ -376,29 +381,28 @@ function formatPercent(e, t) {
|
|
|
376
381
|
let r = e;
|
|
377
382
|
return r || (r = 0, e = 0), t.decimalDigit && (r = Number(e).toFixed(t.decimalDigit)), r + " %";
|
|
378
383
|
}
|
|
379
|
-
function formatCustomFunc(e, t, r, o,
|
|
380
|
-
const
|
|
381
|
-
if (
|
|
384
|
+
function formatCustomFunc(e, t, r, o, a) {
|
|
385
|
+
const n = getCustomFunc(o, t.customFunc);
|
|
386
|
+
if (n) {
|
|
382
387
|
try {
|
|
383
|
-
return
|
|
384
|
-
} catch (
|
|
385
|
-
console.error("自定义函数脚本错误:", e, t2);
|
|
388
|
+
return n.apply(n, [{ pageContext: o, configureObj: a, row: e, prop: r.props.base.prop }]);
|
|
389
|
+
} catch (e2) {
|
|
386
390
|
}
|
|
387
391
|
return "";
|
|
388
392
|
}
|
|
389
393
|
}
|
|
390
|
-
function mergeRowByProperty(e, t, r, o,
|
|
391
|
-
const
|
|
394
|
+
function mergeRowByProperty(e, t, r, o, a) {
|
|
395
|
+
const n = e[o];
|
|
392
396
|
let s = 1, l = true;
|
|
393
397
|
for (let e2 = r - 1; e2 >= 0; e2--) {
|
|
394
|
-
if (
|
|
398
|
+
if (a[e2][o] === n) {
|
|
395
399
|
l = false;
|
|
396
400
|
break;
|
|
397
401
|
}
|
|
398
402
|
break;
|
|
399
403
|
}
|
|
400
404
|
if (!l) return [0, 0];
|
|
401
|
-
for (let e2 = r + 1; e2 <
|
|
405
|
+
for (let e2 = r + 1; e2 < a.length && a[e2][o] === n; e2++) s++;
|
|
402
406
|
return [s, 1];
|
|
403
407
|
}
|
|
404
408
|
export {
|