super-page-runtime 2.2.0 → 2.2.3
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/events/standard-event.d.ts +2 -2
- package/dist/es/components/runtime/utils/events/standard-event.js +49 -41
- package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +2 -0
- package/dist/es/components/runtime/utils/page-helper-util.js +8 -12
- package/dist/es/components/runtime/utils/page-init-util.d.ts +6 -1
- package/dist/es/components/runtime/utils/page-init-util.js +38 -35
- 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/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 +3 -3
- 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 -0
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +146 -112
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +19 -50
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +129 -105
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +16 -17
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +86 -82
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +25 -28
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +14 -12
- package/dist/es/components/runtime/views/super-page.vue.d.ts +9 -0
- package/dist/es/components/runtime/views/super-page.vue.js +163 -161
- package/package.json +2 -2
|
@@ -2,38 +2,38 @@ 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 a = t.map((t2) => this.createExpression(e, t2, o)).join(" ");
|
|
7
|
+
return this.evaluateExpression(a);
|
|
8
8
|
}
|
|
9
|
-
static createExpression(e, t,
|
|
10
|
-
const { propName:
|
|
11
|
-
if (!
|
|
9
|
+
static createExpression(e, t, o) {
|
|
10
|
+
const { propName: a, operator: r, propValue: n, leftBracket: s, rightBracket: l, joinSign: i, dataType: c } = t;
|
|
11
|
+
if (!a || "" === a)
|
|
12
12
|
return "";
|
|
13
|
-
const u = getValueFromVariable(e.entity,
|
|
14
|
-
let p = `${
|
|
13
|
+
const u = getValueFromVariable(e.entity, a, o);
|
|
14
|
+
let p = `${s} ${this.getComparisonExpression(u, r, getValueFromVariable(e.entity, n, o), c)} ${l}`;
|
|
15
15
|
return i && ("and" === i || "AND" === i ? p += "&&" : "or" !== i && "OR" !== i || (p += "||")), p.trim();
|
|
16
16
|
}
|
|
17
|
-
static getComparisonExpression(e, t,
|
|
17
|
+
static getComparisonExpression(e, t, o, a) {
|
|
18
18
|
t || (t = "EQ");
|
|
19
|
-
const r = this.parseValue(e,
|
|
19
|
+
const r = this.parseValue(e, a), n = this.parseValue(o, a);
|
|
20
20
|
switch (t) {
|
|
21
21
|
case "EQ":
|
|
22
|
-
return `${r} === ${
|
|
22
|
+
return `${r} === ${n}`;
|
|
23
23
|
case "GT":
|
|
24
|
-
return `${r} > ${
|
|
24
|
+
return `${r} > ${n}`;
|
|
25
25
|
case "LT":
|
|
26
|
-
return `${r} < ${
|
|
26
|
+
return `${r} < ${n}`;
|
|
27
27
|
case "GET":
|
|
28
|
-
return `${r} >= ${
|
|
28
|
+
return `${r} >= ${n}`;
|
|
29
29
|
case "LET":
|
|
30
|
-
return `${r} <= ${
|
|
30
|
+
return `${r} <= ${n}`;
|
|
31
31
|
case "NET":
|
|
32
|
-
return `${r} !== ${
|
|
32
|
+
return `${r} !== ${n}`;
|
|
33
33
|
case "CONTAIN":
|
|
34
|
-
return `${r}.includes(${
|
|
34
|
+
return `${r}.includes(${n})`;
|
|
35
35
|
case "NOT_CONTAIN":
|
|
36
|
-
return `!${r}.includes(${
|
|
36
|
+
return `!${r}.includes(${n})`;
|
|
37
37
|
case "IS_NULL":
|
|
38
38
|
return `${r} === null`;
|
|
39
39
|
case "IS_NOT_NULL":
|
|
@@ -75,37 +75,37 @@ function getSummaryTitleColumn(e) {
|
|
|
75
75
|
}
|
|
76
76
|
function getSummaryDataColumn(e, t) {
|
|
77
77
|
var _a;
|
|
78
|
-
const
|
|
79
|
-
return ((_a = e.props.summaries) == null ? void 0 : _a.dataColumn) && e.props.summaries.dataColumn.length > 0 && e.props.summaries.dataColumn.forEach((
|
|
78
|
+
const o = {};
|
|
79
|
+
return ((_a = e.props.summaries) == null ? void 0 : _a.dataColumn) && e.props.summaries.dataColumn.length > 0 && e.props.summaries.dataColumn.forEach((a) => {
|
|
80
80
|
var _a2;
|
|
81
|
-
const r = (_a2 = e.items) == null ? void 0 : _a2.find((e2) =>
|
|
82
|
-
r && ("table" === t && r.props.base.tableSummary || "group" === t && r.props.base.groupSummary) && (a
|
|
83
|
-
}),
|
|
81
|
+
const r = (_a2 = e.items) == null ? void 0 : _a2.find((e2) => a.prop === e2.props.base.prop);
|
|
82
|
+
r && ("table" === t && r.props.base.tableSummary || "group" === t && r.props.base.groupSummary) && (o[a.prop] = a);
|
|
83
|
+
}), o;
|
|
84
84
|
}
|
|
85
|
-
function summaryStatistics(e, t,
|
|
85
|
+
function summaryStatistics(e, t, o, a) {
|
|
86
86
|
let r = "";
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
if ("custom" ===
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
const e2 =
|
|
87
|
+
const n = e.summaryMode, s = t.map((e2) => Number(e2[o])).filter((e2) => !Number.isNaN(e2));
|
|
88
|
+
if (s.length > 0)
|
|
89
|
+
if ("custom" === n) {
|
|
90
|
+
const n2 = getCustomFunc(a, e.customFunc);
|
|
91
|
+
if (n2) {
|
|
92
|
+
const e2 = n2.apply(n2, [{ data: t, prop: o }]);
|
|
93
93
|
r = e2 ? ` ${e2}` : " N/A";
|
|
94
94
|
} else
|
|
95
95
|
r = " N/A";
|
|
96
96
|
} else
|
|
97
|
-
switch (
|
|
97
|
+
switch (n) {
|
|
98
98
|
case "sum":
|
|
99
|
-
r = ` ${
|
|
99
|
+
r = ` ${s.reduce((e2, t2) => e2 + t2, 0)}`;
|
|
100
100
|
break;
|
|
101
101
|
case "avg":
|
|
102
|
-
r = " " +
|
|
102
|
+
r = " " + s.reduce((e2, t2) => e2 + t2, 0) / s.length;
|
|
103
103
|
break;
|
|
104
104
|
case "min":
|
|
105
|
-
r = ` ${Math.min(...
|
|
105
|
+
r = ` ${Math.min(...s)}`;
|
|
106
106
|
break;
|
|
107
107
|
case "max":
|
|
108
|
-
r = ` ${Math.max(...
|
|
108
|
+
r = ` ${Math.max(...s)}`;
|
|
109
109
|
break;
|
|
110
110
|
default:
|
|
111
111
|
r = " N/A";
|
|
@@ -116,69 +116,69 @@ function summaryStatistics(e, t, a, o) {
|
|
|
116
116
|
}
|
|
117
117
|
function replacePlaceholders(e, t) {
|
|
118
118
|
if (e)
|
|
119
|
-
return e.replace(/\$\{row\.(\w+)\}/g, (e2,
|
|
119
|
+
return e.replace(/\$\{row\.(\w+)\}/g, (e2, o) => Object.prototype.hasOwnProperty.call(t, o) ? t[o] : "");
|
|
120
120
|
}
|
|
121
|
-
function getHeaderCellStyleUtil(e, t,
|
|
121
|
+
function getHeaderCellStyleUtil(e, t, o) {
|
|
122
122
|
var _a;
|
|
123
|
-
const
|
|
123
|
+
const a = {};
|
|
124
124
|
e.column.property && ((_a = t.titleStyle) == null ? void 0 : _a.forEach((t2) => {
|
|
125
125
|
if (t2.field && t2.field.includes(e.column.property))
|
|
126
126
|
if (t2.scopeFunc) {
|
|
127
|
-
const r2 = getCustomFunc(
|
|
127
|
+
const r2 = getCustomFunc(o.pageContext, t2.scopeFunc);
|
|
128
128
|
if (r2) {
|
|
129
|
-
false !== r2.apply(r2, [{ item: t2, data: e }]) && copyStyle(
|
|
129
|
+
false !== r2.apply(r2, [{ item: t2, data: e }]) && copyStyle(a, t2);
|
|
130
130
|
}
|
|
131
131
|
} else
|
|
132
|
-
copyStyle(
|
|
132
|
+
copyStyle(a, t2);
|
|
133
133
|
}));
|
|
134
|
-
const r = getCellStyleUtil(e, t.cellTitleStyle,
|
|
135
|
-
return r && Object.assign(
|
|
134
|
+
const r = getCellStyleUtil(e, t.cellTitleStyle, o);
|
|
135
|
+
return r && Object.assign(a, r), a;
|
|
136
136
|
}
|
|
137
|
-
function getRowStyleUtil(e, t,
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
for (let t2 = 0; t2 <
|
|
141
|
-
const r =
|
|
137
|
+
function getRowStyleUtil(e, t, o) {
|
|
138
|
+
const a = {};
|
|
139
|
+
if (o.configure.style.rowStyle)
|
|
140
|
+
for (let t2 = 0; t2 < o.configure.style.rowStyle.length; t2++) {
|
|
141
|
+
const r = o.configure.style.rowStyle[t2];
|
|
142
142
|
if (r.scopeFunc) {
|
|
143
|
-
const t3 = getCustomFunc(
|
|
143
|
+
const t3 = getCustomFunc(o.pageContext, r.scopeFunc);
|
|
144
144
|
if (t3) {
|
|
145
|
-
const
|
|
146
|
-
null !=
|
|
145
|
+
const o2 = t3.apply(t3, [{ data: e }]);
|
|
146
|
+
null != o2 && false !== o2 && copyStyle(a, r);
|
|
147
147
|
}
|
|
148
148
|
} else if (r.matchingCondition) {
|
|
149
|
-
const t3 = ExpressionEvaluator.evaluate(
|
|
150
|
-
(t3 || void 0 === t3) && copyStyle(
|
|
149
|
+
const t3 = ExpressionEvaluator.evaluate(o.pageContext, r.matchingCondition, e.row);
|
|
150
|
+
(t3 || void 0 === t3) && copyStyle(a, r);
|
|
151
151
|
} else
|
|
152
|
-
copyStyle(
|
|
152
|
+
copyStyle(a, r);
|
|
153
153
|
}
|
|
154
154
|
if (t && t.length > 0 && -1 !== t.indexOf(e.rowIndex)) {
|
|
155
155
|
const e2 = {};
|
|
156
|
-
if (
|
|
157
|
-
for (let t2 = 0; t2 <
|
|
158
|
-
copyStyle(e2,
|
|
156
|
+
if (o.configure.style.collectStyle && o.configure.style.collectStyle.length > 0)
|
|
157
|
+
for (let t2 = 0; t2 < o.configure.style.collectStyle.length; t2++) {
|
|
158
|
+
copyStyle(e2, o.configure.style.collectStyle[t2]);
|
|
159
159
|
}
|
|
160
160
|
return 0 === Object.keys(e2).length && (e2["background-color"] = "var(--el-table-row-hover-bg-color)"), e2;
|
|
161
161
|
}
|
|
162
|
-
return
|
|
162
|
+
return a;
|
|
163
163
|
}
|
|
164
|
-
function getCellStyleUtil(e, t,
|
|
165
|
-
const
|
|
164
|
+
function getCellStyleUtil(e, t, o) {
|
|
165
|
+
const a = {};
|
|
166
166
|
if (t)
|
|
167
167
|
for (let r = 0; r < t.length; r++) {
|
|
168
|
-
const
|
|
169
|
-
if (isSetStyle(
|
|
170
|
-
if (
|
|
171
|
-
const t2 = getCustomFunc(
|
|
168
|
+
const n = t[r];
|
|
169
|
+
if (isSetStyle(n))
|
|
170
|
+
if (n.scopeFunc) {
|
|
171
|
+
const t2 = getCustomFunc(o.pageContext, n.scopeFunc);
|
|
172
172
|
if (t2) {
|
|
173
|
-
false !== t2.apply(t2, [{ data: e }]) && copyStyle(
|
|
173
|
+
false !== t2.apply(t2, [{ data: e }]) && copyStyle(a, n);
|
|
174
174
|
}
|
|
175
|
-
} else if (
|
|
176
|
-
const t2 = ExpressionEvaluator.evaluate(
|
|
177
|
-
(t2 || void 0 === t2) && copyStyle(
|
|
175
|
+
} else if (n.matchingCondition) {
|
|
176
|
+
const t2 = ExpressionEvaluator.evaluate(o.pageContext, n.matchingCondition, e.row);
|
|
177
|
+
(t2 || void 0 === t2) && copyStyle(a, n);
|
|
178
178
|
} else
|
|
179
|
-
copyStyle(
|
|
179
|
+
copyStyle(a, n);
|
|
180
180
|
}
|
|
181
|
-
return
|
|
181
|
+
return a;
|
|
182
182
|
}
|
|
183
183
|
function isSetStyle(e) {
|
|
184
184
|
let t;
|
|
@@ -188,71 +188,71 @@ function copyStyle(e, t) {
|
|
|
188
188
|
Object.assign(e, t.style), t.customStyle && Object.assign(e, JSON.parse(t.customStyle));
|
|
189
189
|
}
|
|
190
190
|
function rowDataToColumn(e, t) {
|
|
191
|
-
const
|
|
191
|
+
const o = t.props.dataOrigin.groupField, a = t.props.dataOrigin.rowToColumn.titleColumns, r = t.props.dataOrigin.rowToColumn.dataColumns, n = [], s = {};
|
|
192
192
|
return e.forEach((e2) => {
|
|
193
|
-
const t2 =
|
|
194
|
-
if (!
|
|
195
|
-
const
|
|
196
|
-
|
|
193
|
+
const t2 = o.map((t3) => e2[t3]).join("|");
|
|
194
|
+
if (!s[t2]) {
|
|
195
|
+
const a2 = {};
|
|
196
|
+
o.forEach((t3) => a2[t3] = e2[t3]), s[t2] = a2, n.push(a2);
|
|
197
197
|
}
|
|
198
|
-
r.forEach((
|
|
199
|
-
const r2 = `${
|
|
200
|
-
|
|
198
|
+
r.forEach((o2) => {
|
|
199
|
+
const r2 = `${a.map((t3) => e2[t3]).join("")}${o2}`;
|
|
200
|
+
s[t2][r2] = e2[o2];
|
|
201
201
|
});
|
|
202
|
-
}),
|
|
202
|
+
}), n;
|
|
203
203
|
}
|
|
204
204
|
function colDataToRow(e, t) {
|
|
205
|
-
const
|
|
205
|
+
const o = t.props.dataOrigin.groupField, a = t.props.dataOrigin.columnToRow.titleColumns, r = t.props.dataOrigin.columnToRow.dataColumns, n = t.props.dataOrigin.columnToRow.transColumns, s = t.props.dataOrigin.columnToRow.dataColumnsMapping;
|
|
206
206
|
if (0 === e.length)
|
|
207
207
|
return e;
|
|
208
|
-
const l = [], i = groupBy(e,
|
|
209
|
-
e2[
|
|
208
|
+
const l = [], i = groupBy(e, o), c = r.reduce((e2, t2) => t2.columns.length > e2.columns.length ? t2 : e2, r[0]), u = r.reduce((e2, t2) => (t2.columns.forEach((o2) => {
|
|
209
|
+
e2[o2] = t2.prop;
|
|
210
210
|
}), e2), {});
|
|
211
211
|
return i.forEach((e2) => {
|
|
212
212
|
c.columns.forEach((t2) => {
|
|
213
213
|
const i2 = c.prop, p = {};
|
|
214
|
-
if (
|
|
214
|
+
if (o.forEach((t3) => {
|
|
215
215
|
p[t3] = e2[t3];
|
|
216
216
|
}), p[i2] = e2[t2], r.length > 1) {
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
const o2 = s.find((e3) => e3.props.includes(t2));
|
|
218
|
+
o2 && o2.props.length > 1 && o2.props.forEach((o3) => {
|
|
219
|
+
o3 !== t2 && u[o3] && (p[u[o3]] = e2[o3]);
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
let
|
|
225
|
-
|
|
226
|
-
if (
|
|
227
|
-
return p[e3.prop] =
|
|
228
|
-
}),
|
|
222
|
+
a.forEach((e3) => {
|
|
223
|
+
const o2 = n.filter((t3) => t3.relatedTitle === e3.prop);
|
|
224
|
+
let a2 = false;
|
|
225
|
+
o2 && o2.length > 0 && o2.forEach((o3) => {
|
|
226
|
+
if (o3.columns.includes(t2))
|
|
227
|
+
return p[e3.prop] = o3.label, void (a2 = true);
|
|
228
|
+
}), a2 || (p[e3.prop] = t2);
|
|
229
229
|
}), l.push(p);
|
|
230
230
|
});
|
|
231
231
|
}), l;
|
|
232
232
|
}
|
|
233
233
|
function getColumnToRowTableConfig(e) {
|
|
234
|
-
const t = e.items,
|
|
235
|
-
|
|
234
|
+
const t = e.items, o = e.props.dataOrigin.groupField, a = e.props.dataOrigin.columnToRow.titleColumns, r = e.props.dataOrigin.columnToRow.dataColumns, n = [];
|
|
235
|
+
o.forEach((e2) => {
|
|
236
236
|
if (t) {
|
|
237
|
-
const
|
|
238
|
-
|
|
237
|
+
const o2 = t.find((t2) => t2.props.base.prop === e2);
|
|
238
|
+
o2 && n.push(o2);
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
|
-
return [...
|
|
241
|
+
return [...a, ...r].forEach((e2) => {
|
|
242
242
|
if (t) {
|
|
243
|
-
const
|
|
244
|
-
|
|
243
|
+
const o2 = t.find((t2) => t2.props.base.prop === e2);
|
|
244
|
+
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: "" } } } });
|
|
245
245
|
}
|
|
246
|
-
}),
|
|
246
|
+
}), n;
|
|
247
247
|
}
|
|
248
248
|
function groupBy(e, t) {
|
|
249
|
-
const
|
|
249
|
+
const o = {};
|
|
250
250
|
return e.forEach((e2) => {
|
|
251
|
-
const
|
|
252
|
-
a
|
|
253
|
-
a
|
|
254
|
-
})), a
|
|
255
|
-
}), Object.values(
|
|
251
|
+
const a = t.map((t2) => e2[t2]).join("|");
|
|
252
|
+
o[a] || (o[a] = { ...e2, records: [] }, t.forEach((t2, r) => {
|
|
253
|
+
o[a][t2] = e2[t2];
|
|
254
|
+
})), o[a].records.push(e2);
|
|
255
|
+
}), Object.values(o).map((e2) => ({ ...e2, records: void 0 }));
|
|
256
256
|
}
|
|
257
257
|
function getIndexColumn() {
|
|
258
258
|
return { props: { base: { name: "序号", prop: "$index", columnWidth: 80, sortable: true, visible: true, displayOrder: 1, alignTitle: "center", alignContent: "center" } }, events: [], style: { titleFont: {}, contentFont: {}, width: {}, background: {}, tableCell: [{ type: "", model: "" }], conentPadding: {}, tittlePadding: {}, border: {}, shadow: {}, tittleClass: "" } };
|
|
@@ -273,15 +273,15 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
273
273
|
totalValueMap[e] = getAvgValue(datas, getFieldName(e));
|
|
274
274
|
else if (e.startsWith("${add.")) {
|
|
275
275
|
const t = getFieldName(e);
|
|
276
|
-
let
|
|
276
|
+
let o = 0;
|
|
277
277
|
try {
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
o = Number(data[t]), datas.slice(0, index).forEach((e2) => {
|
|
279
|
+
o += Number(e2[t]);
|
|
280
280
|
});
|
|
281
281
|
} catch (e2) {
|
|
282
|
-
|
|
282
|
+
o = 0;
|
|
283
283
|
}
|
|
284
|
-
totalValueMap[e] =
|
|
284
|
+
totalValueMap[e] = o;
|
|
285
285
|
} else
|
|
286
286
|
(e.startsWith("${page.") || e.startsWith("${data.") || e.startsWith("${row.") || e.startsWith("${request.") || e.startsWith("${context.") || e.startsWith("${system.") || e.startsWith("${fixed.")) && (totalValueMap[e] = getValueFromVariable(entity, e, data));
|
|
287
287
|
let expr = itemConfs[key];
|
|
@@ -301,10 +301,44 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
301
301
|
function getFieldName(e) {
|
|
302
302
|
return e.substring(6, e.length - 1);
|
|
303
303
|
}
|
|
304
|
+
function formatColContent(e, t, o, a, r) {
|
|
305
|
+
const n = e[o.props.base.prop];
|
|
306
|
+
switch (t.type) {
|
|
307
|
+
case "number":
|
|
308
|
+
return formatNumber(n, t);
|
|
309
|
+
case "currency":
|
|
310
|
+
return formatCurrency(n, t);
|
|
311
|
+
case "percent":
|
|
312
|
+
return formatPercent(n, t);
|
|
313
|
+
case "custom":
|
|
314
|
+
return formatCustomFunc(e, t, o, a, r);
|
|
315
|
+
default:
|
|
316
|
+
return n;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function formatNumber(e, t) {
|
|
320
|
+
let o = e;
|
|
321
|
+
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;
|
|
322
|
+
}
|
|
323
|
+
function formatCurrency(e, t) {
|
|
324
|
+
let o = e;
|
|
325
|
+
return o || (o = 0), t.decimalDigit && (o = Number(e).toFixed(t.decimalDigit)), t.symbol && (o = `${t.symbol} ${o}`), o;
|
|
326
|
+
}
|
|
327
|
+
function formatPercent(e, t) {
|
|
328
|
+
let o = e;
|
|
329
|
+
return o || (o = 0), t.decimalDigit && (o = Number(e).toFixed(t.decimalDigit)), o + " %";
|
|
330
|
+
}
|
|
331
|
+
function formatCustomFunc(e, t, o, a, r) {
|
|
332
|
+
const n = getCustomFunc(a, t.customFunc);
|
|
333
|
+
if (n) {
|
|
334
|
+
return n.apply(n, [{ pageContext: a, configureObj: r, row: e, prop: o.props.base.prop }]);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
304
337
|
export {
|
|
305
338
|
ExpressionEvaluator,
|
|
306
339
|
colDataToRow,
|
|
307
340
|
computeFormula,
|
|
341
|
+
formatColContent,
|
|
308
342
|
getCellStyleUtil,
|
|
309
343
|
getColumnToRowTableConfig,
|
|
310
344
|
getHeaderCellStyleUtil,
|
|
@@ -1,73 +1,42 @@
|
|
|
1
|
-
import { defineComponent as o, ref as e, resolveComponent as t, openBlock as r, createBlock as p, withCtx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as o, ref as e, resolveComponent as t, openBlock as r, createBlock as p, withCtx as l, createElementBlock as s, Fragment as n, createTextVNode as a, toDisplayString as u, resolveDynamicComponent as i, createVNode as c, normalizeClass as m, createCommentVNode as f, createElementVNode as g } from "vue";
|
|
2
|
+
import "agilebuilder-ui/src/utils/common-util";
|
|
3
|
+
import "agilebuilder-ui/src/utils/util";
|
|
4
4
|
import "agilebuilder-ui/src/utils/request";
|
|
5
|
+
import "element-plus";
|
|
6
|
+
import "agilebuilder-ui/src/utils/auth";
|
|
7
|
+
import "../../../../utils/global-refs.js";
|
|
8
|
+
import d from "../../../../utils/eventBus.js";
|
|
9
|
+
import "axios";
|
|
5
10
|
import "dayjs";
|
|
6
11
|
import "agilebuilder-ui/src/utils/calculator/calculator-util";
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "agilebuilder-ui/src/utils/util";
|
|
12
|
+
import "async-validator";
|
|
13
|
+
import "../../../../utils/events/print-label.js";
|
|
10
14
|
import { expressJump as y } from "../../../../utils/table-utils.js";
|
|
11
|
-
|
|
15
|
+
import { formatColContent as b } from "./chart-table-util.js";
|
|
16
|
+
const k = { key: 0 }, w = { key: 1 }, h = { key: 1 }, x = { key: 2 }, C = o({ __name: "normal-column", props: { configure: { type: Object, default: () => ({}) }, pageContext: { type: Object, default: () => ({}) }, column: { type: Object, default: () => ({}) } }, setup(o2) {
|
|
12
17
|
const C2 = o2, j = e(false);
|
|
13
18
|
let v = null;
|
|
14
19
|
function O(o3, e2, t2, r2) {
|
|
15
20
|
}
|
|
16
|
-
function
|
|
21
|
+
function _(o3) {
|
|
17
22
|
const e2 = y(C2.pageContext, C2.configure, C2.column.linkPage, o3);
|
|
18
23
|
let t2 = false;
|
|
19
24
|
return e2 && (t2 = e2.show, v = e2.toPage), t2;
|
|
20
25
|
}
|
|
21
|
-
function
|
|
26
|
+
function P(o3) {
|
|
22
27
|
if (v) {
|
|
23
28
|
const e2 = C2.pageContext.code + "_", t2 = JSON.parse(JSON.stringify(v));
|
|
24
29
|
t2.base = { successOperation: "closeWindow" };
|
|
25
30
|
const r2 = { id: o3.id ? o3.id : o3.ID, selections: [o3] };
|
|
26
|
-
|
|
31
|
+
d.$emit(e2 + "open-dialog", { pageContext: C2.pageContext, configureObj: { props: t2 }, eventParams: r2 });
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
switch (e2.type) {
|
|
32
|
-
case "number":
|
|
33
|
-
return function(o4, e3) {
|
|
34
|
-
let t3 = o4;
|
|
35
|
-
t3 || (t3 = 0);
|
|
36
|
-
e3.scientific && (t3 = Number(o4).toExponential(e3.scientificNum));
|
|
37
|
-
e3.decimalDigit && (t3 = Number(o4).toFixed(e3.decimalDigit));
|
|
38
|
-
e3.thousandsSeparator && (t3 = t3.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
|
|
39
|
-
e3.symbol && (t3 = `${e3.symbol} ${t3}`);
|
|
40
|
-
return t3;
|
|
41
|
-
}(t2, e2);
|
|
42
|
-
case "currency":
|
|
43
|
-
return function(o4, e3) {
|
|
44
|
-
let t3 = o4;
|
|
45
|
-
t3 || (t3 = 0);
|
|
46
|
-
e3.decimalDigit && (t3 = Number(o4).toFixed(e3.decimalDigit));
|
|
47
|
-
e3.symbol && (t3 = `${e3.symbol} ${t3}`);
|
|
48
|
-
return t3;
|
|
49
|
-
}(t2, e2);
|
|
50
|
-
case "percent":
|
|
51
|
-
return function(o4, e3) {
|
|
52
|
-
let t3 = o4;
|
|
53
|
-
t3 || (t3 = 0);
|
|
54
|
-
e3.decimalDigit && (t3 = Number(o4).toFixed(e3.decimalDigit));
|
|
55
|
-
return t3 + " %";
|
|
56
|
-
}(t2, e2);
|
|
57
|
-
case "custom":
|
|
58
|
-
return function(o4, e3) {
|
|
59
|
-
const t3 = d(C2.pageContext, e3.customFunc);
|
|
60
|
-
if (t3) {
|
|
61
|
-
return t3.apply(t3, [{ pageContext: C2.pageContext, configureObj: C2.configure, row: o4, prop: C2.column.props.base.prop }]);
|
|
62
|
-
}
|
|
63
|
-
}(o3, e2);
|
|
64
|
-
default:
|
|
65
|
-
return t2;
|
|
66
|
-
}
|
|
34
|
+
function T(o3, e2) {
|
|
35
|
+
return b(o3, e2, C2.column, C2.pageContext, C2.configure);
|
|
67
36
|
}
|
|
68
37
|
return C2.column.linkPage && C2.column.linkPage.length > 0 && (j.value = true), (e2, d2) => {
|
|
69
|
-
const
|
|
70
|
-
return "$index" === o2.column.props.base.prop ? (r(), p(
|
|
38
|
+
const y2 = t("el-table-column"), b2 = t("el-progress"), C3 = t("el-tag"), v2 = t("el-link");
|
|
39
|
+
return "$index" === o2.column.props.base.prop ? (r(), p(y2, { key: 0, label: o2.column.props.base.name, type: "index", align: "center", "header-align": "center", width: "80" }, null, 8, ["label"])) : (r(), p(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 ? (r(), s(n, { key: 0 }, [a(u(o2.column.props.format.status) + " ", 1), "customControl" === o2.column.props.format.type ? (r(), p(i(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 ? (r(), p(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 ? (r(), s(n, { key: 2 }, [o2.column.props.format.isTag ? (r(), 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(u(e3.row[o2.column.props.base.prop]), 1)]), _: 2 }, 1032, ["type", "effect", "hit", "size"])])) : (r(), s("span", w, ["pre" === o2.column.props.format.position ? (r(), s("i", { key: 0, class: m(o2.column.props.format.icon) }, null, 2)) : f("", true), g("span", null, u(e3.row[o2.column.props.base.prop]), 1), "suf" === o2.column.props.format.position ? (r(), s("i", { key: 1, class: m(o2.column.props.format.icon) }, null, 2)) : f("", true)]))], 64)) : (r(), s(n, { key: 3 }, [j.value && _(e3.row) ? (r(), p(v2, { key: 0, type: "primary", onClick: (o3) => P(e3.row) }, { default: l(() => [a(u(T(e3.row, o2.column.props.format)), 1)]), _: 2 }, 1032, ["onClick"])) : (r(), s("span", h, u(T(e3.row, o2.column.props.format)), 1))], 64))], 64)) : j.value && _(e3.row) ? (r(), p(v2, { key: 1, type: "primary", onClick: (o3) => P(e3.row) }, { default: l(() => [a(u(e3.row[o2.column.props.base.prop]), 1)]), _: 2 }, 1032, ["onClick"])) : (r(), s("span", x, u(e3.row[o2.column.props.base.prop]), 1))]), _: 1 }, 8, ["prop", "width", "label", "header-align", "align", "fixed"]));
|
|
71
40
|
};
|
|
72
41
|
} });
|
|
73
42
|
export {
|