mvframe 1.0.74 → 1.0.77
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/README.cn.md +11 -3
- package/README.md +11 -3
- package/dist/css/cpt.css +1 -1
- package/dist/vendor.js +2009 -3841
- package/dist/vtable.js +1878 -0
- package/package.json +1 -1
- package/scripts/scaffold-app.js +35 -4
package/dist/vtable.js
ADDED
|
@@ -0,0 +1,1878 @@
|
|
|
1
|
+
import { reactive as ue, onMounted as pe, computed as X, resolveComponent as U, openBlock as A, createBlock as oe, unref as v, withCtx as F, createElementVNode as u, toDisplayString as R, createElementBlock as G, Fragment as se, renderList as ae, normalizeClass as fe, createVNode as J, createCommentVNode as ne, mergeProps as et, createTextVNode as he, ref as we, nextTick as ce, watch as Ve, isRef as tt, createApp as lt, markRaw as Te, shallowRef as ot, onBeforeMount as nt, onUnmounted as it, renderSlot as rt, createSlots as st, normalizeStyle as Ee, withDirectives as at, vShow as ct } from "vue";
|
|
2
|
+
import { e as Fe, A as ut, T as dt, D as ft, i as ht, L as pt, a as le, H as mt } from "./@visactor.js";
|
|
3
|
+
import { _ as Ne, u as gt, D as yt } from "./vendor.js";
|
|
4
|
+
import ke from "vuedraggable";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { download as bt, formatSummaryCell as vt } from "./composition.js";
|
|
7
|
+
import { e as wt } from "./element-plus.js";
|
|
8
|
+
const Ct = { class: "hp100 flexMode g16 p16" }, _t = { class: "w200 hp100 border radius8 fs14" }, xt = { class: "flexMode vc h36 p8 bg-gray3 border-b txt-nowrap" }, St = { class: "p4" }, Tt = ["onClick"], Et = { class: "txt-nowrap" }, kt = {
|
|
9
|
+
class: "flexMode vs hp100 border radius8",
|
|
10
|
+
style: { width: "calc(100% - 12.5rem)" }
|
|
11
|
+
}, $t = { class: "wp50 border-r fs14" }, Mt = { class: "flexMode vc g8 h36 p8 bg-gray3 border-b txt-nowrap" }, Lt = { class: "tagArea blue small" }, At = { class: "p4" }, Vt = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "absCenter tag rect"
|
|
14
|
+
}, Ft = { class: "flexMode vc g8" }, Nt = ["txt", "onClick"], Ht = { class: "wp50 border-r fs14" }, Ot = { class: "flexMode vc g8 h36 p8 bg-gray3 border-b txt-nowrap" }, zt = { class: "tagArea blue small" }, It = {
|
|
15
|
+
class: "relative",
|
|
16
|
+
style: { height: "calc(100% - 2.25rem)" }
|
|
17
|
+
}, Rt = {
|
|
18
|
+
class: "relative p4 bg-body",
|
|
19
|
+
style: { height: "30%" }
|
|
20
|
+
}, Bt = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "absCenter tag rect"
|
|
23
|
+
}, Dt = { class: "columnItem flexMode vc hb h40 g8 p4-8 mb4 radius4 border bg-white" }, jt = { class: "flexMode vc g8 txt-nowrap" }, Kt = { class: "flexMode vc g8" }, Wt = ["txt", "onClick"], Ut = { class: "h16 flexMode hc vc g4" }, Gt = { class: "fs10" }, qt = {
|
|
24
|
+
class: "relative p4",
|
|
25
|
+
style: { height: "calc(70% - 1rem)" }
|
|
26
|
+
}, Jt = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "absCenter tag rect"
|
|
29
|
+
}, Yt = { class: "columnItem flexMode vc hb h40 g8 p4-8 mb4 radius4 border" }, Zt = { class: "flexMode vc g8 txt-nowrap" }, Pt = { class: "flexMode vc g4" }, Xt = ["txt", "onClick"], Qt = ["txt", "onClick"], el = /* @__PURE__ */ Object.assign({
|
|
30
|
+
name: "MvcVTableColumnConfig",
|
|
31
|
+
inheritAttrs: !1
|
|
32
|
+
}, {
|
|
33
|
+
__name: "ColumnConfig",
|
|
34
|
+
props: {
|
|
35
|
+
tableName: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ""
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
emits: "close",
|
|
41
|
+
setup(c, { emit: t }) {
|
|
42
|
+
const n = c, e = ue({
|
|
43
|
+
loading: !1,
|
|
44
|
+
type: "normal",
|
|
45
|
+
columns: {
|
|
46
|
+
normal: [],
|
|
47
|
+
mmp: [],
|
|
48
|
+
asa: []
|
|
49
|
+
},
|
|
50
|
+
fixed: [],
|
|
51
|
+
visible: [],
|
|
52
|
+
selection: [],
|
|
53
|
+
operation: [],
|
|
54
|
+
columnType: {},
|
|
55
|
+
mounted: !1
|
|
56
|
+
});
|
|
57
|
+
pe(() => {
|
|
58
|
+
o();
|
|
59
|
+
});
|
|
60
|
+
const i = t, o = () => {
|
|
61
|
+
i("mounted");
|
|
62
|
+
const h = JSON.parse(localStorage.getItem(`${n.tableName}_Column`)), a = {};
|
|
63
|
+
h.forEach((l) => {
|
|
64
|
+
l.type && (a[l.type] = !0), l.visible ? l.type === "selection" ? e.selection.push(l) : l.type === "operation" ? e.operation.push(l) : l.label && (l.fixed ? e.fixed.push(l) : e.visible.push(l)) : l.type === "mmp" ? e.columns.mmp.push(l) : l.type === "asa" ? e.columns.asa.push(l) : e.columns.normal.push(l);
|
|
65
|
+
}), e.columnType = a;
|
|
66
|
+
}, p = (h) => {
|
|
67
|
+
e.type = h;
|
|
68
|
+
}, b = (h, a) => {
|
|
69
|
+
h.visible = !0, e.visible.unshift(h), h.type ? e.columns[h.type].splice(a, 1) : e.columns.normal.splice(a, 1);
|
|
70
|
+
}, m = (h, a) => {
|
|
71
|
+
e.fixed.unshift(h), e.visible.splice(a, 1);
|
|
72
|
+
}, w = (h, a) => {
|
|
73
|
+
e.visible.unshift(h), e.fixed.splice(a, 1);
|
|
74
|
+
}, x = (h, a) => {
|
|
75
|
+
e.visible.splice(a, 1), h.type ? e.columns[h.type].unshift(h) : e.columns.normal.unshift(h);
|
|
76
|
+
}, N = async () => {
|
|
77
|
+
e.loading = !0, window.$pm(() => {
|
|
78
|
+
const { fixed: h, visible: a, columns: l, selection: _, operation: g } = e;
|
|
79
|
+
let $ = [];
|
|
80
|
+
Object.keys(l).map((M) => {
|
|
81
|
+
$ = $.concat(l[M]);
|
|
82
|
+
}), h.forEach((M) => M.fixed = "left"), $.forEach((M) => M.visible = !1);
|
|
83
|
+
const L = _.concat(h, a, $, g);
|
|
84
|
+
L.forEach((M, ee) => M.sort = ee), localStorage.setItem(`${n.tableName}_Column`, JSON.stringify(L)), e.loading = !1, i("close"), i("init-column");
|
|
85
|
+
});
|
|
86
|
+
}, D = () => {
|
|
87
|
+
e.loading = !0, localStorage.removeItem(`${n.tableName}_Column`), window.$pm(() => {
|
|
88
|
+
e.loading = !1, i("close"), i("init-column");
|
|
89
|
+
}, 4);
|
|
90
|
+
}, r = X(() => {
|
|
91
|
+
var h;
|
|
92
|
+
return ((h = globalThis.$config.options) == null ? void 0 : h.drawerHeight) || 540;
|
|
93
|
+
}), f = X(() => (r.value * 0.3).toFixed(0)), T = X(() => (r.value * 0.7 - 26).toFixed(0)), B = X(() => [
|
|
94
|
+
{
|
|
95
|
+
label: "Base Info",
|
|
96
|
+
value: "normal"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: "Asa Metrics",
|
|
100
|
+
value: "asa",
|
|
101
|
+
hide: !e.columnType.asa
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: "MMP Metrics",
|
|
105
|
+
value: "mmp",
|
|
106
|
+
hide: !e.columnType.mmp
|
|
107
|
+
}
|
|
108
|
+
]);
|
|
109
|
+
return (h, a) => {
|
|
110
|
+
const l = U("el-scrollbar"), _ = U("DrawerArea");
|
|
111
|
+
return A(), oe(_, {
|
|
112
|
+
loading: v(e).loading,
|
|
113
|
+
noscroll: "",
|
|
114
|
+
"cancel-txt": "Reset",
|
|
115
|
+
"cancel-icon": "im-reload",
|
|
116
|
+
class: "MvcVTableColumnConfig",
|
|
117
|
+
onCancel: D,
|
|
118
|
+
onSubmit: N
|
|
119
|
+
}, {
|
|
120
|
+
default: F(() => [
|
|
121
|
+
u("div", Ct, [
|
|
122
|
+
u("div", _t, [
|
|
123
|
+
u("div", xt, R(h.$l("Column Type")), 1),
|
|
124
|
+
u("div", St, [
|
|
125
|
+
(A(!0), G(se, null, ae(v(B), (g) => (A(), G("div", {
|
|
126
|
+
key: g.value,
|
|
127
|
+
class: fe(["typeItem p8-16 mb4 radius4", [v(e).type === g.value && "active", g.hide && "hide"]]),
|
|
128
|
+
onClick: ($) => p(g.value)
|
|
129
|
+
}, [
|
|
130
|
+
u("span", Et, R(g.label), 1)
|
|
131
|
+
], 10, Tt))), 128))
|
|
132
|
+
])
|
|
133
|
+
]),
|
|
134
|
+
u("div", kt, [
|
|
135
|
+
u("div", $t, [
|
|
136
|
+
u("div", Mt, [
|
|
137
|
+
u("span", null, R(h.$l("Columns")), 1),
|
|
138
|
+
u("span", Lt, R(v(e).columns[v(e).type].length), 1)
|
|
139
|
+
]),
|
|
140
|
+
J(l, { style: { height: "calc(100% - 2.25rem)" } }, {
|
|
141
|
+
default: F(() => [
|
|
142
|
+
u("div", At, [
|
|
143
|
+
v(e).columns[v(e).type].length === 0 ? (A(), G("span", Vt, R(h.$l("No Columns")), 1)) : ne("", !0),
|
|
144
|
+
(A(!0), G(se, null, ae(v(e).columns[v(e).type], (g, $) => (A(), G("div", {
|
|
145
|
+
key: g.prop,
|
|
146
|
+
class: "columnItem flexMode vc hb h40 g8 p4-8 mb4 border radius4 txt-nowrap"
|
|
147
|
+
}, [
|
|
148
|
+
u("span", null, R(h.$l(g.label)), 1),
|
|
149
|
+
u("div", Ft, [
|
|
150
|
+
u("div", {
|
|
151
|
+
class: "tipbtn left",
|
|
152
|
+
txt: h.$l("Visible"),
|
|
153
|
+
onClick: (L) => b(g, $)
|
|
154
|
+
}, [...a[0] || (a[0] = [
|
|
155
|
+
u("i", { class: "imicon im-plus-square fs20 txt-p hover" }, null, -1)
|
|
156
|
+
])], 8, Nt)
|
|
157
|
+
])
|
|
158
|
+
]))), 128))
|
|
159
|
+
])
|
|
160
|
+
]),
|
|
161
|
+
_: 1
|
|
162
|
+
})
|
|
163
|
+
]),
|
|
164
|
+
u("div", Ht, [
|
|
165
|
+
u("div", Ot, [
|
|
166
|
+
u("span", null, R(h.$l("Visible Columns")), 1),
|
|
167
|
+
u("span", zt, R(v(e).visible.length), 1)
|
|
168
|
+
]),
|
|
169
|
+
u("div", It, [
|
|
170
|
+
u("div", Rt, [
|
|
171
|
+
v(e).fixed.length === 0 ? (A(), G("span", Bt, R(h.$l("No Fixed Columns")), 1)) : ne("", !0),
|
|
172
|
+
J(l, { height: v(f) }, {
|
|
173
|
+
default: F(() => [
|
|
174
|
+
J(v(ke), {
|
|
175
|
+
list: v(e).fixed,
|
|
176
|
+
"item-key": (g) => g,
|
|
177
|
+
handle: ".im-handle",
|
|
178
|
+
"ghost-class": "ghost"
|
|
179
|
+
}, {
|
|
180
|
+
item: F(({ element: g, index: $ }) => [
|
|
181
|
+
u("div", Dt, [
|
|
182
|
+
u("div", jt, [
|
|
183
|
+
a[1] || (a[1] = u("div", { class: "flexMode hc vc w24 h24 radius4 grab hover-bg-fa" }, [
|
|
184
|
+
u("i", { class: "imicon im-handle" })
|
|
185
|
+
], -1)),
|
|
186
|
+
u("span", null, R(h.$l(g.label)), 1)
|
|
187
|
+
]),
|
|
188
|
+
u("div", Kt, [
|
|
189
|
+
u("div", {
|
|
190
|
+
class: "tipbtn red left",
|
|
191
|
+
txt: h.$l("Unfixed"),
|
|
192
|
+
onClick: (L) => w(g, $)
|
|
193
|
+
}, [...a[2] || (a[2] = [
|
|
194
|
+
u("i", { class: "imicon im-minus-square fs20 txt-p hover" }, null, -1)
|
|
195
|
+
])], 8, Wt)
|
|
196
|
+
])
|
|
197
|
+
])
|
|
198
|
+
]),
|
|
199
|
+
_: 1
|
|
200
|
+
}, 8, ["list", "item-key"])
|
|
201
|
+
]),
|
|
202
|
+
_: 1
|
|
203
|
+
}, 8, ["height"])
|
|
204
|
+
]),
|
|
205
|
+
u("div", Ut, [
|
|
206
|
+
a[3] || (a[3] = u("i", { class: "imicon im-doubleup fs12" }, null, -1)),
|
|
207
|
+
u("span", Gt, R(h.$l("Fixed")), 1),
|
|
208
|
+
a[4] || (a[4] = u("i", { class: "imicon im-doubleup fs12" }, null, -1))
|
|
209
|
+
]),
|
|
210
|
+
u("div", qt, [
|
|
211
|
+
v(e).visible.length === 0 ? (A(), G("span", Jt, R(h.$l("No Columns")), 1)) : ne("", !0),
|
|
212
|
+
J(l, { height: v(T) }, {
|
|
213
|
+
default: F(() => [
|
|
214
|
+
J(v(ke), {
|
|
215
|
+
list: v(e).visible,
|
|
216
|
+
"item-key": (g) => g,
|
|
217
|
+
options: { lockAxis: "y" },
|
|
218
|
+
handle: ".im-handle",
|
|
219
|
+
"ghost-class": "ghost"
|
|
220
|
+
}, {
|
|
221
|
+
item: F(({ element: g, index: $ }) => [
|
|
222
|
+
u("div", Yt, [
|
|
223
|
+
u("div", Zt, [
|
|
224
|
+
a[5] || (a[5] = u("div", { class: "flexMode hc vc w24 h24 radius4 grab hover-bg-fa" }, [
|
|
225
|
+
u("i", { class: "imicon im-handle" })
|
|
226
|
+
], -1)),
|
|
227
|
+
u("span", null, R(h.$l(g.label)), 1)
|
|
228
|
+
]),
|
|
229
|
+
u("div", Pt, [
|
|
230
|
+
u("div", {
|
|
231
|
+
class: "tipbtn left",
|
|
232
|
+
txt: h.$l("Fixed"),
|
|
233
|
+
onClick: (L) => m(g, $)
|
|
234
|
+
}, [...a[6] || (a[6] = [
|
|
235
|
+
u("i", { class: "imicon im-plus-square fs20 txt-p hover" }, null, -1)
|
|
236
|
+
])], 8, Xt),
|
|
237
|
+
u("div", {
|
|
238
|
+
class: "tipbtn red left",
|
|
239
|
+
txt: h.$l("Hide"),
|
|
240
|
+
onClick: (L) => x(g, $)
|
|
241
|
+
}, [...a[7] || (a[7] = [
|
|
242
|
+
u("i", { class: "imicon im-close-square fs20 txt-p hover" }, null, -1)
|
|
243
|
+
])], 8, Qt)
|
|
244
|
+
])
|
|
245
|
+
])
|
|
246
|
+
]),
|
|
247
|
+
_: 1
|
|
248
|
+
}, 8, ["list", "item-key"])
|
|
249
|
+
]),
|
|
250
|
+
_: 1
|
|
251
|
+
}, 8, ["height"])
|
|
252
|
+
])
|
|
253
|
+
])
|
|
254
|
+
])
|
|
255
|
+
])
|
|
256
|
+
])
|
|
257
|
+
]),
|
|
258
|
+
_: 1
|
|
259
|
+
}, 8, ["loading"]);
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}), tl = /* @__PURE__ */ Ne(el, [["__scopeId", "data-v-73161392"]]), ll = { class: "p16" }, ol = { class: "flexMode vc hb p16 border radius8 bg-white" }, nl = { class: "flexMode vc g8" }, il = { class: "m0" }, rl = { class: "p16" }, sl = { class: "sticky flexMode vc g16 pb16 z9 backdrop radius4" }, al = { class: "fw700" }, cl = { class: "flexMode vc g8" }, ul = /* @__PURE__ */ Object.assign({
|
|
263
|
+
name: "MvcVTableColumnDownload",
|
|
264
|
+
inheritAttrs: !1
|
|
265
|
+
}, {
|
|
266
|
+
__name: "ColumnDownload",
|
|
267
|
+
props: {
|
|
268
|
+
tableName: {
|
|
269
|
+
type: String,
|
|
270
|
+
default: ""
|
|
271
|
+
},
|
|
272
|
+
list: {
|
|
273
|
+
type: Array,
|
|
274
|
+
default: () => []
|
|
275
|
+
},
|
|
276
|
+
selection: {
|
|
277
|
+
type: Array,
|
|
278
|
+
default: () => []
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
emits: ["mounted"],
|
|
282
|
+
setup(c, { emit: t }) {
|
|
283
|
+
const n = c, e = ue({
|
|
284
|
+
loading: !1,
|
|
285
|
+
columns: [],
|
|
286
|
+
checked: [],
|
|
287
|
+
useHead: !1,
|
|
288
|
+
onlySelection: !1,
|
|
289
|
+
mounted: !1
|
|
290
|
+
});
|
|
291
|
+
pe(() => {
|
|
292
|
+
o();
|
|
293
|
+
});
|
|
294
|
+
const i = t, o = () => {
|
|
295
|
+
i("mounted"), p(), b();
|
|
296
|
+
}, p = () => {
|
|
297
|
+
const a = JSON.parse(localStorage.getItem(`${n.tableName}_Column`)), l = ["selection", "operation"];
|
|
298
|
+
e.columns = a.filter(
|
|
299
|
+
(_) => !l.includes(_.type) && _.label
|
|
300
|
+
);
|
|
301
|
+
}, b = () => {
|
|
302
|
+
n.selection.length && (e.onlySelection = !0);
|
|
303
|
+
}, m = (a, l) => {
|
|
304
|
+
a ? l.children.forEach((_) => {
|
|
305
|
+
_.visible = !0;
|
|
306
|
+
}) : l.children.forEach((_) => {
|
|
307
|
+
_.visible = !1;
|
|
308
|
+
});
|
|
309
|
+
}, w = (a) => {
|
|
310
|
+
window.$copy(N({ type: a }));
|
|
311
|
+
}, x = async () => {
|
|
312
|
+
e.loading = !0;
|
|
313
|
+
try {
|
|
314
|
+
const a = N("download");
|
|
315
|
+
let l = e.fileName || D.value;
|
|
316
|
+
l && !l.toLowerCase().endsWith(".csv") && (l = `${l}.csv`), await bt({ content: a, filename: l, bom: !0 });
|
|
317
|
+
} finally {
|
|
318
|
+
e.loading = !1;
|
|
319
|
+
}
|
|
320
|
+
}, N = (a) => {
|
|
321
|
+
const l = e.onlySelection ? n.selection : n.list, _ = {}, g = [];
|
|
322
|
+
e.columns.filter((q) => q.visible).forEach((q) => {
|
|
323
|
+
g.push(window.$l(q.label)), _[q.prop] = !0;
|
|
324
|
+
});
|
|
325
|
+
let $ = "", L = [], M = a === "download" ? "," : " ";
|
|
326
|
+
["download", "withHeadCopy"].includes(a) && ($ = g.join(M) + `
|
|
327
|
+
`);
|
|
328
|
+
let ee = [], te;
|
|
329
|
+
return Object.keys(_).forEach((q, H) => {
|
|
330
|
+
q.includes("country") && (te = H);
|
|
331
|
+
const k = [];
|
|
332
|
+
l.forEach((W) => {
|
|
333
|
+
W[q] !== void 0 && k.push(W[q]);
|
|
334
|
+
}), ee.push(k);
|
|
335
|
+
}), ee.forEach((q, H) => {
|
|
336
|
+
!e.useCountryCode && te === H ? q.forEach((k, W) => {
|
|
337
|
+
let P = k;
|
|
338
|
+
window.$getType(k) === "Array" ? P = k.map((ie) => h[ie.toUpperCase()].label.$l()).join(",") : window.$getType(k) === "String" ? P = k.split(",").map((ie) => h[ie.toUpperCase()].label.$l()).join(",") : P = JSON.stringify(k), L[W] ? L[W] += P + M : L[W] = P + M;
|
|
339
|
+
}) : q.forEach((k, W) => {
|
|
340
|
+
L[W] ? L[W] += k + M : L[W] = k + M;
|
|
341
|
+
});
|
|
342
|
+
}), `${$}${L.join(`
|
|
343
|
+
`)}`;
|
|
344
|
+
}, D = X(() => {
|
|
345
|
+
const a = window.$d().format("YYYYMMDDHHmmss");
|
|
346
|
+
return `${n.tableName}_${a}`;
|
|
347
|
+
}), r = X(() => {
|
|
348
|
+
const a = {};
|
|
349
|
+
return e.columns.forEach((l) => {
|
|
350
|
+
const _ = l.type ? l.type : "normal", g = {
|
|
351
|
+
label: T[_],
|
|
352
|
+
type: _,
|
|
353
|
+
visible: 0
|
|
354
|
+
};
|
|
355
|
+
a[_] ? (a[_].children.push(l), l.visible && a[_].visible++) : (g.children = [l], l.visible && g.visible++, a[_] = g);
|
|
356
|
+
}), Object.keys(a).forEach((l) => {
|
|
357
|
+
const _ = a[l].visible === a[l].children.length, g = a[l].visible === 0;
|
|
358
|
+
_ ? (a[l].checkstatus = !0, a[l].indeterminate = !1) : g ? (a[l].checkstatus = !1, a[l].indeterminate = !1) : (a[l].checkstatus = !1, a[l].indeterminate = !0);
|
|
359
|
+
}), a;
|
|
360
|
+
}), f = X(() => {
|
|
361
|
+
const a = [];
|
|
362
|
+
for (let _ in r.value)
|
|
363
|
+
a.push(r.value[_].children);
|
|
364
|
+
return a.flat().filter((_) => _.visible).length <= 0;
|
|
365
|
+
}), T = {
|
|
366
|
+
asa: "Asa Metrics",
|
|
367
|
+
normal: "Base Info",
|
|
368
|
+
mmp: "MMP Metrics"
|
|
369
|
+
};
|
|
370
|
+
"Check All".$l(), "Cancel All".$l();
|
|
371
|
+
const B = [
|
|
372
|
+
{
|
|
373
|
+
label: "Pure Data",
|
|
374
|
+
value: "pureDataCopy",
|
|
375
|
+
icon: "im-list"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
label: "With Table Head",
|
|
379
|
+
value: "withHeadCopy",
|
|
380
|
+
icon: "im-header"
|
|
381
|
+
}
|
|
382
|
+
], h = {};
|
|
383
|
+
return (a, l) => {
|
|
384
|
+
const _ = U("el-checkbox"), g = U("el-button"), $ = U("el-dropdown-item"), L = U("el-dropdown-menu"), M = U("el-dropdown"), ee = U("el-switch"), te = U("Input"), q = U("DrawerArea");
|
|
385
|
+
return A(), oe(q, et(a.$attrs, { class: "MvcVTableColumnDownload" }), {
|
|
386
|
+
cancel: F(() => [
|
|
387
|
+
J(te, {
|
|
388
|
+
modelValue: v(e).fileName,
|
|
389
|
+
"onUpdate:modelValue": l[2] || (l[2] = (H) => v(e).fileName = H),
|
|
390
|
+
icon: "catalog",
|
|
391
|
+
placeholder: v(D),
|
|
392
|
+
class: "w600"
|
|
393
|
+
}, {
|
|
394
|
+
prefix: F(() => [...l[4] || (l[4] = [
|
|
395
|
+
u("i", { class: "imicon im-file-text" }, null, -1)
|
|
396
|
+
])]),
|
|
397
|
+
append: F(() => [
|
|
398
|
+
J(g, {
|
|
399
|
+
loading: v(e).loading,
|
|
400
|
+
disabled: v(f),
|
|
401
|
+
onClick: x
|
|
402
|
+
}, {
|
|
403
|
+
icon: F(() => [...l[5] || (l[5] = [
|
|
404
|
+
u("i", { class: "imicon im-download" }, null, -1)
|
|
405
|
+
])]),
|
|
406
|
+
default: F(() => [
|
|
407
|
+
he(" " + R(a.$l("Download")), 1)
|
|
408
|
+
]),
|
|
409
|
+
_: 1
|
|
410
|
+
}, 8, ["loading", "disabled"])
|
|
411
|
+
]),
|
|
412
|
+
_: 1
|
|
413
|
+
}, 8, ["modelValue", "placeholder"])
|
|
414
|
+
]),
|
|
415
|
+
submit: F(() => [...l[6] || (l[6] = [])]),
|
|
416
|
+
default: F(() => [
|
|
417
|
+
u("div", ll, [
|
|
418
|
+
u("div", ol, [
|
|
419
|
+
u("div", null, [
|
|
420
|
+
u("div", nl, [
|
|
421
|
+
u("h4", il, R(a.$l("Total")), 1),
|
|
422
|
+
u("span", null, R(n.list.length), 1)
|
|
423
|
+
]),
|
|
424
|
+
n.selection.length ? (A(), oe(_, {
|
|
425
|
+
key: 0,
|
|
426
|
+
modelValue: v(e).onlySelection,
|
|
427
|
+
"onUpdate:modelValue": l[0] || (l[0] = (H) => v(e).onlySelection = H),
|
|
428
|
+
label: `${a.$l("Only Selection")}: ${n.selection.length}`
|
|
429
|
+
}, null, 8, ["modelValue", "label"])) : ne("", !0)
|
|
430
|
+
]),
|
|
431
|
+
J(M, {
|
|
432
|
+
trigger: "click",
|
|
433
|
+
placement: "bottom",
|
|
434
|
+
onCommand: w
|
|
435
|
+
}, {
|
|
436
|
+
dropdown: F(() => [
|
|
437
|
+
J(L, null, {
|
|
438
|
+
default: F(() => [
|
|
439
|
+
(A(), G(se, null, ae(B, (H, k) => J($, {
|
|
440
|
+
key: k,
|
|
441
|
+
command: H.command
|
|
442
|
+
}, {
|
|
443
|
+
default: F(() => [
|
|
444
|
+
u("i", {
|
|
445
|
+
class: fe(["imicon", H.icon])
|
|
446
|
+
}, null, 2),
|
|
447
|
+
he(" " + R(H.label.$l()), 1)
|
|
448
|
+
]),
|
|
449
|
+
_: 2
|
|
450
|
+
}, 1032, ["command"])), 64))
|
|
451
|
+
]),
|
|
452
|
+
_: 1
|
|
453
|
+
})
|
|
454
|
+
]),
|
|
455
|
+
default: F(() => [
|
|
456
|
+
J(g, {
|
|
457
|
+
type: "primary",
|
|
458
|
+
class: "reverse"
|
|
459
|
+
}, {
|
|
460
|
+
icon: F(() => [...l[3] || (l[3] = [
|
|
461
|
+
u("i", { class: "imicon im-down" }, null, -1)
|
|
462
|
+
])]),
|
|
463
|
+
default: F(() => [
|
|
464
|
+
he(" " + R(a.$l("Copy to Clipboard")), 1)
|
|
465
|
+
]),
|
|
466
|
+
_: 1
|
|
467
|
+
})
|
|
468
|
+
]),
|
|
469
|
+
_: 1
|
|
470
|
+
})
|
|
471
|
+
])
|
|
472
|
+
]),
|
|
473
|
+
u("div", rl, [
|
|
474
|
+
(A(!0), G(se, null, ae(v(r), (H) => (A(), G("div", {
|
|
475
|
+
key: H.type
|
|
476
|
+
}, [
|
|
477
|
+
u("div", sl, [
|
|
478
|
+
u("span", al, R(H.label), 1),
|
|
479
|
+
J(_, {
|
|
480
|
+
modelValue: H.checkstatus,
|
|
481
|
+
"onUpdate:modelValue": (k) => H.checkstatus = k,
|
|
482
|
+
indeterminate: H.indeterminate,
|
|
483
|
+
label: a.$l("Check All"),
|
|
484
|
+
onChange: (k) => m(k, H)
|
|
485
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "indeterminate", "label", "onChange"])
|
|
486
|
+
]),
|
|
487
|
+
(A(!0), G(se, null, ae(H.children, (k, W) => (A(), oe(_, {
|
|
488
|
+
modelValue: k.visible,
|
|
489
|
+
"onUpdate:modelValue": (P) => k.visible = P,
|
|
490
|
+
key: W,
|
|
491
|
+
label: k.label,
|
|
492
|
+
value: k.value,
|
|
493
|
+
class: "fullCheckbox border mb8"
|
|
494
|
+
}, {
|
|
495
|
+
default: F(() => {
|
|
496
|
+
var P;
|
|
497
|
+
return [
|
|
498
|
+
u("div", cl, [
|
|
499
|
+
u("span", null, R(k.label), 1),
|
|
500
|
+
(P = k.prop) != null && P.includes("country") ? (A(), oe(ee, {
|
|
501
|
+
key: 0,
|
|
502
|
+
modelValue: v(e).useCountryCode,
|
|
503
|
+
"onUpdate:modelValue": l[1] || (l[1] = (ie) => v(e).useCountryCode = ie),
|
|
504
|
+
"inline-prompt": "",
|
|
505
|
+
"active-text": "Use Alpha-2 Code",
|
|
506
|
+
"inactive-text": "Use Country Name",
|
|
507
|
+
class: "primarySwitch"
|
|
508
|
+
}, null, 8, ["modelValue"])) : ne("", !0)
|
|
509
|
+
])
|
|
510
|
+
];
|
|
511
|
+
}),
|
|
512
|
+
_: 2
|
|
513
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "label", "value"]))), 128))
|
|
514
|
+
]))), 128))
|
|
515
|
+
])
|
|
516
|
+
]),
|
|
517
|
+
_: 1
|
|
518
|
+
}, 16);
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
class dl {
|
|
523
|
+
constructor(t) {
|
|
524
|
+
this.editorType = "Input", this.eventHandlers = [], this.editorConfig = t != null && typeof t == "object" && !Array.isArray(t) ? t : /* @__PURE__ */ Object.create(null);
|
|
525
|
+
}
|
|
526
|
+
getInputElement() {
|
|
527
|
+
return this.element;
|
|
528
|
+
}
|
|
529
|
+
createElement() {
|
|
530
|
+
this.eventHandlers = [];
|
|
531
|
+
const t = document.createElement("input");
|
|
532
|
+
t.setAttribute("type", "text"), this.editorConfig.readonly && t.setAttribute("readonly", `${this.editorConfig.readonly}`), t.style.position = "absolute", t.style.padding = "4px", t.style.width = "100%", t.style.boxSizing = "border-box", t.style.borderRadius = "0px", t.style.setProperty(
|
|
533
|
+
"background-color",
|
|
534
|
+
"var(--el-fill-color-blank, var(--el-bg-color, #ffffff))"
|
|
535
|
+
), t.style.setProperty(
|
|
536
|
+
"color",
|
|
537
|
+
"var(--el-input-text-color, var(--el-text-color-regular, #606266))"
|
|
538
|
+
), t.style.setProperty("border", "2px solid var(--el-border-color, #dcdfe6)");
|
|
539
|
+
const n = () => {
|
|
540
|
+
t.style.setProperty("border-color", "var(--el-color-primary)"), t.style.outline = "none";
|
|
541
|
+
};
|
|
542
|
+
t.addEventListener("focus", n), this.eventHandlers.push({ type: "focus", handler: n });
|
|
543
|
+
const e = () => {
|
|
544
|
+
if (t.style.setProperty("border-color", "var(--el-border-color)"), this.table && this.element && this.element.style.opacity === "0") {
|
|
545
|
+
const b = this.table.stateManager.select.cellPos;
|
|
546
|
+
(b.col !== this.col || b.row !== this.row) && this.onEnd();
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
t.addEventListener("blur", e), this.eventHandlers.push({ type: "blur", handler: e }), this.element = t, this.container.appendChild(t);
|
|
550
|
+
const i = (b) => {
|
|
551
|
+
var m, w;
|
|
552
|
+
b.key === "a" && (b.ctrlKey || b.metaKey) && ((w = (m = this.table) == null ? void 0 : m.editorManager) != null && w.editingEditor) && b.stopPropagation();
|
|
553
|
+
};
|
|
554
|
+
t.addEventListener("keydown", i), this.eventHandlers.push({ type: "keydown", handler: i });
|
|
555
|
+
const o = (b) => {
|
|
556
|
+
b.preventDefault();
|
|
557
|
+
};
|
|
558
|
+
t.addEventListener("wheel", o), this.eventHandlers.push({ type: "wheel", handler: o });
|
|
559
|
+
const p = (b) => {
|
|
560
|
+
var m;
|
|
561
|
+
((m = this.element) == null ? void 0 : m.style.opacity) === "0" && b.preventDefault();
|
|
562
|
+
};
|
|
563
|
+
t.addEventListener("paste", p), this.eventHandlers.push({ type: "paste", handler: p });
|
|
564
|
+
}
|
|
565
|
+
setValue(t) {
|
|
566
|
+
this.element.value = t !== void 0 ? t : "";
|
|
567
|
+
}
|
|
568
|
+
getValue() {
|
|
569
|
+
var t;
|
|
570
|
+
return (t = this.element) == null ? void 0 : t.value;
|
|
571
|
+
}
|
|
572
|
+
prepareEdit({ referencePosition: t, container: n, table: e, col: i, row: o }) {
|
|
573
|
+
this.container = n, this.table = e, this.col = i, this.row = o;
|
|
574
|
+
const p = this.table.stateManager.select.cellPos;
|
|
575
|
+
p.col === this.col && p.row === this.row && (this.element ? n.contains(this.element) || (this.element.parentElement.removeChild(this.element), this.container.appendChild(this.element)) : this.createElement(), this.element.style.opacity = "0", this.element.style.pointerEvents = "none", t != null && t.rect && this.adjustPosition(t.rect), this.element.focus());
|
|
576
|
+
}
|
|
577
|
+
onStart({
|
|
578
|
+
value: t,
|
|
579
|
+
referencePosition: n,
|
|
580
|
+
container: e,
|
|
581
|
+
endEdit: i,
|
|
582
|
+
table: o,
|
|
583
|
+
col: p,
|
|
584
|
+
row: b
|
|
585
|
+
}) {
|
|
586
|
+
this.container = e, this.successCallback = i, this.table = o, this.col = p, this.row = b, this.element ? e.contains(this.element) || (this.element.parentElement.removeChild(this.element), this.container.appendChild(this.element)) : (this.createElement(), n != null && n.rect && this.adjustPosition(n.rect)), t != null && this.setValue(t), this.element.style.opacity = "1", this.element.style.pointerEvents = "auto", this.element.focus();
|
|
587
|
+
}
|
|
588
|
+
adjustPosition(t) {
|
|
589
|
+
const n = t.top - 1, e = t.left - 1, i = t.width + 2, o = t.height + 2;
|
|
590
|
+
this.element.style.top = `${n}px`, this.element.style.left = `${e}px`, this.element.style.width = `${i}px`, this.element.style.height = `${o}px`;
|
|
591
|
+
}
|
|
592
|
+
endEditing() {
|
|
593
|
+
}
|
|
594
|
+
onEnd() {
|
|
595
|
+
if (!this.element) return;
|
|
596
|
+
const t = this.element;
|
|
597
|
+
this.eventHandlers.forEach(({ type: e, handler: i }) => {
|
|
598
|
+
t.removeEventListener(e, i);
|
|
599
|
+
}), this.eventHandlers = [];
|
|
600
|
+
const n = t.parentNode;
|
|
601
|
+
if (n)
|
|
602
|
+
try {
|
|
603
|
+
n.removeChild(t);
|
|
604
|
+
} catch (e) {
|
|
605
|
+
if (e instanceof Error && e.name !== "NotFoundError")
|
|
606
|
+
throw e;
|
|
607
|
+
}
|
|
608
|
+
this.element = void 0;
|
|
609
|
+
}
|
|
610
|
+
isEditorElement(t) {
|
|
611
|
+
return t === this.element;
|
|
612
|
+
}
|
|
613
|
+
validateValue() {
|
|
614
|
+
return !0;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
const $e = /* @__PURE__ */ new Set();
|
|
618
|
+
function fl(c, t, n) {
|
|
619
|
+
const e = String(c || "t").replace(/[^a-zA-Z0-9_]/g, "_"), i = String(t || "c").replace(/[^a-zA-Z0-9_]/g, "_"), o = `mvframe_input_${e}_${i}`;
|
|
620
|
+
if ($e.has(o))
|
|
621
|
+
return o;
|
|
622
|
+
const p = n != null && typeof n == "object" && !Array.isArray(n) ? n : /* @__PURE__ */ Object.create(null);
|
|
623
|
+
return Fe(o, new dl(p)), $e.add(o), o;
|
|
624
|
+
}
|
|
625
|
+
const hl = /* @__PURE__ */ Object.assign({
|
|
626
|
+
name: "VTableElementSelectEditor",
|
|
627
|
+
inheritAttrs: !1
|
|
628
|
+
}, {
|
|
629
|
+
__name: "VTableElementSelectEditor",
|
|
630
|
+
props: {
|
|
631
|
+
modelValue: {
|
|
632
|
+
type: [String, Number],
|
|
633
|
+
default: void 0
|
|
634
|
+
},
|
|
635
|
+
/** 与列 `vtable.editorValues` 一致:字符串列表,或 `{ value, label }` */
|
|
636
|
+
values: {
|
|
637
|
+
type: Array,
|
|
638
|
+
default: () => []
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
emits: ["update:modelValue", "commit"],
|
|
642
|
+
setup(c, { expose: t, emit: n }) {
|
|
643
|
+
const e = c, i = n, o = we(e.modelValue), p = we(null);
|
|
644
|
+
pe(() => {
|
|
645
|
+
ce(() => {
|
|
646
|
+
var w, x;
|
|
647
|
+
(x = (w = p.value) == null ? void 0 : w.focus) == null || x.call(w);
|
|
648
|
+
});
|
|
649
|
+
});
|
|
650
|
+
const b = (w) => {
|
|
651
|
+
i("update:modelValue", w), i("commit", w);
|
|
652
|
+
}, m = X(() => (e.values || []).map((x) => {
|
|
653
|
+
if (x != null && typeof x == "object") {
|
|
654
|
+
const N = "value" in x ? x.value : "v" in x ? x.v : x.label ?? x.text, D = "label" in x ? x.label : "text" in x ? x.text : String(N);
|
|
655
|
+
return { value: N, label: D };
|
|
656
|
+
}
|
|
657
|
+
return { value: x, label: String(x) };
|
|
658
|
+
}));
|
|
659
|
+
return Ve(
|
|
660
|
+
() => e.modelValue,
|
|
661
|
+
(w) => {
|
|
662
|
+
o.value = w;
|
|
663
|
+
}
|
|
664
|
+
), t({
|
|
665
|
+
focus: () => {
|
|
666
|
+
var w, x;
|
|
667
|
+
return (x = (w = p.value) == null ? void 0 : w.focus) == null ? void 0 : x.call(w);
|
|
668
|
+
},
|
|
669
|
+
getModelValue: () => o.value
|
|
670
|
+
}), (w, x) => {
|
|
671
|
+
const N = U("el-option"), D = U("el-select");
|
|
672
|
+
return A(), oe(D, {
|
|
673
|
+
ref_key: "selRef",
|
|
674
|
+
ref: p,
|
|
675
|
+
modelValue: v(o),
|
|
676
|
+
"onUpdate:modelValue": x[0] || (x[0] = (r) => tt(o) ? o.value = r : null),
|
|
677
|
+
class: "TableSelect",
|
|
678
|
+
size: "large",
|
|
679
|
+
filterable: "",
|
|
680
|
+
teleported: !1,
|
|
681
|
+
"automatic-dropdown": "",
|
|
682
|
+
onChange: b
|
|
683
|
+
}, {
|
|
684
|
+
default: F(() => [
|
|
685
|
+
(A(!0), G(se, null, ae(v(m), (r) => (A(), oe(N, {
|
|
686
|
+
key: String(r.value),
|
|
687
|
+
label: r.label,
|
|
688
|
+
value: r.value
|
|
689
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
690
|
+
]),
|
|
691
|
+
_: 1
|
|
692
|
+
}, 8, ["modelValue"]);
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
}), Me = /* @__PURE__ */ new Set();
|
|
696
|
+
class pl {
|
|
697
|
+
constructor(t) {
|
|
698
|
+
this.editorConfig = t || /* @__PURE__ */ Object.create(null), this.editorType = "Input", this.container = null, this.successCallback = null, this._rootEl = null, this._app = null, this._current = void 0;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* @param {Object} args
|
|
702
|
+
* @param {HTMLElement} args.container
|
|
703
|
+
* @param {unknown} args.value
|
|
704
|
+
* @param {{ rect?: { top: number; left: number; width: number; height: number } }} [args.referencePosition]
|
|
705
|
+
* @param {() => void} args.endEdit
|
|
706
|
+
*/
|
|
707
|
+
onStart(t) {
|
|
708
|
+
const { container: n, value: e, referencePosition: i, endEdit: o } = t;
|
|
709
|
+
this.container = n, this.successCallback = o, this._current = e, this._rootEl = document.createElement("div"), this._rootEl.className = "MvcVTableElementSelectRoot", this._rootEl.style.position = "absolute", this._rootEl.style.boxSizing = "border-box", this._rootEl.style.zIndex = "30", n.appendChild(this._rootEl);
|
|
710
|
+
const p = this.editorConfig.values ?? [];
|
|
711
|
+
this._app = lt(hl, {
|
|
712
|
+
modelValue: e,
|
|
713
|
+
values: p,
|
|
714
|
+
onCommit: (b) => {
|
|
715
|
+
this._current = b, typeof this.successCallback == "function" && this.successCallback();
|
|
716
|
+
}
|
|
717
|
+
}), this._app.use(wt), this._app.mount(this._rootEl), i != null && i.rect && this.adjustPosition(i.rect);
|
|
718
|
+
}
|
|
719
|
+
getValue() {
|
|
720
|
+
return this._current;
|
|
721
|
+
}
|
|
722
|
+
/** @param {unknown} value */
|
|
723
|
+
setValue(t) {
|
|
724
|
+
this._current = t;
|
|
725
|
+
}
|
|
726
|
+
/** @param {{ top: number; left: number; width: number; height: number }} rect */
|
|
727
|
+
adjustPosition(t) {
|
|
728
|
+
if (!this._rootEl)
|
|
729
|
+
return;
|
|
730
|
+
const n = t.top - 1, e = t.left - 1, i = t.width + 2, o = t.height + 2;
|
|
731
|
+
this._rootEl.style.top = `${n}px`, this._rootEl.style.left = `${e}px`, this._rootEl.style.width = `${i}px`, this._rootEl.style.height = `${o}px`;
|
|
732
|
+
}
|
|
733
|
+
/** @param {EventTarget | null} target */
|
|
734
|
+
isEditorElement(t) {
|
|
735
|
+
return !t || !this._rootEl || !(t instanceof Node) ? !1 : this._rootEl.contains(t);
|
|
736
|
+
}
|
|
737
|
+
endEditing() {
|
|
738
|
+
}
|
|
739
|
+
onEnd() {
|
|
740
|
+
var t;
|
|
741
|
+
if (this._app) {
|
|
742
|
+
try {
|
|
743
|
+
this._app.unmount();
|
|
744
|
+
} catch {
|
|
745
|
+
}
|
|
746
|
+
this._app = null;
|
|
747
|
+
}
|
|
748
|
+
if ((t = this._rootEl) != null && t.parentNode)
|
|
749
|
+
try {
|
|
750
|
+
this._rootEl.parentNode.removeChild(this._rootEl);
|
|
751
|
+
} catch {
|
|
752
|
+
}
|
|
753
|
+
this._rootEl = null, this.container = null;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
function ml(c, t, n) {
|
|
757
|
+
if (!Array.isArray(n) || !n.length)
|
|
758
|
+
return "";
|
|
759
|
+
const e = String(c || "t").replace(/[^a-zA-Z0-9_]/g, "_"), i = String(t || "c").replace(/[^a-zA-Z0-9_]/g, "_"), o = `mvframe_list_${e}_${i}`;
|
|
760
|
+
return Me.has(o) || (Fe(
|
|
761
|
+
o,
|
|
762
|
+
new pl({ values: [...n] })
|
|
763
|
+
), Me.add(o)), o;
|
|
764
|
+
}
|
|
765
|
+
function K(c, t = "") {
|
|
766
|
+
return typeof document > "u" ? t : getComputedStyle(document.documentElement).getPropertyValue(c).trim() || t;
|
|
767
|
+
}
|
|
768
|
+
const gl = 8;
|
|
769
|
+
function Le(c, t) {
|
|
770
|
+
var B, h;
|
|
771
|
+
if (typeof c != "string" || !c || typeof document > "u")
|
|
772
|
+
return null;
|
|
773
|
+
const e = `${typeof ((h = (B = globalThis.$config) == null ? void 0 : B.iconfont) == null ? void 0 : h.prefix) == "string" && globalThis.$config.iconfont.prefix ? globalThis.$config.iconfont.prefix : "imc"}-${c}`, i = document.getElementById(e);
|
|
774
|
+
if (!i || i.tagName.toLowerCase() !== "symbol")
|
|
775
|
+
return null;
|
|
776
|
+
const o = i.getAttribute("viewBox") || "", p = i.innerHTML, m = `<svg xmlns="http://www.w3.org/2000/svg"${o ? ` viewBox="${o.replace(/"/g, """)}"` : ""}>${p}</svg>`, w = (t == null ? void 0 : t.width) ?? 20, x = (t == null ? void 0 : t.height) ?? 20, N = (t == null ? void 0 : t.positionType) ?? "inlineFront", r = {
|
|
777
|
+
type: "svg",
|
|
778
|
+
name: (t == null ? void 0 : t.id) != null && String(t.id) !== "" ? String(t.id) : c,
|
|
779
|
+
svg: m,
|
|
780
|
+
width: w,
|
|
781
|
+
height: x,
|
|
782
|
+
positionType: N
|
|
783
|
+
};
|
|
784
|
+
if ((t == null ? void 0 : t.interactive) !== !1) {
|
|
785
|
+
r.interactive = !0;
|
|
786
|
+
const a = (t == null ? void 0 : t.cursor) ?? "pointer";
|
|
787
|
+
if (a && (r.cursor = a), (t == null ? void 0 : t.hover) !== !1) {
|
|
788
|
+
const l = t != null && t.hover && typeof t.hover == "object" ? t.hover : {};
|
|
789
|
+
r.hover = {
|
|
790
|
+
bgColor: l.bgColor ?? K("--color-bg-menu-item-hover", "rgba(0, 0, 0, 0.06)")
|
|
791
|
+
}, l.width != null && (r.hover.width = l.width), l.height != null && (r.hover.height = l.height), l.image != null && (r.hover.image = l.image);
|
|
792
|
+
}
|
|
793
|
+
} else
|
|
794
|
+
r.interactive = !1;
|
|
795
|
+
const T = t == null ? void 0 : t.tooltip;
|
|
796
|
+
if (T != null && typeof T == "object" && typeof T.title == "string" && T.title !== "") {
|
|
797
|
+
const a = typeof globalThis.$l == "function" ? globalThis.$l(T.title) : T.title;
|
|
798
|
+
r.tooltip = {
|
|
799
|
+
...T,
|
|
800
|
+
title: a,
|
|
801
|
+
placement: T.placement ?? "top"
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
return r;
|
|
805
|
+
}
|
|
806
|
+
function He(c) {
|
|
807
|
+
if (Array.isArray(c)) {
|
|
808
|
+
const t = [];
|
|
809
|
+
for (const n of c) {
|
|
810
|
+
const e = He(n);
|
|
811
|
+
e != null && (Array.isArray(e) ? t.push(...e) : t.push(e));
|
|
812
|
+
}
|
|
813
|
+
if (t.length === 0)
|
|
814
|
+
return null;
|
|
815
|
+
if (t.length > 1)
|
|
816
|
+
for (let n = 0; n < t.length; n++)
|
|
817
|
+
t[n].marginRight = n < t.length - 1 ? gl : 0;
|
|
818
|
+
return t.length === 1 ? t[0] : t;
|
|
819
|
+
}
|
|
820
|
+
return typeof c == "string" ? Le(c) : c && typeof c == "object" && typeof c.name == "string" ? Le(c.name, c) : null;
|
|
821
|
+
}
|
|
822
|
+
const re = "_vtableSelect";
|
|
823
|
+
function Oe(c) {
|
|
824
|
+
return `_${c}SwitchLoading`;
|
|
825
|
+
}
|
|
826
|
+
function ze(c) {
|
|
827
|
+
return `_${c}EditorLoading`;
|
|
828
|
+
}
|
|
829
|
+
function yl(c, t, n, e) {
|
|
830
|
+
const i = typeof n == "string" && n ? n : e(t), o = c.disable;
|
|
831
|
+
c.disable = (p) => {
|
|
832
|
+
try {
|
|
833
|
+
const b = p.table.getCellOriginRecord(p.col, p.row);
|
|
834
|
+
if (b && b[i] === !0)
|
|
835
|
+
return !0;
|
|
836
|
+
} catch {
|
|
837
|
+
}
|
|
838
|
+
return typeof o == "function" ? o(p) : o === !0;
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
function bl(c, t, n) {
|
|
842
|
+
yl(
|
|
843
|
+
c,
|
|
844
|
+
t,
|
|
845
|
+
n,
|
|
846
|
+
Oe
|
|
847
|
+
);
|
|
848
|
+
}
|
|
849
|
+
function vl(c, t, n) {
|
|
850
|
+
const e = typeof n == "string" && n ? n : ze(t), i = c.editor;
|
|
851
|
+
if (i != null) {
|
|
852
|
+
if (typeof i == "string") {
|
|
853
|
+
const o = i;
|
|
854
|
+
c.editor = (p) => {
|
|
855
|
+
try {
|
|
856
|
+
const b = p.table.getCellOriginRecord(p.col, p.row);
|
|
857
|
+
if (b && b[e] === !0)
|
|
858
|
+
return;
|
|
859
|
+
} catch {
|
|
860
|
+
}
|
|
861
|
+
return o;
|
|
862
|
+
};
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
if (typeof i == "function") {
|
|
866
|
+
const o = i;
|
|
867
|
+
c.editor = (p) => {
|
|
868
|
+
try {
|
|
869
|
+
const b = p.table.getCellOriginRecord(p.col, p.row);
|
|
870
|
+
if (b && b[e] === !0)
|
|
871
|
+
return;
|
|
872
|
+
} catch {
|
|
873
|
+
}
|
|
874
|
+
return o(p);
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
function Ie(c) {
|
|
880
|
+
return c.fixed === "right" ? "right" : c.fixed === "left" || c.fixed === !0 ? "left" : !1;
|
|
881
|
+
}
|
|
882
|
+
const be = {
|
|
883
|
+
/** 去掉最左侧外边(左为 0) */
|
|
884
|
+
noOuterStart: [1, 1, 1, 0],
|
|
885
|
+
/** 去掉最右侧外边(右为 0) */
|
|
886
|
+
noOuterEnd: [1, 0, 1, 1],
|
|
887
|
+
/** 仅一列时两侧外边都去掉 */
|
|
888
|
+
noOuterBoth: [1, 0, 1, 0]
|
|
889
|
+
};
|
|
890
|
+
function wl(c) {
|
|
891
|
+
const t = c.field;
|
|
892
|
+
if (!t)
|
|
893
|
+
return;
|
|
894
|
+
const n = c.style;
|
|
895
|
+
c.style = (e) => {
|
|
896
|
+
let i = {};
|
|
897
|
+
if (typeof n == "function") {
|
|
898
|
+
const w = n(e);
|
|
899
|
+
w && typeof w == "object" && (i = { ...w });
|
|
900
|
+
} else n && typeof n == "object" && (i = { ...n });
|
|
901
|
+
let o = !1;
|
|
902
|
+
try {
|
|
903
|
+
const w = e.table.getCellOriginRecord(e.col, e.row);
|
|
904
|
+
o = (w == null ? void 0 : w[t]) === !0;
|
|
905
|
+
} catch {
|
|
906
|
+
}
|
|
907
|
+
const p = K(
|
|
908
|
+
"--color-on-primary-text",
|
|
909
|
+
K("--color-txt-white", "#ffffff")
|
|
910
|
+
), b = K("--color-txt-p", "#555555"), m = o ? p : b;
|
|
911
|
+
return { ...i, fill: m, color: m };
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
function ve(c, t) {
|
|
915
|
+
const n = t === "both" ? be.noOuterBoth : t === "start" ? be.noOuterStart : be.noOuterEnd, e = c.style, i = c.headerStyle;
|
|
916
|
+
c.style = (o) => ({ ...typeof e == "function" ? { ...e(o) || {} } : { ...e && typeof e == "object" ? e : {} }, borderLineWidth: n }), c.headerStyle = (o) => ({ ...typeof i == "function" ? { ...i(o) || {} } : {
|
|
917
|
+
...i && typeof i == "object" ? i : {}
|
|
918
|
+
}, borderLineWidth: n });
|
|
919
|
+
}
|
|
920
|
+
function Cl(c, t) {
|
|
921
|
+
if (!c || !(t != null && t.length))
|
|
922
|
+
return;
|
|
923
|
+
const n = `${c}_Column`;
|
|
924
|
+
if (localStorage.getItem(n))
|
|
925
|
+
return;
|
|
926
|
+
const e = t.filter(Boolean).map((i, o) => ({
|
|
927
|
+
prop: i.type === "selection" ? re : i.field,
|
|
928
|
+
labelKey: i.labelKey ?? i.title,
|
|
929
|
+
label: i.labelKey ?? i.title,
|
|
930
|
+
sort: o,
|
|
931
|
+
visible: i.visible !== !1,
|
|
932
|
+
fixed: Ie(i),
|
|
933
|
+
nomove: i.nomove,
|
|
934
|
+
type: i.type === "selection" ? "selection" : i.type === "operation" ? "operation" : i.type || void 0,
|
|
935
|
+
resizable: !0,
|
|
936
|
+
width: i.width
|
|
937
|
+
}));
|
|
938
|
+
localStorage.setItem(n, JSON.stringify(e));
|
|
939
|
+
}
|
|
940
|
+
function _l(c) {
|
|
941
|
+
if (!c)
|
|
942
|
+
return null;
|
|
943
|
+
try {
|
|
944
|
+
const t = localStorage.getItem(`${c}_Column`);
|
|
945
|
+
return t ? JSON.parse(t) : null;
|
|
946
|
+
} catch {
|
|
947
|
+
return null;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
function xl({
|
|
951
|
+
tableName: c,
|
|
952
|
+
columnMetas: t,
|
|
953
|
+
summaryData: n,
|
|
954
|
+
summaryMetricProp: e
|
|
955
|
+
}) {
|
|
956
|
+
const i = Array.isArray(t) ? t.filter((r) => r != null) : [], o = _l(c);
|
|
957
|
+
let p;
|
|
958
|
+
o != null && o.length ? p = o.slice().sort((r, f) => r.sort - f.sort).filter((r) => r != null && r.visible) : p = i.map((r, f) => ({
|
|
959
|
+
prop: r.type === "selection" ? re : r.field,
|
|
960
|
+
labelKey: r.labelKey ?? r.title,
|
|
961
|
+
label: r.labelKey ?? r.title,
|
|
962
|
+
sort: f,
|
|
963
|
+
visible: r.visible !== !1,
|
|
964
|
+
fixed: Ie(r),
|
|
965
|
+
type: r.type === "selection" ? "selection" : r.type === "operation" ? "operation" : r.type,
|
|
966
|
+
width: r.width
|
|
967
|
+
}));
|
|
968
|
+
const b = [];
|
|
969
|
+
let m = 0, w = !0, x = !1;
|
|
970
|
+
const N = (r) => {
|
|
971
|
+
var T, B;
|
|
972
|
+
const f = Ae(r, e);
|
|
973
|
+
return f !== void 0 ? f : Ae(r, (B = (T = globalThis.$config) == null ? void 0 : T.table) == null ? void 0 : B.summaryMetric);
|
|
974
|
+
};
|
|
975
|
+
for (const r of p) {
|
|
976
|
+
if (r == null)
|
|
977
|
+
continue;
|
|
978
|
+
if (r.type === "selection") {
|
|
979
|
+
x = !0, b.push({
|
|
980
|
+
field: re,
|
|
981
|
+
title: "",
|
|
982
|
+
width: r.width ?? 48,
|
|
983
|
+
minWidth: 48,
|
|
984
|
+
headerType: "checkbox",
|
|
985
|
+
cellType: "checkbox"
|
|
986
|
+
}), w && m++;
|
|
987
|
+
continue;
|
|
988
|
+
}
|
|
989
|
+
const f = i.find((g) => g.field === r.prop);
|
|
990
|
+
let T = {}, B, h;
|
|
991
|
+
if (f != null && f.vtable && typeof f.vtable == "object") {
|
|
992
|
+
T = { ...f.vtable }, h = T.cellSelectable, delete T.cellSelectable, B = T.mvcIcon, delete T.mvcIcon, delete T.switchLoadingKey, delete T.editorLoadingKey;
|
|
993
|
+
const g = T.inputEditor === !0, $ = T.inputEditorConfig;
|
|
994
|
+
delete T.inputEditor, delete T.inputEditorConfig;
|
|
995
|
+
const L = T.editorValues;
|
|
996
|
+
if (delete T.editorValues, g && c && r.prop != null && r.prop !== "") {
|
|
997
|
+
const M = fl(
|
|
998
|
+
c,
|
|
999
|
+
r.prop,
|
|
1000
|
+
$
|
|
1001
|
+
);
|
|
1002
|
+
M && (T.editor = M);
|
|
1003
|
+
}
|
|
1004
|
+
if (Array.isArray(L) && L.length && c) {
|
|
1005
|
+
const M = ml(
|
|
1006
|
+
c,
|
|
1007
|
+
r.prop,
|
|
1008
|
+
L
|
|
1009
|
+
);
|
|
1010
|
+
M && (T.editor = M);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
const a = (f == null ? void 0 : f.minWidth) ?? 80, l = {
|
|
1014
|
+
field: r.prop,
|
|
1015
|
+
title: globalThis.$l(r.labelKey ?? r.label),
|
|
1016
|
+
width: r.width ?? (f == null ? void 0 : f.width) ?? a,
|
|
1017
|
+
minWidth: a,
|
|
1018
|
+
cellType: "text",
|
|
1019
|
+
...T
|
|
1020
|
+
};
|
|
1021
|
+
if (l.icon == null && B != null) {
|
|
1022
|
+
const g = He(B);
|
|
1023
|
+
g && (l.icon = g);
|
|
1024
|
+
}
|
|
1025
|
+
if (l.cellType === "switch" && r.prop != null && r.prop !== "" && (wl(l), bl(
|
|
1026
|
+
l,
|
|
1027
|
+
r.prop,
|
|
1028
|
+
f != null && f.vtable && typeof f.vtable.switchLoadingKey == "string" ? f.vtable.switchLoadingKey : void 0
|
|
1029
|
+
)), l.editor && r.prop != null && r.prop !== "" && vl(
|
|
1030
|
+
l,
|
|
1031
|
+
r.prop,
|
|
1032
|
+
f != null && f.vtable && typeof f.vtable.editorLoadingKey == "string" ? f.vtable.editorLoadingKey : void 0
|
|
1033
|
+
), n && typeof n == "object") {
|
|
1034
|
+
const g = n[r.prop];
|
|
1035
|
+
l.aggregation = {
|
|
1036
|
+
aggregationType: ut.CUSTOM,
|
|
1037
|
+
aggregationFun: () => g === void 0 ? "" : g,
|
|
1038
|
+
formatFun: ($) => vt(r.prop, $, N(r.prop))
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
(r.type === "operation" || h === !1) && (l.disableSelect = !0, l.disableHeaderSelect = !0), b.push(l);
|
|
1042
|
+
const _ = r.fixed === "left" || r.fixed === !0;
|
|
1043
|
+
w && _ ? m++ : _ || (w = !1);
|
|
1044
|
+
}
|
|
1045
|
+
let D = 0;
|
|
1046
|
+
for (let r = p.length - 1; r >= 0; r--) {
|
|
1047
|
+
const f = p[r];
|
|
1048
|
+
if (f.type === "selection")
|
|
1049
|
+
break;
|
|
1050
|
+
if (f.fixed === "right")
|
|
1051
|
+
D++;
|
|
1052
|
+
else
|
|
1053
|
+
break;
|
|
1054
|
+
}
|
|
1055
|
+
return b.length === 1 ? ve(b[0], "both") : b.length > 1 && (ve(b[0], "start"), ve(b[b.length - 1], "end")), { columns: b, frozenColCount: m, rightFrozenColCount: D, hasSelection: x };
|
|
1056
|
+
}
|
|
1057
|
+
function Ae(c, t) {
|
|
1058
|
+
if (t != null)
|
|
1059
|
+
return typeof t == "function" ? t(c) : t[c];
|
|
1060
|
+
}
|
|
1061
|
+
function Sl(c = {}) {
|
|
1062
|
+
const { frameSideLines: t = !1 } = c, n = K("--color-border", "#e5e5e5"), e = K("--color-white", "#ffffff"), i = K("--color-bg-page-header", e), o = K("--color-bg-menu-children", "#f9f9f9"), p = K("--color-txt-h2", "#333333"), b = K("--color-txt-p", "#555555"), m = K("--color-primary", "#007bff"), w = K("--color-primary-bg-txt", "rgba(0, 123, 255, 0.12)"), x = K(
|
|
1063
|
+
"--color-vtable-hover-cross",
|
|
1064
|
+
"rgba(0, 123, 255, 0.045)"
|
|
1065
|
+
), N = K("--color-on-primary-text", "#ffffff"), D = K("--color-bg-body", "#fafafa"), r = K("--color-txt-tip", "#999999"), f = typeof document < "u" && getComputedStyle(document.body).fontFamily || "system-ui,sans-serif", B = {
|
|
1066
|
+
underlayBackgroundColor: e,
|
|
1067
|
+
defaultStyle: {
|
|
1068
|
+
borderColor: n
|
|
1069
|
+
},
|
|
1070
|
+
headerStyle: {
|
|
1071
|
+
bgColor: i,
|
|
1072
|
+
color: (h) => {
|
|
1073
|
+
var L, M, ee, te;
|
|
1074
|
+
const { col: a, row: l, table: _ } = h, g = _.columnHeaderLevelCount ?? 1;
|
|
1075
|
+
if (typeof l != "number" || l < 0 || l >= g || (M = (L = _.options) == null ? void 0 : L.select) != null && M.disableHeaderSelect)
|
|
1076
|
+
return p;
|
|
1077
|
+
const $ = (ee = _.stateManager) == null ? void 0 : ee.select;
|
|
1078
|
+
if (!((te = $ == null ? void 0 : $.ranges) != null && te.length) || $.highlightScope === "none")
|
|
1079
|
+
return p;
|
|
1080
|
+
try {
|
|
1081
|
+
if (ht(_.stateManager, a, l))
|
|
1082
|
+
return N;
|
|
1083
|
+
} catch {
|
|
1084
|
+
}
|
|
1085
|
+
return p;
|
|
1086
|
+
},
|
|
1087
|
+
fontSize: 14,
|
|
1088
|
+
fontFamily: f,
|
|
1089
|
+
fontWeight: "600",
|
|
1090
|
+
borderColor: n,
|
|
1091
|
+
hover: {
|
|
1092
|
+
cellBgColor: w
|
|
1093
|
+
},
|
|
1094
|
+
select: {
|
|
1095
|
+
cellBgColor: m,
|
|
1096
|
+
inlineColumnBgColor: m
|
|
1097
|
+
}
|
|
1098
|
+
},
|
|
1099
|
+
bodyStyle: {
|
|
1100
|
+
bgColor: (h) => {
|
|
1101
|
+
const { row: a, table: l } = h, _ = l.columnHeaderLevelCount ?? 1, g = a - _;
|
|
1102
|
+
return g < 0 || g % 2 === 0 ? e : D;
|
|
1103
|
+
},
|
|
1104
|
+
color: b,
|
|
1105
|
+
fontSize: 14,
|
|
1106
|
+
fontFamily: f,
|
|
1107
|
+
borderColor: n,
|
|
1108
|
+
hover: {
|
|
1109
|
+
cellBgColor: x,
|
|
1110
|
+
inlineRowBgColor: x,
|
|
1111
|
+
inlineColumnBgColor: x
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
1114
|
+
bottomFrozenStyle: {
|
|
1115
|
+
bgColor: o,
|
|
1116
|
+
color: b,
|
|
1117
|
+
borderColor: n,
|
|
1118
|
+
fontFamily: f,
|
|
1119
|
+
fontSize: 14
|
|
1120
|
+
},
|
|
1121
|
+
frameStyle: {
|
|
1122
|
+
borderColor: n,
|
|
1123
|
+
borderLineWidth: t ? [0, 1, 0, 1] : [0, 0, 0, 0],
|
|
1124
|
+
innerBorder: !0,
|
|
1125
|
+
cornerRadius: 0,
|
|
1126
|
+
shadowBlur: 0
|
|
1127
|
+
},
|
|
1128
|
+
scrollStyle: {
|
|
1129
|
+
scrollRailColor: o,
|
|
1130
|
+
scrollSliderColor: r,
|
|
1131
|
+
hoverOn: !0,
|
|
1132
|
+
visible: "scrolling",
|
|
1133
|
+
width: 8
|
|
1134
|
+
},
|
|
1135
|
+
// 见 vtable create-select-border:`overlay` 会给选区 rect 填 `cellBgColor`,易盖住单元格文本;
|
|
1136
|
+
// `replace` 时 fill 为 false,只保留描边,文字保持可读。
|
|
1137
|
+
selectionStyle: {
|
|
1138
|
+
cellBorderColor: m,
|
|
1139
|
+
cellBorderLineWidth: 2,
|
|
1140
|
+
selectionFillMode: "replace"
|
|
1141
|
+
},
|
|
1142
|
+
frozenColumnLine: {
|
|
1143
|
+
border: {
|
|
1144
|
+
lineColor: n,
|
|
1145
|
+
lineWidth: 1,
|
|
1146
|
+
bgColor: e
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
tooltipStyle: {
|
|
1150
|
+
bgColor: K("--color-bg-menu", e),
|
|
1151
|
+
color: b,
|
|
1152
|
+
fontFamily: f,
|
|
1153
|
+
fontSize: 12
|
|
1154
|
+
},
|
|
1155
|
+
functionalIconsStyle: {
|
|
1156
|
+
sort_color: m,
|
|
1157
|
+
sort_color_2: r,
|
|
1158
|
+
frozen_color: m
|
|
1159
|
+
},
|
|
1160
|
+
/** 未配置时 VTable 默认勾选项与表体底色接近,选中态几乎不可见 */
|
|
1161
|
+
checkboxStyle: {
|
|
1162
|
+
size: 16,
|
|
1163
|
+
defaultFill: e,
|
|
1164
|
+
defaultStroke: r,
|
|
1165
|
+
checkedFill: m,
|
|
1166
|
+
checkedStroke: m
|
|
1167
|
+
},
|
|
1168
|
+
/**
|
|
1169
|
+
* 开关:打开态轨道 `--color-primary`;标签字色由列 `style` 在 columns 内按
|
|
1170
|
+
* `--color-on-primary-text` / `--color-txt-p` 自动区分(见 wrapSwitchColumnLabelStyle)。
|
|
1171
|
+
*/
|
|
1172
|
+
switchStyle: {
|
|
1173
|
+
boxWidth: 30,
|
|
1174
|
+
boxHeight: 16,
|
|
1175
|
+
circleRadius: 6,
|
|
1176
|
+
checkedFill: m,
|
|
1177
|
+
uncheckedFill: n,
|
|
1178
|
+
circleFill: e
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
return new dt(B, ft);
|
|
1182
|
+
}
|
|
1183
|
+
function Tl(c = {}) {
|
|
1184
|
+
const t = K("--color-txt-tip", "#999999"), n = typeof document < "u" && getComputedStyle(document.body).fontFamily || "system-ui,sans-serif", e = typeof globalThis.$l == "function" && globalThis.$l("No Data") || "No Data", i = c.text !== void 0 && c.text !== "" ? c.text : e, o = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="96" height="96"><g fill="none" stroke="${t}" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"><rect x="16" y="28" width="64" height="48" rx="4"/><path d="M16 40h64"/><ellipse cx="48" cy="52" rx="14" ry="6"/></g><circle cx="48" cy="20" r="7" fill="${t}" opacity="0.18"/></svg>`;
|
|
1185
|
+
return {
|
|
1186
|
+
displayMode: "basedOnContainer",
|
|
1187
|
+
spaceBetweenTextAndIcon: 16,
|
|
1188
|
+
text: i,
|
|
1189
|
+
textStyle: {
|
|
1190
|
+
fontSize: 14,
|
|
1191
|
+
fontFamily: n,
|
|
1192
|
+
fontWeight: "normal",
|
|
1193
|
+
color: t,
|
|
1194
|
+
lineHeight: 22,
|
|
1195
|
+
...c.textStyle
|
|
1196
|
+
},
|
|
1197
|
+
icon: c.icon !== void 0 ? c.icon : {
|
|
1198
|
+
image: o,
|
|
1199
|
+
width: 72,
|
|
1200
|
+
height: 72
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
const El = {
|
|
1205
|
+
key: 0,
|
|
1206
|
+
class: "flexMode vc"
|
|
1207
|
+
}, kl = { class: "tableArea relative radius ctx-auto" }, $l = {
|
|
1208
|
+
key: 1,
|
|
1209
|
+
class: "tableFooter relative flexMode vc h56 p16 xscroll nobar z9"
|
|
1210
|
+
}, Ml = /* @__PURE__ */ Object.assign({
|
|
1211
|
+
name: "MvcVTable",
|
|
1212
|
+
inheritAttrs: !1
|
|
1213
|
+
}, {
|
|
1214
|
+
__name: "index",
|
|
1215
|
+
props: {
|
|
1216
|
+
/** 列定义(替代 `<Table>` 下 `el-table-column` slot;与 ColumnConfig 存储的 `prop` 对齐) */
|
|
1217
|
+
columnMetas: {
|
|
1218
|
+
type: Array,
|
|
1219
|
+
default: () => []
|
|
1220
|
+
},
|
|
1221
|
+
defaultLoading: {
|
|
1222
|
+
type: Boolean,
|
|
1223
|
+
default: !0
|
|
1224
|
+
},
|
|
1225
|
+
tableName: {
|
|
1226
|
+
type: String,
|
|
1227
|
+
default: ""
|
|
1228
|
+
},
|
|
1229
|
+
autoHeader: {
|
|
1230
|
+
type: Boolean,
|
|
1231
|
+
default: !0
|
|
1232
|
+
},
|
|
1233
|
+
headerClass: {
|
|
1234
|
+
type: String,
|
|
1235
|
+
default: ""
|
|
1236
|
+
},
|
|
1237
|
+
height: {
|
|
1238
|
+
type: [String, Number],
|
|
1239
|
+
default: 0
|
|
1240
|
+
},
|
|
1241
|
+
minusHeight: {
|
|
1242
|
+
type: [String, Number],
|
|
1243
|
+
default: 0
|
|
1244
|
+
},
|
|
1245
|
+
defer: {
|
|
1246
|
+
type: Boolean,
|
|
1247
|
+
default: !1
|
|
1248
|
+
},
|
|
1249
|
+
rowKey: {
|
|
1250
|
+
type: String,
|
|
1251
|
+
default: ""
|
|
1252
|
+
},
|
|
1253
|
+
tool: {
|
|
1254
|
+
type: [Object, Boolean],
|
|
1255
|
+
default: () => ({
|
|
1256
|
+
download: !0,
|
|
1257
|
+
refresh: !0,
|
|
1258
|
+
column: !0,
|
|
1259
|
+
showLabel: !1
|
|
1260
|
+
})
|
|
1261
|
+
},
|
|
1262
|
+
noheader: {
|
|
1263
|
+
type: Boolean,
|
|
1264
|
+
default: !1
|
|
1265
|
+
},
|
|
1266
|
+
nofooter: {
|
|
1267
|
+
type: Boolean,
|
|
1268
|
+
default: !1
|
|
1269
|
+
},
|
|
1270
|
+
loadData: {
|
|
1271
|
+
type: Function,
|
|
1272
|
+
default: () => ({
|
|
1273
|
+
list: [],
|
|
1274
|
+
total: 0
|
|
1275
|
+
})
|
|
1276
|
+
},
|
|
1277
|
+
/**
|
|
1278
|
+
* 树形懒加载:`columnMetas[].vtable.tree === true` 且行上 `children: true` 时,用户展开会触发;
|
|
1279
|
+
* 返回子行记录数组(字段与根行一致为佳;含勾选列时需带 `_vtableSelect`)。
|
|
1280
|
+
*
|
|
1281
|
+
* @type {undefined|((args: { record: Record<string, unknown>; col: number; row: number }) => Promise<unknown[]> | unknown[])}
|
|
1282
|
+
*/
|
|
1283
|
+
loadTreeChildren: {
|
|
1284
|
+
type: Function,
|
|
1285
|
+
default: null
|
|
1286
|
+
},
|
|
1287
|
+
/** 树列缩进像素,仅当存在 `tree` 列时写入 `hierarchyIndent` */
|
|
1288
|
+
hierarchyIndent: {
|
|
1289
|
+
type: Number,
|
|
1290
|
+
default: 20
|
|
1291
|
+
},
|
|
1292
|
+
pageSize: {
|
|
1293
|
+
type: Number,
|
|
1294
|
+
default: 0
|
|
1295
|
+
},
|
|
1296
|
+
pageSizes: {
|
|
1297
|
+
type: Array,
|
|
1298
|
+
default: () => [10, 20, 50, 100]
|
|
1299
|
+
},
|
|
1300
|
+
summaryMetric: {
|
|
1301
|
+
type: [Object, Function],
|
|
1302
|
+
default: null
|
|
1303
|
+
},
|
|
1304
|
+
/** 空数据主文案;空串时沿用 `$l('No Data')` */
|
|
1305
|
+
emptyText: {
|
|
1306
|
+
type: String,
|
|
1307
|
+
default: ""
|
|
1308
|
+
},
|
|
1309
|
+
/**
|
|
1310
|
+
* 列宽模式。`autoWidth` 按表头/内容自动算宽,列上的 `width` 常不生效;
|
|
1311
|
+
* `standard` 使用列定义中的 `width` / `minWidth`(与 columnMetas、列配置一致)。
|
|
1312
|
+
*/
|
|
1313
|
+
widthMode: {
|
|
1314
|
+
type: String,
|
|
1315
|
+
default: "standard"
|
|
1316
|
+
},
|
|
1317
|
+
/**
|
|
1318
|
+
* 是否在横向铺满容器时扩展列宽。与 `widthMode: 'standard'` 同用时,为 true 会把多余宽度分给可伸缩列;
|
|
1319
|
+
* 为 false 时更贴近配置的像素宽度(总宽不足容器时右侧留白,超出则横向滚动)。
|
|
1320
|
+
*/
|
|
1321
|
+
autoFillWidth: {
|
|
1322
|
+
type: Boolean,
|
|
1323
|
+
default: !1
|
|
1324
|
+
},
|
|
1325
|
+
/**
|
|
1326
|
+
* 可编辑列(如 ListEditor 下拉)进入编辑的触发方式;下拉列常用 `click`。
|
|
1327
|
+
* @see https://visactor.io/vtable/guide/edit/edit_cell
|
|
1328
|
+
*/
|
|
1329
|
+
editCellTrigger: {
|
|
1330
|
+
type: [String, Array],
|
|
1331
|
+
default: "click"
|
|
1332
|
+
},
|
|
1333
|
+
/**
|
|
1334
|
+
* `loadData` / 分页 / 刷新后 `syncVTable` 完成时是否将纵向滚动置顶。
|
|
1335
|
+
* 为 false 时不再滚动(替代仅依赖 `window.config?.table?.scrollToTop` 的旧行为)。
|
|
1336
|
+
*/
|
|
1337
|
+
scrollToTopOnLoad: {
|
|
1338
|
+
type: Boolean,
|
|
1339
|
+
default: !0
|
|
1340
|
+
},
|
|
1341
|
+
/**
|
|
1342
|
+
* 整表是否允许单元格选区(与列 `vtable.cellSelectable: false` 叠加;本项为 `false` 时整表不可选)。
|
|
1343
|
+
* 透传 VTable `options.select`:`disableSelect`、`disableHeaderSelect`、`disableDragSelect`。
|
|
1344
|
+
*/
|
|
1345
|
+
cellSelectable: {
|
|
1346
|
+
type: Boolean,
|
|
1347
|
+
default: !0
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
emits: [
|
|
1351
|
+
"selection-change",
|
|
1352
|
+
"refresh",
|
|
1353
|
+
"switch-change",
|
|
1354
|
+
"cell-value-change",
|
|
1355
|
+
// 单元格内图标点击(mvcIcon / 列 icon;树展开等内置图标会带 funcType)
|
|
1356
|
+
"icon-click"
|
|
1357
|
+
],
|
|
1358
|
+
setup(c, { expose: t, emit: n }) {
|
|
1359
|
+
const e = c, i = ue({
|
|
1360
|
+
loading: !0,
|
|
1361
|
+
selection: []
|
|
1362
|
+
}), o = ue({
|
|
1363
|
+
list: [],
|
|
1364
|
+
total: 0,
|
|
1365
|
+
page: 1,
|
|
1366
|
+
pageSize: 50,
|
|
1367
|
+
summary: !1,
|
|
1368
|
+
nopagination: !1
|
|
1369
|
+
}), p = ue({
|
|
1370
|
+
current: "",
|
|
1371
|
+
list: [
|
|
1372
|
+
{
|
|
1373
|
+
title: "Table Column Customization",
|
|
1374
|
+
size: 1024,
|
|
1375
|
+
cpt: Te(tl)
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
title: "Download from Current Table",
|
|
1379
|
+
cpt: Te(ul)
|
|
1380
|
+
}
|
|
1381
|
+
]
|
|
1382
|
+
}), b = we(null), m = ot(null);
|
|
1383
|
+
let w, x = !1, N, D, r = 0;
|
|
1384
|
+
const f = ue({
|
|
1385
|
+
show: !1,
|
|
1386
|
+
left: 0,
|
|
1387
|
+
top: 0,
|
|
1388
|
+
width: 0,
|
|
1389
|
+
height: 0
|
|
1390
|
+
});
|
|
1391
|
+
let T = { col: -1, row: -1 }, B = null;
|
|
1392
|
+
nt(() => {
|
|
1393
|
+
a();
|
|
1394
|
+
}), pe(() => {
|
|
1395
|
+
var s;
|
|
1396
|
+
e.tableName && ((s = e.columnMetas) != null && s.length) && Cl(e.tableName, e.columnMetas), typeof MutationObserver < "u" && (N = new MutationObserver(() => {
|
|
1397
|
+
clearTimeout(D), D = setTimeout(Ce, 80);
|
|
1398
|
+
}), N.observe(document.documentElement, {
|
|
1399
|
+
attributes: !0,
|
|
1400
|
+
attributeFilter: ["class"]
|
|
1401
|
+
})), l();
|
|
1402
|
+
});
|
|
1403
|
+
const h = n, a = () => {
|
|
1404
|
+
i.loading = e.defaultLoading, e.pageSize && (o.pageSize = e.pageSize);
|
|
1405
|
+
}, l = () => {
|
|
1406
|
+
e.defer === !1 && de();
|
|
1407
|
+
}, _ = (s, y) => {
|
|
1408
|
+
if (!y)
|
|
1409
|
+
return s;
|
|
1410
|
+
for (const d of s)
|
|
1411
|
+
(!(re in d) || d[re] !== !0) && (d[re] = !1);
|
|
1412
|
+
return s;
|
|
1413
|
+
}, g = () => xl({
|
|
1414
|
+
tableName: e.tableName,
|
|
1415
|
+
columnMetas: e.columnMetas,
|
|
1416
|
+
summaryData: o.summary || null,
|
|
1417
|
+
summaryMetricProp: e.summaryMetric
|
|
1418
|
+
}), $ = (s) => {
|
|
1419
|
+
const y = [];
|
|
1420
|
+
for (const d of s)
|
|
1421
|
+
d != null && d.field && (d.cellType === "switch" || d.cellType === "checkbox") && y.push(d.field);
|
|
1422
|
+
return y;
|
|
1423
|
+
}, L = (s) => {
|
|
1424
|
+
const y = [];
|
|
1425
|
+
for (const d of s)
|
|
1426
|
+
!(d != null && d.field) || !d.editor || y.push(d.field);
|
|
1427
|
+
return y;
|
|
1428
|
+
}, M = () => {
|
|
1429
|
+
var V, O;
|
|
1430
|
+
const s = m.value;
|
|
1431
|
+
if (!((V = s == null ? void 0 : s.stateManager) != null && V.checkedState) || !((O = s.dataSource) != null && O.getIndexKey))
|
|
1432
|
+
return;
|
|
1433
|
+
const y = g(), d = $(y.columns);
|
|
1434
|
+
if (!d.length)
|
|
1435
|
+
return;
|
|
1436
|
+
const S = s.stateManager.checkedState;
|
|
1437
|
+
for (let j = 0; j < o.list.length; j++) {
|
|
1438
|
+
const C = String(s.dataSource.getIndexKey(j)), E = S.get(C);
|
|
1439
|
+
if (E)
|
|
1440
|
+
for (const z of d)
|
|
1441
|
+
Object.prototype.hasOwnProperty.call(E, z) && (o.list[j][z] = E[z] === !0);
|
|
1442
|
+
}
|
|
1443
|
+
}, ee = (s) => {
|
|
1444
|
+
var S, V;
|
|
1445
|
+
const y = (S = e.columnMetas) == null ? void 0 : S.find((O) => O != null && O.field === s), d = (V = y == null ? void 0 : y.vtable) == null ? void 0 : V.switchLoadingKey;
|
|
1446
|
+
return typeof d == "string" && d ? d : Oe(s);
|
|
1447
|
+
}, te = (s) => {
|
|
1448
|
+
var S, V;
|
|
1449
|
+
const y = (S = e.columnMetas) == null ? void 0 : S.find((O) => O != null && O.field === s), d = (V = y == null ? void 0 : y.vtable) == null ? void 0 : V.editorLoadingKey;
|
|
1450
|
+
return typeof d == "string" && d ? d : ze(s);
|
|
1451
|
+
}, q = () => {
|
|
1452
|
+
M();
|
|
1453
|
+
const s = re;
|
|
1454
|
+
if (!g().hasSelection) {
|
|
1455
|
+
i.selection = [], h("selection-change", []);
|
|
1456
|
+
return;
|
|
1457
|
+
}
|
|
1458
|
+
const d = o.list.filter((S) => S[s] === !0);
|
|
1459
|
+
i.selection = d, h("selection-change", d);
|
|
1460
|
+
}, H = () => {
|
|
1461
|
+
if (B != null && m.value)
|
|
1462
|
+
try {
|
|
1463
|
+
m.value.off(B);
|
|
1464
|
+
} catch {
|
|
1465
|
+
}
|
|
1466
|
+
B = null;
|
|
1467
|
+
}, k = () => {
|
|
1468
|
+
const s = m.value;
|
|
1469
|
+
if (!s || !f.show)
|
|
1470
|
+
return;
|
|
1471
|
+
const { col: y, row: d } = T;
|
|
1472
|
+
if (!(!Number.isFinite(y) || !Number.isFinite(d)))
|
|
1473
|
+
try {
|
|
1474
|
+
const S = s.getCellRelativeRect(y, d);
|
|
1475
|
+
if (!S)
|
|
1476
|
+
return;
|
|
1477
|
+
const V = S.width != null ? S.width : S.right - S.left, O = S.height != null ? S.height : S.bottom - S.top;
|
|
1478
|
+
f.left = S.left, f.top = S.top, f.width = Math.max(0, V), f.height = Math.max(0, O);
|
|
1479
|
+
} catch {
|
|
1480
|
+
}
|
|
1481
|
+
}, W = () => {
|
|
1482
|
+
f.show = !1, T = { col: -1, row: -1 }, f.left = 0, f.top = 0, f.width = 0, f.height = 0, H();
|
|
1483
|
+
}, P = (s, y, d) => {
|
|
1484
|
+
H(), T = { col: y, row: d }, f.show = !0, ce(() => {
|
|
1485
|
+
if (k(), !s || m.value !== s)
|
|
1486
|
+
return;
|
|
1487
|
+
const S = () => {
|
|
1488
|
+
k();
|
|
1489
|
+
};
|
|
1490
|
+
B = s.on(
|
|
1491
|
+
le.SCROLL,
|
|
1492
|
+
S
|
|
1493
|
+
);
|
|
1494
|
+
});
|
|
1495
|
+
}, ie = (s, y) => {
|
|
1496
|
+
const d = m.value;
|
|
1497
|
+
!d || !Number.isFinite(s) || !Number.isFinite(y) || P(d, s, y);
|
|
1498
|
+
}, Re = (s) => {
|
|
1499
|
+
if (x)
|
|
1500
|
+
return;
|
|
1501
|
+
x = !0;
|
|
1502
|
+
const y = () => {
|
|
1503
|
+
q();
|
|
1504
|
+
}, d = (C) => {
|
|
1505
|
+
var z, Y;
|
|
1506
|
+
try {
|
|
1507
|
+
(Y = (z = s.editorManager) == null ? void 0 : z.cancelEdit) == null || Y.call(z);
|
|
1508
|
+
} catch {
|
|
1509
|
+
}
|
|
1510
|
+
y();
|
|
1511
|
+
const E = C == null ? void 0 : C.field;
|
|
1512
|
+
typeof E != "string" || !E || h("switch-change", {
|
|
1513
|
+
field: E,
|
|
1514
|
+
checked: C.checked === !0,
|
|
1515
|
+
row: C.originData,
|
|
1516
|
+
loadingKey: ee(E),
|
|
1517
|
+
col: C.col,
|
|
1518
|
+
cellRow: C.row
|
|
1519
|
+
});
|
|
1520
|
+
}, S = (C) => {
|
|
1521
|
+
const E = C == null ? void 0 : C.field;
|
|
1522
|
+
if (typeof E != "string" || !E)
|
|
1523
|
+
return;
|
|
1524
|
+
const z = g();
|
|
1525
|
+
if (!new Set(L(z.columns)).has(E))
|
|
1526
|
+
return;
|
|
1527
|
+
const Z = C.recordIndex;
|
|
1528
|
+
let Q;
|
|
1529
|
+
try {
|
|
1530
|
+
Q = s.getCellOriginRecord(C.col, C.row);
|
|
1531
|
+
} catch {
|
|
1532
|
+
Q = void 0;
|
|
1533
|
+
}
|
|
1534
|
+
if (Q == null) {
|
|
1535
|
+
const I = Number(Z);
|
|
1536
|
+
Number.isFinite(I) && I >= 0 && I < o.list.length && Number.isInteger(I) && (Q = o.list[I]);
|
|
1537
|
+
}
|
|
1538
|
+
h("cell-value-change", {
|
|
1539
|
+
field: E,
|
|
1540
|
+
row: Q,
|
|
1541
|
+
recordIndex: Z,
|
|
1542
|
+
currentValue: C.currentValue,
|
|
1543
|
+
changedValue: C.changedValue,
|
|
1544
|
+
rawValue: C.rawValue,
|
|
1545
|
+
col: C.col,
|
|
1546
|
+
cellRow: C.row,
|
|
1547
|
+
loadingKey: te(E)
|
|
1548
|
+
});
|
|
1549
|
+
}, V = (C) => {
|
|
1550
|
+
if (m.value !== s || C == null)
|
|
1551
|
+
return;
|
|
1552
|
+
const E = C.col, z = C.row, Y = g(), Z = Number.isFinite(E) && E >= 0 && E < Y.columns.length ? Y.columns[E] : null, Q = (Z == null ? void 0 : Z.field) ?? null;
|
|
1553
|
+
let I = null;
|
|
1554
|
+
try {
|
|
1555
|
+
I = s.getCellOriginRecord(E, z);
|
|
1556
|
+
} catch {
|
|
1557
|
+
I = null;
|
|
1558
|
+
}
|
|
1559
|
+
let ye = null;
|
|
1560
|
+
if (I != null && Array.isArray(o.list)) {
|
|
1561
|
+
const Se = o.list.indexOf(I);
|
|
1562
|
+
Se >= 0 ? ye = Se : I && typeof I.index == "number" && (ye = I.index);
|
|
1563
|
+
}
|
|
1564
|
+
h("icon-click", {
|
|
1565
|
+
field: Q,
|
|
1566
|
+
col: E,
|
|
1567
|
+
row: z,
|
|
1568
|
+
iconName: C.name,
|
|
1569
|
+
funcType: C.funcType,
|
|
1570
|
+
record: I,
|
|
1571
|
+
recordIndex: ye,
|
|
1572
|
+
nativeEvent: C.event
|
|
1573
|
+
});
|
|
1574
|
+
}, O = () => {
|
|
1575
|
+
typeof globalThis.requestAnimationFrame != "function" || r !== 0 || (r = globalThis.requestAnimationFrame(() => {
|
|
1576
|
+
var E, z, Y, Z, Q, I;
|
|
1577
|
+
r = 0;
|
|
1578
|
+
const C = m.value;
|
|
1579
|
+
if (!(!C || C !== s))
|
|
1580
|
+
try {
|
|
1581
|
+
(z = (E = C.scenegraph) == null ? void 0 : E.clearCells) == null || z.call(E), (Y = C.clearCellStyleCache) == null || Y.call(C), (Q = (Z = C.scenegraph) == null ? void 0 : Z.createSceneGraph) == null || Q.call(Z, !0), (I = C.render) == null || I.call(C);
|
|
1582
|
+
} catch {
|
|
1583
|
+
}
|
|
1584
|
+
}));
|
|
1585
|
+
}, j = (C) => {
|
|
1586
|
+
if ((C == null ? void 0 : C.hierarchyState) !== mt.expand || typeof e.loadTreeChildren != "function")
|
|
1587
|
+
return;
|
|
1588
|
+
const E = C.originData;
|
|
1589
|
+
if (E == null || E.children !== !0)
|
|
1590
|
+
return;
|
|
1591
|
+
const z = C.col, Y = C.row;
|
|
1592
|
+
!Number.isFinite(z) || !Number.isFinite(Y) || (async () => {
|
|
1593
|
+
P(s, z, Y);
|
|
1594
|
+
try {
|
|
1595
|
+
const Z = await e.loadTreeChildren({ record: E, col: z, row: Y }), Q = Array.isArray(Z) ? Z : [], I = m.value;
|
|
1596
|
+
if (!I || I !== s)
|
|
1597
|
+
return;
|
|
1598
|
+
I.setRecordChildren(Q, z, Y);
|
|
1599
|
+
} catch {
|
|
1600
|
+
} finally {
|
|
1601
|
+
W();
|
|
1602
|
+
}
|
|
1603
|
+
})();
|
|
1604
|
+
};
|
|
1605
|
+
s.on(le.CHECKBOX_STATE_CHANGE, y), s.on(le.SWITCH_STATE_CHANGE, d), s.on(le.CHANGE_CELL_VALUE, S), s.on(
|
|
1606
|
+
le.TREE_HIERARCHY_STATE_CHANGE,
|
|
1607
|
+
j
|
|
1608
|
+
), s.on(
|
|
1609
|
+
le.SELECTED_CHANGED,
|
|
1610
|
+
O
|
|
1611
|
+
), s.on(
|
|
1612
|
+
le.SELECTED_CLEAR,
|
|
1613
|
+
O
|
|
1614
|
+
), s.on(
|
|
1615
|
+
le.DRAG_SELECT_END,
|
|
1616
|
+
O
|
|
1617
|
+
), s.on(le.ICON_CLICK, V);
|
|
1618
|
+
}, Be = () => Tl({
|
|
1619
|
+
text: e.emptyText || void 0
|
|
1620
|
+
}), De = () => Sl({
|
|
1621
|
+
frameSideLines: o.list.length === 0
|
|
1622
|
+
}), me = () => {
|
|
1623
|
+
const s = g(), y = _(o.list, s.hasSelection), d = 40, S = s.columns.some((V) => (V == null ? void 0 : V.tree) === !0);
|
|
1624
|
+
return {
|
|
1625
|
+
records: y,
|
|
1626
|
+
columns: s.columns,
|
|
1627
|
+
frozenColCount: s.frozenColCount,
|
|
1628
|
+
rightFrozenColCount: s.rightFrozenColCount ?? 0,
|
|
1629
|
+
widthMode: e.widthMode,
|
|
1630
|
+
autoFillWidth: e.autoFillWidth,
|
|
1631
|
+
heightMode: "standard",
|
|
1632
|
+
defaultRowHeight: d,
|
|
1633
|
+
defaultHeaderRowHeight: d,
|
|
1634
|
+
...S && e.hierarchyIndent > 0 ? { hierarchyIndent: e.hierarchyIndent } : {},
|
|
1635
|
+
theme: De(),
|
|
1636
|
+
/**
|
|
1637
|
+
* 表体单元格悬停:整行 + 整列交叉高亮(主题 `bodyStyle.hover` 已配 cell / inlineRow / inlineColumn)。
|
|
1638
|
+
* `disableHeaderHover: true` 避免在表头悬停时同样触发交叉带,与「非表头才延伸」一致;表头无指针悬停底色。
|
|
1639
|
+
*/
|
|
1640
|
+
hover: {
|
|
1641
|
+
highlightMode: "cross",
|
|
1642
|
+
disableHeaderHover: !0
|
|
1643
|
+
},
|
|
1644
|
+
select: {
|
|
1645
|
+
highlightInRange: !0,
|
|
1646
|
+
...e.cellSelectable === !1 ? {
|
|
1647
|
+
disableSelect: !0,
|
|
1648
|
+
disableHeaderSelect: !0,
|
|
1649
|
+
disableDragSelect: !0
|
|
1650
|
+
} : {}
|
|
1651
|
+
},
|
|
1652
|
+
emptyTip: Be(),
|
|
1653
|
+
editCellTrigger: e.editCellTrigger
|
|
1654
|
+
};
|
|
1655
|
+
}, Ce = async () => {
|
|
1656
|
+
var s;
|
|
1657
|
+
if (!(!m.value || i.loading || !((s = e.columnMetas) != null && s.length)))
|
|
1658
|
+
try {
|
|
1659
|
+
await m.value.updateOption(me());
|
|
1660
|
+
} catch {
|
|
1661
|
+
}
|
|
1662
|
+
}, je = () => {
|
|
1663
|
+
if (r !== 0 && globalThis.cancelAnimationFrame && (globalThis.cancelAnimationFrame(r), r = 0), clearTimeout(D), N == null || N.disconnect(), N = void 0, w == null || w.disconnect(), w = void 0, x = !1, W(), m.value) {
|
|
1664
|
+
try {
|
|
1665
|
+
m.value.release();
|
|
1666
|
+
} catch {
|
|
1667
|
+
}
|
|
1668
|
+
m.value = null;
|
|
1669
|
+
}
|
|
1670
|
+
}, _e = async () => {
|
|
1671
|
+
var y;
|
|
1672
|
+
if (await ce(), !b.value || i.loading || !((y = e.columnMetas) != null && y.length))
|
|
1673
|
+
return;
|
|
1674
|
+
const s = me();
|
|
1675
|
+
if (m.value ? await m.value.updateOption(s) : (m.value = new pt(b.value, s), Re(m.value), w = new ResizeObserver(() => {
|
|
1676
|
+
var d, S;
|
|
1677
|
+
(S = (d = m.value) == null ? void 0 : d.resize) == null || S.call(d), k();
|
|
1678
|
+
}), w.observe(b.value)), m.value && e.scrollToTopOnLoad)
|
|
1679
|
+
try {
|
|
1680
|
+
m.value.scrollTop = 0;
|
|
1681
|
+
} catch {
|
|
1682
|
+
}
|
|
1683
|
+
}, Ke = (s) => {
|
|
1684
|
+
de(s);
|
|
1685
|
+
}, de = async (s = {}) => {
|
|
1686
|
+
if (s.refresh && i.loading)
|
|
1687
|
+
return;
|
|
1688
|
+
i.loading = !0;
|
|
1689
|
+
const y = {
|
|
1690
|
+
pageSize: s.pageSize || o.pageSize,
|
|
1691
|
+
pageStart: s.pageStart || o.page
|
|
1692
|
+
};
|
|
1693
|
+
s.refresh && (y.remote = !0);
|
|
1694
|
+
const { list: d = [], total: S, summary: V } = await e.loadData(y) || {};
|
|
1695
|
+
o.list = d.map((O, j) => (O.index = j, O)), S === void 0 ? (o.total = o.list.length, o.nopagination = !0) : (o.total = S, o.nopagination = !1), V ? o.summary = V : o.summary = !1, i.loading = !1, await _e();
|
|
1696
|
+
}, We = () => {
|
|
1697
|
+
de({
|
|
1698
|
+
pageStart: 1
|
|
1699
|
+
});
|
|
1700
|
+
}, Ue = () => {
|
|
1701
|
+
de();
|
|
1702
|
+
}, Ge = () => {
|
|
1703
|
+
i.loading || (de({ refresh: !0 }), h("refresh"));
|
|
1704
|
+
}, qe = () => {
|
|
1705
|
+
p.current = 0;
|
|
1706
|
+
}, Je = () => {
|
|
1707
|
+
p.current = 1;
|
|
1708
|
+
}, Ye = async () => {
|
|
1709
|
+
await _e();
|
|
1710
|
+
}, Ze = async ({ i: s, row: y }) => {
|
|
1711
|
+
var d, S, V, O;
|
|
1712
|
+
if (o.list[s] = y, m.value) {
|
|
1713
|
+
await ce();
|
|
1714
|
+
try {
|
|
1715
|
+
(S = (d = m.value.editorManager) == null ? void 0 : d.cancelEdit) == null || S.call(d);
|
|
1716
|
+
} catch {
|
|
1717
|
+
}
|
|
1718
|
+
await ce();
|
|
1719
|
+
try {
|
|
1720
|
+
await m.value.updateOption(me()), await ce(), (O = (V = m.value).resize) == null || O.call(V);
|
|
1721
|
+
} catch {
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
}, Pe = X(() => ({
|
|
1725
|
+
left: `${f.left}px`,
|
|
1726
|
+
top: `${f.top}px`,
|
|
1727
|
+
width: `${f.width}px`,
|
|
1728
|
+
height: `${f.height}px`
|
|
1729
|
+
})), Xe = X(() => {
|
|
1730
|
+
var y;
|
|
1731
|
+
let s = e.height || ((y = globalThis.$config.options) == null ? void 0 : y.pageHeight) || 640;
|
|
1732
|
+
return e.noheader === !1 && (s -= 64), e.nofooter === !1 && (s -= 56), s -= e.minusHeight, s;
|
|
1733
|
+
}), Qe = X(() => o.nopagination === !0 ? "total" : "total,->,prev,pager,next,sizes"), ge = X(() => {
|
|
1734
|
+
if (e.tool) {
|
|
1735
|
+
const {
|
|
1736
|
+
column: s = !0,
|
|
1737
|
+
download: y = !0,
|
|
1738
|
+
refresh: d = !0,
|
|
1739
|
+
showLabel: S
|
|
1740
|
+
} = e.tool;
|
|
1741
|
+
return {
|
|
1742
|
+
column: s,
|
|
1743
|
+
download: y,
|
|
1744
|
+
refresh: d,
|
|
1745
|
+
showLabel: S
|
|
1746
|
+
};
|
|
1747
|
+
} else
|
|
1748
|
+
return !1;
|
|
1749
|
+
}), xe = X(() => {
|
|
1750
|
+
if (!ge.value)
|
|
1751
|
+
return [];
|
|
1752
|
+
const s = gt.lang("common.vTableTool") || {}, y = ge.value, d = [];
|
|
1753
|
+
return y.refresh && d.push({
|
|
1754
|
+
key: "refresh",
|
|
1755
|
+
txt: s.refresh,
|
|
1756
|
+
icon: "im-reload",
|
|
1757
|
+
onClick: Ge
|
|
1758
|
+
}), y.column && d.push({
|
|
1759
|
+
key: "column",
|
|
1760
|
+
txt: s.column,
|
|
1761
|
+
icon: "im-layout",
|
|
1762
|
+
onClick: qe
|
|
1763
|
+
}), y.download && d.push({
|
|
1764
|
+
key: "download",
|
|
1765
|
+
txt: s.download,
|
|
1766
|
+
icon: "im-download",
|
|
1767
|
+
onClick: Je
|
|
1768
|
+
}), d;
|
|
1769
|
+
});
|
|
1770
|
+
return Ve(
|
|
1771
|
+
() => e.cellSelectable,
|
|
1772
|
+
() => {
|
|
1773
|
+
Ce();
|
|
1774
|
+
}
|
|
1775
|
+
), it(() => {
|
|
1776
|
+
je();
|
|
1777
|
+
}), t({
|
|
1778
|
+
initTable: Ke,
|
|
1779
|
+
editRow: Ze,
|
|
1780
|
+
showCellLoadMask: ie,
|
|
1781
|
+
hideCellLoadMask: W
|
|
1782
|
+
}), (s, y) => {
|
|
1783
|
+
const d = U("Loading"), S = U("el-button"), V = U("el-pagination"), O = U("Card");
|
|
1784
|
+
return A(), oe(O, {
|
|
1785
|
+
class: "MvcVTable",
|
|
1786
|
+
"body-class": "p0"
|
|
1787
|
+
}, {
|
|
1788
|
+
default: F(() => [
|
|
1789
|
+
J(d, {
|
|
1790
|
+
loading: v(i).loading
|
|
1791
|
+
}, null, 8, ["loading"]),
|
|
1792
|
+
e.noheader === !1 ? (A(), G("div", {
|
|
1793
|
+
key: 0,
|
|
1794
|
+
class: fe(["tableHeader flexMode hb g12 p16", e.autoHeader ? "minh64" : "h64"])
|
|
1795
|
+
}, [
|
|
1796
|
+
u("div", {
|
|
1797
|
+
class: fe(["flexMode vc flexGrow maxwp100", e.headerClass])
|
|
1798
|
+
}, [
|
|
1799
|
+
rt(s.$slots, "header", {}, void 0, !0)
|
|
1800
|
+
], 2),
|
|
1801
|
+
v(xe).length ? (A(), G("div", El, [
|
|
1802
|
+
(A(!0), G(se, null, ae(v(xe), (j) => (A(), oe(S, {
|
|
1803
|
+
key: j.key,
|
|
1804
|
+
class: "tipbtn bottom fs20",
|
|
1805
|
+
txt: j.txt,
|
|
1806
|
+
rect: "",
|
|
1807
|
+
onClick: j.onClick
|
|
1808
|
+
}, st({
|
|
1809
|
+
icon: F(() => [
|
|
1810
|
+
u("i", {
|
|
1811
|
+
class: fe(["imicon", j.icon])
|
|
1812
|
+
}, null, 2)
|
|
1813
|
+
]),
|
|
1814
|
+
_: 2
|
|
1815
|
+
}, [
|
|
1816
|
+
v(ge).showLabel ? {
|
|
1817
|
+
name: "default",
|
|
1818
|
+
fn: F(() => [
|
|
1819
|
+
he(R(j.txt), 1)
|
|
1820
|
+
]),
|
|
1821
|
+
key: "0"
|
|
1822
|
+
} : void 0
|
|
1823
|
+
]), 1032, ["txt", "onClick"]))), 128))
|
|
1824
|
+
])) : ne("", !0)
|
|
1825
|
+
], 2)) : ne("", !0),
|
|
1826
|
+
u("div", kl, [
|
|
1827
|
+
u("div", {
|
|
1828
|
+
class: "vtableWrapper relative wp100 z1",
|
|
1829
|
+
style: Ee({ height: `${v(Xe)}px` })
|
|
1830
|
+
}, [
|
|
1831
|
+
u("div", {
|
|
1832
|
+
ref_key: "vtableHost",
|
|
1833
|
+
ref: b,
|
|
1834
|
+
class: "vtableHost relative wp100 vtableHostFill"
|
|
1835
|
+
}, null, 512),
|
|
1836
|
+
at(u("div", {
|
|
1837
|
+
class: "treeCellLoadMask abs flexMode hc vc",
|
|
1838
|
+
style: Ee(v(Pe))
|
|
1839
|
+
}, [...y[2] || (y[2] = [
|
|
1840
|
+
u("i", { class: "imicon im-loading ani-rotate fs18 txt-primary loadMaskIcon" }, null, -1)
|
|
1841
|
+
])], 4), [
|
|
1842
|
+
[ct, v(f).show]
|
|
1843
|
+
])
|
|
1844
|
+
], 4)
|
|
1845
|
+
]),
|
|
1846
|
+
e.nofooter === !1 ? (A(), G("div", $l, [
|
|
1847
|
+
J(V, {
|
|
1848
|
+
"current-page": v(o).page,
|
|
1849
|
+
"onUpdate:currentPage": y[0] || (y[0] = (j) => v(o).page = j),
|
|
1850
|
+
background: "",
|
|
1851
|
+
total: v(o).total,
|
|
1852
|
+
"default-page-size": v(o).pageSize,
|
|
1853
|
+
"page-sizes": e.pageSizes,
|
|
1854
|
+
"pager-count": 5,
|
|
1855
|
+
layout: v(Qe),
|
|
1856
|
+
class: "wp100",
|
|
1857
|
+
onSizeChange: We,
|
|
1858
|
+
onCurrentChange: Ue
|
|
1859
|
+
}, null, 8, ["current-page", "total", "default-page-size", "page-sizes", "layout"])
|
|
1860
|
+
])) : ne("", !0),
|
|
1861
|
+
J(yt, {
|
|
1862
|
+
current: v(p).current,
|
|
1863
|
+
"onUpdate:current": y[1] || (y[1] = (j) => v(p).current = j),
|
|
1864
|
+
"table-name": e.tableName,
|
|
1865
|
+
drawer: v(p).list,
|
|
1866
|
+
list: v(o).list,
|
|
1867
|
+
selection: v(i).selection,
|
|
1868
|
+
onInitColumn: Ye
|
|
1869
|
+
}, null, 8, ["current", "table-name", "drawer", "list", "selection"])
|
|
1870
|
+
]),
|
|
1871
|
+
_: 3
|
|
1872
|
+
});
|
|
1873
|
+
};
|
|
1874
|
+
}
|
|
1875
|
+
}), zl = /* @__PURE__ */ Ne(Ml, [["__scopeId", "data-v-a13ba899"]]);
|
|
1876
|
+
export {
|
|
1877
|
+
zl as default
|
|
1878
|
+
};
|