super-page-runtime 2.3.7 → 2.3.8
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 +76 -76
- package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +26 -24
- package/dist/es/components/runtime/utils/charts/chart-pie-util.js +59 -58
- package/dist/es/components/runtime/utils/charts/chart-radar-util.js +38 -37
- package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +28 -27
- package/dist/es/components/runtime/utils/charts/chart-util.d.ts +1 -0
- package/dist/es/components/runtime/utils/charts/chart-util.js +29 -22
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +4 -1
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +4 -4
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +4 -1
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +15 -15
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +4 -1
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +7 -7
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +4 -1
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +8 -8
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +4 -1
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +7 -7
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +86 -82
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +18 -15
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +4 -1
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +32 -29
- package/dist/es/style.css +30 -0
- package/package.json +2 -2
|
@@ -3,28 +3,32 @@ 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
5
|
static evaluate(e, t, r) {
|
|
6
|
+
if (t && t.length > 0) {
|
|
7
|
+
const e2 = t[t.length - 1];
|
|
8
|
+
e2.joinSign && (e2.joinSign = "");
|
|
9
|
+
}
|
|
6
10
|
const o = t.map((t2) => this.createExpression(e, t2, r)).join(" ");
|
|
7
11
|
return this.evaluateExpression(o);
|
|
8
12
|
}
|
|
9
13
|
static createExpression(e, t, r) {
|
|
10
|
-
const { propName: o, operator:
|
|
14
|
+
const { propName: o, operator: n, propValue: a, leftBracket: s, rightBracket: l, joinSign: i, dataType: c } = t;
|
|
11
15
|
if (!o || "" === o) return "";
|
|
12
16
|
const u = getValueFromVariable(e.entity, o, r);
|
|
13
|
-
let p = `${s} ${this.getComparisonExpression(u, t, getValueFromVariable(e.entity,
|
|
17
|
+
let p = `${s} ${this.getComparisonExpression(u, t, getValueFromVariable(e.entity, a, r))} ${l}`;
|
|
14
18
|
return i && ("and" === i || "AND" === i ? p += "&&" : "or" !== i && "OR" !== i || (p += "||")), p.trim();
|
|
15
19
|
}
|
|
16
20
|
static getComparisonExpression(e, t, r) {
|
|
17
|
-
const { dataType: o, variableIsNull:
|
|
18
|
-
let
|
|
19
|
-
|
|
21
|
+
const { dataType: o, variableIsNull: n } = t;
|
|
22
|
+
let a = t.operator;
|
|
23
|
+
a || (a = "EQ");
|
|
20
24
|
let s = this.parseValue(e, o);
|
|
21
25
|
const l = this.parseValue(r, o);
|
|
22
|
-
if (null == l &&
|
|
23
|
-
if (null == s && (s = "null"), "null" ===
|
|
24
|
-
if ("ignore" ===
|
|
25
|
-
if ("notequal" ===
|
|
26
|
+
if (null == l && n) {
|
|
27
|
+
if (null == s && (s = "null"), "null" === n) return `${s} === null`;
|
|
28
|
+
if ("ignore" === n) return "1=1";
|
|
29
|
+
if ("notequal" === n) return "1!=1";
|
|
26
30
|
}
|
|
27
|
-
switch (
|
|
31
|
+
switch (a) {
|
|
28
32
|
case "EQ":
|
|
29
33
|
return `${s} === ${l}`;
|
|
30
34
|
case "GT":
|
|
@@ -51,7 +55,7 @@ class ExpressionEvaluator {
|
|
|
51
55
|
}
|
|
52
56
|
return `[${l}].includes(${s})`;
|
|
53
57
|
default:
|
|
54
|
-
throw new Error(`比较符号不匹配: ${
|
|
58
|
+
throw new Error(`比较符号不匹配: ${a}`);
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
61
|
static changeDataType(e) {
|
|
@@ -110,40 +114,40 @@ function getSummaryDataColumn(e, t) {
|
|
|
110
114
|
const r = {};
|
|
111
115
|
return ((_a = e.props.summaries) == null ? void 0 : _a.dataColumn) && e.props.summaries.dataColumn.length > 0 && e.props.summaries.dataColumn.forEach((o) => {
|
|
112
116
|
var _a2;
|
|
113
|
-
const
|
|
114
|
-
|
|
117
|
+
const n = (_a2 = e.items) == null ? void 0 : _a2.find((e2) => o.prop === e2.props.base.prop);
|
|
118
|
+
n && ("table" === t && n.props.base.tableSummary || "group" === t && n.props.base.groupSummary) && (r[o.prop] = o);
|
|
115
119
|
}), r;
|
|
116
120
|
}
|
|
117
121
|
function summaryStatistics(e, t, r, o) {
|
|
118
|
-
let
|
|
119
|
-
const
|
|
120
|
-
if (s.length > 0) if ("custom" ===
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
const e2 =
|
|
124
|
-
|
|
122
|
+
let n = "";
|
|
123
|
+
const a = e.summaryMode, s = t.map((e2) => Number(e2[r])).filter((e2) => !Number.isNaN(e2));
|
|
124
|
+
if (s.length > 0) if ("custom" === a) {
|
|
125
|
+
const a2 = getCustomFunc(o, e.customFunc);
|
|
126
|
+
if (a2) try {
|
|
127
|
+
const e2 = a2.apply(a2, [{ data: t, prop: r }]);
|
|
128
|
+
n = e2 ? ` ${e2}` : " N/A";
|
|
125
129
|
} catch (e2) {
|
|
126
130
|
console.error("自定义函数脚本错误:", t, e2);
|
|
127
131
|
}
|
|
128
|
-
else
|
|
129
|
-
} else switch (
|
|
132
|
+
else n = " N/A";
|
|
133
|
+
} else switch (a) {
|
|
130
134
|
case "sum":
|
|
131
|
-
|
|
135
|
+
n = ` ${s.reduce((e2, t2) => e2 + t2, 0)}`;
|
|
132
136
|
break;
|
|
133
137
|
case "avg":
|
|
134
|
-
|
|
138
|
+
n = " " + s.reduce((e2, t2) => e2 + t2, 0) / s.length;
|
|
135
139
|
break;
|
|
136
140
|
case "min":
|
|
137
|
-
|
|
141
|
+
n = ` ${Math.min(...s)}`;
|
|
138
142
|
break;
|
|
139
143
|
case "max":
|
|
140
|
-
|
|
144
|
+
n = ` ${Math.max(...s)}`;
|
|
141
145
|
break;
|
|
142
146
|
default:
|
|
143
|
-
|
|
147
|
+
n = " N/A";
|
|
144
148
|
}
|
|
145
|
-
else
|
|
146
|
-
return
|
|
149
|
+
else n = " N/A";
|
|
150
|
+
return n;
|
|
147
151
|
}
|
|
148
152
|
function replacePlaceholders(e, t) {
|
|
149
153
|
if (e) return e.replace(/\$\{row\.(\w+)\}/g, (e2, r) => Object.prototype.hasOwnProperty.call(t, r) ? t[r] : "");
|
|
@@ -153,33 +157,33 @@ function getHeaderCellStyleUtil(e, t, r) {
|
|
|
153
157
|
const o = {};
|
|
154
158
|
e.column.property && ((_a = t.titleStyle) == null ? void 0 : _a.forEach((t2) => {
|
|
155
159
|
if (t2.field && t2.field.includes(e.column.property)) if (t2.scopeFunc) {
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
false !==
|
|
160
|
+
const n2 = getCustomFunc(r.pageContext, t2.scopeFunc);
|
|
161
|
+
if (n2) try {
|
|
162
|
+
false !== n2.apply(n2, [{ item: t2, data: e }]) && copyStyle(o, t2);
|
|
159
163
|
} catch (r2) {
|
|
160
164
|
console.error("自定义函数脚本错误:", t2, e, r2);
|
|
161
165
|
}
|
|
162
166
|
} else copyStyle(o, t2);
|
|
163
167
|
}));
|
|
164
|
-
const
|
|
165
|
-
return
|
|
168
|
+
const n = getCellStyleUtil(e, t.cellTitleStyle, r);
|
|
169
|
+
return n && Object.assign(o, n), o;
|
|
166
170
|
}
|
|
167
171
|
function getRowStyleUtil(e, t, r) {
|
|
168
172
|
const o = {};
|
|
169
173
|
if (r.configure.style.rowStyle) for (let t2 = 0; t2 < r.configure.style.rowStyle.length; t2++) {
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
const t3 = getCustomFunc(r.pageContext,
|
|
174
|
+
const n = r.configure.style.rowStyle[t2];
|
|
175
|
+
if (n.scopeFunc) {
|
|
176
|
+
const t3 = getCustomFunc(r.pageContext, n.scopeFunc);
|
|
173
177
|
if (t3) try {
|
|
174
178
|
const r2 = t3.apply(t3, [{ data: e }]);
|
|
175
|
-
null != r2 && false !== r2 && copyStyle(o,
|
|
179
|
+
null != r2 && false !== r2 && copyStyle(o, n);
|
|
176
180
|
} catch (t4) {
|
|
177
181
|
console.error("自定义函数脚本错误:", e, t4);
|
|
178
182
|
}
|
|
179
|
-
} else if (
|
|
180
|
-
const t3 = ExpressionEvaluator.evaluate(r.pageContext,
|
|
181
|
-
(t3 || void 0 === t3) && copyStyle(o,
|
|
182
|
-
} else copyStyle(o,
|
|
183
|
+
} else if (n.matchingCondition) {
|
|
184
|
+
const t3 = ExpressionEvaluator.evaluate(r.pageContext, n.matchingCondition, e.row);
|
|
185
|
+
(t3 || void 0 === t3) && copyStyle(o, n);
|
|
186
|
+
} else copyStyle(o, n);
|
|
183
187
|
}
|
|
184
188
|
if (t && t.length > 0 && -1 !== t.indexOf(e.rowIndex)) {
|
|
185
189
|
const e2 = {};
|
|
@@ -192,19 +196,19 @@ function getRowStyleUtil(e, t, r) {
|
|
|
192
196
|
}
|
|
193
197
|
function getCellStyleUtil(e, t, r) {
|
|
194
198
|
const o = {};
|
|
195
|
-
if (t) for (let
|
|
196
|
-
const
|
|
197
|
-
if (isSetStyle(
|
|
198
|
-
const t2 = getCustomFunc(r.pageContext,
|
|
199
|
+
if (t) for (let n = 0; n < t.length; n++) {
|
|
200
|
+
const a = t[n];
|
|
201
|
+
if (isSetStyle(a)) if (a.scopeFunc) {
|
|
202
|
+
const t2 = getCustomFunc(r.pageContext, a.scopeFunc);
|
|
199
203
|
if (t2) try {
|
|
200
|
-
false !== t2.apply(t2, [{ data: e }]) && copyStyle(o,
|
|
204
|
+
false !== t2.apply(t2, [{ data: e }]) && copyStyle(o, a);
|
|
201
205
|
} catch (t3) {
|
|
202
206
|
console.error("自定义函数脚本错误:", e, t3);
|
|
203
207
|
}
|
|
204
|
-
} else if (
|
|
205
|
-
const t2 = ExpressionEvaluator.evaluate(r.pageContext,
|
|
206
|
-
(t2 || void 0 === t2) && copyStyle(o,
|
|
207
|
-
} else copyStyle(o,
|
|
208
|
+
} else if (a.matchingCondition) {
|
|
209
|
+
const t2 = ExpressionEvaluator.evaluate(r.pageContext, a.matchingCondition, e.row);
|
|
210
|
+
(t2 || void 0 === t2) && copyStyle(o, a);
|
|
211
|
+
} else copyStyle(o, a);
|
|
208
212
|
}
|
|
209
213
|
return o;
|
|
210
214
|
}
|
|
@@ -216,33 +220,33 @@ function copyStyle(e, t) {
|
|
|
216
220
|
Object.assign(e, t.style), t.customStyle && Object.assign(e, JSON.parse(t.customStyle));
|
|
217
221
|
}
|
|
218
222
|
function rowDataToColumn(e, t, r) {
|
|
219
|
-
const o = t.props.dataOrigin.groupField,
|
|
223
|
+
const o = t.props.dataOrigin.groupField, n = t.props.dataOrigin.rowToColumn.titleColumns, a = t.props.dataOrigin.rowToColumn.dataColumns, s = [], l = {};
|
|
220
224
|
if (o && o.length > 0) e.forEach((e2) => {
|
|
221
225
|
const t2 = o.map((t3) => e2[t3]).join("|");
|
|
222
226
|
if (!l[t2]) {
|
|
223
227
|
const r2 = {};
|
|
224
228
|
o.forEach((t3) => r2[t3] = e2[t3]), l[t2] = r2, s.push(r2);
|
|
225
229
|
}
|
|
226
|
-
|
|
227
|
-
const o2 = `${
|
|
230
|
+
a.forEach((r2) => {
|
|
231
|
+
const o2 = `${n.map((t3) => e2[t3]).join("")}${r2}`;
|
|
228
232
|
l[t2][o2] = e2[r2];
|
|
229
233
|
});
|
|
230
234
|
});
|
|
231
235
|
else {
|
|
232
236
|
const t2 = [];
|
|
233
237
|
e.forEach((e2) => {
|
|
234
|
-
|
|
238
|
+
n.forEach((r2) => {
|
|
235
239
|
e2[r2] && t2.push(e2[r2]);
|
|
236
240
|
});
|
|
237
|
-
}),
|
|
238
|
-
const o2 = {},
|
|
241
|
+
}), a.forEach((t3) => {
|
|
242
|
+
const o2 = {}, a2 = r.find((e2) => {
|
|
239
243
|
var _a, _b;
|
|
240
244
|
return ((_b = (_a = e2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop) === t3;
|
|
241
245
|
});
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
o2[
|
|
246
|
+
a2 && (o2.$GroupColumn = a2.props.base.name), e.forEach((e2) => {
|
|
247
|
+
n.forEach((r2) => {
|
|
248
|
+
const n2 = e2[r2], a3 = e2[t3];
|
|
249
|
+
o2[n2] = a3;
|
|
246
250
|
});
|
|
247
251
|
}), s.push(o2);
|
|
248
252
|
});
|
|
@@ -250,9 +254,9 @@ function rowDataToColumn(e, t, r) {
|
|
|
250
254
|
return s;
|
|
251
255
|
}
|
|
252
256
|
function colDataToRow(e, t) {
|
|
253
|
-
const r = t.props.dataOrigin.groupField, o = t.props.dataOrigin.columnToRow.titleColumns,
|
|
257
|
+
const r = t.props.dataOrigin.groupField, o = t.props.dataOrigin.columnToRow.titleColumns, n = t.props.dataOrigin.columnToRow.dataColumns, a = t.props.dataOrigin.columnToRow.transColumns, s = t.props.dataOrigin.columnToRow.dataColumnsMapping;
|
|
254
258
|
if (0 === e.length) return e;
|
|
255
|
-
const l = [], i = groupBy(e, r), c =
|
|
259
|
+
const l = [], i = groupBy(e, r), c = n.reduce((e2, t2) => t2.columns.length > e2.columns.length ? t2 : e2, n[0]), u = n.reduce((e2, t2) => (t2.columns.forEach((r2) => {
|
|
256
260
|
e2[r2] = t2.prop;
|
|
257
261
|
}), e2), {});
|
|
258
262
|
return i.forEach((e2) => {
|
|
@@ -260,14 +264,14 @@ function colDataToRow(e, t) {
|
|
|
260
264
|
const i2 = c.prop, p = {};
|
|
261
265
|
if (r.forEach((t3) => {
|
|
262
266
|
p[t3] = e2[t3];
|
|
263
|
-
}), p[i2] = e2[t2],
|
|
267
|
+
}), p[i2] = e2[t2], n.length > 1) {
|
|
264
268
|
const r2 = s.find((e3) => e3.props.includes(t2));
|
|
265
269
|
r2 && r2.props.length > 1 && r2.props.forEach((r3) => {
|
|
266
270
|
r3 !== t2 && u[r3] && (p[u[r3]] = e2[r3]);
|
|
267
271
|
});
|
|
268
272
|
}
|
|
269
273
|
o.forEach((e3) => {
|
|
270
|
-
const r2 =
|
|
274
|
+
const r2 = a.filter((t3) => t3.relatedTitle === e3.prop);
|
|
271
275
|
let o2 = false;
|
|
272
276
|
r2 && r2.length > 0 && r2.forEach((r3) => {
|
|
273
277
|
if (r3.columns.includes(t2)) return p[e3.prop] = r3.label, void (o2 = true);
|
|
@@ -277,25 +281,25 @@ function colDataToRow(e, t) {
|
|
|
277
281
|
}), l;
|
|
278
282
|
}
|
|
279
283
|
function getColumnToRowTableConfig(e) {
|
|
280
|
-
const t = e.items, r = e.props.dataOrigin.groupField, o = e.props.dataOrigin.columnToRow.titleColumns,
|
|
284
|
+
const t = e.items, r = e.props.dataOrigin.groupField, o = e.props.dataOrigin.columnToRow.titleColumns, n = e.props.dataOrigin.columnToRow.dataColumns, a = [];
|
|
281
285
|
r && r.length > 0 && r.forEach((e2) => {
|
|
282
286
|
if (t) {
|
|
283
287
|
const r2 = t.find((t2) => t2.props.base.prop === e2);
|
|
284
|
-
r2 &&
|
|
288
|
+
r2 && a.push(r2);
|
|
285
289
|
}
|
|
286
290
|
});
|
|
287
|
-
return [...o, ...
|
|
291
|
+
return [...o, ...n].forEach((e2) => {
|
|
288
292
|
if (t) {
|
|
289
293
|
const r2 = t.find((t2) => t2.props.base.prop === e2);
|
|
290
|
-
r2 ?
|
|
294
|
+
r2 ? a.push(r2) : a.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: "" } } } });
|
|
291
295
|
}
|
|
292
|
-
}),
|
|
296
|
+
}), a;
|
|
293
297
|
}
|
|
294
298
|
function groupBy(e, t) {
|
|
295
299
|
const r = {};
|
|
296
300
|
return e.forEach((e2) => {
|
|
297
301
|
const o = t.map((t2) => e2[t2]).join("|");
|
|
298
|
-
r[o] || (r[o] = { ...e2, records: [] }, t.forEach((t2,
|
|
302
|
+
r[o] || (r[o] = { ...e2, records: [] }, t.forEach((t2, n) => {
|
|
299
303
|
r[o][t2] = e2[t2];
|
|
300
304
|
})), r[o].records.push(e2);
|
|
301
305
|
}), Object.values(r).map((e2) => ({ ...e2, records: void 0 }));
|
|
@@ -343,19 +347,19 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
343
347
|
function getFieldName(e) {
|
|
344
348
|
return e.substring(6, e.length - 1);
|
|
345
349
|
}
|
|
346
|
-
function formatColContent(e, t, r, o,
|
|
347
|
-
const
|
|
350
|
+
function formatColContent(e, t, r, o, n) {
|
|
351
|
+
const a = e[r.props.base.prop];
|
|
348
352
|
switch (t.type) {
|
|
349
353
|
case "number":
|
|
350
|
-
return formatNumber(
|
|
354
|
+
return formatNumber(a, t);
|
|
351
355
|
case "currency":
|
|
352
|
-
return formatCurrency(
|
|
356
|
+
return formatCurrency(a, t);
|
|
353
357
|
case "percent":
|
|
354
|
-
return formatPercent(
|
|
358
|
+
return formatPercent(a, t);
|
|
355
359
|
case "custom":
|
|
356
|
-
return formatCustomFunc(e, t, r, o,
|
|
360
|
+
return formatCustomFunc(e, t, r, o, n);
|
|
357
361
|
default:
|
|
358
|
-
return
|
|
362
|
+
return a;
|
|
359
363
|
}
|
|
360
364
|
}
|
|
361
365
|
function formatNumber(e, t) {
|
|
@@ -370,11 +374,11 @@ function formatPercent(e, t) {
|
|
|
370
374
|
let r = e;
|
|
371
375
|
return r || (r = 0), t.decimalDigit && (r = Number(e).toFixed(t.decimalDigit)), r + " %";
|
|
372
376
|
}
|
|
373
|
-
function formatCustomFunc(e, t, r, o,
|
|
374
|
-
const
|
|
375
|
-
if (
|
|
377
|
+
function formatCustomFunc(e, t, r, o, n) {
|
|
378
|
+
const a = getCustomFunc(o, t.customFunc);
|
|
379
|
+
if (a) {
|
|
376
380
|
try {
|
|
377
|
-
return
|
|
381
|
+
return a.apply(a, [{ pageContext: o, configureObj: n, row: e, prop: r.props.base.prop }]);
|
|
378
382
|
} catch (t2) {
|
|
379
383
|
console.error("自定义函数脚本错误:", e, t2);
|
|
380
384
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as e, ref as t, onMounted as n, watch as o, onUnmounted as i, resolveComponent as a, createElementBlock as l, openBlock as r, unref as u, createVNode as s } from "vue";
|
|
2
|
-
import { setTableEvents as c, canExecuteButton as p, doAfterClickEvent as d, doBeforeClickEvent as f, gridSelectRecord as g, gridSelectAllRecords as m, gridSelectionChange as v, cellClick as h, cellDblClick as b, rowClick as w, rowDblClick as S, headerClick as C, getEventNameByType as y, getEventFuncByType as x, getHandleEvent as
|
|
3
|
-
import { getBaseUrl as
|
|
2
|
+
import { setTableEvents as c, canExecuteButton as p, doAfterClickEvent as d, doBeforeClickEvent as f, gridSelectRecord as g, gridSelectAllRecords as m, gridSelectionChange as v, cellClick as h, cellDblClick as b, rowClick as w, rowDblClick as S, headerClick as C, getEventNameByType as y, getEventFuncByType as x, getHandleEvent as D } from "../../../../utils/events/event-util.js";
|
|
3
|
+
import { getBaseUrl as E, getListCode as T, getRealRestApiPath as O, isWorkflowPage as R, isVariableInvalidValue as k } from "../../../../utils/common-util.js";
|
|
4
4
|
import { getAdditionalParamMap as I, getSaveFormRequestWithRow as V, standardEvents as j } from "../../../../utils/events/standard-event.js";
|
|
5
5
|
import { isPromise as N } from "agilebuilder-ui/src/utils/common-util";
|
|
6
6
|
import { getOperationButtons as B, popupToPage as P } from "../../../../utils/table-utils.js";
|
|
@@ -15,14 +15,14 @@ const z = ["id"], W = e({ __name: "main-table-runtime", props: { pageContext: {}
|
|
|
15
15
|
const K = t({});
|
|
16
16
|
Y.isTest ? K.value = Q.configure.runtime ? Q.configure.runtime : {} : Y.tableRuntimes && Y.tableRuntimes[J.uuid] && (J = JSON.parse(Y.tableRuntimes[J.uuid].configure), K.value = J.runtime ? J.runtime : {});
|
|
17
17
|
const X = K.value.style, Z = K.value.class, ee = Y.systemCode, te = Y.backendUrl, ne = J.props && J.props.dataOrigin && J.props.dataOrigin.tableName;
|
|
18
|
-
let oe =
|
|
18
|
+
let oe = E(Y.backendUrl, Y.isTest);
|
|
19
19
|
oe || (oe = window.$vueApp.config.globalProperties.baseURL);
|
|
20
20
|
const ie = t({}), ae = [], le = t({});
|
|
21
21
|
le.value = function() {
|
|
22
22
|
const e3 = Y.systemCode, t2 = Y.code;
|
|
23
23
|
let n2 = J.props && J.props.dataOrigin && "[]" !== J.props.dataOrigin.sqlFilterCondition ? J.props.dataOrigin.sqlFilterCondition : null;
|
|
24
24
|
null == n2 && (n2 = []);
|
|
25
|
-
const o2 = { isSql: true, optionTableHeight: 0, rowKeyProp: J.props.dataOrigin.principalLinkage, extraParam: { beanName: Y.beanName, functionCode: t2 + ".listData", tableName: ne, systemCode: e3, pageCode: Y.code, pageVersion: Y.version }, initSearchForm: n2, lineEditOptions: { aftersaveIsCreateRow: false, autoSave: false, enter: Se, esc:
|
|
25
|
+
const o2 = { isSql: true, optionTableHeight: 0, rowKeyProp: J.props.dataOrigin.principalLinkage, extraParam: { beanName: Y.beanName, functionCode: t2 + ".listData", tableName: ne, systemCode: e3, pageCode: Y.code, pageVersion: Y.version }, initSearchForm: n2, lineEditOptions: { aftersaveIsCreateRow: false, autoSave: false, enter: Se, esc: Ee }, indexContinuous: !(!J.props || !J.props.otherSettings) && J.props.otherSettings.serialNumberContinuous, initSearch: !J.props || false !== J.props.dataOrigin.initializationQuery, resizeHeight: je, pageCode: Y.code, pageVersion: Y.version, additionalParamMap: I(Y), showOverflowTooltip: !(!J.props || !J.props.otherSettings || void 0 !== J.props.otherSettings.isBreakLine && false !== J.props.otherSettings.isBreakLine), isEnableEnterEvent: J.props && J.props.otherSettings && J.props.otherSettings.isEnableEnterEvent, isWithDataPermission: !!(J.props && J.props.otherSettings && J.props.otherSettings.isWithDataPermission) && J.props.otherSettings.isWithDataPermission, pageDevMode: false, isWorkflowEntity: R(Y), tableClass: Z, tableStyle: X, pageContext: Y, configureObj: J, backendUrl: oe, cellStyleRender: qe, rowStyleRender: We, titleStyleRender: Qe, validateEitConditions: Xe };
|
|
26
26
|
return function(e4) {
|
|
27
27
|
var _a;
|
|
28
28
|
((_a = J.props.highOrder) == null ? void 0 : _a.mergeFields) && J.props.highOrder.mergeFields.length > 0 && (e4.mergeFields = J.props.highOrder.mergeFields.join(","));
|
|
@@ -56,7 +56,7 @@ const z = ["id"], W = e({ __name: "main-table-runtime", props: { pageContext: {}
|
|
|
56
56
|
}();
|
|
57
57
|
const re = t(), ue = t(), se = function() {
|
|
58
58
|
let e3 = oe + "/dsc/commons/list";
|
|
59
|
-
e3 && (e3 =
|
|
59
|
+
e3 && (e3 = O(e3, ee, te, Y.isTest));
|
|
60
60
|
return e3;
|
|
61
61
|
}(), ce = T(Y.code, Y.version, J.uuid), pe = Y.code + "_" + ce, de = t([]), fe = Y.entity.page, ge = t({ data: [] }), me = Y.superGridItems, ve = me ? me[J.uuid] : null, he = t(false), be = q;
|
|
62
62
|
function we() {
|
|
@@ -89,7 +89,7 @@ const z = ["id"], W = e({ __name: "main-table-runtime", props: { pageContext: {}
|
|
|
89
89
|
function Ce(e3, t2, n2, o2, i2) {
|
|
90
90
|
const a2 = ie.value.lineEditSave, l2 = J;
|
|
91
91
|
a2.props.base.tableUuid = l2.uuid, le.value.lineEditOptions.beforeSave = xe, Y.editData = n2, p({ pageContext: Y, configureObj: a2 }).then((l3) => {
|
|
92
|
-
true === l3.canExecute && (le.value.lineEditOptions.saveRow =
|
|
92
|
+
true === l3.canExecute && (le.value.lineEditOptions.saveRow = De, ue.value.saveRow(i2, ce).then(() => {
|
|
93
93
|
d(Y, a2, { originalValue: e3, formatValue: t2, row: n2, column: o2, rowIndex: i2 });
|
|
94
94
|
}));
|
|
95
95
|
}).finally(() => {
|
|
@@ -101,7 +101,7 @@ const z = ["id"], W = e({ __name: "main-table-runtime", props: { pageContext: {}
|
|
|
101
101
|
let t2;
|
|
102
102
|
const n2 = y(e3.events, "click");
|
|
103
103
|
if (n2) {
|
|
104
|
-
if (ie.value[n2] = e3, "lineEditSave" === n2 ? t2 = Ce : "restoreEdit" === n2 ? t2 = Te : "lineEditUpdate" === n2 ? t2 =
|
|
104
|
+
if (ie.value[n2] = e3, "lineEditSave" === n2 ? t2 = Ce : "restoreEdit" === n2 ? t2 = Te : "lineEditUpdate" === n2 ? t2 = Oe : "lineEditDelete" === n2 && (t2 = ke), !t2) {
|
|
105
105
|
t2 = x(Y, e3.events, "click");
|
|
106
106
|
}
|
|
107
107
|
} else ie.value[e3.uuid] = e3, t2 = Be;
|
|
@@ -112,7 +112,7 @@ const z = ["id"], W = e({ __name: "main-table-runtime", props: { pageContext: {}
|
|
|
112
112
|
o2.props.base.tableUuid = i2.uuid;
|
|
113
113
|
return f(Y, o2, { row: e3, columns: t2 });
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function De({ row: e3, columns: t2, dataTypeMap: n2, dynamicColumnInfo: o2, additionalParamMap: i2, mainDefaultValueColumns: a2 }) {
|
|
116
116
|
const l2 = ie.value.lineEditSave, r2 = J;
|
|
117
117
|
return l2.props.base.tableUuid = r2.uuid, new Promise((t3, n3) => {
|
|
118
118
|
const i3 = { tableName: r2.props.dataOrigin.tableName };
|
|
@@ -123,7 +123,7 @@ const z = ["id"], W = e({ __name: "main-table-runtime", props: { pageContext: {}
|
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Ee({ rowIndex: e3, column: t2, row: n2, orgRow: o2 }) {
|
|
127
127
|
Te(null, null, n2, t2, e3);
|
|
128
128
|
}
|
|
129
129
|
function Te(e3, t2, n2, o2, i2) {
|
|
@@ -136,15 +136,15 @@ const z = ["id"], W = e({ __name: "main-table-runtime", props: { pageContext: {}
|
|
|
136
136
|
}) : ue.value.restoreRow(i2, ce);
|
|
137
137
|
d(Y, J, { originalValue: e3, formatValue: t2, row: n2, column: o2, rowIndex: i2 });
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Oe(e3, t2, n2, o2, i2) {
|
|
140
140
|
const a2 = ie.value.lineEditUpdate, l2 = J;
|
|
141
141
|
a2.props.base.tableUuid = l2.uuid;
|
|
142
142
|
const r2 = f(Y, a2, { originalValue: e3, formatValue: t2, row: n2, column: o2, rowIndex: i2 });
|
|
143
143
|
r2 && (N(r2) ? r2.then((l3) => {
|
|
144
|
-
l3 &&
|
|
145
|
-
}) :
|
|
144
|
+
l3 && Re(e3, t2, n2, o2, i2, a2);
|
|
145
|
+
}) : Re(e3, t2, n2, o2, i2, a2));
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Re(e3, t2, n2, o2, i2, a2) {
|
|
148
148
|
Y.editData = n2, p({ pageContext: Y, configureObj: a2 }).then((a3) => {
|
|
149
149
|
if (true === a3.canExecute) {
|
|
150
150
|
ue.value.editRow(i2, ce);
|
|
@@ -221,7 +221,7 @@ const z = ["id"], W = e({ __name: "main-table-runtime", props: { pageContext: {}
|
|
|
221
221
|
}
|
|
222
222
|
function Be(e3, t2, n2, o2, i2, a2) {
|
|
223
223
|
const l2 = { originalValue: e3, formatValue: t2, row: n2, column: o2, rowIndex: i2, button: a2, id: n2.ID ? n2.ID : n2.id }, r2 = ie.value[a2.sourceButton.uuid], u2 = J;
|
|
224
|
-
r2.props.base.tableUuid = u2.uuid,
|
|
224
|
+
r2.props.base.tableUuid = u2.uuid, D(null, Y, r2, "click", l2);
|
|
225
225
|
}
|
|
226
226
|
function Pe(e3) {
|
|
227
227
|
"close_open_win" === e3.data && ue.value && ue.value.refresh();
|
|
@@ -353,7 +353,7 @@ const z = ["id"], W = e({ __name: "main-table-runtime", props: { pageContext: {}
|
|
|
353
353
|
}, setScrollLeft: function(e3) {
|
|
354
354
|
ue.value && ue.value.setScrollLeft(e3);
|
|
355
355
|
}, getSuperGridRef: function() {
|
|
356
|
-
return ue.value
|
|
356
|
+
return ue.value;
|
|
357
357
|
}, getSuperGridTableRef: function() {
|
|
358
358
|
return ue.value.getSuperGridTableRef();
|
|
359
359
|
}, setCurrentRowIndex: function(e3) {
|
|
@@ -362,6 +362,9 @@ const z = ["id"], W = e({ __name: "main-table-runtime", props: { pageContext: {}
|
|
|
362
362
|
}, setScrollTopByRowIndex: function(e3) {
|
|
363
363
|
var _a;
|
|
364
364
|
(_a = ue.value) == null ? void 0 : _a.setScrollTopByRowIndex(e3);
|
|
365
|
+
}, getTableData: function() {
|
|
366
|
+
var _a;
|
|
367
|
+
return (_a = ue.value) == null ? void 0 : _a.getTableData();
|
|
365
368
|
} }), (e3, t2) => {
|
|
366
369
|
const n2 = a("super-grid");
|
|
367
370
|
return r(), l("div", { ref_key: "tableDivRef", ref: re, id: u(ce) + "_tableDiv" }, [s(n2, { ref_key: "gridRef", ref: ue, url: u(se), options: le.value, code: u(ce), settings: u(ve), "search-form-info": ge.value, "list-toolbar-form-data": u(fe), onSelect: Fe, onSelectAll: He, onSelectionChange: Ue, onCellClick: Le, onCellDblclick: Me, onRowClick: $e, onRowDblclick: _e, onHeaderClick: Ae, onRefresh: Ge, onNewOpenGridDialog: u(P), onCanShowMobileSearch: ze, onGridOnmounted: we }, null, 8, ["url", "options", "code", "settings", "search-form-info", "list-toolbar-form-data", "onNewOpenGridDialog"])], 8, z);
|
|
@@ -276,13 +276,16 @@ const j = e({ __name: "sub-table-runtime", props: { pageContext: {}, configure:
|
|
|
276
276
|
}, getSuperGridRef: function() {
|
|
277
277
|
return le.value;
|
|
278
278
|
}, getSuperGridTableRef: function() {
|
|
279
|
-
return le.value.
|
|
279
|
+
return le.value.getSuperGridTableRef();
|
|
280
280
|
}, setCurrentRowIndex: function(e3) {
|
|
281
281
|
var _a;
|
|
282
282
|
(_a = le.value) == null ? void 0 : _a.setCurrentRowIndex(e3);
|
|
283
283
|
}, setScrollTopByRowIndex: function(e3) {
|
|
284
284
|
var _a;
|
|
285
285
|
(_a = le.value) == null ? void 0 : _a.setScrollTopByRowIndex(e3);
|
|
286
|
+
}, getTableData: function() {
|
|
287
|
+
var _a;
|
|
288
|
+
return (_a = le.value) == null ? void 0 : _a.getTableData();
|
|
286
289
|
} }), (e3, t2) => {
|
|
287
290
|
const n2 = a("super-grid");
|
|
288
291
|
return i(), l("div", null, [ee.value ? (i(), u(n2, { key: 0, ref_key: "gridRef", ref: le, url: s(Z) + "/dsc/commons/sub-table", options: oe.value, code: s(G), settings: s(K), onSelect: _e, onSelectAll: ke, onSelectionChange: Me, onCellClick: Fe, onCellDblclick: $e, onRowClick: je, onRowDblclick: Ae, onHeaderClick: Le, onFnProhibitToEdit: Re, onChangeGridData: ye, onReloadGrid: de, onRefresMainTableFields: Oe, onSetSelectOptions: Ie, onChangeRowsPerPage: Pe, onNewOpenGridDialog: s(I), onChangeFormData: Be }, null, 8, ["url", "options", "code", "settings", "onNewOpenGridDialog"])) : r("", true)]);
|
|
@@ -2,71 +2,74 @@ import { defineComponent as e, ref as t, onUnmounted as n, createElementBlock as
|
|
|
2
2
|
import i from "./sub-table-runtime.vue.js";
|
|
3
3
|
import c from "./main-table-runtime.vue.js";
|
|
4
4
|
const f = e({ __name: "table-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: f2 }) {
|
|
5
|
-
const
|
|
6
|
-
p.value = S ? S.configure ? JSON.parse(S.configure) : null :
|
|
7
|
-
const T =
|
|
5
|
+
const g = e2, s = g.pageContext.pageType, p = t(null), v = g.configure.uuid, d = g.pageContext.superGridItems, S = d ? d[v] : null;
|
|
6
|
+
p.value = S ? S.configure ? JSON.parse(S.configure) : null : g.configure;
|
|
7
|
+
const T = g.configure.runtime ? g.configure.runtime : {};
|
|
8
8
|
T.style, T.class;
|
|
9
|
-
const
|
|
9
|
+
const b = t(true), C = t(null);
|
|
10
10
|
let m = null;
|
|
11
11
|
function E(e3) {
|
|
12
|
-
|
|
12
|
+
g.pageContext.entity.data._SAFE_DELETE_TABLE_NAMES ? g.pageContext.entity.data._SAFE_DELETE_TABLE_NAMES.push(e3) : g.pageContext.entity.data._SAFE_DELETE_TABLE_NAMES = [e3];
|
|
13
13
|
}
|
|
14
14
|
return n(() => {
|
|
15
15
|
m && clearTimeout(m);
|
|
16
16
|
}), f2({ refresh: function(e3, t2, n2, u2) {
|
|
17
|
-
if (
|
|
17
|
+
if (s && "list" === s) return C.value.refresh(e3, t2, n2, u2);
|
|
18
18
|
}, createRow: function() {
|
|
19
|
-
return
|
|
19
|
+
return C.value.createRow();
|
|
20
20
|
}, clearSelections: function() {
|
|
21
|
-
return
|
|
21
|
+
return C.value.clearSelections();
|
|
22
22
|
}, getSelections: function() {
|
|
23
|
-
return
|
|
23
|
+
return C.value.getSelections();
|
|
24
24
|
}, getSelectionIds: function() {
|
|
25
|
-
return
|
|
25
|
+
return C.value.getSelectionIds();
|
|
26
26
|
}, getTableConfigure: function() {
|
|
27
|
-
return
|
|
27
|
+
return C.value.getTableConfigure();
|
|
28
28
|
}, isDeleteChange: function(e3) {
|
|
29
|
-
|
|
29
|
+
s && "list" === s && C.value.isDeleteChange(e3);
|
|
30
30
|
}, validatorSunTableListData: function() {
|
|
31
|
-
if (
|
|
31
|
+
if (s && "form" === s) return C.value.validatorSunTableListData();
|
|
32
32
|
}, showMobileSearch: function() {
|
|
33
|
-
|
|
33
|
+
C.value.showMobileSearch();
|
|
34
34
|
}, getTableSelectOptions: function() {
|
|
35
|
-
if (
|
|
35
|
+
if (C.value) return C.value.getTableSelectOptions();
|
|
36
36
|
}, dynamicControlTableEdit: function(e3, t2, n2) {
|
|
37
|
-
|
|
37
|
+
C.value && C.value.dynamicControlTableEdit(e3, t2, n2);
|
|
38
38
|
}, getTableUuid: function() {
|
|
39
|
-
return
|
|
39
|
+
return g.configure.uuid;
|
|
40
40
|
}, doLayout: function(e3) {
|
|
41
|
-
|
|
41
|
+
C.value && C.value.doLayout(e3);
|
|
42
42
|
}, changeOperationAddState: function(e3) {
|
|
43
|
-
|
|
43
|
+
C.value && C.value.changeOperationAddState(e3);
|
|
44
44
|
}, scrollTo: function(e3, t2) {
|
|
45
45
|
var _a;
|
|
46
|
-
(_a =
|
|
46
|
+
(_a = C.value) == null ? void 0 : _a.scrollTo(e3, t2);
|
|
47
47
|
}, setScrollTop: function(e3) {
|
|
48
48
|
var _a;
|
|
49
|
-
(_a =
|
|
49
|
+
(_a = C.value) == null ? void 0 : _a.setScrollTop(e3);
|
|
50
50
|
}, setScrollLeft: function(e3) {
|
|
51
51
|
var _a;
|
|
52
|
-
(_a =
|
|
52
|
+
(_a = C.value) == null ? void 0 : _a.setScrollLeft(e3);
|
|
53
53
|
}, getSuperGridRef: function() {
|
|
54
54
|
var _a;
|
|
55
|
-
return (_a =
|
|
55
|
+
return (_a = C.value) == null ? void 0 : _a.getSuperGridRef();
|
|
56
56
|
}, getSuperGridTableRef: function() {
|
|
57
57
|
var _a;
|
|
58
|
-
return (_a =
|
|
58
|
+
return (_a = C.value) == null ? void 0 : _a.getSuperGridTableRef();
|
|
59
59
|
}, setCurrentRowIndex: function(e3) {
|
|
60
60
|
var _a;
|
|
61
|
-
(_a =
|
|
61
|
+
(_a = C.value) == null ? void 0 : _a.setCurrentRowIndex(e3);
|
|
62
62
|
}, setScrollTopByRowIndex: function(e3) {
|
|
63
63
|
var _a;
|
|
64
|
-
(_a =
|
|
64
|
+
(_a = C.value) == null ? void 0 : _a.setScrollTopByRowIndex(e3);
|
|
65
65
|
}, reloadSubTable: function() {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
b.value = false, m = setTimeout(() => {
|
|
67
|
+
b.value = true;
|
|
68
68
|
}, 10);
|
|
69
|
-
}
|
|
69
|
+
}, getTableData: function() {
|
|
70
|
+
var _a;
|
|
71
|
+
return (_a = C.value) == null ? void 0 : _a.getTableData();
|
|
72
|
+
} }), (e3, t2) => (o(), u("div", null, [r(s) && "form" === r(s) && b.value ? (o(), l(i, { key: 0, ref_key: "gridRef", ref: C, pageContext: e3.pageContext, configure: p.value, onSetSafeDeleteTableCode: E }, null, 8, ["pageContext", "configure"])) : r(s) && "form" === r(s) ? a("", true) : (o(), l(c, { key: 1, ref_key: "gridRef", ref: C, pageContext: e3.pageContext, configure: p.value, onSetSafeDeleteTableCode: E }, null, 8, ["pageContext", "configure"]))]));
|
|
70
73
|
} });
|
|
71
74
|
export {
|
|
72
75
|
f as default
|
package/dist/es/style.css
CHANGED
|
@@ -551,6 +551,36 @@
|
|
|
551
551
|
}
|
|
552
552
|
|
|
553
553
|
|
|
554
|
+
|
|
555
|
+
.amb-chart-container[data-v-5b4e8687] {
|
|
556
|
+
display: flex;
|
|
557
|
+
flex-direction: column;
|
|
558
|
+
height: 100%;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.amb-chart-container[data-v-961b3d1c] {
|
|
562
|
+
display: flex;
|
|
563
|
+
flex-direction: column;
|
|
564
|
+
height: 100%;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.amb-chart-container[data-v-8d392d9f] {
|
|
568
|
+
display: flex;
|
|
569
|
+
flex-direction: column;
|
|
570
|
+
height: 100%;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.amb-chart-container[data-v-f50eeed9] {
|
|
574
|
+
display: flex;
|
|
575
|
+
flex-direction: column;
|
|
576
|
+
height: 100%;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.amb-chart-container[data-v-e08919a0] {
|
|
580
|
+
display: flex;
|
|
581
|
+
flex-direction: column;
|
|
582
|
+
height: 100%;
|
|
583
|
+
}
|
|
554
584
|
|
|
555
585
|
/** 右键菜单样式 */
|
|
556
586
|
.context-menu[data-v-89330064] {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-page-runtime",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.8",
|
|
4
4
|
"description": "AgileBuilder super page runtime",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/es/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
49
49
|
"@vue/eslint-config-prettier": "^8.0.0",
|
|
50
50
|
"@vue/test-utils": "^2.4.4",
|
|
51
|
-
"agilebuilder-ui": "1.1.
|
|
51
|
+
"agilebuilder-ui": "1.1.44",
|
|
52
52
|
"axios": "^1.6.8",
|
|
53
53
|
"cypress": "^13.6.6",
|
|
54
54
|
"element-plus": "^2.6.1",
|