super-page-runtime 2.2.77-sit1 → 2.2.77-sit5
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as e, ref as o, onMounted as n, watch as r, resolveComponent as t, createElementBlock as i, openBlock as a, normalizeClass as u, normalizeStyle as p, unref as l, withDirectives as s, createVNode as c, createBlock as g, createCommentVNode as f, vShow as m, withCtx as d, Fragment as h, renderList as v, h as y } from "vue";
|
|
2
2
|
import C from "../common/common-chart-header.vue.js";
|
|
3
3
|
import { getSizeConfig as b, getChartDatasFromPage as x, getValueFromVariable as O, isPromise as S, setValueForVariableName as w, updateChartDatasourcesByComponent as E, caculateShowCondition as j } from "../../../../utils/page-helper-util.js";
|
|
4
|
-
import { getCustomFunc as
|
|
5
|
-
import
|
|
4
|
+
import { getCustomFunc as $ } from "../../../../utils/events/event-util.js";
|
|
5
|
+
import F from "./group-column.vue.js";
|
|
6
6
|
import k from "./normal-column.vue.js";
|
|
7
7
|
import I from "./table-pageination.vue.js";
|
|
8
|
-
import { getSummaryTitleColumn as
|
|
8
|
+
import { getSummaryTitleColumn as N, getSummaryDataColumn as R, rowDataToColumn as T, getColumnToRowTableConfig as H, colDataToRow as _, computeFormula as z, getNewColumnConfig as D, summaryStatistics as J, replacePlaceholders as P, getIndexColumn as U, getHeaderCellStyleUtil as V, getRowStyleUtil as G, getCellStyleUtil as K, formatColContent as A } from "./chart-table-util.js";
|
|
9
9
|
import { deepCopy as L } from "../../../../utils/common-util.js";
|
|
10
10
|
const q = e({ __name: "table-runtime", props: { configure: { type: Object, default: () => ({}) }, pageContext: { type: Object, default: () => ({}) } }, setup(e2, { expose: q2 }) {
|
|
11
11
|
var _a;
|
|
@@ -19,7 +19,7 @@ const q = e({ __name: "table-runtime", props: { configure: { type: Object, defau
|
|
|
19
19
|
}), e3.sort((e4, o2) => e4.displayOrder - o2.displayOrder), re.value = e3, function() {
|
|
20
20
|
if (B.configure.props.base.showIndex) {
|
|
21
21
|
re.value.unshift({ columnUuid: "$index", displayOrder: 0, isLeaf: true, prop: "$index", titleText: "序号", uuid: "$index" });
|
|
22
|
-
const e4 =
|
|
22
|
+
const e4 = U();
|
|
23
23
|
e4 && (te.value.$index = e4);
|
|
24
24
|
}
|
|
25
25
|
}();
|
|
@@ -28,7 +28,7 @@ const q = e({ __name: "table-runtime", props: { configure: { type: Object, defau
|
|
|
28
28
|
te.value[e3.uuid] = e3, Object.keys(e3.style).length > 0 && (se.value[e3.props.base.prop] = { cellStyle: e3.style, titleStyle: e3.titleStyle }), e3.formula && "" !== e3.formula.trim() && (ce.value[e3.props.base.prop] = e3.formula);
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
ie.value = B.configure.props.base.showSummary, (ie.value || B.configure.props.highOrder.groupField && B.configure.props.highOrder.groupField.length > 0) && (ae.value =
|
|
31
|
+
ie.value = B.configure.props.base.showSummary, (ie.value || B.configure.props.highOrder.groupField && B.configure.props.highOrder.groupField.length > 0) && (ae.value = N(B.configure), ie.value && (ue.value = R(B.configure, "table")), B.configure.props.highOrder.groupField && B.configure.props.highOrder.groupField.length > 0 && (pe.value = R(B.configure, "group")));
|
|
32
32
|
let de = 300, he = b(B.pageContext, B.configure);
|
|
33
33
|
function ve() {
|
|
34
34
|
const e3 = B.configure.props.dataOrigin.variable.match(/\${(.*?)}/), o2 = e3 ? e3[1].split(".") : [];
|
|
@@ -38,36 +38,48 @@ const q = e({ __name: "table-runtime", props: { configure: { type: Object, defau
|
|
|
38
38
|
}
|
|
39
39
|
function ye(e3) {
|
|
40
40
|
e3 || (e3 = []), (e3 = e3.length > 0 ? e3[0] : {}) || (e3 = {}), e3.hasRender ? e3.hasRender = true : (!function(e4) {
|
|
41
|
-
var _a2
|
|
41
|
+
var _a2;
|
|
42
42
|
Re(e4), "service" === B.configure.props.dataOrigin.dataSource && e4.result ? me = e4.result[B.configure.props.dataOrigin.service.serviceDataField] : "variable" === B.configure.props.dataOrigin.dataSource && (ve(), me = O(B.pageContext.entity, B.configure.props.dataOrigin.variable));
|
|
43
|
-
if (me) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if ((o2 == null ? void 0 : o2.length) > 0) {
|
|
55
|
-
const n2 = me.slice(e5, me.length - 1), r2 = {}, t2 = ne.value[0].props.base.prop;
|
|
56
|
-
n2.forEach((e6) => {
|
|
57
|
-
o2.forEach((o3) => {
|
|
58
|
-
void 0 === r2[o3] && (r2[o3] = 0), r2[o3] = r2[o3] + e6[o3];
|
|
59
|
-
});
|
|
60
|
-
}), me.length > e5 && (me = me.slice(0, e5 - 1)), r2[t2] = B.configure.props.dataOrigin.overItemAlias, me.push(r2);
|
|
61
|
-
}
|
|
43
|
+
if (me) if (((_a2 = B.configure.props) == null ? void 0 : _a2.dataOrigin.limitEnable) && B.configure.props.dataOrigin.itemNumSource) {
|
|
44
|
+
let o2 = 10;
|
|
45
|
+
if ("fix" === B.configure.props.dataOrigin.itemNumSource) o2 = B.configure.props.dataOrigin.itemNumFix;
|
|
46
|
+
else if ("variable" === B.configure.props.dataOrigin.itemNumSource) {
|
|
47
|
+
o2 = Number(O(B.pageContext.entity, B.configure.props.dataOrigin.itemNumVariable));
|
|
48
|
+
const n2 = B.configure.props.dataOrigin.itemNumVariable.match(/\${(.*?)}/), t2 = n2 ? n2[1].split(".") : [], i2 = JSON.parse(JSON.stringify(me));
|
|
49
|
+
r(() => t2.reduce((e5, o3) => e5[o3], B.pageContext.entity), (o3) => {
|
|
50
|
+
Ce(o3, i2, e4);
|
|
51
|
+
});
|
|
62
52
|
}
|
|
63
|
-
Ce(me, e4);
|
|
64
|
-
}
|
|
53
|
+
Ce(o2, me, e4);
|
|
54
|
+
} else be(me, e4);
|
|
65
55
|
}(e3), e3.hasRender = true, X && (X.autoRefresh = false));
|
|
66
56
|
}
|
|
67
|
-
function Ce(e3, o2) {
|
|
57
|
+
function Ce(e3, o2, n2) {
|
|
58
|
+
var _a2;
|
|
59
|
+
if (e3 && e3 < o2.length) {
|
|
60
|
+
let r2 = [];
|
|
61
|
+
if (((_a2 = B.configure.props.dataOrigin.limitCountColumns) == null ? void 0 : _a2.length) > 0) r2 = B.configure.props.dataOrigin.limitCountColumns;
|
|
62
|
+
else {
|
|
63
|
+
ne.value.filter((e4) => "number" === e4.props.base.dataType).forEach((e4) => {
|
|
64
|
+
r2.push(e4.props.base.prop);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if ((r2 == null ? void 0 : r2.length) > 0) {
|
|
68
|
+
const n3 = o2.slice(e3 - 1, o2.length), t2 = {};
|
|
69
|
+
let i2 = ne.value[0].props.base.prop;
|
|
70
|
+
"$index" === i2 && (i2 = ne.value[1].props.base.prop), n3.forEach((e4) => {
|
|
71
|
+
r2.forEach((o3) => {
|
|
72
|
+
void 0 === t2[o3] && (t2[o3] = 0), t2[o3] = t2[o3] + e4[o3];
|
|
73
|
+
});
|
|
74
|
+
}), o2.length > e3 && (o2 = o2.slice(0, e3 - 1)), t2[i2] = B.configure.props.dataOrigin.overItemAlias, o2.push(t2);
|
|
75
|
+
}
|
|
76
|
+
be(o2, n2);
|
|
77
|
+
} else be(o2, n2);
|
|
78
|
+
}
|
|
79
|
+
function be(e3, o2) {
|
|
68
80
|
var _a2;
|
|
69
|
-
if (
|
|
70
|
-
if (e3 =
|
|
81
|
+
if (xe("rowToColumn")) {
|
|
82
|
+
if (e3 = T(e3, B.configure, ne.value), !ee.value) {
|
|
71
83
|
const o3 = function(e4, o4, n2) {
|
|
72
84
|
const r2 = B.configure.props.dataOrigin.rowToColumn.titleColumns, t2 = B.configure.props.dataOrigin.rowToColumn.dataColumns, i2 = e4.props.dataOrigin.groupField;
|
|
73
85
|
if ((!i2 || 0 === i2.length) && n2.length > 0) {
|
|
@@ -98,16 +110,16 @@ const q = e({ __name: "table-runtime", props: { configure: { type: Object, defau
|
|
|
98
110
|
}(B.configure, ne.value, e3);
|
|
99
111
|
ne.value = o3;
|
|
100
112
|
}
|
|
101
|
-
} else
|
|
113
|
+
} else xe("columnToRow") && (ee.value || (ne.value = H(B.configure)), e3 = _(e3, B.configure));
|
|
102
114
|
if (B.configure.props.dataOrigin.dataFormatting) {
|
|
103
|
-
const o3 =
|
|
115
|
+
const o3 = $(B.pageContext, B.configure.props.dataOrigin.dataFormatting);
|
|
104
116
|
if (o3) {
|
|
105
117
|
const n2 = o3.apply(o3, [{ tableData: e3 }]);
|
|
106
118
|
n2 && (e3 = n2);
|
|
107
119
|
}
|
|
108
120
|
}
|
|
109
121
|
if (Object.keys(ce.value).length > 0 && e3 && e3.length > 0 && z(ce.value, e3, B.pageContext.entity), ((_a2 = B.configure.pageination) == null ? void 0 : _a2.enable) ? function(e4) {
|
|
110
|
-
"frontend" === B.configure.pageination.type ? (fe.value = me.length,
|
|
122
|
+
"frontend" === B.configure.pageination.type ? (fe.value = me.length, ke(1, B.configure.pageination.pageSize)) : "backend" === B.configure.pageination.type && (oe.value = me, B.configure.pageination.totalFrom && (fe.value = e4.result[B.configure.pageination.totalFrom]));
|
|
111
123
|
}(o2) : oe.value = e3, B.configure.props.highOrder.groupField && B.configure.props.highOrder.groupField.length > 0) {
|
|
112
124
|
const e4 = B.configure.props.highOrder.groupField;
|
|
113
125
|
oe.value = function(e5, o3) {
|
|
@@ -122,11 +134,11 @@ const q = e({ __name: "table-runtime", props: { configure: { type: Object, defau
|
|
|
122
134
|
for (let e6 = 0; e6 < a2.length; e6++) {
|
|
123
135
|
const o4 = a2[e6], i3 = {};
|
|
124
136
|
t2 == null ? void 0 : t2.forEach((e7) => {
|
|
125
|
-
const n3 = e7.props.base.prop, r3 =
|
|
137
|
+
const n3 = e7.props.base.prop, r3 = J(pe.value[n3], o4, n3, B.pageContext);
|
|
126
138
|
i3[n3] = r3;
|
|
127
139
|
}), n2.push(...o4), r2 == null ? void 0 : r2.forEach((e7) => {
|
|
128
140
|
const n3 = e7.props.base.prop;
|
|
129
|
-
i3[n3] =
|
|
141
|
+
i3[n3] = P(e7.props.base.summaryTitle, o4[0]);
|
|
130
142
|
}), n2.push(i3), le.push(n2.length - 1);
|
|
131
143
|
}
|
|
132
144
|
return n2;
|
|
@@ -134,24 +146,24 @@ const q = e({ __name: "table-runtime", props: { configure: { type: Object, defau
|
|
|
134
146
|
}
|
|
135
147
|
!function(e4) {
|
|
136
148
|
if (B.configure.props.base.showIndex && -1 === e4.findIndex((e5) => "$index" === e5.props.base.prop)) {
|
|
137
|
-
const o3 =
|
|
149
|
+
const o3 = U();
|
|
138
150
|
o3 && e4.unshift(o3);
|
|
139
151
|
}
|
|
140
152
|
}(ne.value);
|
|
141
153
|
}
|
|
142
|
-
function be(e3) {
|
|
143
|
-
return B.configure.props.dataOrigin.transition === e3 && B.configure.props.dataOrigin[e3].titleColumns && B.configure.props.dataOrigin[e3].titleColumns.length > 0 && B.configure.props.dataOrigin[e3].dataColumns && B.configure.props.dataOrigin[e3].dataColumns.length > 0;
|
|
144
|
-
}
|
|
145
154
|
function xe(e3) {
|
|
146
|
-
|
|
147
|
-
return K(e3, { cellTitleStyle: o2, titleStyle: n2 }, B);
|
|
155
|
+
return B.configure.props.dataOrigin.transition === e3 && B.configure.props.dataOrigin[e3].titleColumns && B.configure.props.dataOrigin[e3].titleColumns.length > 0 && B.configure.props.dataOrigin[e3].dataColumns && B.configure.props.dataOrigin[e3].dataColumns.length > 0;
|
|
148
156
|
}
|
|
149
157
|
function Oe(e3) {
|
|
150
|
-
|
|
158
|
+
const o2 = se.value[e3.column.property] ? se.value[e3.column.property].titleStyle : null, n2 = Q == null ? void 0 : Q.titleStyle;
|
|
159
|
+
return V(e3, { cellTitleStyle: o2, titleStyle: n2 }, B);
|
|
151
160
|
}
|
|
152
161
|
function Se(e3) {
|
|
162
|
+
return G(e3, le, B);
|
|
163
|
+
}
|
|
164
|
+
function we(e3) {
|
|
153
165
|
const o2 = se.value[e3.column.property] ? se.value[e3.column.property].cellStyle : null;
|
|
154
|
-
return
|
|
166
|
+
return K(e3, o2, B);
|
|
155
167
|
}
|
|
156
168
|
he && he.fixHeight && (de = he.fixHeight), he && he.maxHeight && (de = he.maxHeight), de && (de = Number(de + "")), n(() => {
|
|
157
169
|
const e3 = x(B.pageContext, B.configure);
|
|
@@ -159,50 +171,50 @@ const q = e({ __name: "table-runtime", props: { configure: { type: Object, defau
|
|
|
159
171
|
else if ("variable" === B.configure.props.dataOrigin.dataSource) {
|
|
160
172
|
ve();
|
|
161
173
|
const o2 = O(B.pageContext.entity, B.configure.props.dataOrigin.variable);
|
|
162
|
-
o2 &&
|
|
174
|
+
o2 && be(o2, e3);
|
|
163
175
|
}
|
|
164
176
|
});
|
|
165
|
-
const
|
|
177
|
+
const Ee = (e3) => {
|
|
166
178
|
const { columns: o2, data: n2 } = e3, r2 = [];
|
|
167
179
|
return o2.forEach((e4, o3) => {
|
|
168
180
|
if (ae.value[e4.property]) {
|
|
169
181
|
const t2 = ae.value[e4.property].label;
|
|
170
|
-
r2[o3] = y("div", {}, [
|
|
182
|
+
r2[o3] = y("div", {}, [P(t2, n2)]);
|
|
171
183
|
} else if (ue.value[e4.property]) {
|
|
172
184
|
const t2 = n2.filter((e5, o4) => !le.includes(o4));
|
|
173
|
-
r2[o3] =
|
|
185
|
+
r2[o3] = J(ue.value[e4.property], t2, e4.property, B.pageContext);
|
|
174
186
|
}
|
|
175
187
|
}), r2;
|
|
176
188
|
};
|
|
177
|
-
function
|
|
189
|
+
function je({ row: e3, column: o2, rowIndex: n2, columnIndex: r2 }) {
|
|
178
190
|
const t2 = o2.property, i2 = B.configure.props.highOrder;
|
|
179
191
|
if (i2.scopeFunc) {
|
|
180
|
-
const t3 =
|
|
192
|
+
const t3 = $(B.pageContext, i2.scopeFunc);
|
|
181
193
|
if (t3) {
|
|
182
194
|
const i3 = t3.apply(t3, [{ tableData: oe.value, row: e3, column: o2, rowIndex: n2, columnIndex: r2 }]);
|
|
183
195
|
if (i3) return i3;
|
|
184
196
|
}
|
|
185
197
|
} else if (i2 && i2.mergeColumn, i2 && i2.mergeRow && i2.mergeRow.includes(t2) && 0 === n2) return { rowspan: oe.value.length, colspan: 1 };
|
|
186
198
|
}
|
|
187
|
-
function
|
|
188
|
-
"frontend" === B.configure.pageination.type ?
|
|
199
|
+
function $e(e3, o2) {
|
|
200
|
+
"frontend" === B.configure.pageination.type ? ke(e3, o2) : Ie(e3, o2);
|
|
189
201
|
}
|
|
190
202
|
function Fe(e3, o2) {
|
|
191
|
-
"frontend" === B.configure.pageination.type ?
|
|
203
|
+
"frontend" === B.configure.pageination.type ? ke(e3, o2) : Ie(e3, o2);
|
|
192
204
|
}
|
|
193
|
-
function
|
|
205
|
+
function ke(e3, o2) {
|
|
194
206
|
me && (oe.value = me.slice((e3 - 1) * o2, e3 * o2));
|
|
195
207
|
}
|
|
196
|
-
function
|
|
208
|
+
function Ie(e3, o2) {
|
|
197
209
|
B.configure.pageination.currentPageSet && w(B.pageContext.entity, B.configure.pageination.currentPageSet, e3), B.configure.pageination.pageSizeSet && w(B.pageContext.entity, B.configure.pageination.pageSizeSet, o2), E(B.pageContext, B.configure.uuid);
|
|
198
210
|
}
|
|
199
|
-
function
|
|
211
|
+
function Ne(e3) {
|
|
200
212
|
const o2 = e3.showCondition;
|
|
201
213
|
return j(B.pageContext, o2);
|
|
202
214
|
}
|
|
203
215
|
function Re(e3) {
|
|
204
216
|
if (B.configure.props.modelCustom) {
|
|
205
|
-
const o2 =
|
|
217
|
+
const o2 = $(B.pageContext, B.configure.props.modelCustom);
|
|
206
218
|
if (o2) {
|
|
207
219
|
const n2 = o2.apply(o2, [{ pageContext: B.pageContext, configureObj: B.configure, value: e3 }]);
|
|
208
220
|
S(n2) ? n2.then((e4) => {
|
|
@@ -227,7 +239,7 @@ const q = e({ __name: "table-runtime", props: { configure: { type: Object, defau
|
|
|
227
239
|
let o3 = [];
|
|
228
240
|
oe.value && (o3 = L(oe.value), o3.forEach((o4) => {
|
|
229
241
|
e4.forEach((e5) => {
|
|
230
|
-
const n3 =
|
|
242
|
+
const n3 = A(o4, e5.props.format, e5, B.pageContext, B.configure);
|
|
231
243
|
o4[e5.props.base.prop] = n3;
|
|
232
244
|
});
|
|
233
245
|
}));
|
|
@@ -235,7 +247,7 @@ const q = e({ __name: "table-runtime", props: { configure: { type: Object, defau
|
|
|
235
247
|
}(n2), columns: e3 };
|
|
236
248
|
} }), (o2, n2) => {
|
|
237
249
|
const r2 = t("el-table");
|
|
238
|
-
return a(), i("div", { style: p([l(Q), { display: "flex", "flex-direction": "column" }]), class: u([l(W), "amb-widget-chart amb-widget-flex"]), ref: "thisRef" }, [s(c(C, { ref_key: "headerRef", ref: Z, headerInfo: l(Y), configure: e2.configure, pageContext: e2.pageContext }, null, 8, ["headerInfo", "configure", "pageContext"]), [[m, l(Y).showHeader || e2.pageContext.showHomepageSearch]]), c(r2, { ref_key: "gridRef", ref: ge, data: oe.value, style: { width: "100%" }, "max-height": l(de), "header-cell-style":
|
|
250
|
+
return a(), i("div", { style: p([l(Q), { display: "flex", "flex-direction": "column" }]), class: u([l(W), "amb-widget-chart amb-widget-flex"]), ref: "thisRef" }, [s(c(C, { ref_key: "headerRef", ref: Z, headerInfo: l(Y), configure: e2.configure, pageContext: e2.pageContext }, null, 8, ["headerInfo", "configure", "pageContext"]), [[m, l(Y).showHeader || e2.pageContext.showHomepageSearch]]), c(r2, { ref_key: "gridRef", ref: ge, data: oe.value, style: { width: "100%" }, "max-height": l(de), "header-cell-style": Oe, "row-style": Se, "cell-style": we, "show-summary": ie.value, stripe: e2.configure.props.base.stripe, "summary-method": Ee, "span-method": je }, { default: d(() => [ee.value ? (a(true), i(h, { key: 0 }, v(re.value, (o3, n3) => (a(), i(h, { key: n3 }, [o3.isLeaf ? Ne(te.value[o3.columnUuid]) ? (a(), g(k, { key: 1, configure: e2.configure, pageContext: e2.pageContext, column: te.value[o3.columnUuid] }, null, 8, ["configure", "pageContext", "column"])) : f("", true) : (a(), g(F, { key: 0, configure: e2.configure, pageContext: e2.pageContext, groupColumn: o3, columnsConfigKeyValues: te.value }, null, 8, ["configure", "pageContext", "groupColumn", "columnsConfigKeyValues"]))], 64))), 128)) : (a(true), i(h, { key: 1 }, v(ne.value, (o3, n3) => (a(), i(h, { key: n3 }, [Ne(o3) ? (a(), g(k, { key: 0, column: o3, configure: e2.configure, pageContext: e2.pageContext }, null, 8, ["column", "configure", "pageContext"])) : f("", true)], 64))), 128))]), _: 1 }, 8, ["data", "max-height", "show-summary", "stripe"]), e2.configure.pageination && e2.configure.pageination.enable ? (a(), g(I, { key: 0, configure: e2.configure, "table-data": oe.value, total: fe.value, onPageChange: $e, onPageSizeChange: Fe }, null, 8, ["configure", "table-data", "total"])) : f("", true)], 6);
|
|
239
251
|
};
|
|
240
252
|
} });
|
|
241
253
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-page-runtime",
|
|
3
|
-
"version": "2.2.77-
|
|
3
|
+
"version": "2.2.77-sit5",
|
|
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.26-
|
|
51
|
+
"agilebuilder-ui": "1.1.26-sit2",
|
|
52
52
|
"axios": "^1.6.8",
|
|
53
53
|
"cypress": "^13.6.6",
|
|
54
54
|
"element-plus": "^2.6.1",
|