super-page-runtime 2.2.72 → 2.2.77-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/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 +152 -153
- package/dist/es/components/runtime/utils/events/validator-util.js +48 -38
- package/dist/es/components/runtime/utils/page-permission-util.js +16 -16
- package/dist/es/components/runtime/utils/tree-utils.js +24 -23
- 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 +6 -5
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +125 -111
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +3 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +76 -54
- 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 +32 -27
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +20 -20
- 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 +1 -0
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +54 -52
- 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 +77 -73
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +6 -1
- 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 +29 -29
- 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 +13 -13
- 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 +17 -15
- package/dist/es/index.js +1 -0
- package/dist/es/style.css +242 -100
- 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, 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
|
}
|
|
@@ -112,64 +126,64 @@ function summaryStatistics(e, t, o, r) {
|
|
|
112
126
|
return a;
|
|
113
127
|
}
|
|
114
128
|
function replacePlaceholders(e, t) {
|
|
115
|
-
if (e) return e.replace(/\$\{row\.(\w+)\}/g, (e2,
|
|
129
|
+
if (e) return e.replace(/\$\{row\.(\w+)\}/g, (e2, r) => Object.prototype.hasOwnProperty.call(t, r) ? t[r] : "");
|
|
116
130
|
}
|
|
117
|
-
function getHeaderCellStyleUtil(e, t,
|
|
131
|
+
function getHeaderCellStyleUtil(e, t, r) {
|
|
118
132
|
var _a;
|
|
119
|
-
const
|
|
133
|
+
const o = {};
|
|
120
134
|
e.column.property && ((_a = t.titleStyle) == null ? void 0 : _a.forEach((t2) => {
|
|
121
135
|
if (t2.field && t2.field.includes(e.column.property)) if (t2.scopeFunc) {
|
|
122
|
-
const a2 = getCustomFunc(
|
|
136
|
+
const a2 = getCustomFunc(r.pageContext, t2.scopeFunc);
|
|
123
137
|
if (a2) try {
|
|
124
|
-
false !== a2.apply(a2, [{ item: t2, data: e }]) && copyStyle(
|
|
138
|
+
false !== a2.apply(a2, [{ item: t2, data: e }]) && copyStyle(o, t2);
|
|
125
139
|
} catch (e2) {
|
|
126
140
|
}
|
|
127
|
-
} else copyStyle(
|
|
141
|
+
} else copyStyle(o, t2);
|
|
128
142
|
}));
|
|
129
|
-
const a = getCellStyleUtil(e, t.cellTitleStyle,
|
|
130
|
-
return a && Object.assign(
|
|
143
|
+
const a = getCellStyleUtil(e, t.cellTitleStyle, r);
|
|
144
|
+
return a && Object.assign(o, a), o;
|
|
131
145
|
}
|
|
132
|
-
function getRowStyleUtil(e, t,
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
const a =
|
|
146
|
+
function getRowStyleUtil(e, t, r) {
|
|
147
|
+
const o = {};
|
|
148
|
+
if (r.configure.style.rowStyle) for (let t2 = 0; t2 < r.configure.style.rowStyle.length; t2++) {
|
|
149
|
+
const a = r.configure.style.rowStyle[t2];
|
|
136
150
|
if (a.scopeFunc) {
|
|
137
|
-
const t3 = getCustomFunc(
|
|
151
|
+
const t3 = getCustomFunc(r.pageContext, a.scopeFunc);
|
|
138
152
|
if (t3) try {
|
|
139
|
-
const
|
|
140
|
-
null !=
|
|
153
|
+
const r2 = t3.apply(t3, [{ data: e }]);
|
|
154
|
+
null != r2 && false !== r2 && copyStyle(o, a);
|
|
141
155
|
} catch (e2) {
|
|
142
156
|
}
|
|
143
157
|
} else if (a.matchingCondition) {
|
|
144
|
-
const t3 = ExpressionEvaluator.evaluate(
|
|
145
|
-
(t3 || void 0 === t3) && copyStyle(
|
|
146
|
-
} else copyStyle(
|
|
158
|
+
const t3 = ExpressionEvaluator.evaluate(r.pageContext, a.matchingCondition, e.row);
|
|
159
|
+
(t3 || void 0 === t3) && copyStyle(o, a);
|
|
160
|
+
} else copyStyle(o, a);
|
|
147
161
|
}
|
|
148
162
|
if (t && t.length > 0 && -1 !== t.indexOf(e.rowIndex)) {
|
|
149
163
|
const e2 = {};
|
|
150
|
-
if (
|
|
151
|
-
copyStyle(e2,
|
|
164
|
+
if (r.configure.style.collectStyle && r.configure.style.collectStyle.length > 0) for (let t2 = 0; t2 < r.configure.style.collectStyle.length; t2++) {
|
|
165
|
+
copyStyle(e2, r.configure.style.collectStyle[t2]);
|
|
152
166
|
}
|
|
153
167
|
return 0 === Object.keys(e2).length && (e2["background-color"] = "var(--el-table-row-hover-bg-color)"), e2;
|
|
154
168
|
}
|
|
155
|
-
return
|
|
169
|
+
return o;
|
|
156
170
|
}
|
|
157
|
-
function getCellStyleUtil(e, t,
|
|
158
|
-
const
|
|
171
|
+
function getCellStyleUtil(e, t, r) {
|
|
172
|
+
const o = {};
|
|
159
173
|
if (t) for (let a = 0; a < t.length; a++) {
|
|
160
174
|
const n = t[a];
|
|
161
175
|
if (isSetStyle(n)) if (n.scopeFunc) {
|
|
162
|
-
const t2 = getCustomFunc(
|
|
176
|
+
const t2 = getCustomFunc(r.pageContext, n.scopeFunc);
|
|
163
177
|
if (t2) try {
|
|
164
|
-
false !== t2.apply(t2, [{ data: e }]) && copyStyle(
|
|
178
|
+
false !== t2.apply(t2, [{ data: e }]) && copyStyle(o, n);
|
|
165
179
|
} catch (e2) {
|
|
166
180
|
}
|
|
167
181
|
} else if (n.matchingCondition) {
|
|
168
|
-
const t2 = ExpressionEvaluator.evaluate(
|
|
169
|
-
(t2 || void 0 === t2) && copyStyle(
|
|
170
|
-
} else copyStyle(
|
|
182
|
+
const t2 = ExpressionEvaluator.evaluate(r.pageContext, n.matchingCondition, e.row);
|
|
183
|
+
(t2 || void 0 === t2) && copyStyle(o, n);
|
|
184
|
+
} else copyStyle(o, n);
|
|
171
185
|
}
|
|
172
|
-
return
|
|
186
|
+
return o;
|
|
173
187
|
}
|
|
174
188
|
function isSetStyle(e) {
|
|
175
189
|
let t;
|
|
@@ -178,96 +192,96 @@ function isSetStyle(e) {
|
|
|
178
192
|
function copyStyle(e, t) {
|
|
179
193
|
Object.assign(e, t.style), t.customStyle && Object.assign(e, JSON.parse(t.customStyle));
|
|
180
194
|
}
|
|
181
|
-
function rowDataToColumn(e, t,
|
|
182
|
-
const
|
|
183
|
-
if (
|
|
184
|
-
const t2 =
|
|
195
|
+
function rowDataToColumn(e, t, r) {
|
|
196
|
+
const o = t.props.dataOrigin.groupField, a = t.props.dataOrigin.rowToColumn.titleColumns, n = t.props.dataOrigin.rowToColumn.dataColumns, s = [], l = {};
|
|
197
|
+
if (o && o.length > 0) e.forEach((e2) => {
|
|
198
|
+
const t2 = o.map((t3) => e2[t3]).join("|");
|
|
185
199
|
if (!l[t2]) {
|
|
186
|
-
const
|
|
187
|
-
|
|
200
|
+
const r2 = {};
|
|
201
|
+
o.forEach((t3) => r2[t3] = e2[t3]), l[t2] = r2, s.push(r2);
|
|
188
202
|
}
|
|
189
|
-
n.forEach((
|
|
190
|
-
const
|
|
191
|
-
l[t2][
|
|
203
|
+
n.forEach((r2) => {
|
|
204
|
+
const o2 = `${a.map((t3) => e2[t3]).join("")}${r2}`;
|
|
205
|
+
l[t2][o2] = e2[r2];
|
|
192
206
|
});
|
|
193
207
|
});
|
|
194
208
|
else {
|
|
195
209
|
const t2 = [];
|
|
196
210
|
e.forEach((e2) => {
|
|
197
|
-
a.forEach((
|
|
198
|
-
e2[
|
|
211
|
+
a.forEach((r2) => {
|
|
212
|
+
e2[r2] && t2.push(e2[r2]);
|
|
199
213
|
});
|
|
200
214
|
}), n.forEach((t3) => {
|
|
201
|
-
const
|
|
215
|
+
const o2 = {}, n2 = r.find((e2) => {
|
|
202
216
|
var _a, _b;
|
|
203
217
|
return ((_b = (_a = e2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop) === t3;
|
|
204
218
|
});
|
|
205
|
-
n2 && (
|
|
206
|
-
a.forEach((
|
|
207
|
-
const a2 = e2[
|
|
208
|
-
|
|
219
|
+
n2 && (o2.$GroupColumn = n2.props.base.name), e.forEach((e2) => {
|
|
220
|
+
a.forEach((r2) => {
|
|
221
|
+
const a2 = e2[r2], n3 = e2[t3];
|
|
222
|
+
o2[a2] = n3;
|
|
209
223
|
});
|
|
210
|
-
}), s.push(
|
|
224
|
+
}), s.push(o2);
|
|
211
225
|
});
|
|
212
226
|
}
|
|
213
227
|
return s;
|
|
214
228
|
}
|
|
215
229
|
function colDataToRow(e, t) {
|
|
216
|
-
const
|
|
230
|
+
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;
|
|
217
231
|
if (0 === e.length) return e;
|
|
218
|
-
const l = [], i = groupBy(e,
|
|
219
|
-
e2[
|
|
232
|
+
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) => {
|
|
233
|
+
e2[r2] = t2.prop;
|
|
220
234
|
}), e2), {});
|
|
221
235
|
return i.forEach((e2) => {
|
|
222
236
|
c.columns.forEach((t2) => {
|
|
223
237
|
const i2 = c.prop, p = {};
|
|
224
|
-
if (
|
|
238
|
+
if (r.forEach((t3) => {
|
|
225
239
|
p[t3] = e2[t3];
|
|
226
240
|
}), p[i2] = e2[t2], a.length > 1) {
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
241
|
+
const r2 = s.find((e3) => e3.props.includes(t2));
|
|
242
|
+
r2 && r2.props.length > 1 && r2.props.forEach((r3) => {
|
|
243
|
+
r3 !== t2 && u[r3] && (p[u[r3]] = e2[r3]);
|
|
230
244
|
});
|
|
231
245
|
}
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
let
|
|
235
|
-
|
|
236
|
-
if (
|
|
237
|
-
}),
|
|
246
|
+
o.forEach((e3) => {
|
|
247
|
+
const r2 = n.filter((t3) => t3.relatedTitle === e3.prop);
|
|
248
|
+
let o2 = false;
|
|
249
|
+
r2 && r2.length > 0 && r2.forEach((r3) => {
|
|
250
|
+
if (r3.columns.includes(t2)) return p[e3.prop] = r3.label, void (o2 = true);
|
|
251
|
+
}), o2 || (p[e3.prop] = t2);
|
|
238
252
|
}), l.push(p);
|
|
239
253
|
});
|
|
240
254
|
}), l;
|
|
241
255
|
}
|
|
242
256
|
function getColumnToRowTableConfig(e) {
|
|
243
|
-
const t = e.items,
|
|
244
|
-
|
|
257
|
+
const t = e.items, r = e.props.dataOrigin.groupField, o = e.props.dataOrigin.columnToRow.titleColumns, a = e.props.dataOrigin.columnToRow.dataColumns, n = [];
|
|
258
|
+
r && r.length > 0 && r.forEach((e2) => {
|
|
245
259
|
if (t) {
|
|
246
|
-
const
|
|
247
|
-
|
|
260
|
+
const r2 = t.find((t2) => t2.props.base.prop === e2);
|
|
261
|
+
r2 && n.push(r2);
|
|
248
262
|
}
|
|
249
263
|
});
|
|
250
|
-
return [...
|
|
264
|
+
return [...o, ...a].forEach((e2) => {
|
|
251
265
|
if (t) {
|
|
252
|
-
const
|
|
253
|
-
|
|
266
|
+
const r2 = t.find((t2) => t2.props.base.prop === e2);
|
|
267
|
+
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: "" } } } });
|
|
254
268
|
}
|
|
255
269
|
}), n;
|
|
256
270
|
}
|
|
257
271
|
function groupBy(e, t) {
|
|
258
|
-
const
|
|
272
|
+
const r = {};
|
|
259
273
|
return e.forEach((e2) => {
|
|
260
|
-
const
|
|
261
|
-
o
|
|
262
|
-
o
|
|
263
|
-
})), o
|
|
264
|
-
}), Object.values(
|
|
274
|
+
const o = t.map((t2) => e2[t2]).join("|");
|
|
275
|
+
r[o] || (r[o] = { ...e2, records: [] }, t.forEach((t2, a) => {
|
|
276
|
+
r[o][t2] = e2[t2];
|
|
277
|
+
})), r[o].records.push(e2);
|
|
278
|
+
}), Object.values(r).map((e2) => ({ ...e2, records: void 0 }));
|
|
265
279
|
}
|
|
266
280
|
function getIndexColumn() {
|
|
267
281
|
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: "" } };
|
|
268
282
|
}
|
|
269
|
-
function getNewColumnConfig(e, t,
|
|
270
|
-
return { uuid: (/* @__PURE__ */ new Date()).getTime(), name: "", props: { base: { prop: e, name: t, displayOrder:
|
|
283
|
+
function getNewColumnConfig(e, t, r, o) {
|
|
284
|
+
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: "" } } } };
|
|
271
285
|
}
|
|
272
286
|
function computeFormula(itemConfs, datas, entity) {
|
|
273
287
|
Object.keys(itemConfs).forEach((key) => {
|
|
@@ -280,15 +294,15 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
280
294
|
else if (e.startsWith("${avg.")) totalValueMap[e] = getAvgValue(datas, getFieldName(e));
|
|
281
295
|
else if (e.startsWith("${add.")) {
|
|
282
296
|
const t = getFieldName(e);
|
|
283
|
-
let
|
|
297
|
+
let r = 0;
|
|
284
298
|
try {
|
|
285
|
-
|
|
286
|
-
|
|
299
|
+
r = Number(data[t]), datas.slice(0, index).forEach((e2) => {
|
|
300
|
+
r += Number(e2[t]);
|
|
287
301
|
});
|
|
288
302
|
} catch (e2) {
|
|
289
|
-
|
|
303
|
+
r = 0;
|
|
290
304
|
}
|
|
291
|
-
totalValueMap[e] =
|
|
305
|
+
totalValueMap[e] = r;
|
|
292
306
|
} 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));
|
|
293
307
|
let expr = itemConfs[key];
|
|
294
308
|
Object.keys(totalValueMap).forEach((e) => {
|
|
@@ -306,8 +320,8 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
306
320
|
function getFieldName(e) {
|
|
307
321
|
return e.substring(6, e.length - 1);
|
|
308
322
|
}
|
|
309
|
-
function formatColContent(e, t,
|
|
310
|
-
const n = e[
|
|
323
|
+
function formatColContent(e, t, r, o, a) {
|
|
324
|
+
const n = e[r.props.base.prop];
|
|
311
325
|
switch (t.type) {
|
|
312
326
|
case "number":
|
|
313
327
|
return formatNumber(n, t);
|
|
@@ -316,28 +330,28 @@ function formatColContent(e, t, o, r, a) {
|
|
|
316
330
|
case "percent":
|
|
317
331
|
return formatPercent(n, t);
|
|
318
332
|
case "custom":
|
|
319
|
-
return formatCustomFunc(e, t,
|
|
333
|
+
return formatCustomFunc(e, t, r, o, a);
|
|
320
334
|
default:
|
|
321
335
|
return n;
|
|
322
336
|
}
|
|
323
337
|
}
|
|
324
338
|
function formatNumber(e, t) {
|
|
325
|
-
let
|
|
326
|
-
return
|
|
339
|
+
let r = e;
|
|
340
|
+
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;
|
|
327
341
|
}
|
|
328
342
|
function formatCurrency(e, t) {
|
|
329
|
-
let
|
|
330
|
-
return
|
|
343
|
+
let r = e;
|
|
344
|
+
return r || (r = 0), t.decimalDigit && (r = Number(e).toFixed(t.decimalDigit)), t.symbol && (r = `${t.symbol} ${r}`), r;
|
|
331
345
|
}
|
|
332
346
|
function formatPercent(e, t) {
|
|
333
|
-
let
|
|
334
|
-
return
|
|
347
|
+
let r = e;
|
|
348
|
+
return r || (r = 0), t.decimalDigit && (r = Number(e).toFixed(t.decimalDigit)), r + " %";
|
|
335
349
|
}
|
|
336
|
-
function formatCustomFunc(e, t,
|
|
337
|
-
const n = getCustomFunc(
|
|
350
|
+
function formatCustomFunc(e, t, r, o, a) {
|
|
351
|
+
const n = getCustomFunc(o, t.customFunc);
|
|
338
352
|
if (n) {
|
|
339
353
|
try {
|
|
340
|
-
return n.apply(n, [{ pageContext:
|
|
354
|
+
return n.apply(n, [{ pageContext: o, configureObj: a, row: e, prop: r.props.base.prop }]);
|
|
341
355
|
} catch (e2) {
|
|
342
356
|
}
|
|
343
357
|
return "";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as o, ref as e, resolveComponent as t, createBlock as r, openBlock as p, withCtx as l, createElementBlock as s, Fragment as n, createTextVNode as a, toDisplayString as
|
|
1
|
+
import { defineComponent as o, ref as e, resolveComponent as t, createBlock as r, openBlock as p, withCtx as l, createElementBlock as s, Fragment as n, createTextVNode as a, toDisplayString as i, resolveDynamicComponent as u, createVNode as c, createCommentVNode as m, createElementVNode as f, normalizeClass as g } from "vue";
|
|
2
2
|
import "agilebuilder-ui/src/utils/common-util";
|
|
3
3
|
import "agilebuilder-ui/src/utils/util";
|
|
4
4
|
import "agilebuilder-ui/src/utils/request";
|
|
5
|
+
import "agilebuilder-ui/src/store";
|
|
5
6
|
import "element-plus";
|
|
6
7
|
import "agilebuilder-ui/src/utils/auth";
|
|
7
8
|
import "../../../../utils/global-refs.js";
|
|
@@ -37,7 +38,7 @@ const k = { key: 0 }, w = { key: 1 }, h = { key: 1 }, x = { key: 2 }, C = o({ __
|
|
|
37
38
|
}
|
|
38
39
|
return C2.column.linkPage && C2.column.linkPage.length > 0 && (j.value = true), (e2, d2) => {
|
|
39
40
|
const y2 = t("el-table-column"), b2 = t("el-progress"), C3 = t("el-tag"), v2 = t("el-link");
|
|
40
|
-
return "$index" === o2.column.props.base.prop ? (p(), r(y2, { key: 0, label: o2.column.props.base.name, type: "index", align: "center", "header-align": "center", width: "80" }, null, 8, ["label"])) : (p(), r(y2, { key: 1, prop: o2.column.props.base.prop, width: o2.column.props.base.width ? o2.column.props.base.width : "", label: o2.column.props.base.name, "header-align": o2.column.props.base.headerAlign, align: o2.column.props.base.align, fixed: !!o2.column.props.base.fixed && o2.column.props.base.fixed, formatter: O }, { default: l((e3) => [o2.column.props.format && o2.column.props.format.type ? (p(), s(n, { key: 0 }, [a(
|
|
41
|
+
return "$index" === o2.column.props.base.prop ? (p(), r(y2, { key: 0, label: o2.column.props.base.name, type: "index", align: "center", "header-align": "center", width: "80" }, null, 8, ["label"])) : (p(), r(y2, { key: 1, prop: o2.column.props.base.prop, width: o2.column.props.base.width ? o2.column.props.base.width : "", label: o2.column.props.base.name, "header-align": o2.column.props.base.headerAlign, align: o2.column.props.base.align, fixed: !!o2.column.props.base.fixed && o2.column.props.base.fixed, formatter: O }, { default: l((e3) => [o2.column.props.format && o2.column.props.format.type ? (p(), s(n, { key: 0 }, [a(i(o2.column.props.format.status) + " ", 1), "customControl" === o2.column.props.format.type ? (p(), r(u(o2.column.props.format.customControl), { key: 0, scope: e3, column: o2.column, configure: o2.configure, pageContext: o2.pageContext }, null, 8, ["scope", "column", "configure", "pageContext"])) : "progress" === o2.column.props.format.type ? (p(), r(b2, { key: 1, type: o2.column.props.format.progressType, percentage: e3.row[o2.column.props.base.prop], status: o2.column.props.format.status, "text-inside": o2.column.props.format.showText, "stroke-width": o2.column.props.format.strokeWidth, color: "custom" === o2.column.props.format.colorType ? o2.column.props.format.color : "" }, null, 8, ["type", "percentage", "status", "text-inside", "stroke-width", "color"])) : "icon" === o2.column.props.format.type ? (p(), s(n, { key: 2 }, [o2.column.props.format.isTag ? (p(), s("span", k, [c(C3, { type: o2.column.props.format.tagType, effect: o2.column.props.format.tagEffect, hit: o2.column.props.format.hit, size: o2.column.props.format.size }, { default: l(() => [a(i(e3.row[o2.column.props.base.prop]), 1)]), _: 2 }, 1032, ["type", "effect", "hit", "size"])])) : (p(), s("span", w, ["pre" === o2.column.props.format.position ? (p(), s("i", { key: 0, class: g(o2.column.props.format.icon) }, null, 2)) : m("", true), f("span", null, i(e3.row[o2.column.props.base.prop]), 1), "suf" === o2.column.props.format.position ? (p(), s("i", { key: 1, class: g(o2.column.props.format.icon) }, null, 2)) : m("", true)]))], 64)) : (p(), s(n, { key: 3 }, [j.value && _(e3.row) ? (p(), r(v2, { key: 0, type: "primary", onClick: (o3) => P(e3.row) }, { default: l(() => [a(i(T(e3.row, o2.column.props.format)), 1)]), _: 2 }, 1032, ["onClick"])) : (p(), s("span", h, i(T(e3.row, o2.column.props.format)), 1))], 64))], 64)) : j.value && _(e3.row) ? (p(), r(v2, { key: 1, type: "primary", onClick: (o3) => P(e3.row) }, { default: l(() => [a(i(e3.row[o2.column.props.base.prop]), 1)]), _: 2 }, 1032, ["onClick"])) : (p(), s("span", x, i(e3.row[o2.column.props.base.prop]), 1))]), _: 1 }, 8, ["prop", "width", "label", "header-align", "align", "fixed"]));
|
|
41
42
|
};
|
|
42
43
|
} });
|
|
43
44
|
export {
|