mvframe 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,2056 @@
1
- import "./util.js";
2
- import "./directive.js";
3
- import "./store.js";
4
- import { i as p } from "./vendor.js";
1
+ import { u as ke } from "./util.js";
2
+ import { d as Te } from "./directive.js";
3
+ import { s as Me, p as Ae, a as Ve } from "./store.js";
4
+ import { createRouter as Oe, createWebHistory as je, useRoute as $e, useRouter as xe } from "vue-router";
5
+ import { computed as V, openBlock as y, createElementBlock as T, normalizeClass as R, unref as a, Fragment as te, renderList as ne, toDisplayString as A, defineComponent as Ce, reactive as H, getCurrentInstance as re, watch as le, resolveComponent as K, createVNode as E, withCtx as I, renderSlot as q, inject as pe, onMounted as oe, onUnmounted as ce, createElementVNode as i, withModifiers as he, createCommentVNode as B, createTextVNode as Q, nextTick as me, normalizeProps as ue, guardReactiveProps as de, createSlots as fe, createBlock as D, ref as J, mergeProps as se, useAttrs as ge, isRef as Se, markRaw as ye, onBeforeMount as Ie, resolveDynamicComponent as Ne } from "vue";
6
+ /* empty css */
7
+ import { deepEqual as be, isInView as ze, download as Ee, useRemoteSummary as Ke } from "./composition.js";
8
+ import ve from "vuedraggable";
9
+ const Le = ({ router: h, useAdmin: b, adminPermission: l, noaccess: e }) => {
10
+ h.beforeEach((o, r, d) => {
11
+ b ? o.meta.admin && l() ? d() : e && e(d) : d();
12
+ }), h.afterEach((o, r) => {
13
+ const d = Me.tab(Ae);
14
+ document.title = o.meta.title, d.saveTab(o);
15
+ });
16
+ }, Be = (h, { routes: b, guard: l, useAdmin: e = !1, adminPermission: o = () => !0, noaccess: r }) => {
17
+ const d = Oe({
18
+ history: je(),
19
+ routes: b
20
+ });
21
+ l && l(d), Le({ router: d, useAdmin: e, adminPermission: o, noaccess: r }), h.use(d), globalThis.$router = d;
22
+ }, X = (h, b) => {
23
+ const l = h.__vccOpts || h;
24
+ for (const [e, o] of b)
25
+ l[e] = o;
26
+ return l;
27
+ }, Pe = ["disabled", "onClick"], Fe = /* @__PURE__ */ Object.assign({
28
+ name: "MvcBtnGroup",
29
+ inheritAttrs: !1
30
+ }, {
31
+ __name: "index",
32
+ props: {
33
+ modelValue: {
34
+ type: [String, Number, Boolean],
35
+ default: void 0
36
+ },
37
+ options: {
38
+ type: Array,
39
+ default: () => []
40
+ },
41
+ valueKey: {
42
+ type: String,
43
+ default: "value"
44
+ },
45
+ labelKey: {
46
+ type: String,
47
+ default: "label"
48
+ },
49
+ disabled: {
50
+ type: Boolean,
51
+ default: !1
52
+ },
53
+ size: {
54
+ type: String,
55
+ default: "default",
56
+ validator: (h) => ["default", "small", "large"].includes(h)
57
+ }
58
+ },
59
+ emits: ["update:modelValue", "change"],
60
+ setup(h, { emit: b }) {
61
+ const l = h, e = b, o = (u) => u == null ? u : ["Object", "Array"].includes(globalThis.$getType(u)) ? u[l.valueKey] : u, r = (u) => u == null ? "" : ["Object", "Array"].includes(globalThis.$getType(u)) ? u[l.labelKey] : String(u), d = (u) => {
62
+ const x = o(u);
63
+ return x === l.modelValue && (x !== void 0 || l.modelValue !== void 0);
64
+ }, w = (u) => {
65
+ if (l.disabled) return;
66
+ const x = o(u);
67
+ e("update:modelValue", x), e("change", x);
68
+ }, g = V(() => ({ small: "g4", default: "g6", large: "g8" })[l.size] ?? "g6"), k = V(() => l.size === "small" ? "sizeSmall" : l.size === "large" ? "sizeLarge" : "");
69
+ return (u, x) => (y(), T("div", {
70
+ class: R(["MvcBtnGroup flexMode", [a(g), a(k)]]),
71
+ role: "group"
72
+ }, [
73
+ (y(!0), T(te, null, ne(l.options, (S) => (y(), T("button", {
74
+ key: o(S),
75
+ type: "button",
76
+ class: R(["btnItem", { isActive: d(S) }]),
77
+ disabled: l.disabled,
78
+ onClick: ($) => w(S)
79
+ }, A(r(S)), 11, Pe))), 128))
80
+ ], 2));
81
+ }
82
+ }), De = /* @__PURE__ */ X(Fe, [["__scopeId", "data-v-19946018"]]), Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
83
+ __proto__: null,
84
+ default: De
85
+ }, Symbol.toStringTag, { value: "Module" })), He = Ce({
86
+ name: "MvcFormItemFilter",
87
+ setup: (h, b) => {
88
+ var r, d;
89
+ const l = (w) => Array.isArray(w) ? w.filter((g) => g.children !== "v-if").map((g) => {
90
+ var u, x, S, $;
91
+ return g && (window.$getType(g.children) === "Array" ? g.children = l(g.children) : ((u = g.type) == null ? void 0 : u.name) === "ElFormItem" && (x = g.props) != null && x.label && (g.props.label = (($ = (S = g.props.label).$l) == null ? void 0 : $.call(S)) || g.props.label), g);
92
+ }) : [], e = (d = (r = b.slots).default) == null ? void 0 : d.call(r), o = e == null ? void 0 : e[0];
93
+ return () => l((o == null ? void 0 : o.children) ?? []);
94
+ }
95
+ }), Ue = { class: "MvcForm" }, Je = /* @__PURE__ */ Object.assign({
96
+ name: "MvcForm"
97
+ }, {
98
+ __name: "index",
99
+ props: {
100
+ modelValue: {
101
+ type: Object,
102
+ default: /* @__PURE__ */ Object.create(null)
103
+ },
104
+ rules: {
105
+ type: Object,
106
+ default: /* @__PURE__ */ Object.create(null)
107
+ },
108
+ size: {
109
+ type: String,
110
+ default: "large"
111
+ }
112
+ },
113
+ setup(h, { expose: b, emit: l }) {
114
+ const e = h, o = H({
115
+ form: {}
116
+ }), { proxy: r } = re(), d = l, w = async () => {
117
+ var u;
118
+ try {
119
+ return (u = r.$refs) != null && u.form ? (await r.$refs.form.validate(), g()) : !1;
120
+ } catch {
121
+ return !1;
122
+ }
123
+ }, g = () => o.form, k = V(() => {
124
+ const u = {};
125
+ for (let x in e.rules)
126
+ u[x] = e.rules[x].map((S) => ({
127
+ ...S,
128
+ ...S.message && { message: window.$l(S.message) }
129
+ }));
130
+ return u;
131
+ });
132
+ return le(
133
+ () => o.form,
134
+ (u) => {
135
+ u && !be(u, e.modelValue) && d("update:modelValue", u);
136
+ },
137
+ {
138
+ deep: !0
139
+ }
140
+ ), le(
141
+ () => e.modelValue,
142
+ (u) => {
143
+ u && !be(u, o.form) && (o.form = u);
144
+ },
145
+ {
146
+ immediate: !0,
147
+ deep: !0
148
+ }
149
+ ), b({
150
+ validate: w
151
+ }), (u, x) => {
152
+ const S = K("el-form");
153
+ return y(), T("div", Ue, [
154
+ E(S, {
155
+ ref: "form",
156
+ model: a(o).form,
157
+ rules: a(k),
158
+ size: e.size,
159
+ "validate-on-rule-change": !1,
160
+ "label-position": "top"
161
+ }, {
162
+ default: I(() => [
163
+ E(a(He), null, {
164
+ default: I(() => [
165
+ q(u.$slots, "default")
166
+ ]),
167
+ _: 3
168
+ })
169
+ ]),
170
+ _: 3
171
+ }, 8, ["model", "rules", "size"])
172
+ ]);
173
+ };
174
+ }
175
+ }), qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
176
+ __proto__: null,
177
+ default: Je
178
+ }, Symbol.toStringTag, { value: "Module" })), Ge = { class: "FrameTab relative h36 pl16 pt4 xscroll nobar fadeout" }, We = { class: "relative flexMode vr g4 z2" }, Ye = ["id", "onContextmenu", "onClick", "onDblclick"], Ze = ["onClick"], Qe = /* @__PURE__ */ Object.assign({
179
+ name: "FrameTab",
180
+ inheritAttrs: !1
181
+ }, {
182
+ __name: "Tab",
183
+ setup(h) {
184
+ H({
185
+ active: 2
186
+ });
187
+ const b = pe("store"), l = b.tab(), e = b.rmenu(), o = $e(), r = xe(), { proxy: d } = re();
188
+ oe(() => {
189
+ w();
190
+ });
191
+ const w = () => {
192
+ d.$el.addEventListener("scroll", k);
193
+ }, g = () => {
194
+ const s = localStorage.getItem("tabsScroll");
195
+ s && (d.$el.scrollLeft = Number(s));
196
+ }, k = (s) => {
197
+ let f = null;
198
+ f !== null && clearTimeout(f), f = setTimeout(function() {
199
+ const { scrollLeft: O } = s.target;
200
+ localStorage.setItem("tabsScroll", O);
201
+ }, 100);
202
+ }, u = () => {
203
+ me(() => {
204
+ const s = d.$el.querySelector(`#tab_${c.value}`);
205
+ ze(d.$el, s) ? g() : d.$el.scrollLeft = (s == null ? void 0 : s.offsetLeft) - 16;
206
+ });
207
+ }, x = (s, f, O) => {
208
+ e.saveData("type", "tabManager"), e.saveData("options", [
209
+ {
210
+ label: "Close",
211
+ value: "close",
212
+ icon: "im-close",
213
+ disabled: m.value.length === 1,
214
+ cb: () => {
215
+ l.closeTab(f, O);
216
+ }
217
+ },
218
+ {
219
+ label: "Close Right",
220
+ value: "closeRight",
221
+ icon: "im-right",
222
+ disabled: O === m.value.length - 1,
223
+ cb: () => {
224
+ l.closeRightTab(f, O);
225
+ }
226
+ },
227
+ {
228
+ label: "Close Left",
229
+ value: "closeLeft",
230
+ icon: "im-left",
231
+ disabled: O === 0,
232
+ cb: () => {
233
+ l.closeLeftTab(f, O);
234
+ }
235
+ },
236
+ {
237
+ label: "Close Other",
238
+ value: "closeOther",
239
+ icon: "im-left",
240
+ disabled: m.value.length === 1,
241
+ cb: () => {
242
+ l.closeOtherTab(f, O);
243
+ }
244
+ }
245
+ ]), e.show({ el: s.target });
246
+ }, S = (s) => {
247
+ s.name !== c.value && r.push({ name: s.name });
248
+ }, $ = (s) => {
249
+ s.name === c.value ? r.replace({ name: s.name, query: { t: +/* @__PURE__ */ new Date() } }) : S(s);
250
+ }, M = (s, f) => {
251
+ l.closeTab(s, f);
252
+ }, m = V(() => l.tabs), c = V(() => o.name), t = V(() => m.value.length);
253
+ return le(
254
+ () => t.value,
255
+ (s) => {
256
+ s && (localStorage.setItem("tabs", JSON.stringify(m.value)), u());
257
+ },
258
+ {
259
+ immediate: !0
260
+ }
261
+ ), ce(() => {
262
+ d.$el.removeEventListener("scroll", k);
263
+ }), (s, f) => (y(), T("div", Ge, [
264
+ i("div", We, [
265
+ (y(!0), T(te, null, ne(a(m), (O, C) => (y(), T("div", {
266
+ key: O.name,
267
+ id: `tab_${O.name}`,
268
+ class: R(["relative flexMode vc g4 noShrink tabItem h32 p0-8 fs12 radius4 point noselect", [
269
+ O.name === a(c) && "active",
270
+ a(m).length > 1 && "hoverItem"
271
+ ]]),
272
+ onContextmenu: he((n) => x(n, O, C), ["prevent", "stop"]),
273
+ onClick: (n) => S(O),
274
+ onDblclick: (n) => $(O)
275
+ }, [
276
+ O.icon ? (y(), T("i", {
277
+ key: 0,
278
+ class: R(["imicon", O.icon])
279
+ }, null, 2)) : B("", !0),
280
+ Q(" " + A(O.meta.title) + " ", 1),
281
+ i("div", {
282
+ class: "abs r flexMode hc vc w20 h20",
283
+ onClick: he((n) => M(O, C), ["stop"])
284
+ }, [...f[0] || (f[0] = [
285
+ i("span", null, "✕", -1)
286
+ ])], 8, Ze)
287
+ ], 42, Ye))), 128)),
288
+ f[1] || (f[1] = i("div", { class: "w16 h16 noShrink" }, null, -1))
289
+ ])
290
+ ]));
291
+ }
292
+ }), Xe = /* @__PURE__ */ X(Qe, [["__scopeId", "data-v-1a5bae58"]]), et = { class: "LogoArea flexMode vc h64 p0-16 relative" }, tt = { class: "logo" }, lt = { class: "logomini" }, ot = { class: "MenuArea p4 yscroll" }, nt = ["onClick"], st = { class: "itemIcon w24 txt-c txt-tip fs18" }, at = { key: 1 }, rt = {
293
+ key: 0,
294
+ class: "itemChildrenArea mt2 p4"
295
+ }, it = ["onClick"], ct = { class: "itemIcon w24 txt-c txt-tip fs18" }, ut = /* @__PURE__ */ Object.assign({
296
+ name: "FrameMenu",
297
+ inheritAttrs: !1
298
+ }, {
299
+ __name: "Menu",
300
+ props: {
301
+ iconClass: {
302
+ type: String,
303
+ default: ""
304
+ },
305
+ routes: {
306
+ type: Array,
307
+ default: () => []
308
+ }
309
+ },
310
+ setup(h, { emit: b }) {
311
+ const l = h, e = H({
312
+ collapse: !1
313
+ }), o = $e(), r = xe();
314
+ oe(() => {
315
+ w();
316
+ });
317
+ const d = b, w = () => {
318
+ const m = localStorage.getItem("collapse");
319
+ m && (e.collapse = JSON.parse(m)), document.addEventListener("keydown", k);
320
+ }, g = (m) => {
321
+ e.collapse === !0 ? e.collapse = !1 : e.collapse === !1 ? e.collapse = !0 : e.collapse = m, localStorage.setItem("collapse", e.collapse), d("on-collapse-change", e.collapse);
322
+ }, k = (m) => {
323
+ m.shiftKey && (m.metaKey || m.ctrlKey) && (m.keyCode === 37 ? g(!0) : m.keyCode === 39 && g(!1));
324
+ }, u = (m) => {
325
+ var c;
326
+ return (c = m == null ? void 0 : m.children) != null && c.length ? u(m.children[0]) : m;
327
+ }, x = (m) => {
328
+ var c;
329
+ return ((c = m == null ? void 0 : m.children) == null ? void 0 : c.some((t) => t.name === o.name || x(t))) ?? !1;
330
+ }, S = (m) => {
331
+ const c = u(m);
332
+ c != null && c.name && r.push({ name: c.name });
333
+ }, $ = () => {
334
+ const m = { ...o.query, _: Date.now() }, c = o.name ? { name: o.name, params: o.params, query: m } : { path: o.path, query: m };
335
+ r.replace(c).catch(() => {
336
+ });
337
+ }, M = V(() => e.collapse ? "im-verticalleft" : "im-verticalright");
338
+ return ce(() => {
339
+ document.removeEventListener("keydown", k);
340
+ }), (m, c) => (y(), T("div", {
341
+ class: R(["FrameMenu sticky vh100 noselect noShrink", a(e).collapse && "collapse"])
342
+ }, [
343
+ i("div", et, [
344
+ i("div", tt, [
345
+ q(m.$slots, "logo", {}, void 0, !0)
346
+ ]),
347
+ i("div", lt, [
348
+ q(m.$slots, "logomini", {}, void 0, !0)
349
+ ]),
350
+ i("div", {
351
+ class: "collapseArea hover abs",
352
+ onClick: c[0] || (c[0] = (t) => g(a(e).collapse))
353
+ }, [
354
+ i("i", {
355
+ class: R(["imicon fs20", a(M)])
356
+ }, null, 2)
357
+ ])
358
+ ]),
359
+ i("div", ot, [
360
+ (y(!0), T(te, null, ne(l.routes, (t, s) => {
361
+ var f, O;
362
+ return y(), T("div", {
363
+ key: s,
364
+ class: "menuItemWrap mb2"
365
+ }, [
366
+ i("div", {
367
+ class: R(["menuItem flexMode vc g8 radius4 p0-16", [
368
+ a(o).name === t.name && "active bg-primary",
369
+ a(e).collapse && "hc",
370
+ a(e).collapse && x(t) && "activeChild"
371
+ ]]),
372
+ onClick: (C) => S(t),
373
+ onDblclick: $
374
+ }, [
375
+ i("div", st, [
376
+ t.meta.icon ? (y(), T("i", {
377
+ key: 0,
378
+ class: R([l.iconClass, t.meta.icon])
379
+ }, null, 2)) : (y(), T("span", at, A(((f = t.meta.title) == null ? void 0 : f.substr(0, 1)) || "U"), 1))
380
+ ]),
381
+ a(e).collapse ? B("", !0) : (y(), T("div", {
382
+ key: 0,
383
+ class: R(["itemTitle txt-nowrap fs14", a(o).name === t.name ? "txt-white" : "txt-h1"])
384
+ }, A(t.meta.title), 3))
385
+ ], 42, nt),
386
+ (O = t.children) != null && O.length ? (y(), T("div", rt, [
387
+ (y(!0), T(te, null, ne(t.children, (C, n) => (y(), T("div", {
388
+ key: n,
389
+ class: R(["childrenItem flexMode vc g8 radius4 h40 p0-16", a(o).name === C.name && "active bg-primary"]),
390
+ onClick: (p) => S(C),
391
+ onDblclick: $
392
+ }, [
393
+ i("div", ct, [
394
+ C.meta.icon ? (y(), T("i", {
395
+ key: 0,
396
+ class: R([l.iconClass, C.meta.icon])
397
+ }, null, 2)) : B("", !0)
398
+ ]),
399
+ a(e).collapse ? B("", !0) : (y(), T("div", {
400
+ key: 0,
401
+ class: R(["itemTitle txt-nowrap fs14", a(o).name === C.name ? "txt-white" : "txt-h1"])
402
+ }, A(C.meta.title), 3))
403
+ ], 42, it))), 128))
404
+ ])) : B("", !0)
405
+ ]);
406
+ }), 128))
407
+ ])
408
+ ], 2));
409
+ }
410
+ }), dt = /* @__PURE__ */ X(ut, [["__scopeId", "data-v-8dc648a5"]]), pt = { class: "FrameFooter" }, mt = { class: "txt-tip" }, ft = { class: "txt-primary" }, gt = /* @__PURE__ */ Object.assign({
411
+ name: "FrameFooter",
412
+ inheritAttrs: !1
413
+ }, {
414
+ __name: "Footer",
415
+ setup(h) {
416
+ H({});
417
+ const b = V(() => globalThis.$config);
418
+ return (l, e) => (y(), T("div", pt, [
419
+ i("span", mt, A(a(b).copyright), 1),
420
+ i("span", ft, A(a(b).author), 1)
421
+ ]));
422
+ }
423
+ }), ht = /* @__PURE__ */ X(gt, [["__scopeId", "data-v-c3ba0162"]]), yt = { class: "MvcFrame" }, bt = { class: "PageArea" }, vt = /* @__PURE__ */ Object.assign({
424
+ name: "MvcFrame",
425
+ inheritAttrs: !1
426
+ }, {
427
+ __name: "index",
428
+ props: {
429
+ /* menu包含:
430
+ @params
431
+ options: vue-router的路由表
432
+ iconClass: 菜单图标样式名,iconfont创建时的样式名或其它自定义规则
433
+ logo: 菜单logo, vue dom
434
+ logomini: 菜单logo缩小时的样子, vue dom
435
+ */
436
+ menu: {
437
+ type: Object,
438
+ default: /* @__PURE__ */ Object.create(null)
439
+ },
440
+ page: {
441
+ type: Object,
442
+ default: /* @__PURE__ */ Object.create(null)
443
+ }
444
+ },
445
+ setup(h) {
446
+ const b = h;
447
+ H({});
448
+ const e = pe("store").tab();
449
+ oe(() => {
450
+ o();
451
+ });
452
+ const o = () => {
453
+ r();
454
+ }, r = () => {
455
+ var d, w, g, k, u, x;
456
+ if ((w = (d = globalThis.$config) == null ? void 0 : d.iconfont) != null && w.url) {
457
+ const S = document.createElement("script");
458
+ if (S.id = "iconfont", S.type = "text/javascript", S.src = (k = (g = globalThis.$config) == null ? void 0 : g.iconfont) == null ? void 0 : k.url, document.getElementById("iconfont"))
459
+ return;
460
+ document.head.appendChild(S), (x = (u = globalThis.$config) == null ? void 0 : u.iconfont) == null || delete x.url;
461
+ }
462
+ };
463
+ return (d, w) => {
464
+ const g = K("router-view");
465
+ return y(), T("div", yt, [
466
+ E(dt, ue(de(b.menu)), fe({ _: 2 }, [
467
+ d.$slots.logo ? {
468
+ name: "logo",
469
+ fn: I(() => [
470
+ q(d.$slots, "logo", {}, void 0, !0)
471
+ ]),
472
+ key: "0"
473
+ } : void 0,
474
+ d.$slots.logomini ? {
475
+ name: "logomini",
476
+ fn: I(() => [
477
+ q(d.$slots, "logomini", {}, void 0, !0)
478
+ ]),
479
+ key: "1"
480
+ } : void 0
481
+ ]), 1040),
482
+ i("div", bt, [
483
+ a(e).useTab ? (y(), D(Xe, { key: 0 })) : B("", !0),
484
+ E(g, ue(de(b.page)), null, 16),
485
+ E(ht)
486
+ ])
487
+ ]);
488
+ };
489
+ }
490
+ }), _t = /* @__PURE__ */ X(vt, [["__scopeId", "data-v-d0100e71"]]), $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
491
+ __proto__: null,
492
+ default: _t
493
+ }, Symbol.toStringTag, { value: "Module" })), xt = {
494
+ class: "MvcIcon",
495
+ "aria-hidden": "true"
496
+ }, Ct = ["xlink:href"], St = /* @__PURE__ */ Object.assign({
497
+ name: "MvcIcon"
498
+ }, {
499
+ __name: "index",
500
+ props: {
501
+ name: {
502
+ type: String,
503
+ default: "cloud"
504
+ }
505
+ },
506
+ setup(h) {
507
+ const b = H({
508
+ prefix: "imc"
509
+ });
510
+ return oe(() => {
511
+ var l, e;
512
+ (e = (l = globalThis.$config) == null ? void 0 : l.iconfont) != null && e.prefix && (b.prefix = globalThis.$config.iconfont.prefix);
513
+ }), (l, e) => (y(), T("svg", xt, [
514
+ i("use", {
515
+ "xlink:href": `#${a(b).prefix}-${h.name}`
516
+ }, null, 8, Ct)
517
+ ]));
518
+ }
519
+ }), wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
520
+ __proto__: null,
521
+ default: St
522
+ }, Symbol.toStringTag, { value: "Module" })), kt = /* @__PURE__ */ Object.assign({
523
+ name: "MvcInput"
524
+ }, {
525
+ __name: "index",
526
+ props: {
527
+ modelValue: {
528
+ type: [String, Number],
529
+ default: ""
530
+ }
531
+ },
532
+ emits: [
533
+ "update:modelValue",
534
+ "input",
535
+ "change",
536
+ "blur",
537
+ "focus"
538
+ ],
539
+ setup(h, { emit: b }) {
540
+ const l = h, e = J(null);
541
+ let o = null;
542
+ const r = H({
543
+ val: "",
544
+ isComposing: !1
545
+ }), d = b, { proxy: w } = re();
546
+ oe(() => {
547
+ var m, c, t;
548
+ const M = (m = e.value) == null ? void 0 : m.$el;
549
+ o = ((c = M == null ? void 0 : M.querySelector) == null ? void 0 : c.call(M, "input")) || ((t = M == null ? void 0 : M.querySelector) == null ? void 0 : t.call(M, "textarea")), o && (o.addEventListener("compositionstart", g), o.addEventListener("compositionend", k));
550
+ });
551
+ const g = () => {
552
+ r.isComposing = !0;
553
+ }, k = () => {
554
+ r.isComposing = !1, me(() => x(r.val));
555
+ }, u = (M) => {
556
+ r.isComposing || x(M);
557
+ }, x = (M) => {
558
+ d("update:modelValue", M), d("input", M);
559
+ }, S = V(() => !!(w.$attrs.maxlength || $.value)), $ = V(() => w.$attrs.max);
560
+ return le(
561
+ () => l.modelValue,
562
+ (M) => {
563
+ const m = String(M ?? "");
564
+ String(r.val) !== m && (r.val = m);
565
+ },
566
+ { immediate: !0 }
567
+ ), ce(() => {
568
+ o && (o.removeEventListener("compositionstart", g), o.removeEventListener("compositionend", k), o = null);
569
+ }), (M, m) => {
570
+ const c = K("el-input");
571
+ return y(), D(c, se({
572
+ ref_key: "inputRef",
573
+ ref: e,
574
+ modelValue: a(r).val,
575
+ "onUpdate:modelValue": m[0] || (m[0] = (t) => a(r).val = t),
576
+ "show-word-limit": a(S),
577
+ maxlength: a($),
578
+ class: "MvcInput"
579
+ }, M.$attrs, { onInput: u }), null, 16, ["modelValue", "show-word-limit", "maxlength"]);
580
+ };
581
+ }
582
+ }), Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
583
+ __proto__: null,
584
+ default: kt
585
+ }, Symbol.toStringTag, { value: "Module" })), Mt = { class: "MvcPage" }, At = {
586
+ key: 0,
587
+ class: "PageHeader"
588
+ }, Vt = { class: "PageHeaderLeft" }, Ot = { class: "PageHeaderTitle" }, jt = { class: "PageHeaderSubTitle" }, It = { class: "PageHeaderRight" }, Nt = { class: "PageBody" }, zt = /* @__PURE__ */ Object.assign({
589
+ name: "MvcPage",
590
+ inheritAttrs: !1
591
+ }, {
592
+ __name: "index",
593
+ props: {
594
+ title: {
595
+ type: String,
596
+ default: ""
597
+ },
598
+ subtitle: {
599
+ type: String,
600
+ default: ""
601
+ },
602
+ noheader: {
603
+ type: Boolean,
604
+ default: !1
605
+ }
606
+ },
607
+ setup(h) {
608
+ const b = h, { proxy: l } = re(), o = pe("store").tab(), r = V(() => b.title || b.subtitle);
609
+ return V(() => o.useTab ? {
610
+ minHeight: "calc(100vh - 48px - 36px)"
611
+ } : {
612
+ minHeight: "calc(100vh - 48px)"
613
+ }), (d, w) => (y(), T("div", Mt, [
614
+ b.noheader ? B("", !0) : (y(), T("div", At, [
615
+ i("div", Vt, [
616
+ d.$slots.header ? q(d.$slots, "header", { key: 0 }, void 0, !0) : a(r) ? (y(), T(te, { key: 1 }, [
617
+ i("h3", Ot, A(b.title), 1),
618
+ i("p", jt, A(b.subtitle), 1)
619
+ ], 64)) : B("", !0)
620
+ ]),
621
+ i("div", It, [
622
+ d.$slots.right ? q(d.$slots, "right", { key: 0 }, void 0, !0) : B("", !0)
623
+ ])
624
+ ])),
625
+ i("div", Nt, [
626
+ q(d.$slots, "default", {}, void 0, !0)
627
+ ])
628
+ ]));
629
+ }
630
+ }), Et = /* @__PURE__ */ X(zt, [["__scopeId", "data-v-7d18d3b1"]]), Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
631
+ __proto__: null,
632
+ default: Et
633
+ }, Symbol.toStringTag, { value: "Module" })), Lt = { class: "flexMode hb vc" }, Bt = { key: 1 }, Pt = { class: "tag" }, Ft = { class: "flexMode hr" }, Dt = /* @__PURE__ */ Object.assign({
634
+ name: "MvcSelect",
635
+ inheritAttrs: !1
636
+ }, {
637
+ __name: "index",
638
+ props: {
639
+ modelValue: {
640
+ type: [String, Number, Array],
641
+ default: void 0
642
+ },
643
+ multiple: {
644
+ type: Boolean,
645
+ default: !1
646
+ },
647
+ filterable: {
648
+ type: Boolean,
649
+ default: !1
650
+ },
651
+ options: {
652
+ type: Array,
653
+ default: () => []
654
+ },
655
+ valueKey: {
656
+ type: String,
657
+ default: "value"
658
+ },
659
+ labelKey: {
660
+ type: String,
661
+ default: "label"
662
+ },
663
+ selectAllTxt: {
664
+ type: String,
665
+ default: "All"
666
+ },
667
+ confirmTxt: {
668
+ type: String,
669
+ default: "Confirm"
670
+ },
671
+ nowrap: {
672
+ type: Boolean,
673
+ default: !1
674
+ }
675
+ },
676
+ emits: ["update:modelValue", "change"],
677
+ setup(h, { emit: b }) {
678
+ const l = h, e = J(null), o = J([]), r = J(!1), d = J(!1), w = J(!1), g = b, k = (n) => {
679
+ l.multiple ? (o.value = Array.isArray(n) ? [...n] : [], m()) : (g("update:modelValue", n), g("change", n));
680
+ }, u = (n) => {
681
+ if (r.value = n, n && l.multiple) {
682
+ const p = l.modelValue;
683
+ o.value = Array.isArray(p) ? [...p] : p ? [p] : [], m();
684
+ }
685
+ }, x = () => {
686
+ var _;
687
+ if (!l.filterable || !r.value) return M();
688
+ const n = e.value, p = ((_ = n == null ? void 0 : n.optionsArray) == null ? void 0 : _.value) ?? (n == null ? void 0 : n.optionsArray) ?? [];
689
+ return Array.isArray(p) ? p.filter((v) => v.visible && !v.isDisabled).map((v) => v.value) : M();
690
+ }, S = (n) => {
691
+ w.value = !1;
692
+ const p = x();
693
+ if (n)
694
+ o.value = [.../* @__PURE__ */ new Set([...o.value, ...p])];
695
+ else {
696
+ const _ = new Set(p);
697
+ o.value = o.value.filter((v) => !_.has(v));
698
+ }
699
+ }, $ = () => {
700
+ var n, p;
701
+ l.multiple && (g("update:modelValue", o.value), g("change", o.value), (p = (n = e.value) == null ? void 0 : n.blur) == null || p.call(n));
702
+ }, M = () => {
703
+ const n = l.valueKey;
704
+ return (l.options || []).map((p) => typeof p == "object" ? p[n] : p);
705
+ }, m = () => {
706
+ const n = x(), p = new Set(o.value ?? []), _ = n.filter((z) => p.has(z)).length, v = n.length;
707
+ d.value = v > 0 && _ === v, w.value = _ > 0 && _ < v;
708
+ }, c = V(() => l.multiple && r.value ? o.value : l.modelValue), t = V(() => {
709
+ const {
710
+ modelValue: n,
711
+ valueKey: p,
712
+ labelKey: _,
713
+ selectAllTxt: v,
714
+ confirmTxt: z,
715
+ nowrap: N,
716
+ ...P
717
+ } = l, G = P.props ?? {};
718
+ return {
719
+ ...P,
720
+ props: {
721
+ ...G,
722
+ value: p,
723
+ label: _
724
+ }
725
+ };
726
+ }), s = V(
727
+ () => l.nowrap ? {
728
+ collapseTags: !0,
729
+ collapseTagsTooltip: !0,
730
+ maxCollapseTags: 1,
731
+ tagTooltip: { popperStyle: { maxWidth: "400px" } }
732
+ } : {}
733
+ ), f = V(() => ({
734
+ ...s.value,
735
+ ...ge(),
736
+ ...t.value
737
+ })), O = V(() => {
738
+ const n = l.multiple && r.value ? o.value : l.modelValue, p = Array.isArray(n) ? n : n ? [n] : [];
739
+ if (!l.filterable || !r.value) return p.length;
740
+ const _ = x();
741
+ return p.filter((v) => _.includes(v)).length;
742
+ }), C = V(() => x().length);
743
+ return le(o, () => m(), { deep: !0 }), le(
744
+ () => l.modelValue,
745
+ (n) => {
746
+ if (l.multiple && r.value) {
747
+ const p = Array.isArray(n) ? [...n] : n ? [n] : [];
748
+ JSON.stringify(p) !== JSON.stringify(o.value) && (o.value = p, m());
749
+ }
750
+ }
751
+ ), (n, p) => {
752
+ const _ = K("el-checkbox"), v = K("el-button"), z = K("el-select");
753
+ return y(), D(z, se({
754
+ ref_key: "selectRef",
755
+ ref: e,
756
+ "model-value": a(c),
757
+ "tag-effect": "plain",
758
+ class: "MvcSelect"
759
+ }, a(f), {
760
+ "onUpdate:modelValue": k,
761
+ onVisibleChange: u
762
+ }), fe({
763
+ default: I(() => [
764
+ q(n.$slots, "default")
765
+ ]),
766
+ _: 2
767
+ }, [
768
+ l.filterable ? {
769
+ name: "header",
770
+ fn: I(() => [
771
+ i("div", Lt, [
772
+ l.multiple ? (y(), D(_, {
773
+ key: 0,
774
+ modelValue: a(d),
775
+ "onUpdate:modelValue": p[0] || (p[0] = (N) => Se(d) ? d.value = N : null),
776
+ indeterminate: a(w),
777
+ class: "h24",
778
+ onChange: S
779
+ }, {
780
+ default: I(() => [
781
+ Q(A(h.selectAllTxt), 1)
782
+ ]),
783
+ _: 1
784
+ }, 8, ["modelValue", "indeterminate"])) : (y(), T("span", Bt)),
785
+ i("span", Pt, A(a(O)) + "/" + A(a(C)), 1)
786
+ ])
787
+ ]),
788
+ key: "0"
789
+ } : void 0,
790
+ l.multiple ? {
791
+ name: "footer",
792
+ fn: I(() => [
793
+ i("div", Ft, [
794
+ E(v, {
795
+ type: "primary",
796
+ size: "small",
797
+ onClick: $
798
+ }, {
799
+ default: I(() => [
800
+ Q(A(h.confirmTxt), 1)
801
+ ]),
802
+ _: 1
803
+ })
804
+ ])
805
+ ]),
806
+ key: "1"
807
+ } : void 0
808
+ ]), 1040, ["model-value"]);
809
+ };
810
+ }
811
+ }), Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
812
+ __proto__: null,
813
+ default: Dt
814
+ }, Symbol.toStringTag, { value: "Module" })), Ht = { class: "flexMode hb vc" }, Ut = { key: 1 }, Jt = { class: "tag" }, qt = { class: "flexMode hr" }, Gt = /* @__PURE__ */ Object.assign({
815
+ name: "MvcSelectV2",
816
+ inheritAttrs: !1
817
+ }, {
818
+ __name: "index",
819
+ props: {
820
+ modelValue: {
821
+ type: [String, Number, Array],
822
+ default: void 0
823
+ },
824
+ multiple: {
825
+ type: Boolean,
826
+ default: !1
827
+ },
828
+ filterable: {
829
+ type: Boolean,
830
+ default: !1
831
+ },
832
+ options: {
833
+ type: Array,
834
+ default: () => []
835
+ },
836
+ valueKey: {
837
+ type: String,
838
+ default: "value"
839
+ },
840
+ labelKey: {
841
+ type: String,
842
+ default: "label"
843
+ },
844
+ selectAllTxt: {
845
+ type: String,
846
+ default: "All"
847
+ },
848
+ confirmTxt: {
849
+ type: String,
850
+ default: "Confirm"
851
+ },
852
+ nowrap: {
853
+ type: Boolean,
854
+ default: !1
855
+ }
856
+ },
857
+ emits: ["update:modelValue", "change"],
858
+ setup(h, { emit: b }) {
859
+ const l = h, e = J(null), o = J([]), r = J(!1), d = J(!1), w = J(!1), g = b, k = (n) => {
860
+ l.multiple ? (o.value = Array.isArray(n) ? [...n] : [], m()) : (g("update:modelValue", n), g("change", n));
861
+ }, u = (n) => {
862
+ if (r.value = n, n && l.multiple) {
863
+ const p = l.modelValue;
864
+ o.value = Array.isArray(p) ? [...p] : p ? [p] : [], m();
865
+ }
866
+ }, x = () => {
867
+ var v;
868
+ if (!l.filterable || !r.value) return M();
869
+ const n = e.value, p = ((v = n == null ? void 0 : n.filteredOptions) == null ? void 0 : v.value) ?? (n == null ? void 0 : n.filteredOptions) ?? [];
870
+ if (!Array.isArray(p)) return M();
871
+ const _ = l.valueKey;
872
+ return p.filter((z) => z.type !== "Group" && !z.disabled).map((z) => typeof z == "object" ? z[_] : z);
873
+ }, S = (n) => {
874
+ w.value = !1;
875
+ const p = x();
876
+ if (n)
877
+ o.value = [.../* @__PURE__ */ new Set([...o.value, ...p])];
878
+ else {
879
+ const _ = new Set(p);
880
+ o.value = o.value.filter((v) => !_.has(v));
881
+ }
882
+ }, $ = () => {
883
+ var n, p;
884
+ l.multiple && (g("update:modelValue", o.value), g("change", o.value), (p = (n = e.value) == null ? void 0 : n.blur) == null || p.call(n));
885
+ }, M = () => {
886
+ const n = l.valueKey;
887
+ return (l.options || []).map((p) => typeof p == "object" ? p[n] : p);
888
+ }, m = () => {
889
+ const n = x(), p = new Set(o.value ?? []), _ = n.filter((z) => p.has(z)).length, v = n.length;
890
+ d.value = v > 0 && _ === v, w.value = _ > 0 && _ < v;
891
+ }, c = V(() => l.multiple && r.value ? o.value : l.modelValue), t = V(() => {
892
+ const {
893
+ modelValue: n,
894
+ valueKey: p,
895
+ labelKey: _,
896
+ selectAllTxt: v,
897
+ confirmTxt: z,
898
+ nowrap: N,
899
+ ...P
900
+ } = l, G = P.props ?? {};
901
+ return {
902
+ ...P,
903
+ props: {
904
+ ...G,
905
+ value: p,
906
+ label: _
907
+ }
908
+ };
909
+ }), s = V(
910
+ () => l.nowrap ? {
911
+ collapseTags: !0,
912
+ collapseTagsTooltip: !0,
913
+ maxCollapseTags: 1,
914
+ tagTooltip: { popperStyle: { maxWidth: "400px" } }
915
+ } : {}
916
+ ), f = V(() => ({
917
+ ...s.value,
918
+ ...ge(),
919
+ ...t.value
920
+ })), O = V(() => {
921
+ const n = l.multiple && r.value ? o.value : l.modelValue, p = Array.isArray(n) ? n : n ? [n] : [];
922
+ if (!l.filterable || !r.value) return p.length;
923
+ const _ = x();
924
+ return p.filter((v) => _.includes(v)).length;
925
+ }), C = V(() => x().length);
926
+ return le(o, () => m(), { deep: !0 }), le(
927
+ () => l.modelValue,
928
+ (n) => {
929
+ if (l.multiple && r.value) {
930
+ const p = Array.isArray(n) ? [...n] : n ? [n] : [];
931
+ JSON.stringify(p) !== JSON.stringify(o.value) && (o.value = p, m());
932
+ }
933
+ }
934
+ ), (n, p) => {
935
+ const _ = K("el-checkbox"), v = K("el-button"), z = K("el-select-v2");
936
+ return y(), D(z, se({
937
+ ref_key: "selectRef",
938
+ ref: e,
939
+ "model-value": a(c),
940
+ class: "MvcSelectV2"
941
+ }, a(f), {
942
+ "onUpdate:modelValue": k,
943
+ onVisibleChange: u
944
+ }), fe({ _: 2 }, [
945
+ l.filterable ? {
946
+ name: "header",
947
+ fn: I(() => [
948
+ i("div", Ht, [
949
+ l.multiple ? (y(), D(_, {
950
+ key: 0,
951
+ modelValue: a(d),
952
+ "onUpdate:modelValue": p[0] || (p[0] = (N) => Se(d) ? d.value = N : null),
953
+ indeterminate: a(w),
954
+ class: "h24",
955
+ onChange: S
956
+ }, {
957
+ default: I(() => [
958
+ Q(A(h.selectAllTxt), 1)
959
+ ]),
960
+ _: 1
961
+ }, 8, ["modelValue", "indeterminate"])) : (y(), T("span", Ut)),
962
+ i("span", Jt, A(a(O)) + "/" + A(a(C)), 1)
963
+ ])
964
+ ]),
965
+ key: "0"
966
+ } : void 0,
967
+ n.$slots.default ? {
968
+ name: "default",
969
+ fn: I((N) => [
970
+ q(n.$slots, "default", ue(de(N)))
971
+ ]),
972
+ key: "1"
973
+ } : void 0,
974
+ l.multiple ? {
975
+ name: "footer",
976
+ fn: I(() => [
977
+ i("div", qt, [
978
+ E(v, {
979
+ type: "primary",
980
+ size: "small",
981
+ onClick: $
982
+ }, {
983
+ default: I(() => [
984
+ Q(A(h.confirmTxt), 1)
985
+ ]),
986
+ _: 1
987
+ })
988
+ ])
989
+ ]),
990
+ key: "2"
991
+ } : void 0
992
+ ]), 1040, ["model-value"]);
993
+ };
994
+ }
995
+ }), Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
996
+ __proto__: null,
997
+ default: Gt
998
+ }, Symbol.toStringTag, { value: "Module" })), Yt = Ce({
999
+ name: "MvcTableColumnFilter",
1000
+ props: {
1001
+ tableName: {
1002
+ type: String,
1003
+ default: ""
1004
+ },
1005
+ group: {
1006
+ type: Object,
1007
+ default: /* @__PURE__ */ Object.create(null)
1008
+ },
1009
+ column: {
1010
+ type: Boolean,
1011
+ default: !1
1012
+ }
1013
+ },
1014
+ setup: (h, b) => {
1015
+ var w;
1016
+ const l = H({
1017
+ options: [],
1018
+ slots: []
1019
+ }), e = h.tableName + "_Column";
1020
+ let o = [];
1021
+ (() => {
1022
+ const g = b.slots.default()[0].children, k = {
1023
+ normal: [],
1024
+ mmp: [],
1025
+ asa: [],
1026
+ fixed: [],
1027
+ columns: []
1028
+ }, u = h.tableName ? JSON.parse(localStorage.getItem(e)) : null, x = [void 0];
1029
+ g.forEach(($) => {
1030
+ window.$getType($.type) === "Symbol" ? o = o.concat($.children) : o.push($);
1031
+ }), o.forEach(($, M) => {
1032
+ var m;
1033
+ if (window.$getType($.type), ((m = $.type) == null ? void 0 : m.name) === "ElTableColumn") {
1034
+ let c = {
1035
+ ...$.props,
1036
+ sort: M,
1037
+ nomove: $.props.nomove || $.props.nomove === "" || $.props.type === "selection" || $.props.label === "Operation",
1038
+ resizable: !0,
1039
+ visible: $.props.visible !== !1
1040
+ };
1041
+ if (c.labelKey || (c.labelKey = c.label), c.label = window.$l(c.labelKey), h.column && (u != null && u.length) && x.indexOf($.props.prop) === -1) {
1042
+ const { data: t } = u.filter1((s) => s.prop === $.props.prop);
1043
+ t && (c.sort = t.sort, c.fixed = t.fixed, c.visible = t.visible);
1044
+ }
1045
+ $.props.fixed && k.fixed.push(c), $.props.type === "mmp" ? k.mmp.push(c) : $.props.type === "asa" ? k.asa.push(c) : k.normal.push(c), $.props = c;
1046
+ }
1047
+ }), l.columnInfo = k;
1048
+ let S = [...k.normal, ...k.mmp, ...k.asa];
1049
+ h.tableName && (S = S.sort(($, M) => $.sort - M.sort), localStorage.setItem(e, JSON.stringify(S)));
1050
+ })();
1051
+ let d = [];
1052
+ if (o.forEach((g) => {
1053
+ window.$getType(g) !== "String" && g.props.visible && d.push(g);
1054
+ }), (w = h.group) != null && w.label) {
1055
+ const g = {
1056
+ label: "Group By " + h.group.label,
1057
+ // prop: props.group.value,
1058
+ width: h.group.width,
1059
+ fixed: "left",
1060
+ visible: !0,
1061
+ resizable: !0
1062
+ };
1063
+ d[0].props.type === "selection" ? d.splice(1, 0, {
1064
+ ...d[1],
1065
+ props: g
1066
+ }) : d.unshift({
1067
+ ...d[0],
1068
+ props: g
1069
+ });
1070
+ }
1071
+ return d = d.sort((g, k) => g.props.sort - k.props.sort), () => d;
1072
+ }
1073
+ }), Zt = { class: "hp100 flexMode" }, Qt = { class: "w200 hp100 border-r fs14" }, Xt = { class: "flexMode vc h36 p8 bg-gray3 border-b txt-nowrap" }, el = { class: "p4" }, tl = ["onClick"], ll = {
1074
+ class: "flexMode vs hp100",
1075
+ style: { width: "calc(100% - 200px)" }
1076
+ }, ol = { class: "wp50 border-r fs14" }, nl = { class: "flexMode vc g8 h36 p8 bg-gray3 border-b txt-nowrap" }, sl = { class: "tagArea blue small" }, al = { class: "p4" }, rl = {
1077
+ key: 0,
1078
+ class: "absCenter fs12 txt-dark5 txt-nowrap"
1079
+ }, il = { class: "flexMode vc g8" }, cl = ["txt", "onClick"], ul = { class: "wp50 border-r fs14" }, dl = { class: "flexMode vc g8 h36 p8 bg-gray3 border-b txt-nowrap" }, pl = { class: "tagArea blue small" }, ml = {
1080
+ class: "relative p4",
1081
+ style: { height: "calc(100% - 36px)" }
1082
+ }, fl = {
1083
+ class: "relative",
1084
+ style: { height: "30%" }
1085
+ }, gl = {
1086
+ key: 0,
1087
+ class: "absCenter fs12 txt-dark5 txt-nowrap"
1088
+ }, hl = { class: "columnItem flexMode vc hb h40 g8 p4-8 mb4 radius4" }, yl = { class: "flexMode vc g8 txt-nowrap" }, bl = { class: "flexMode vc g8" }, vl = ["txt", "onClick"], _l = {
1089
+ class: "relative",
1090
+ style: { height: "calc(70% - 10px)" }
1091
+ }, $l = {
1092
+ key: 0,
1093
+ class: "absCenter fs12 txt-dark5 txt-nowrap"
1094
+ }, xl = { class: "columnItem flexMode vc hb h40 g8 p4-8 mb4 radius4" }, Cl = { class: "flexMode vc g8 txt-nowrap" }, Sl = { class: "flexMode vc" }, wl = ["txt", "onClick"], kl = ["txt", "onClick"], Tl = /* @__PURE__ */ Object.assign({
1095
+ name: "MvcTableColumnConfig",
1096
+ inheritAttrs: !1
1097
+ }, {
1098
+ __name: "ColumnConfig",
1099
+ props: {
1100
+ tableName: {
1101
+ type: String,
1102
+ default: ""
1103
+ }
1104
+ },
1105
+ emits: "close",
1106
+ setup(h, { emit: b }) {
1107
+ const l = h, e = H({
1108
+ loading: !1,
1109
+ type: "normal",
1110
+ columns: {
1111
+ normal: [],
1112
+ mmp: [],
1113
+ asa: []
1114
+ },
1115
+ fixed: [],
1116
+ visible: [],
1117
+ selection: [],
1118
+ operation: [],
1119
+ columnType: {},
1120
+ mounted: !1
1121
+ });
1122
+ oe(() => {
1123
+ r();
1124
+ });
1125
+ const o = b, r = () => {
1126
+ o("mounted");
1127
+ const t = JSON.parse(localStorage.getItem(`${l.tableName}_Column`)), s = {};
1128
+ t.forEach((f) => {
1129
+ f.type && (s[f.type] = !0), f.visible ? f.type === "selection" ? e.selection.push(f) : f.type === "operation" ? e.operation.push(f) : f.label && (f.fixed ? e.fixed.push(f) : e.visible.push(f)) : f.type === "mmp" ? e.columns.mmp.push(f) : f.type === "asa" ? e.columns.asa.push(f) : e.columns.normal.push(f);
1130
+ }), e.columnType = s;
1131
+ }, d = (t) => {
1132
+ e.type = t;
1133
+ }, w = (t, s) => {
1134
+ t.visible = !0, e.visible.unshift(t), t.type ? e.columns[t.type].splice(s, 1) : e.columns.normal.splice(s, 1);
1135
+ }, g = (t, s) => {
1136
+ e.fixed.unshift(t), e.visible.splice(s, 1);
1137
+ }, k = (t, s) => {
1138
+ e.visible.unshift(t), e.fixed.splice(s, 1);
1139
+ }, u = (t, s) => {
1140
+ e.visible.splice(s, 1), t.type ? e.columns[t.type].unshift(t) : e.columns.normal.unshift(t);
1141
+ }, x = async () => {
1142
+ e.loading = !0, window.$pm(() => {
1143
+ const { fixed: t, visible: s, columns: f, selection: O, operation: C } = e;
1144
+ let n = [];
1145
+ Object.keys(f).map((_) => {
1146
+ n = n.concat(f[_]);
1147
+ }), t.forEach((_) => _.fixed = "left"), n.forEach((_) => _.visible = !1);
1148
+ const p = O.concat(t, s, n, C);
1149
+ p.forEach((_, v) => _.sort = v), localStorage.setItem(`${l.tableName}_Column`, JSON.stringify(p)), e.loading = !1, o("close"), o("init-column");
1150
+ });
1151
+ }, S = () => {
1152
+ e.loading = !0, localStorage.removeItem(`${l.tableName}_Column`), window.$pm(() => {
1153
+ e.loading = !1, o("close"), o("init-column");
1154
+ }, 4);
1155
+ }, $ = V(() => window.config.options.drawerHeight - 36 - 64), M = V(() => ($.value * 0.3).toFixed(0)), m = V(() => ($.value * 0.7 - 10).toFixed(0)), c = V(() => [
1156
+ {
1157
+ label: "Base Info",
1158
+ value: "normal"
1159
+ },
1160
+ {
1161
+ label: "Asa Metrics",
1162
+ value: "asa",
1163
+ hide: !e.columnType.asa
1164
+ },
1165
+ {
1166
+ label: "MMP Metrics",
1167
+ value: "mmp",
1168
+ hide: !e.columnType.mmp
1169
+ }
1170
+ ]);
1171
+ return (t, s) => {
1172
+ const f = K("el-scrollbar"), O = K("DrawerArea");
1173
+ return y(), D(O, {
1174
+ loading: a(e).loading,
1175
+ noscroll: "",
1176
+ "cancel-txt": "Reset",
1177
+ "cancel-icon": "im-sync",
1178
+ class: "MvcTableColumnConfig",
1179
+ onCancel: S,
1180
+ onSubmit: x
1181
+ }, {
1182
+ default: I(() => [
1183
+ i("div", Zt, [
1184
+ i("div", Qt, [
1185
+ i("div", Xt, A(t.$l("Column Type")), 1),
1186
+ i("div", el, [
1187
+ (y(!0), T(te, null, ne(a(c), (C) => (y(), T("div", {
1188
+ key: C.value,
1189
+ class: R(["typeItem p8-16 mb4 radius4 txt-nowrap", [a(e).type === C.value && "active", C.hide && "hide"]]),
1190
+ onClick: (n) => d(C.value)
1191
+ }, A(C.label), 11, tl))), 128))
1192
+ ])
1193
+ ]),
1194
+ i("div", ll, [
1195
+ i("div", ol, [
1196
+ i("div", nl, [
1197
+ i("span", null, A(t.$l("Columns")), 1),
1198
+ i("span", sl, A(a(e).columns[a(e).type].length), 1)
1199
+ ]),
1200
+ E(f, { style: { height: "calc(100% - 36px)" } }, {
1201
+ default: I(() => [
1202
+ i("div", al, [
1203
+ a(e).columns[a(e).type].length === 0 ? (y(), T("span", rl, A(t.$l("No Columns")), 1)) : B("", !0),
1204
+ (y(!0), T(te, null, ne(a(e).columns[a(e).type], (C, n) => (y(), T("div", {
1205
+ key: C.prop,
1206
+ class: "columnItem flexMode vc hb h40 g8 p4-8 mb4 radius4 txt-nowrap"
1207
+ }, [
1208
+ i("span", null, A(t.$l(C.label)), 1),
1209
+ i("div", il, [
1210
+ i("div", {
1211
+ class: "tipbtn left",
1212
+ txt: t.$l("Visible"),
1213
+ onClick: (p) => w(C, n)
1214
+ }, [...s[0] || (s[0] = [
1215
+ i("i", { class: "imicon im-plus fs16" }, null, -1)
1216
+ ])], 8, cl)
1217
+ ])
1218
+ ]))), 128))
1219
+ ])
1220
+ ]),
1221
+ _: 1
1222
+ })
1223
+ ]),
1224
+ i("div", ul, [
1225
+ i("div", dl, [
1226
+ i("span", null, A(t.$l("Visible Columns")), 1),
1227
+ i("span", pl, A(a(e).visible.length), 1)
1228
+ ]),
1229
+ i("div", ml, [
1230
+ i("div", fl, [
1231
+ a(e).fixed.length === 0 ? (y(), T("span", gl, A(t.$l("No Fixed Columns")), 1)) : B("", !0),
1232
+ E(f, { height: a(M) }, {
1233
+ default: I(() => [
1234
+ E(a(ve), {
1235
+ list: a(e).fixed,
1236
+ "item-key": (C) => C,
1237
+ handle: ".im-handle",
1238
+ "ghost-class": "ghost"
1239
+ }, {
1240
+ item: I(({ element: C, index: n }) => [
1241
+ i("div", hl, [
1242
+ i("div", yl, [
1243
+ s[1] || (s[1] = i("i", { class: "imicon im-handle cursor-grab" }, null, -1)),
1244
+ i("span", null, A(t.$l(C.label)), 1)
1245
+ ]),
1246
+ i("div", bl, [
1247
+ i("div", {
1248
+ class: "tipbtn red left",
1249
+ txt: t.$l("Unfixed"),
1250
+ onClick: (p) => k(C, n)
1251
+ }, [...s[2] || (s[2] = [
1252
+ i("i", { class: "imicon im-download1 fs14" }, null, -1)
1253
+ ])], 8, vl)
1254
+ ])
1255
+ ])
1256
+ ]),
1257
+ _: 1
1258
+ }, 8, ["list", "item-key"])
1259
+ ]),
1260
+ _: 1
1261
+ }, 8, ["height"])
1262
+ ]),
1263
+ s[6] || (s[6] = i("div", { class: "p4-0" }, [
1264
+ i("div", { class: "border-t" })
1265
+ ], -1)),
1266
+ i("div", _l, [
1267
+ a(e).visible.length === 0 ? (y(), T("span", $l, A(t.$l("No Columns")), 1)) : B("", !0),
1268
+ E(f, { height: a(m) }, {
1269
+ default: I(() => [
1270
+ E(a(ve), {
1271
+ list: a(e).visible,
1272
+ "item-key": (C) => C,
1273
+ options: { lockAxis: "y" },
1274
+ handle: ".im-handle",
1275
+ "ghost-class": "ghost"
1276
+ }, {
1277
+ item: I(({ element: C, index: n }) => [
1278
+ i("div", xl, [
1279
+ i("div", Cl, [
1280
+ s[3] || (s[3] = i("i", { class: "imicon im-handle cursor-grab" }, null, -1)),
1281
+ i("span", null, A(t.$l(C.label)), 1)
1282
+ ]),
1283
+ i("div", Sl, [
1284
+ i("div", {
1285
+ class: "tipbtn left",
1286
+ txt: t.$l("Fixed"),
1287
+ onClick: (p) => g(C, n)
1288
+ }, [...s[4] || (s[4] = [
1289
+ i("i", { class: "imicon im-download1 fs14 rotateZ180" }, null, -1)
1290
+ ])], 8, wl),
1291
+ i("div", {
1292
+ class: "tipbtn red left",
1293
+ txt: t.$l("Hide"),
1294
+ onClick: (p) => u(C, n)
1295
+ }, [...s[5] || (s[5] = [
1296
+ i("i", { class: "imicon im-close fs14" }, null, -1)
1297
+ ])], 8, kl)
1298
+ ])
1299
+ ])
1300
+ ]),
1301
+ _: 1
1302
+ }, 8, ["list", "item-key"])
1303
+ ]),
1304
+ _: 1
1305
+ }, 8, ["height"])
1306
+ ])
1307
+ ])
1308
+ ])
1309
+ ])
1310
+ ])
1311
+ ]),
1312
+ _: 1
1313
+ }, 8, ["loading"]);
1314
+ };
1315
+ }
1316
+ }), Ml = /* @__PURE__ */ X(Tl, [["__scopeId", "data-v-01691821"]]), Al = { class: "p16 border-b" }, Vl = { class: "flexMode vc g8" }, Ol = {
1317
+ key: 0,
1318
+ class: "flexMode vc g8"
1319
+ }, jl = { class: "flexMode g16 hr vc" }, Il = { class: "TheEnd p16" }, Nl = { class: "sticky flexMode vc hb p4-8 mt16 mb8 fs14 txt-dark9 z9 backdrop border-l4-primary bg-gray3 radius4" }, zl = { class: "fw700" }, El = { class: "flexMode vc g8" }, Kl = /* @__PURE__ */ Object.assign({
1320
+ name: "MvcTableColumnDownload",
1321
+ inheritAttrs: !1
1322
+ }, {
1323
+ __name: "ColumnDownload",
1324
+ props: {
1325
+ tableName: {
1326
+ type: String,
1327
+ default: ""
1328
+ },
1329
+ list: {
1330
+ type: Array,
1331
+ default: () => []
1332
+ },
1333
+ selection: {
1334
+ type: Array,
1335
+ default: () => []
1336
+ }
1337
+ },
1338
+ emits: ["mounted"],
1339
+ setup(h, { emit: b }) {
1340
+ const l = h, e = H({
1341
+ loading: !1,
1342
+ columns: [],
1343
+ checked: [],
1344
+ useHead: !1,
1345
+ onlySelection: !1,
1346
+ mounted: !1
1347
+ });
1348
+ oe(() => {
1349
+ r();
1350
+ });
1351
+ const o = b, r = () => {
1352
+ o("mounted"), d(), w();
1353
+ }, d = () => {
1354
+ const c = JSON.parse(localStorage.getItem(`${l.tableName}_Column`)), t = ["selection", "operation"];
1355
+ e.columns = c.filter((s) => !t.includes(s.type) && s.label);
1356
+ }, w = () => {
1357
+ l.selection.length && (e.onlySelection = !0);
1358
+ }, g = (c, t) => {
1359
+ c ? t.children.forEach((s) => {
1360
+ s.visible = !0;
1361
+ }) : t.children.forEach((s) => {
1362
+ s.visible = !1;
1363
+ });
1364
+ }, k = () => {
1365
+ window.$copy(x());
1366
+ }, u = async () => {
1367
+ e.loading = !0;
1368
+ try {
1369
+ const c = x("download");
1370
+ let t = e.fileName || S.value;
1371
+ t && !t.toLowerCase().endsWith(".csv") && (t = `${t}.csv`), await Ee({ content: c, filename: t, bom: !0 });
1372
+ } finally {
1373
+ e.loading = !1;
1374
+ }
1375
+ }, x = (c) => {
1376
+ const t = e.onlySelection ? l.selection : l.list, s = {}, f = [];
1377
+ e.columns.filter((v) => v.visible).forEach((v) => {
1378
+ f.push(window.$l(v.label)), s[v.prop] = !0;
1379
+ });
1380
+ let O = "", C = [], n = c === "download" ? "," : " ";
1381
+ (e.useHead || c) && (O = f.join(n) + `
1382
+ `);
1383
+ let p = [], _;
1384
+ return Object.keys(s).forEach((v, z) => {
1385
+ v.includes("country") && (_ = z);
1386
+ const N = [];
1387
+ t.forEach((P) => {
1388
+ P[v] !== void 0 && N.push(P[v]);
1389
+ }), p.push(N);
1390
+ }), p.forEach((v, z) => {
1391
+ !e.useCountryCode && _ === z ? v.forEach((N, P) => {
1392
+ let G = N;
1393
+ window.$getType(N) === "Array" ? G = N.map((ie) => m[ie.toUpperCase()].label.$l()).join(",") : window.$getType(N) === "String" ? G = N.split(",").map((ie) => m[ie.toUpperCase()].label.$l()).join(",") : G = JSON.stringify(N), C[P] ? C[P] += G + n : C[P] = G + n;
1394
+ }) : v.forEach((N, P) => {
1395
+ C[P] ? C[P] += N + n : C[P] = N + n;
1396
+ });
1397
+ }), `${O}${C.join(`
1398
+ `)}`;
1399
+ }, S = V(() => {
1400
+ const c = window.$m().format("YYYYMMDDHHmmss");
1401
+ return `${l.tableName}_${c}`;
1402
+ }), $ = V(() => {
1403
+ const c = {};
1404
+ return e.columns.forEach((t) => {
1405
+ const s = t.type ? t.type : "normal", f = {
1406
+ label: M[s],
1407
+ type: s,
1408
+ visible: 0
1409
+ };
1410
+ c[s] ? (c[s].children.push(t), t.visible && c[s].visible++) : (f.children = [t], t.visible && f.visible++, c[s] = f);
1411
+ }), Object.keys(c).forEach((t) => {
1412
+ const s = c[t].visible === c[t].children.length, f = c[t].visible === 0;
1413
+ s ? (c[t].checkstatus = !0, c[t].indeterminate = !1) : f ? (c[t].checkstatus = !1, c[t].indeterminate = !1) : (c[t].checkstatus = !1, c[t].indeterminate = !0);
1414
+ }), c;
1415
+ }), M = {
1416
+ asa: "Asa Metrics",
1417
+ normal: "Base Info",
1418
+ mmp: "MMP Metrics"
1419
+ };
1420
+ "Check All".$l(), "Cancel All".$l();
1421
+ const m = useMap("asa.countryAll.obj");
1422
+ return (c, t) => {
1423
+ const s = K("el-checkbox"), f = K("el-button"), O = K("MvcAlert"), C = K("el-switch"), n = K("Input"), p = K("DrawerArea");
1424
+ return y(), D(p, se(c.$attrs, { class: "MvcTableColumnDownload" }), {
1425
+ cancel: I(() => [
1426
+ E(n, {
1427
+ modelValue: a(e).fileName,
1428
+ "onUpdate:modelValue": t[3] || (t[3] = (_) => a(e).fileName = _),
1429
+ icon: "catalog",
1430
+ placeholder: a(S),
1431
+ class: "w600"
1432
+ }, {
1433
+ append: I(() => [
1434
+ E(f, {
1435
+ loading: a(e).loading,
1436
+ onClick: u
1437
+ }, {
1438
+ icon: I(() => [...t[5] || (t[5] = [
1439
+ i("i", { class: "imicon im-download1" }, null, -1)
1440
+ ])]),
1441
+ default: I(() => [
1442
+ Q(" " + A(c.$l("Download")), 1)
1443
+ ]),
1444
+ _: 1
1445
+ }, 8, ["loading"])
1446
+ ]),
1447
+ _: 1
1448
+ }, 8, ["modelValue", "placeholder"])
1449
+ ]),
1450
+ submit: I(() => [...t[6] || (t[6] = [])]),
1451
+ default: I(() => [
1452
+ i("div", Al, [
1453
+ E(O, null, {
1454
+ default: I(() => [
1455
+ i("div", Vl, [
1456
+ i("span", null, A(c.$l("Total")), 1),
1457
+ i("span", null, A(l.list.length), 1)
1458
+ ]),
1459
+ l.selection.length ? (y(), T("div", Ol, [
1460
+ i("span", null, A(c.$l("Selection")), 1),
1461
+ i("span", null, A(l.selection.length), 1),
1462
+ E(s, {
1463
+ modelValue: a(e).onlySelection,
1464
+ "onUpdate:modelValue": t[0] || (t[0] = (_) => a(e).onlySelection = _),
1465
+ label: c.$l("Only Selection")
1466
+ }, null, 8, ["modelValue", "label"])
1467
+ ])) : B("", !0),
1468
+ i("div", jl, [
1469
+ E(f, { onClick: k }, {
1470
+ icon: I(() => [...t[4] || (t[4] = [
1471
+ i("i", { class: "imicon im-copy" }, null, -1)
1472
+ ])]),
1473
+ default: I(() => [
1474
+ Q(" " + A(c.$l("Copy to Clipboard")), 1)
1475
+ ]),
1476
+ _: 1
1477
+ }),
1478
+ E(s, {
1479
+ modelValue: a(e).useHead,
1480
+ "onUpdate:modelValue": t[1] || (t[1] = (_) => a(e).useHead = _),
1481
+ label: c.$l("With Table Head")
1482
+ }, null, 8, ["modelValue", "label"])
1483
+ ])
1484
+ ]),
1485
+ _: 1
1486
+ })
1487
+ ]),
1488
+ i("div", Il, [
1489
+ (y(!0), T(te, null, ne(a($), (_) => (y(), T("div", {
1490
+ key: _.type
1491
+ }, [
1492
+ i("div", Nl, [
1493
+ i("span", zl, A(_.label), 1),
1494
+ E(s, {
1495
+ modelValue: _.checkstatus,
1496
+ "onUpdate:modelValue": (v) => _.checkstatus = v,
1497
+ indeterminate: _.indeterminate,
1498
+ label: c.$l("Check"),
1499
+ onChange: (v) => g(v, _)
1500
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "indeterminate", "label", "onChange"])
1501
+ ]),
1502
+ (y(!0), T(te, null, ne(_.children, (v, z) => (y(), D(s, {
1503
+ modelValue: v.visible,
1504
+ "onUpdate:modelValue": (N) => v.visible = N,
1505
+ key: z,
1506
+ label: v.label,
1507
+ value: v.value,
1508
+ class: "fullCheckbox p8-12 mb4 radius2 hover-txt-primary hover-bg-gray3"
1509
+ }, {
1510
+ default: I(() => {
1511
+ var N;
1512
+ return [
1513
+ i("div", El, [
1514
+ i("span", null, A(v.label), 1),
1515
+ (N = v.prop) != null && N.includes("country") ? (y(), D(C, {
1516
+ key: 0,
1517
+ modelValue: a(e).useCountryCode,
1518
+ "onUpdate:modelValue": t[2] || (t[2] = (P) => a(e).useCountryCode = P),
1519
+ "inline-prompt": "",
1520
+ "active-text": "Use Alpha-2 Code",
1521
+ "inactive-text": "Use Country Name",
1522
+ class: "primarySwitch"
1523
+ }, null, 8, ["modelValue"])) : B("", !0)
1524
+ ])
1525
+ ];
1526
+ }),
1527
+ _: 2
1528
+ }, 1032, ["modelValue", "onUpdate:modelValue", "label", "value"]))), 128))
1529
+ ]))), 128))
1530
+ ])
1531
+ ]),
1532
+ _: 1
1533
+ }, 16);
1534
+ };
1535
+ }
1536
+ }), Ll = { class: "MvcTable" }, Bl = {
1537
+ key: 0,
1538
+ class: "flexMode vc"
1539
+ }, Pl = { class: "tableArea relative radius ctx-auto" }, Fl = {
1540
+ key: 1,
1541
+ class: "flexMode vc h56 p16 xscroll nobar fadeout"
1542
+ }, Dl = /* @__PURE__ */ Object.assign({
1543
+ name: "MvcTable",
1544
+ inheritAttrs: !1
1545
+ }, {
1546
+ __name: "index",
1547
+ props: {
1548
+ defaultLoading: {
1549
+ type: Boolean,
1550
+ default: !0
1551
+ },
1552
+ tableName: {
1553
+ type: String,
1554
+ default: ""
1555
+ },
1556
+ autoHeader: {
1557
+ type: Boolean,
1558
+ default: !0
1559
+ },
1560
+ headerClass: {
1561
+ type: String,
1562
+ default: ""
1563
+ },
1564
+ height: {
1565
+ type: [String, Number],
1566
+ default: 0
1567
+ },
1568
+ minusHeight: {
1569
+ type: [String, Number],
1570
+ default: 0
1571
+ },
1572
+ defer: {
1573
+ type: Boolean,
1574
+ default: !1
1575
+ },
1576
+ rowKey: {
1577
+ type: String,
1578
+ default: ""
1579
+ },
1580
+ defaultExpandAll: {
1581
+ type: Boolean,
1582
+ default: !1
1583
+ },
1584
+ tool: {
1585
+ type: [Object, Boolean],
1586
+ default: () => ({
1587
+ download: !0,
1588
+ refresh: !0,
1589
+ column: !0
1590
+ })
1591
+ },
1592
+ noheader: {
1593
+ type: Boolean,
1594
+ default: !1
1595
+ },
1596
+ nofooter: {
1597
+ type: Boolean,
1598
+ default: !1
1599
+ },
1600
+ loadData: {
1601
+ type: Function,
1602
+ default: () => ({
1603
+ list: [],
1604
+ total: 0
1605
+ })
1606
+ },
1607
+ pageSize: {
1608
+ type: Number,
1609
+ default: 0
1610
+ },
1611
+ pageSizes: {
1612
+ type: Array,
1613
+ default: () => [10, 20, 50, 100]
1614
+ },
1615
+ /**
1616
+ * 远程汇总行按列格式化:与 util `$fu` 的 metric 形态一致。
1617
+ * 未传时使用全局 `$config.table.summaryMetric`(应用入口一次配置即可)。
1618
+ * 对象:`{ spend: { unit: 'currency', precision: 2 }, rate: { unit: '%', precision: 2 } }`
1619
+ * 函数:`(prop) => ({ unit, precision, currency })`。
1620
+ */
1621
+ summaryMetric: {
1622
+ type: [Object, Function],
1623
+ default: null
1624
+ }
1625
+ },
1626
+ emits: ["selection-change", "refresh"],
1627
+ setup(h, { expose: b, emit: l }) {
1628
+ const e = h, o = H({
1629
+ loading: !0,
1630
+ selection: []
1631
+ }), r = H({
1632
+ list: [],
1633
+ total: 0,
1634
+ page: 1,
1635
+ pageSize: 50,
1636
+ summary: !1,
1637
+ summaryType: "remote",
1638
+ nopagination: !1,
1639
+ params: {}
1640
+ }), d = H({
1641
+ tabelKey: 0,
1642
+ current: "",
1643
+ list: [
1644
+ {
1645
+ title: "Table Column Customization",
1646
+ size: 1024,
1647
+ cpt: ye(Ml)
1648
+ },
1649
+ {
1650
+ title: "Download from Current Table",
1651
+ cpt: ye(Kl)
1652
+ }
1653
+ ]
1654
+ }), w = J(null), { proxy: g } = re();
1655
+ Ie(() => {
1656
+ u();
1657
+ }), oe(() => {
1658
+ x();
1659
+ });
1660
+ const k = l, u = () => {
1661
+ o.loading = e.defaultLoading, e.pageSize && (r.pageSize = e.pageSize);
1662
+ }, x = () => {
1663
+ _(), e.defer === !1 && $();
1664
+ }, S = (j) => {
1665
+ $(j);
1666
+ }, $ = async (j = {}) => {
1667
+ if (j.refresh && o.loading)
1668
+ return;
1669
+ o.loading = !0;
1670
+ const L = {
1671
+ pageSize: j.pageSize || r.pageSize,
1672
+ pageStart: j.pageStart || r.page
1673
+ };
1674
+ j.refresh && (L.remote = !0);
1675
+ const { list: W = [], total: F, summary: U } = await e.loadData(L) || {};
1676
+ r.list = W.map((Z, ee) => (Z.index = ee, Z)), F === void 0 ? (r.total = r.list.length, r.nopagination = !0) : (r.total = F, r.nopagination = !1), window.config.table.scrollToTop && c(), M(U), o.loading = !1;
1677
+ }, M = (j) => {
1678
+ j ? r.summary = j : r.summary = !1;
1679
+ }, m = (j) => {
1680
+ if (r.summaryType === "locale")
1681
+ return [];
1682
+ if (r.summaryType === "remote") {
1683
+ const L = (F, U) => {
1684
+ if (F != null)
1685
+ return typeof F == "function" ? F(U) : F[U];
1686
+ }, W = (F) => {
1687
+ var Z, ee;
1688
+ const U = L(e.summaryMetric, F);
1689
+ return U !== void 0 ? U : L((ee = (Z = globalThis.$config) == null ? void 0 : Z.table) == null ? void 0 : ee.summaryMetric, F);
1690
+ };
1691
+ return Ke(j, r.summary, { resolveMetric: W });
1692
+ }
1693
+ return [];
1694
+ }, c = () => {
1695
+ w.value.$refs.scrollBarRef.setScrollTop(0);
1696
+ }, t = () => {
1697
+ $({
1698
+ pageStart: 1
1699
+ });
1700
+ }, s = () => {
1701
+ $();
1702
+ }, f = (j) => {
1703
+ if (o.selection = j, k("selection-change", j), o.shiftKey) {
1704
+ const L = j[j.length - 2], W = j[j.length - 1], F = r.list.filter1((Y) => Y.id === L.id).index || 0, U = r.list.filter1((Y) => Y.id === W.id).index;
1705
+ let Z = F, ee = U;
1706
+ F > U && (Z = U, ee = F);
1707
+ for (let Y = Z; Y <= ee; Y++)
1708
+ g.$refs.body.toggleRowSelection(r.list[Y], !0);
1709
+ }
1710
+ }, O = () => {
1711
+ o.loading || ($({ refresh: !0 }), k("refresh"));
1712
+ }, C = () => {
1713
+ d.current = 0;
1714
+ }, n = () => {
1715
+ d.current = 1;
1716
+ }, p = () => {
1717
+ o.tableKey++;
1718
+ }, _ = () => {
1719
+ document.addEventListener("keydown", v), document.addEventListener("keyup", z);
1720
+ }, v = (j) => {
1721
+ j.keyCode === 16 && (o.shiftKey = !0);
1722
+ }, z = (j) => {
1723
+ j.keyCode === 16 && (o.shiftKey = !1);
1724
+ }, N = () => {
1725
+ document.removeEventListener("keydown", v), document.removeEventListener("keyup", z);
1726
+ }, P = ({ i: j, row: L }) => {
1727
+ r.list[j] = L;
1728
+ }, G = V(() => {
1729
+ let j = e.height || window.config.options.pageHeight;
1730
+ return e.noheader === !1 && (j -= 64), e.nofooter === !1 && (j -= 56), j -= e.minusHeight, j;
1731
+ }), ie = V(() => !!r.summary), we = V(() => r.nopagination === !0 ? "total" : "total,->,prev,pager,next,sizes"), ae = V(() => {
1732
+ if (e.tool) {
1733
+ const { column: j = !0, download: L = !0, refresh: W = !0 } = e.tool;
1734
+ return {
1735
+ column: j,
1736
+ download: L,
1737
+ refresh: W
1738
+ };
1739
+ } else
1740
+ return !1;
1741
+ });
1742
+ return ce(() => {
1743
+ N();
1744
+ }), b({
1745
+ initTable: S,
1746
+ editRow: P
1747
+ }), (j, L) => {
1748
+ const W = K("el-button"), F = K("Loading"), U = K("el-table"), Z = K("el-pagination"), ee = K("Drawer");
1749
+ return y(), T("div", Ll, [
1750
+ e.noheader === !1 ? (y(), T("div", {
1751
+ key: 0,
1752
+ class: R(["flexMode hb g12 p16 bg-white", e.autoHeader ? "minh64" : "h64"])
1753
+ }, [
1754
+ i("div", {
1755
+ class: R(["flexMode vc flexGrow maxwp100", e.headerClass])
1756
+ }, [
1757
+ q(j.$slots, "header", {}, void 0, !0)
1758
+ ], 2),
1759
+ a(ae) ? (y(), T("div", Bl, [
1760
+ a(ae).refresh ? (y(), D(W, {
1761
+ key: 0,
1762
+ onClick: O
1763
+ }, {
1764
+ icon: I(() => [...L[2] || (L[2] = [
1765
+ i("i", { class: "imicon im-sync" }, null, -1)
1766
+ ])]),
1767
+ default: I(() => [
1768
+ Q(" " + A(j.$l("Refresh")), 1)
1769
+ ]),
1770
+ _: 1
1771
+ })) : B("", !0),
1772
+ a(ae).column ? (y(), D(W, {
1773
+ key: 1,
1774
+ onClick: C
1775
+ }, {
1776
+ icon: I(() => [...L[3] || (L[3] = [
1777
+ i("i", { class: "imicon im-column" }, null, -1)
1778
+ ])]),
1779
+ default: I(() => [
1780
+ Q(" " + A(j.$l("Columns")), 1)
1781
+ ]),
1782
+ _: 1
1783
+ })) : B("", !0),
1784
+ a(ae).download ? (y(), D(W, {
1785
+ key: 2,
1786
+ onClick: n
1787
+ }, {
1788
+ icon: I(() => [...L[4] || (L[4] = [
1789
+ i("i", { class: "imicon im-download1" }, null, -1)
1790
+ ])]),
1791
+ default: I(() => [
1792
+ Q(" " + A(j.$l("Download")), 1)
1793
+ ]),
1794
+ _: 1
1795
+ })) : B("", !0)
1796
+ ])) : B("", !0)
1797
+ ], 2)) : B("", !0),
1798
+ i("div", Pl, [
1799
+ E(F, {
1800
+ loading: a(o).loading
1801
+ }, null, 8, ["loading"]),
1802
+ (y(), D(U, {
1803
+ ref_key: "body",
1804
+ ref: w,
1805
+ key: a(o).tableKey,
1806
+ height: a(G),
1807
+ data: a(r).list,
1808
+ "default-expand-all": e.defaultExpandAll,
1809
+ "row-key": e.rowKey,
1810
+ stripe: "",
1811
+ border: "",
1812
+ "show-summary": a(ie),
1813
+ "summary-method": m,
1814
+ class: "MainTable",
1815
+ onSelectionChange: f
1816
+ }, {
1817
+ default: I(() => [
1818
+ E(a(Yt), se({
1819
+ "table-name": e.tableName,
1820
+ column: a(ae) ? a(ae).column : !1
1821
+ }, j.$attrs), {
1822
+ default: I(() => [
1823
+ q(j.$slots, "default", {}, void 0, !0)
1824
+ ]),
1825
+ _: 3
1826
+ }, 16, ["table-name", "column"])
1827
+ ]),
1828
+ _: 3
1829
+ }, 8, ["height", "data", "default-expand-all", "row-key", "show-summary"]))
1830
+ ]),
1831
+ e.nofooter === !1 ? (y(), T("div", Fl, [
1832
+ E(Z, {
1833
+ "current-page": a(r).page,
1834
+ "onUpdate:currentPage": L[0] || (L[0] = (Y) => a(r).page = Y),
1835
+ background: "",
1836
+ total: a(r).total,
1837
+ "default-page-size": a(r).pageSize,
1838
+ "page-sizes": e.pageSizes,
1839
+ "pager-count": 5,
1840
+ layout: a(we),
1841
+ class: "wp100",
1842
+ onSizeChange: t,
1843
+ onCurrentChange: s
1844
+ }, null, 8, ["current-page", "total", "default-page-size", "page-sizes", "layout"])
1845
+ ])) : B("", !0),
1846
+ E(ee, {
1847
+ current: a(d).current,
1848
+ "onUpdate:current": L[1] || (L[1] = (Y) => a(d).current = Y),
1849
+ "table-name": e.tableName,
1850
+ drawer: a(d).list,
1851
+ list: a(r).list,
1852
+ selection: a(o).selection,
1853
+ onInitColumn: p
1854
+ }, null, 8, ["current", "table-name", "drawer", "list", "selection"])
1855
+ ]);
1856
+ };
1857
+ }
1858
+ }), Rl = /* @__PURE__ */ X(Dl, [["__scopeId", "data-v-e72098dd"]]), Hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1859
+ __proto__: null,
1860
+ default: Rl
1861
+ }, Symbol.toStringTag, { value: "Module" })), Ul = { class: "panelWrap" }, Jl = /* @__PURE__ */ Object.assign({
1862
+ name: "MvcTabs",
1863
+ inheritAttrs: !1
1864
+ }, {
1865
+ __name: "index",
1866
+ props: {
1867
+ modelValue: {
1868
+ type: [String, Number, Boolean],
1869
+ default: void 0
1870
+ },
1871
+ /** 与 BtnGroup 一致;每项需含 `component`(或 `componentKey` 指定字段)指向要渲染的组件 */
1872
+ options: {
1873
+ type: Array,
1874
+ default: () => []
1875
+ },
1876
+ valueKey: {
1877
+ type: String,
1878
+ default: "value"
1879
+ },
1880
+ labelKey: {
1881
+ type: String,
1882
+ default: "label"
1883
+ },
1884
+ componentKey: {
1885
+ type: String,
1886
+ default: "component"
1887
+ },
1888
+ /** 选项对象上用于 `v-bind` 到当前面板的字段名,如 `{ paneProps: { id: 1 } }` */
1889
+ panePropsKey: {
1890
+ type: String,
1891
+ default: "paneProps"
1892
+ },
1893
+ disabled: {
1894
+ type: Boolean,
1895
+ default: !1
1896
+ }
1897
+ },
1898
+ emits: ["update:modelValue", "change"],
1899
+ setup(h, { emit: b }) {
1900
+ const l = h, e = b, o = ge(), r = (u) => u == null ? u : ["Object", "Array"].includes(globalThis.$getType(u)) ? u[l.valueKey] : u, d = (u) => {
1901
+ e("update:modelValue", u);
1902
+ const x = l.options.find((S) => r(S) === u);
1903
+ e("change", u, x);
1904
+ }, w = V(
1905
+ () => l.options.find((u) => r(u) === l.modelValue)
1906
+ ), g = V(() => {
1907
+ const u = w.value;
1908
+ if (!(!u || !["Object", "Array"].includes(globalThis.$getType(u))))
1909
+ return u[l.componentKey];
1910
+ }), k = V(() => {
1911
+ const u = w.value;
1912
+ return !u || !["Object", "Array"].includes(globalThis.$getType(u)) ? {} : u[l.panePropsKey] ?? {};
1913
+ });
1914
+ return (u, x) => {
1915
+ const S = K("BtnGroup");
1916
+ return y(), T("div", se({ class: "MvcTabs flexMode flexV g12" }, a(o)), [
1917
+ E(S, {
1918
+ "model-value": l.modelValue,
1919
+ options: l.options,
1920
+ "value-key": l.valueKey,
1921
+ "label-key": l.labelKey,
1922
+ disabled: l.disabled,
1923
+ "onUpdate:modelValue": d
1924
+ }, null, 8, ["model-value", "options", "value-key", "label-key", "disabled"]),
1925
+ i("div", Ul, [
1926
+ a(g) ? (y(), D(Ne(a(g)), ue(se({ key: 0 }, a(k))), null, 16)) : B("", !0)
1927
+ ])
1928
+ ], 16);
1929
+ };
1930
+ }
1931
+ }), ql = /* @__PURE__ */ X(Jl, [["__scopeId", "data-v-62303cd8"]]), Gl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1932
+ __proto__: null,
1933
+ default: ql
1934
+ }, Symbol.toStringTag, { value: "Module" })), Wl = /* @__PURE__ */ Object.assign({
1935
+ name: "MvcTextarea",
1936
+ inheritAttrs: !1
1937
+ }, {
1938
+ __name: "index",
1939
+ props: {
1940
+ modelValue: {
1941
+ type: [String, Number, Array],
1942
+ default: ""
1943
+ },
1944
+ rows: {
1945
+ type: Number,
1946
+ default: 3
1947
+ },
1948
+ height: {
1949
+ type: [String, Number],
1950
+ default: ""
1951
+ },
1952
+ output: {
1953
+ type: String,
1954
+ default: "string",
1955
+ validator: (h) => ["string", "array"].includes(h)
1956
+ },
1957
+ resize: {
1958
+ type: String,
1959
+ default: "vertical",
1960
+ validator: (h) => ["none", "vertical"].includes(h)
1961
+ }
1962
+ },
1963
+ emits: [
1964
+ "update:modelValue",
1965
+ "input",
1966
+ "change",
1967
+ "blur",
1968
+ "focus"
1969
+ ],
1970
+ setup(h, { emit: b }) {
1971
+ const l = h, e = J(null);
1972
+ let o = null;
1973
+ const r = H({
1974
+ val: "",
1975
+ isComposing: !1
1976
+ }), d = b, { proxy: w } = re();
1977
+ oe(() => {
1978
+ var s, f;
1979
+ const t = (s = e.value) == null ? void 0 : s.$el;
1980
+ o = (f = t == null ? void 0 : t.querySelector) == null ? void 0 : f.call(t, "textarea"), o && (o.addEventListener("compositionstart", g), o.addEventListener("compositionend", k));
1981
+ });
1982
+ const g = () => {
1983
+ r.isComposing = !0;
1984
+ }, k = () => {
1985
+ r.isComposing = !1, me(() => $(r.val));
1986
+ }, u = (t) => {
1987
+ r.isComposing || $(t);
1988
+ }, x = (t) => {
1989
+ const s = String(t ?? "").split(/\r?\n/);
1990
+ return l.output === "array" ? s : s.join(",");
1991
+ }, S = (t) => Array.isArray(t) ? t.join(`
1992
+ `) : String(t ?? "").replace(/,/g, `
1993
+ `), $ = (t) => {
1994
+ const s = x(t);
1995
+ d("update:modelValue", s), d("input", s);
1996
+ }, M = V(() => {
1997
+ if (!l.height) return w.$attrs["input-style"];
1998
+ const t = typeof l.height == "number" ? `${l.height}px` : l.height;
1999
+ return { ...w.$attrs["input-style"] && typeof w.$attrs["input-style"] == "object" ? { ...w.$attrs["input-style"] } : {}, height: t, minHeight: t };
2000
+ }), m = V(() => !!(w.$attrs.maxlength || c.value)), c = V(() => w.$attrs.max);
2001
+ return le(
2002
+ () => l.modelValue,
2003
+ (t) => {
2004
+ const s = S(t);
2005
+ r.val !== s && (r.val = s);
2006
+ },
2007
+ { immediate: !0 }
2008
+ ), ce(() => {
2009
+ o && (o.removeEventListener("compositionstart", g), o.removeEventListener("compositionend", k), o = null);
2010
+ }), (t, s) => {
2011
+ const f = K("el-input");
2012
+ return y(), D(f, se({
2013
+ ref_key: "inputRef",
2014
+ ref: e,
2015
+ type: "textarea",
2016
+ modelValue: a(r).val,
2017
+ "onUpdate:modelValue": s[0] || (s[0] = (O) => a(r).val = O),
2018
+ rows: l.rows,
2019
+ style: t.$attrs.style,
2020
+ "input-style": a(M),
2021
+ "show-word-limit": a(m),
2022
+ maxlength: a(c),
2023
+ class: "MvcTextarea"
2024
+ }, t.$attrs, { onInput: u }), null, 16, ["modelValue", "rows", "style", "input-style", "show-word-limit", "maxlength"]);
2025
+ };
2026
+ }
2027
+ }), Yl = /* @__PURE__ */ X(Wl, [["__scopeId", "data-v-4dba94bf"]]), Zl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2028
+ __proto__: null,
2029
+ default: Yl
2030
+ }, Symbol.toStringTag, { value: "Module" })), _e = /* @__PURE__ */ Object.assign({ "../component/BtnGroup/index.vue": Re, "../component/Form/index.vue": qe, "../component/Frame/index.vue": $t, "../component/Icon/index.vue": wt, "../component/Input/index.vue": Tt, "../component/Page/index.vue": Kt, "../component/Select/index.vue": Rt, "../component/SelectV2/index.vue": Wt, "../component/Table/index.vue": Hl, "../component/Tabs/index.vue": Gl, "../component/Textarea/index.vue": Zl }), Ql = (h) => {
2031
+ for (let b in _e) {
2032
+ let l = b.match(/\.\.\/component\/(.*)\/index.vue/)[1];
2033
+ h.component(l, _e[b].default);
2034
+ }
2035
+ }, Xl = {
2036
+ name: "Matt Avias Frame",
2037
+ copyright: "©2026",
2038
+ version: "1.0.10",
2039
+ author: "Matt Avias",
2040
+ date: "2026-02-26",
2041
+ /** Table 等表格默认;业务在 app.use(mvframe, { config }) 里覆盖 */
2042
+ table: {
2043
+ /** 同 Table 的 summary-metric:{ [prop]: { unit, precision, currency } } 或 (prop) => metric */
2044
+ summaryMetric: null
2045
+ }
2046
+ }, eo = (h, b = {}) => {
2047
+ globalThis.$config = {
2048
+ ...Xl,
2049
+ ...b
2050
+ };
2051
+ }, co = (h, b) => {
2052
+ h.use(eo, b.config).use(Ql).use(ke).use(Te).use(Ve, b.pinia).use(Be, b.vueRouter);
2053
+ };
5
2054
  export {
6
- p as default
2055
+ co as default
7
2056
  };