xto-fronted 0.4.96 → 0.4.98

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.
@@ -0,0 +1,3145 @@
1
+ import { x as U, y as et, z as tt, A as st, B as ot, o as mt, C as at, D as Be, m as pt, i as vt, E as ht, F as _t } from "./user-Qd_jMBaH.js";
2
+ import { ref as g, computed as b, watch as Se, defineComponent as se, resolveComponent as nt, openBlock as s, createBlock as V, unref as a, withCtx as M, createElementBlock as c, Fragment as W, renderList as X, createElementVNode as e, toDisplayString as x, createCommentVNode as E, normalizeClass as Y, withDirectives as Te, vShow as ft, createVNode as y, createTextVNode as he, onMounted as Re, onUnmounted as Fe, vModelText as Ke, Transition as ye, withModifiers as Ee, normalizeStyle as Ne, reactive as We, createStaticVNode as Ue, withKeys as gt, h as yt } from "vue";
3
+ import { defineStore as Ie } from "pinia";
4
+ import { useRoute as we, useRouter as me, createRouter as je, createWebHistory as qe } from "vue-router";
5
+ import { SubMenu as Oe, MenuItem as Me, Menu as He, Tabs as kt, TabPane as wt } from "@xto/navigation";
6
+ import { Icon as N, Button as ke } from "@xto/base";
7
+ import { Drawer as Xe, Message as bt } from "@xto/feedback";
8
+ import { Form as xt, FormItem as Ae, Input as Je, Checkbox as Ct } from "@xto/form";
9
+ import { createLocaleProvider as $t, getSupportedLocales as Lt, useLocale as Mt } from "@xto/core/locale";
10
+ const pe = Ie("app", () => {
11
+ const t = g(U.get("appName") || "XTO App"), r = g(U.get("indexPath") || "/dashboard"), d = g(U.get("isDark") || !1), i = g(U.get("theme") || "light"), o = g(U.get("layout") || "sidebar"), l = g(U.get("isCollapsed") || !1), _ = g(U.get("showTabs") ?? !0), u = g(U.get("showFooter") ?? !0), f = g(U.get("showBreadcrumb") ?? !0), v = g(U.get("primaryColor") || "#409eff"), p = g([]), h = g([]), k = b(() => d.value ? "dark" : "light"), q = (z) => {
12
+ t.value = z, U.set("appName", z);
13
+ }, A = (z) => {
14
+ r.value = z, U.set("indexPath", z);
15
+ }, H = () => {
16
+ d.value = !d.value, i.value = d.value ? "dark" : "light", O();
17
+ }, R = (z) => {
18
+ i.value = z, d.value = z === "dark", O();
19
+ }, O = () => {
20
+ const z = document.documentElement;
21
+ d.value ? z.classList.add("dark") : z.classList.remove("dark"), U.set("isDark", d.value), U.set("theme", i.value);
22
+ }, P = () => {
23
+ l.value = !l.value, U.set("isCollapsed", l.value);
24
+ }, D = (z) => {
25
+ o.value = z, U.set("layout", z);
26
+ }, T = () => {
27
+ _.value = !_.value, U.set("showTabs", _.value);
28
+ }, F = () => {
29
+ u.value = !u.value, U.set("showFooter", u.value);
30
+ }, j = () => {
31
+ f.value = !f.value, U.set("showBreadcrumb", f.value);
32
+ }, G = (z) => {
33
+ v.value = z, document.documentElement.style.setProperty("--color-primary", z), U.set("primaryColor", z);
34
+ }, B = (z) => {
35
+ p.value.includes(z) || p.value.push(z);
36
+ }, J = (z) => {
37
+ const de = p.value.indexOf(z);
38
+ de > -1 && p.value.splice(de, 1);
39
+ }, Q = () => {
40
+ p.value = [];
41
+ }, ne = (z) => {
42
+ h.value = z;
43
+ }, ce = () => {
44
+ O(), v.value !== "#409eff" && document.documentElement.style.setProperty("--color-primary", v.value);
45
+ };
46
+ return Se(d, O), {
47
+ appName: t,
48
+ indexPath: r,
49
+ isDark: d,
50
+ theme: i,
51
+ layout: o,
52
+ isCollapsed: l,
53
+ showTabs: _,
54
+ showFooter: u,
55
+ showBreadcrumb: f,
56
+ primaryColor: v,
57
+ cachedViews: p,
58
+ mixSubMenus: h,
59
+ themeClass: k,
60
+ setAppName: q,
61
+ setIndexPath: A,
62
+ toggleTheme: H,
63
+ toggleCollapse: P,
64
+ setTheme: R,
65
+ setLayout: D,
66
+ toggleTabs: T,
67
+ toggleFooter: F,
68
+ toggleBreadcrumb: j,
69
+ setPrimaryColor: G,
70
+ addCachedView: B,
71
+ removeCachedView: J,
72
+ clearCachedViews: Q,
73
+ setMixSubMenus: ne,
74
+ initTheme: ce
75
+ };
76
+ }), Pe = "menu_list", De = "permission_list", St = {
77
+ menuCode: "home",
78
+ menuName: "首页",
79
+ menuUrl: "/dashboard",
80
+ icon: "home",
81
+ closable: !1,
82
+ isDefault: !1,
83
+ isOut: !1
84
+ };
85
+ function lt(t) {
86
+ return t.filter((r) => r.type !== 1).map((r) => ({
87
+ ...r,
88
+ children: r.children ? lt(r.children) : void 0
89
+ }));
90
+ }
91
+ function Nt(t) {
92
+ const r = [];
93
+ function d(i) {
94
+ i.forEach((o) => {
95
+ o.type === 1 && o.menuCode && r.push(o.menuCode), o.children && d(o.children);
96
+ });
97
+ }
98
+ return d(t), r;
99
+ }
100
+ const ie = Ie("menu", () => {
101
+ const t = g(U.get(Pe) || []), r = g(U.get(De) || []), d = b(() => t.value.length > 0);
102
+ return {
103
+ menuList: t,
104
+ permissions: r,
105
+ hasMenu: d,
106
+ setMenuList: (_) => {
107
+ r.value = Nt(_), U.set(De, r.value);
108
+ const u = lt(_);
109
+ t.value = [St, ...u], U.set(Pe, t.value);
110
+ },
111
+ clearMenu: () => {
112
+ t.value = [], r.value = [], U.remove(Pe), U.remove(De);
113
+ },
114
+ hasPermission: (_) => Array.isArray(_) ? _.some((u) => r.value.includes(u)) : r.value.includes(_)
115
+ };
116
+ }), Ve = "user_info", oe = Ie("user", () => {
117
+ const t = g(U.get(Ve)), r = b(() => !!t.value), d = b(() => {
118
+ var h;
119
+ return ((h = t.value) == null ? void 0 : h.userId) || "";
120
+ }), i = b(() => {
121
+ var h;
122
+ return ((h = t.value) == null ? void 0 : h.userName) || "";
123
+ }), o = b(() => {
124
+ var h;
125
+ return ((h = t.value) == null ? void 0 : h.departmentName) || "";
126
+ }), l = b(() => {
127
+ var h;
128
+ return ((h = t.value) == null ? void 0 : h.email) || "";
129
+ }), _ = b(() => {
130
+ var h;
131
+ return ((h = t.value) == null ? void 0 : h.mobilePhone) || "";
132
+ }), u = b(() => {
133
+ var h;
134
+ return ((h = t.value) == null ? void 0 : h.positionName) || "";
135
+ }), f = b(() => {
136
+ var h;
137
+ return ((h = t.value) == null ? void 0 : h.avatar) || "";
138
+ });
139
+ return {
140
+ userInfo: t,
141
+ isLoggedIn: r,
142
+ userId: d,
143
+ userName: i,
144
+ departmentName: o,
145
+ email: l,
146
+ mobilePhone: _,
147
+ positionName: u,
148
+ avatar: f,
149
+ setUserInfo: (h) => {
150
+ t.value = h, U.set(Ve, h);
151
+ },
152
+ clearUserInfo: () => {
153
+ t.value = null, U.remove(Ve);
154
+ }
155
+ };
156
+ }), ze = Ie("auth", () => {
157
+ const t = g(et()), r = b(() => tt()), d = g(""), i = g(""), o = g(""), l = g("/login");
158
+ return {
159
+ token: t,
160
+ isLoggedIn: r,
161
+ baseUrl: d,
162
+ appId: i,
163
+ clientId: o,
164
+ loginPath: l,
165
+ login: (k) => {
166
+ t.value = k.access_token, ot(k);
167
+ },
168
+ logout: () => {
169
+ t.value = null, st();
170
+ },
171
+ setBaseUrl: (k) => {
172
+ d.value = k;
173
+ },
174
+ setAppId: (k) => {
175
+ i.value = k;
176
+ },
177
+ setClientId: (k) => {
178
+ o.value = k;
179
+ },
180
+ setLoginPath: (k) => {
181
+ l.value = k;
182
+ }
183
+ };
184
+ }), It = { class: "menu-item__content" }, zt = { class: "menu-item__icon" }, Ut = {
185
+ key: 1,
186
+ class: "menu-item__char"
187
+ }, Tt = { class: "menu-item__text" }, Et = { class: "menu-item__content" }, At = {
188
+ key: 0,
189
+ class: "menu-item__icon"
190
+ }, Pt = {
191
+ key: 1,
192
+ class: "menu-item__char"
193
+ }, Dt = { class: "menu-item__text" }, Vt = /* @__PURE__ */ se({
194
+ __name: "SidebarMenuItem",
195
+ props: {
196
+ menu: {}
197
+ },
198
+ setup(t) {
199
+ const r = t, d = /* @__PURE__ */ new Set([
200
+ "arrow-up",
201
+ "arrow-down",
202
+ "arrow-left",
203
+ "arrow-right",
204
+ "caret-down",
205
+ "caret-right",
206
+ "plus",
207
+ "minus",
208
+ "close",
209
+ "check",
210
+ "edit",
211
+ "delete",
212
+ "copy",
213
+ "download",
214
+ "upload",
215
+ "refresh",
216
+ "search",
217
+ "filter",
218
+ "more",
219
+ "setting",
220
+ "share",
221
+ "loading",
222
+ "info",
223
+ "success",
224
+ "warning",
225
+ "error",
226
+ "question",
227
+ "user",
228
+ "user-add",
229
+ "user-group",
230
+ "logout",
231
+ "login",
232
+ "file",
233
+ "folder",
234
+ "folder-open",
235
+ "document",
236
+ "image",
237
+ "video",
238
+ "music",
239
+ "camera",
240
+ "mail",
241
+ "phone",
242
+ "chat",
243
+ "bell",
244
+ "message",
245
+ "eye",
246
+ "eye-off",
247
+ "calendar",
248
+ "clock",
249
+ "history",
250
+ "timer",
251
+ "location",
252
+ "map",
253
+ "globe",
254
+ "star",
255
+ "heart",
256
+ "thumb-up",
257
+ "link",
258
+ "external-link",
259
+ "lock",
260
+ "unlock",
261
+ "key",
262
+ "home",
263
+ "menu",
264
+ "menu-fold",
265
+ "menu-unfold",
266
+ "sidebar-fold",
267
+ "sidebar-expand",
268
+ "sidebar-left",
269
+ "dashboard",
270
+ "chart",
271
+ "chart-pie",
272
+ "chart-line",
273
+ "report",
274
+ "analytics",
275
+ "system",
276
+ "permission",
277
+ "role",
278
+ "user-manage",
279
+ "log",
280
+ "notification",
281
+ "app",
282
+ "list",
283
+ "grid",
284
+ "fullscreen",
285
+ "fullscreen-exit",
286
+ "zoom-in",
287
+ "zoom-out",
288
+ "print",
289
+ "bookmark",
290
+ "tag",
291
+ "code",
292
+ "terminal",
293
+ "database",
294
+ "server",
295
+ "cloud",
296
+ "gift",
297
+ "moon",
298
+ "sun",
299
+ "theme",
300
+ "skin"
301
+ ]), i = (u) => {
302
+ if (!u || u === "") return "";
303
+ if (u.startsWith("tineco-icon-")) {
304
+ const v = u.replace("tineco-icon-", "");
305
+ return {
306
+ home: "home",
307
+ dashboard: "dashboard",
308
+ system: "system",
309
+ user: "user",
310
+ role: "role",
311
+ menu: "list",
312
+ setting: "setting",
313
+ file: "file",
314
+ folder: "folder",
315
+ chart: "chart",
316
+ report: "report",
317
+ analytics: "analytics"
318
+ }[v] || v;
319
+ }
320
+ return {
321
+ dashboard: "dashboard",
322
+ system: "system",
323
+ user: "user",
324
+ role: "role",
325
+ menu: "list",
326
+ setting: "setting",
327
+ home: "home",
328
+ chart: "chart",
329
+ report: "report",
330
+ analytics: "analytics",
331
+ permission: "permission",
332
+ log: "log",
333
+ notification: "notification",
334
+ app: "app",
335
+ list: "list",
336
+ grid: "grid"
337
+ }[u] || u;
338
+ }, o = (u) => u ? u.charAt(0) : "", l = (u) => d.has(u), _ = b(() => r.menu.children && r.menu.children.length > 0);
339
+ return (u, f) => {
340
+ const v = nt("SidebarMenuItem", !0);
341
+ return _.value ? (s(), V(a(Oe), {
342
+ key: 0,
343
+ index: t.menu.menuUrl
344
+ }, {
345
+ title: M(() => [
346
+ e("span", It, [
347
+ e("span", zt, [
348
+ l(i(t.menu.icon)) ? (s(), V(a(N), {
349
+ key: 0,
350
+ name: i(t.menu.icon),
351
+ size: 16
352
+ }, null, 8, ["name"])) : (s(), c("span", Ut, x(o(t.menu.menuName)), 1))
353
+ ]),
354
+ e("span", Tt, x(t.menu.menuName), 1)
355
+ ])
356
+ ]),
357
+ default: M(() => [
358
+ (s(!0), c(W, null, X(t.menu.children, (p) => (s(), V(v, {
359
+ key: p.menuUrl,
360
+ menu: p
361
+ }, null, 8, ["menu"]))), 128))
362
+ ]),
363
+ _: 1
364
+ }, 8, ["index"])) : (s(), V(a(Me), {
365
+ key: 1,
366
+ index: t.menu.menuUrl
367
+ }, {
368
+ default: M(() => [
369
+ e("span", Et, [
370
+ t.menu.menuName !== "首页" ? (s(), c("span", At, [
371
+ l(i(t.menu.icon)) ? (s(), V(a(N), {
372
+ key: 0,
373
+ name: i(t.menu.icon),
374
+ size: 16
375
+ }, null, 8, ["name"])) : (s(), c("span", Pt, x(o(t.menu.menuName)), 1))
376
+ ])) : E("", !0),
377
+ e("span", Dt, x(t.menu.menuName), 1)
378
+ ])
379
+ ]),
380
+ _: 1
381
+ }, 8, ["index"]));
382
+ };
383
+ }
384
+ }), ae = (t, r) => {
385
+ const d = t.__vccOpts || t;
386
+ for (const [i, o] of r)
387
+ d[i] = o;
388
+ return d;
389
+ }, Ot = /* @__PURE__ */ ae(Vt, [["__scopeId", "data-v-27c9479b"]]), Bt = {
390
+ key: 0,
391
+ class: "sidebar__logo"
392
+ }, Rt = ["src"], Ft = {
393
+ key: 1,
394
+ class: "sidebar__user"
395
+ }, Kt = { class: "sidebar__user-info" }, Wt = { class: "sidebar__user-name" }, jt = { class: "sidebar__user-role" }, Ze = "sidebar_opened_menus", qt = /* @__PURE__ */ se({
396
+ __name: "Sidebar",
397
+ props: {
398
+ menuList: { default: () => [] },
399
+ showLogo: { type: Boolean, default: !0 },
400
+ showUser: { type: Boolean, default: !0 },
401
+ logoSrc: { default: "/vite.svg" }
402
+ },
403
+ setup(t) {
404
+ const r = t, d = we(), i = me(), o = ie(), l = oe(), _ = ze(), u = pe(), f = b(() => r.menuList.length > 0 ? r.menuList : o.menuList), v = b(() => u.isCollapsed), p = b(() => d.path), h = g(U.get(Ze) || []);
405
+ Se(h, (P) => {
406
+ U.set(Ze, P);
407
+ }, { deep: !0 });
408
+ const k = (P, D, T = []) => {
409
+ var F;
410
+ for (const j of P) {
411
+ if (D === j.menuUrl || D.startsWith(j.menuUrl + "/"))
412
+ return [...T, j.menuUrl];
413
+ if ((F = j.children) != null && F.length) {
414
+ const G = k(j.children, D, [...T, j.menuUrl]);
415
+ if (G) return G;
416
+ }
417
+ }
418
+ return null;
419
+ };
420
+ Se([() => d.path, f], ([P, D]) => {
421
+ if (D.length > 0) {
422
+ const T = k(D, P);
423
+ if (T) {
424
+ const F = T.slice(0, -1), j = /* @__PURE__ */ new Set([...h.value, ...F]);
425
+ h.value = Array.from(j);
426
+ }
427
+ }
428
+ }, { immediate: !0 });
429
+ const q = b(() => u.isDark ? "#1d1e1f" : "#fff"), A = b(() => u.isDark ? "#cfd3dc" : "#303133"), H = b(() => "#409eff"), R = (P) => {
430
+ P && P !== d.path && i.push(P);
431
+ }, O = () => {
432
+ _.logout(), l.clearUserInfo(), o.clearMenu(), i.push("/login");
433
+ };
434
+ return (P, D) => (s(), c("div", {
435
+ class: Y(["sidebar", { "sidebar--collapsed": v.value }])
436
+ }, [
437
+ r.showLogo ? (s(), c("div", Bt, [
438
+ e("img", {
439
+ src: r.logoSrc,
440
+ alt: "Logo",
441
+ class: "sidebar__logo-img"
442
+ }, null, 8, Rt),
443
+ Te(e("span", { class: "sidebar__logo-text" }, x(a(u).appName), 513), [
444
+ [ft, !v.value]
445
+ ])
446
+ ])) : E("", !0),
447
+ y(a(He), {
448
+ modelValue: p.value,
449
+ "onUpdate:modelValue": D[0] || (D[0] = (T) => p.value = T),
450
+ openeds: h.value,
451
+ "onUpdate:openeds": D[1] || (D[1] = (T) => h.value = T),
452
+ mode: "vertical",
453
+ collapse: v.value,
454
+ "collapse-transition": !1,
455
+ "background-color": q.value,
456
+ "text-color": A.value,
457
+ "active-text-color": H.value,
458
+ class: "sidebar__menu",
459
+ onSelect: R
460
+ }, {
461
+ default: M(() => [
462
+ (s(!0), c(W, null, X(f.value, (T) => (s(), V(Ot, {
463
+ key: T.menuUrl,
464
+ menu: T
465
+ }, null, 8, ["menu"]))), 128))
466
+ ]),
467
+ _: 1
468
+ }, 8, ["modelValue", "openeds", "collapse", "background-color", "text-color", "active-text-color"]),
469
+ r.showUser && !v.value ? (s(), c("div", Ft, [
470
+ e("div", Kt, [
471
+ e("span", Wt, x(a(l).userName), 1),
472
+ e("span", jt, x(a(l).departmentName), 1)
473
+ ]),
474
+ y(a(ke), {
475
+ type: "text",
476
+ size: "small",
477
+ onClick: O
478
+ }, {
479
+ default: M(() => [...D[2] || (D[2] = [
480
+ he("退出", -1)
481
+ ])]),
482
+ _: 1
483
+ })
484
+ ])) : E("", !0)
485
+ ], 2));
486
+ }
487
+ }), Qe = /* @__PURE__ */ ae(qt, [["__scopeId", "data-v-9cdb8060"]]), Ht = { class: "header" }, Xt = { class: "header__left" }, Yt = {
488
+ key: 0,
489
+ class: "header__breadcrumb"
490
+ }, Gt = {
491
+ key: 0,
492
+ class: "breadcrumb-separator"
493
+ }, Jt = { class: "header__right" }, Zt = {
494
+ key: 0,
495
+ class: "header__search-dropdown"
496
+ }, Qt = {
497
+ key: 0,
498
+ class: "header__search-results"
499
+ }, es = ["onClick"], ts = {
500
+ key: 0,
501
+ class: "header__search-icon"
502
+ }, ss = {
503
+ key: 1,
504
+ class: "header__search-char"
505
+ }, os = { class: "header__search-item-title" }, as = {
506
+ key: 1,
507
+ class: "header__search-item-parent"
508
+ }, ns = {
509
+ key: 1,
510
+ class: "header__search-empty"
511
+ }, ls = ["title"], rs = { class: "header__avatar" }, is = { class: "header__user-name" }, cs = {
512
+ key: 0,
513
+ class: "header__dropdown"
514
+ }, ds = { class: "header__dropdown-header" }, us = { class: "header__dropdown-avatar" }, ms = { class: "header__dropdown-info" }, ps = { class: "header__dropdown-name" }, vs = { class: "header__dropdown-role" }, hs = { class: "header__dropdown-menu" }, _s = { class: "settings-drawer" }, fs = { class: "settings-section" }, gs = { class: "settings-layout-options" }, ys = ["onClick"], ks = { class: "layout-option__preview" }, ws = {
515
+ key: 0,
516
+ class: "layout-preview-sidebar"
517
+ }, bs = {
518
+ key: 1,
519
+ class: "layout-preview-top"
520
+ }, xs = {
521
+ key: 2,
522
+ class: "layout-preview-mix"
523
+ }, Cs = { class: "layout-option__label" }, $s = { class: "settings-section" }, Ls = { class: "settings-color-options" }, Ms = ["title", "onClick"], Ss = { class: "settings-section" }, Ns = { class: "settings-switch-list" }, Is = { class: "settings-switch-item" }, zs = { class: "settings-switch-item" }, Us = /* @__PURE__ */ se({
524
+ __name: "Header",
525
+ setup(t) {
526
+ const r = we(), d = me(), i = pe(), o = oe(), l = ze(), _ = ie(), u = g(!1), f = g(!1), v = g(null), p = g(!1), h = g(!1), k = g(""), q = g(null), A = g(!1), H = [
527
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
528
+ { value: "top", label: "顶部菜单", icon: "menu" },
529
+ { value: "mix", label: "混合菜单", icon: "grid" }
530
+ ], R = [
531
+ { value: "#409eff", label: "默认蓝" },
532
+ { value: "#1890ff", label: "科技蓝" },
533
+ { value: "#52c41a", label: "极光绿" },
534
+ { value: "#faad14", label: "日落橙" },
535
+ { value: "#f5222d", label: "薄暮红" },
536
+ { value: "#722ed1", label: "酱紫" }
537
+ ], O = b(() => r.matched.filter((w) => w.meta && w.meta.title).map((w) => ({
538
+ title: w.meta.title,
539
+ path: w.path
540
+ }))), P = (I, w = "") => {
541
+ const Z = [];
542
+ return I.forEach((C) => {
543
+ C.children && C.children.length > 0 ? Z.push(...P(C.children, C.menuName)) : Z.push({ ...C, parentTitle: w, title: C.menuName, path: C.menuUrl });
544
+ }), Z;
545
+ }, D = /* @__PURE__ */ new Set([
546
+ "arrow-up",
547
+ "arrow-down",
548
+ "arrow-left",
549
+ "arrow-right",
550
+ "caret-down",
551
+ "caret-right",
552
+ "plus",
553
+ "minus",
554
+ "close",
555
+ "check",
556
+ "edit",
557
+ "delete",
558
+ "copy",
559
+ "download",
560
+ "upload",
561
+ "refresh",
562
+ "search",
563
+ "filter",
564
+ "more",
565
+ "setting",
566
+ "share",
567
+ "loading",
568
+ "info",
569
+ "success",
570
+ "warning",
571
+ "error",
572
+ "question",
573
+ "user",
574
+ "user-add",
575
+ "user-group",
576
+ "logout",
577
+ "login",
578
+ "file",
579
+ "folder",
580
+ "folder-open",
581
+ "document",
582
+ "image",
583
+ "video",
584
+ "music",
585
+ "camera",
586
+ "mail",
587
+ "phone",
588
+ "chat",
589
+ "bell",
590
+ "message",
591
+ "eye",
592
+ "eye-off",
593
+ "calendar",
594
+ "clock",
595
+ "history",
596
+ "timer",
597
+ "location",
598
+ "map",
599
+ "globe",
600
+ "star",
601
+ "heart",
602
+ "thumb-up",
603
+ "link",
604
+ "external-link",
605
+ "lock",
606
+ "unlock",
607
+ "key",
608
+ "home",
609
+ "menu",
610
+ "menu-fold",
611
+ "menu-unfold",
612
+ "sidebar-fold",
613
+ "sidebar-expand",
614
+ "sidebar-left",
615
+ "dashboard",
616
+ "chart",
617
+ "chart-pie",
618
+ "chart-line",
619
+ "report",
620
+ "analytics",
621
+ "system",
622
+ "permission",
623
+ "role",
624
+ "user-manage",
625
+ "log",
626
+ "notification",
627
+ "app",
628
+ "list",
629
+ "grid",
630
+ "fullscreen",
631
+ "fullscreen-exit",
632
+ "zoom-in",
633
+ "zoom-out",
634
+ "print",
635
+ "bookmark",
636
+ "tag",
637
+ "code",
638
+ "terminal",
639
+ "database",
640
+ "server",
641
+ "cloud",
642
+ "gift",
643
+ "moon",
644
+ "sun",
645
+ "theme",
646
+ "skin"
647
+ ]), T = (I) => {
648
+ if (!I || I === "") return "";
649
+ if (I.startsWith("tineco-icon-")) {
650
+ const Z = I.replace("tineco-icon-", "");
651
+ return {
652
+ home: "home",
653
+ dashboard: "dashboard",
654
+ system: "system",
655
+ user: "user",
656
+ role: "role",
657
+ menu: "list",
658
+ setting: "setting",
659
+ file: "file",
660
+ folder: "folder",
661
+ chart: "chart",
662
+ report: "report",
663
+ analytics: "analytics"
664
+ }[Z] || Z;
665
+ }
666
+ return {
667
+ dashboard: "dashboard",
668
+ system: "system",
669
+ user: "user",
670
+ role: "role",
671
+ menu: "list",
672
+ setting: "setting",
673
+ home: "home",
674
+ chart: "chart",
675
+ report: "report",
676
+ analytics: "analytics",
677
+ permission: "permission",
678
+ log: "log",
679
+ notification: "notification",
680
+ app: "app",
681
+ list: "list",
682
+ grid: "grid"
683
+ }[I] || I;
684
+ }, F = (I) => I ? I.charAt(0) : "", j = (I) => D.has(I), G = b(() => k.value.trim() ? P(_.menuList).filter(
685
+ (w) => w.title.toLowerCase().includes(k.value.toLowerCase())
686
+ ) : []), B = b(() => i.layout), J = () => {
687
+ i.toggleCollapse();
688
+ }, Q = () => {
689
+ i.toggleTheme();
690
+ }, ne = () => {
691
+ f.value = !0;
692
+ }, ce = (I) => {
693
+ i.setLayout(I), f.value = !1;
694
+ }, z = (I) => {
695
+ A.value = I;
696
+ const w = document.documentElement;
697
+ I ? w.classList.add("grey-mode") : w.classList.remove("grey-mode");
698
+ }, de = () => {
699
+ z(!A.value), f.value = !1;
700
+ }, le = () => {
701
+ i.toggleTheme(), f.value = !1;
702
+ }, ue = () => {
703
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
704
+ }, _e = () => {
705
+ p.value = !!document.fullscreenElement;
706
+ }, re = () => {
707
+ u.value = !u.value;
708
+ }, te = () => {
709
+ u.value = !1;
710
+ }, ve = () => {
711
+ h.value = !1, k.value = "";
712
+ }, be = (I) => {
713
+ d.push(I), ve();
714
+ }, xe = (I) => {
715
+ i.setPrimaryColor(I), f.value = !1;
716
+ }, Ce = () => {
717
+ te(), d.push("/profile");
718
+ }, $e = () => {
719
+ te(), d.push("/change-password");
720
+ }, Le = () => {
721
+ te(), l.logout(), o.clearUserInfo(), _.clearMenu(), d.push("/login");
722
+ }, fe = (I) => {
723
+ v.value && !v.value.contains(I.target) && te(), q.value && !q.value.contains(I.target) && ve();
724
+ }, ge = (I) => {
725
+ I.key === "Escape" && (ve(), te());
726
+ };
727
+ return Re(() => {
728
+ document.addEventListener("click", fe), document.addEventListener("fullscreenchange", _e), document.addEventListener("keydown", ge), i.initTheme(), A.value = document.documentElement.classList.contains("grey-mode");
729
+ }), Fe(() => {
730
+ document.removeEventListener("click", fe), document.removeEventListener("fullscreenchange", _e), document.removeEventListener("keydown", ge);
731
+ }), (I, w) => {
732
+ var Z;
733
+ return s(), c("div", Ht, [
734
+ e("div", Xt, [
735
+ e("div", {
736
+ class: "header__collapse",
737
+ onClick: J
738
+ }, [
739
+ y(a(N), {
740
+ name: a(i).isCollapsed ? "menu-unfold" : "menu-fold",
741
+ size: 18
742
+ }, null, 8, ["name"])
743
+ ]),
744
+ a(i).showBreadcrumb ? (s(), c("div", Yt, [
745
+ (s(!0), c(W, null, X(O.value, (C, S) => (s(), c("span", {
746
+ key: C.path
747
+ }, [
748
+ S > 0 ? (s(), c("span", Gt, "/")) : E("", !0),
749
+ e("span", {
750
+ class: Y({ "is-current": S === O.value.length - 1 })
751
+ }, x(C.title), 3)
752
+ ]))), 128))
753
+ ])) : E("", !0)
754
+ ]),
755
+ e("div", Jt, [
756
+ e("div", {
757
+ class: "header__search",
758
+ ref_key: "searchRef",
759
+ ref: q
760
+ }, [
761
+ y(a(N), {
762
+ name: "search",
763
+ size: 14,
764
+ class: "header__search-icon"
765
+ }),
766
+ Te(e("input", {
767
+ "onUpdate:modelValue": w[0] || (w[0] = (C) => k.value = C),
768
+ type: "text",
769
+ class: "header__search-input",
770
+ placeholder: "搜索菜单...",
771
+ onFocus: w[1] || (w[1] = (C) => h.value = !0)
772
+ }, null, 544), [
773
+ [Ke, k.value]
774
+ ]),
775
+ y(ye, { name: "search-dropdown" }, {
776
+ default: M(() => [
777
+ h.value && (G.value.length > 0 || k.value) ? (s(), c("div", Zt, [
778
+ G.value.length > 0 ? (s(), c("div", Qt, [
779
+ (s(!0), c(W, null, X(G.value, (C) => (s(), c("div", {
780
+ key: C.path,
781
+ class: "header__search-item",
782
+ onClick: (S) => be(C.path)
783
+ }, [
784
+ C.title !== "首页" ? (s(), c("span", ts, [
785
+ j(T(C.icon)) ? (s(), V(a(N), {
786
+ key: 0,
787
+ name: T(C.icon),
788
+ size: 16
789
+ }, null, 8, ["name"])) : (s(), c("span", ss, x(F(C.title)), 1))
790
+ ])) : E("", !0),
791
+ e("span", os, x(C.title), 1),
792
+ C.parentTitle ? (s(), c("span", as, x(C.parentTitle), 1)) : E("", !0)
793
+ ], 8, es))), 128))
794
+ ])) : (s(), c("div", ns, " 未找到匹配的菜单 "))
795
+ ])) : E("", !0)
796
+ ]),
797
+ _: 1
798
+ })
799
+ ], 512),
800
+ e("div", {
801
+ class: "header__action",
802
+ onClick: ue,
803
+ title: p.value ? "退出全屏" : "全屏"
804
+ }, [
805
+ y(a(N), {
806
+ name: p.value ? "fullscreen-exit" : "fullscreen",
807
+ size: 16
808
+ }, null, 8, ["name"])
809
+ ], 8, ls),
810
+ e("div", {
811
+ class: "header__action",
812
+ onClick: ne,
813
+ title: "换肤设置"
814
+ }, [
815
+ y(a(N), {
816
+ name: "skin",
817
+ size: 16
818
+ })
819
+ ]),
820
+ e("div", {
821
+ class: "header__action",
822
+ onClick: Q,
823
+ title: "切换主题"
824
+ }, [
825
+ y(a(N), {
826
+ name: a(i).isDark ? "sun" : "moon",
827
+ size: 16
828
+ }, null, 8, ["name"])
829
+ ]),
830
+ e("div", {
831
+ class: "header__user",
832
+ ref_key: "dropdownRef",
833
+ ref: v
834
+ }, [
835
+ e("div", {
836
+ class: "header__user-trigger",
837
+ onClick: Ee(re, ["stop"])
838
+ }, [
839
+ e("div", rs, [
840
+ e("span", null, x(((Z = a(o).userName) == null ? void 0 : Z.charAt(0)) || "U"), 1)
841
+ ]),
842
+ e("span", is, x(a(o).userName), 1),
843
+ e("span", {
844
+ class: Y(["header__user-arrow", { "is-active": u.value }])
845
+ }, "▼", 2)
846
+ ]),
847
+ y(ye, { name: "dropdown" }, {
848
+ default: M(() => {
849
+ var C;
850
+ return [
851
+ u.value ? (s(), c("div", cs, [
852
+ e("div", ds, [
853
+ e("div", us, [
854
+ e("span", null, x(((C = a(o).userName) == null ? void 0 : C.charAt(0)) || "U"), 1)
855
+ ]),
856
+ e("div", ms, [
857
+ e("div", ps, x(a(o).userName), 1),
858
+ e("div", vs, x(a(o).departmentName), 1)
859
+ ])
860
+ ]),
861
+ w[7] || (w[7] = e("div", { class: "header__dropdown-divider" }, null, -1)),
862
+ e("div", hs, [
863
+ e("div", {
864
+ class: "header__dropdown-item",
865
+ onClick: Ce
866
+ }, [
867
+ y(a(N), {
868
+ name: "user",
869
+ size: 16
870
+ }),
871
+ w[3] || (w[3] = e("span", null, "个人信息", -1))
872
+ ]),
873
+ e("div", {
874
+ class: "header__dropdown-item",
875
+ onClick: $e
876
+ }, [
877
+ y(a(N), {
878
+ name: "lock",
879
+ size: 16
880
+ }),
881
+ w[4] || (w[4] = e("span", null, "修改密码", -1))
882
+ ]),
883
+ w[6] || (w[6] = e("div", { class: "header__dropdown-divider" }, null, -1)),
884
+ e("div", {
885
+ class: "header__dropdown-item header__dropdown-item--danger",
886
+ onClick: Le
887
+ }, [
888
+ y(a(N), {
889
+ name: "logout",
890
+ size: 16
891
+ }),
892
+ w[5] || (w[5] = e("span", null, "退出登录", -1))
893
+ ])
894
+ ])
895
+ ])) : E("", !0)
896
+ ];
897
+ }),
898
+ _: 1
899
+ })
900
+ ], 512)
901
+ ]),
902
+ y(a(Xe), {
903
+ modelValue: f.value,
904
+ "onUpdate:modelValue": w[2] || (w[2] = (C) => f.value = C),
905
+ title: "换肤设置",
906
+ direction: "rtl",
907
+ size: "320px"
908
+ }, {
909
+ default: M(() => [
910
+ e("div", _s, [
911
+ e("div", fs, [
912
+ w[11] || (w[11] = e("div", { class: "settings-title" }, "布局模式", -1)),
913
+ e("div", gs, [
914
+ (s(), c(W, null, X(H, (C) => e("div", {
915
+ key: C.value,
916
+ class: Y(["layout-option", { "is-active": B.value === C.value }]),
917
+ onClick: (S) => ce(C.value)
918
+ }, [
919
+ e("div", ks, [
920
+ C.value === "sidebar" ? (s(), c("div", ws, [...w[8] || (w[8] = [
921
+ e("div", { class: "preview-aside" }, null, -1),
922
+ e("div", { class: "preview-main" }, [
923
+ e("div", { class: "preview-header" }),
924
+ e("div", { class: "preview-content" })
925
+ ], -1)
926
+ ])])) : C.value === "top" ? (s(), c("div", bs, [...w[9] || (w[9] = [
927
+ e("div", { class: "preview-header-full" }, null, -1),
928
+ e("div", { class: "preview-content-full" }, null, -1)
929
+ ])])) : (s(), c("div", xs, [...w[10] || (w[10] = [
930
+ e("div", { class: "preview-header-mix" }, [
931
+ e("div", { class: "preview-mix-left" })
932
+ ], -1),
933
+ e("div", { class: "preview-mix-body" }, [
934
+ e("div", { class: "preview-mix-aside" }),
935
+ e("div", { class: "preview-mix-content" })
936
+ ], -1)
937
+ ])]))
938
+ ]),
939
+ e("span", Cs, x(C.label), 1)
940
+ ], 10, ys)), 64))
941
+ ])
942
+ ]),
943
+ e("div", $s, [
944
+ w[12] || (w[12] = e("div", { class: "settings-title" }, "主题色", -1)),
945
+ e("div", Ls, [
946
+ (s(), c(W, null, X(R, (C) => e("div", {
947
+ key: C.value,
948
+ class: Y(["color-option", { "is-active": a(i).primaryColor === C.value }]),
949
+ style: Ne({ backgroundColor: C.value }),
950
+ title: C.label,
951
+ onClick: (S) => xe(C.value)
952
+ }, [
953
+ a(i).primaryColor === C.value ? (s(), V(a(N), {
954
+ key: 0,
955
+ name: "check",
956
+ size: 12,
957
+ color: "#fff"
958
+ })) : E("", !0)
959
+ ], 14, Ms)), 64))
960
+ ])
961
+ ]),
962
+ e("div", Ss, [
963
+ w[17] || (w[17] = e("div", { class: "settings-title" }, "功能设置", -1)),
964
+ e("div", Ns, [
965
+ e("div", Is, [
966
+ w[14] || (w[14] = e("span", null, "灰色模式", -1)),
967
+ e("div", {
968
+ class: Y(["switch-wrapper", { "is-checked": A.value }]),
969
+ onClick: de
970
+ }, [...w[13] || (w[13] = [
971
+ e("span", { class: "switch-core" }, null, -1)
972
+ ])], 2)
973
+ ]),
974
+ e("div", zs, [
975
+ w[16] || (w[16] = e("span", null, "暗黑模式", -1)),
976
+ e("div", {
977
+ class: Y(["switch-wrapper", { "is-checked": a(i).isDark }]),
978
+ onClick: le
979
+ }, [...w[15] || (w[15] = [
980
+ e("span", { class: "switch-core" }, null, -1)
981
+ ])], 2)
982
+ ])
983
+ ])
984
+ ])
985
+ ])
986
+ ]),
987
+ _: 1
988
+ }, 8, ["modelValue"])
989
+ ]);
990
+ };
991
+ }
992
+ }), Ts = /* @__PURE__ */ ae(Us, [["__scopeId", "data-v-89179947"]]), Es = { class: "top-menu" }, As = { class: "top-menu__logo" }, Ps = ["src"], Ds = { class: "top-menu__logo-text" }, Vs = { class: "top-menu__menu-content" }, Os = {
993
+ key: 0,
994
+ class: "top-menu__menu-icon"
995
+ }, Bs = {
996
+ key: 1,
997
+ class: "top-menu__menu-char"
998
+ }, Rs = { class: "top-menu__menu-text" }, Fs = { class: "top-menu__menu-content" }, Ks = { class: "top-menu__menu-icon" }, Ws = {
999
+ key: 1,
1000
+ class: "top-menu__menu-char"
1001
+ }, js = { class: "top-menu__menu-text" }, qs = { class: "top-menu__menu-content" }, Hs = { class: "top-menu__menu-icon" }, Xs = {
1002
+ key: 1,
1003
+ class: "top-menu__menu-char"
1004
+ }, Ys = { class: "top-menu__menu-text" }, Gs = { class: "top-menu__menu-content" }, Js = { class: "top-menu__menu-icon" }, Zs = {
1005
+ key: 1,
1006
+ class: "top-menu__menu-char"
1007
+ }, Qs = { class: "top-menu__menu-text" }, eo = { class: "top-menu__menu-content" }, to = {
1008
+ key: 0,
1009
+ class: "top-menu__menu-icon"
1010
+ }, so = {
1011
+ key: 1,
1012
+ class: "top-menu__menu-char"
1013
+ }, oo = { class: "top-menu__menu-text" }, ao = { class: "top-menu__actions" }, no = {
1014
+ key: 0,
1015
+ class: "top-menu__search-dropdown"
1016
+ }, lo = {
1017
+ key: 0,
1018
+ class: "top-menu__search-results"
1019
+ }, ro = ["onClick"], io = {
1020
+ key: 0,
1021
+ class: "top-menu__search-icon-item"
1022
+ }, co = {
1023
+ key: 1,
1024
+ class: "top-menu__search-char"
1025
+ }, uo = { class: "top-menu__search-item-title" }, mo = {
1026
+ key: 1,
1027
+ class: "top-menu__search-item-parent"
1028
+ }, po = {
1029
+ key: 1,
1030
+ class: "top-menu__search-empty"
1031
+ }, vo = ["title"], ho = { class: "top-menu__avatar" }, _o = { class: "top-menu__user-name" }, fo = {
1032
+ key: 0,
1033
+ class: "top-menu__dropdown"
1034
+ }, go = { class: "top-menu__dropdown-header" }, yo = { class: "top-menu__dropdown-avatar" }, ko = { class: "top-menu__dropdown-info" }, wo = { class: "top-menu__dropdown-name" }, bo = { class: "top-menu__dropdown-role" }, xo = { class: "top-menu__dropdown-menu" }, Co = { class: "settings-drawer" }, $o = { class: "settings-section" }, Lo = { class: "settings-layout-options" }, Mo = ["onClick"], So = { class: "layout-option__preview" }, No = {
1035
+ key: 0,
1036
+ class: "layout-preview-sidebar"
1037
+ }, Io = {
1038
+ key: 1,
1039
+ class: "layout-preview-top"
1040
+ }, zo = {
1041
+ key: 2,
1042
+ class: "layout-preview-mix"
1043
+ }, Uo = { class: "layout-option__label" }, To = { class: "settings-section" }, Eo = { class: "settings-color-options" }, Ao = ["title", "onClick"], Po = { class: "settings-section" }, Do = { class: "settings-switch-list" }, Vo = { class: "settings-switch-item" }, Oo = { class: "settings-switch-item" }, Bo = /* @__PURE__ */ se({
1044
+ __name: "TopMenu",
1045
+ props: {
1046
+ logoSrc: { default: "/vite.svg" }
1047
+ },
1048
+ setup(t) {
1049
+ const r = t, d = we(), i = me(), o = ie(), l = pe(), _ = oe(), u = ze(), f = b(() => d.path), v = (S, L = "") => {
1050
+ const ee = [];
1051
+ return S.forEach((n) => {
1052
+ n.children && n.children.length > 0 ? ee.push(...v(n.children, n.menuName)) : ee.push({ ...n, parentTitle: L, title: n.menuName, path: n.menuUrl });
1053
+ }), ee;
1054
+ }, p = b(() => T.value.trim() ? v(o.menuList).filter(
1055
+ (L) => L.title.toLowerCase().includes(T.value.toLowerCase())
1056
+ ) : []), h = b(() => l.isDark ? "#1d1e1f" : "#fff"), k = b(() => l.isDark ? "#cfd3dc" : "#303133"), q = b(() => "#409eff"), A = g(!1), H = g(null), R = g(!1), O = g(!1), P = g(!1), D = g(!1), T = g(""), F = g(null), j = (S) => {
1057
+ S && S !== d.path && i.push(S);
1058
+ }, G = /* @__PURE__ */ new Set([
1059
+ "arrow-up",
1060
+ "arrow-down",
1061
+ "arrow-left",
1062
+ "arrow-right",
1063
+ "caret-down",
1064
+ "caret-right",
1065
+ "plus",
1066
+ "minus",
1067
+ "close",
1068
+ "check",
1069
+ "edit",
1070
+ "delete",
1071
+ "copy",
1072
+ "download",
1073
+ "upload",
1074
+ "refresh",
1075
+ "search",
1076
+ "filter",
1077
+ "more",
1078
+ "setting",
1079
+ "share",
1080
+ "loading",
1081
+ "info",
1082
+ "success",
1083
+ "warning",
1084
+ "error",
1085
+ "question",
1086
+ "user",
1087
+ "user-add",
1088
+ "user-group",
1089
+ "logout",
1090
+ "login",
1091
+ "file",
1092
+ "folder",
1093
+ "folder-open",
1094
+ "document",
1095
+ "image",
1096
+ "video",
1097
+ "music",
1098
+ "camera",
1099
+ "mail",
1100
+ "phone",
1101
+ "chat",
1102
+ "bell",
1103
+ "message",
1104
+ "eye",
1105
+ "eye-off",
1106
+ "calendar",
1107
+ "clock",
1108
+ "history",
1109
+ "timer",
1110
+ "location",
1111
+ "map",
1112
+ "globe",
1113
+ "star",
1114
+ "heart",
1115
+ "thumb-up",
1116
+ "link",
1117
+ "external-link",
1118
+ "lock",
1119
+ "unlock",
1120
+ "key",
1121
+ "home",
1122
+ "menu",
1123
+ "menu-fold",
1124
+ "menu-unfold",
1125
+ "sidebar-fold",
1126
+ "sidebar-expand",
1127
+ "sidebar-left",
1128
+ "dashboard",
1129
+ "chart",
1130
+ "chart-pie",
1131
+ "chart-line",
1132
+ "report",
1133
+ "analytics",
1134
+ "system",
1135
+ "permission",
1136
+ "role",
1137
+ "user-manage",
1138
+ "log",
1139
+ "notification",
1140
+ "app",
1141
+ "list",
1142
+ "grid",
1143
+ "fullscreen",
1144
+ "fullscreen-exit",
1145
+ "zoom-in",
1146
+ "zoom-out",
1147
+ "print",
1148
+ "bookmark",
1149
+ "tag",
1150
+ "code",
1151
+ "terminal",
1152
+ "database",
1153
+ "server",
1154
+ "cloud",
1155
+ "gift",
1156
+ "moon",
1157
+ "sun",
1158
+ "theme",
1159
+ "skin"
1160
+ ]), B = (S) => {
1161
+ if (!S || S === "") return "";
1162
+ if (S.startsWith("tineco-icon-")) {
1163
+ const ee = S.replace("tineco-icon-", "");
1164
+ return {
1165
+ home: "home",
1166
+ dashboard: "dashboard",
1167
+ system: "system",
1168
+ user: "user",
1169
+ role: "role",
1170
+ menu: "list",
1171
+ setting: "setting",
1172
+ file: "file",
1173
+ folder: "folder",
1174
+ chart: "chart",
1175
+ report: "report",
1176
+ analytics: "analytics"
1177
+ }[ee] || ee;
1178
+ }
1179
+ return {
1180
+ dashboard: "dashboard",
1181
+ system: "system",
1182
+ user: "user",
1183
+ role: "role",
1184
+ menu: "list",
1185
+ setting: "setting",
1186
+ home: "home",
1187
+ chart: "chart",
1188
+ report: "report",
1189
+ analytics: "analytics",
1190
+ permission: "permission",
1191
+ log: "log",
1192
+ notification: "notification",
1193
+ app: "app",
1194
+ list: "list",
1195
+ grid: "grid"
1196
+ }[S] || S;
1197
+ }, J = (S) => S ? S.charAt(0) : "", Q = (S) => G.has(S), ne = () => {
1198
+ l.toggleTheme(), O.value = !1;
1199
+ }, ce = () => {
1200
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1201
+ }, z = () => {
1202
+ R.value = !!document.fullscreenElement;
1203
+ }, de = () => {
1204
+ A.value = !A.value;
1205
+ }, le = () => {
1206
+ A.value = !1;
1207
+ }, ue = () => {
1208
+ D.value = !1, T.value = "";
1209
+ }, _e = (S) => {
1210
+ i.push(S), ue();
1211
+ }, re = () => {
1212
+ O.value = !0;
1213
+ }, te = (S) => {
1214
+ P.value = S;
1215
+ const L = document.documentElement;
1216
+ S ? L.classList.add("grey-mode") : L.classList.remove("grey-mode");
1217
+ }, ve = () => {
1218
+ te(!P.value), O.value = !1;
1219
+ }, be = () => {
1220
+ l.toggleTheme(), O.value = !1;
1221
+ }, xe = [
1222
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
1223
+ { value: "top", label: "顶部菜单", icon: "menu" },
1224
+ { value: "mix", label: "混合菜单", icon: "grid" }
1225
+ ], Ce = b(() => l.layout), $e = (S) => {
1226
+ l.setLayout(S), O.value = !1;
1227
+ }, Le = [
1228
+ { value: "#409eff", label: "默认蓝" },
1229
+ { value: "#1890ff", label: "科技蓝" },
1230
+ { value: "#52c41a", label: "极光绿" },
1231
+ { value: "#faad14", label: "日落橙" },
1232
+ { value: "#f5222d", label: "薄暮红" },
1233
+ { value: "#722ed1", label: "酱紫" }
1234
+ ], fe = (S) => {
1235
+ l.setPrimaryColor(S), O.value = !1;
1236
+ }, ge = () => {
1237
+ le(), i.push("/profile");
1238
+ }, I = () => {
1239
+ le(), i.push("/change-password");
1240
+ }, w = () => {
1241
+ le(), u.logout(), _.clearUserInfo(), o.clearMenu(), i.push("/login");
1242
+ }, Z = (S) => {
1243
+ H.value && !H.value.contains(S.target) && le(), F.value && !F.value.contains(S.target) && ue();
1244
+ }, C = (S) => {
1245
+ S.key === "Escape" && (ue(), le());
1246
+ };
1247
+ return Re(() => {
1248
+ document.addEventListener("click", Z), document.addEventListener("fullscreenchange", z), document.addEventListener("keydown", C), P.value = document.documentElement.classList.contains("grey-mode");
1249
+ }), Fe(() => {
1250
+ document.removeEventListener("click", Z), document.removeEventListener("fullscreenchange", z), document.removeEventListener("keydown", C);
1251
+ }), (S, L) => {
1252
+ var ee;
1253
+ return s(), c("div", Es, [
1254
+ e("div", As, [
1255
+ e("img", {
1256
+ src: r.logoSrc,
1257
+ alt: "Logo",
1258
+ class: "top-menu__logo-img"
1259
+ }, null, 8, Ps),
1260
+ e("span", Ds, x(a(l).appName), 1)
1261
+ ]),
1262
+ y(a(He), {
1263
+ "model-value": f.value,
1264
+ mode: "horizontal",
1265
+ "background-color": h.value,
1266
+ "text-color": k.value,
1267
+ "active-text-color": q.value,
1268
+ class: "top-menu__menu",
1269
+ onSelect: j
1270
+ }, {
1271
+ default: M(() => [
1272
+ (s(!0), c(W, null, X(a(o).menuList, (n) => (s(), c(W, {
1273
+ key: n.menuUrl
1274
+ }, [
1275
+ n.children && n.children.length > 0 ? (s(), V(a(Oe), {
1276
+ key: 0,
1277
+ index: n.menuUrl
1278
+ }, {
1279
+ title: M(() => [
1280
+ e("span", Vs, [
1281
+ n.menuName !== "首页" ? (s(), c("span", Os, [
1282
+ Q(B(n.icon)) ? (s(), V(a(N), {
1283
+ key: 0,
1284
+ name: B(n.icon),
1285
+ size: 16
1286
+ }, null, 8, ["name"])) : (s(), c("span", Bs, x(J(n.menuName)), 1))
1287
+ ])) : E("", !0),
1288
+ e("span", Rs, x(n.menuName), 1)
1289
+ ])
1290
+ ]),
1291
+ default: M(() => [
1292
+ (s(!0), c(W, null, X(n.children, (m) => (s(), c(W, {
1293
+ key: m.menuUrl
1294
+ }, [
1295
+ m.children && m.children.length > 0 ? (s(), V(a(Oe), {
1296
+ key: 0,
1297
+ index: m.menuUrl
1298
+ }, {
1299
+ title: M(() => [
1300
+ e("span", Fs, [
1301
+ e("span", Ks, [
1302
+ Q(B(m.icon)) ? (s(), V(a(N), {
1303
+ key: 0,
1304
+ name: B(m.icon),
1305
+ size: 16
1306
+ }, null, 8, ["name"])) : (s(), c("span", Ws, x(J(m.menuName)), 1))
1307
+ ]),
1308
+ e("span", js, x(m.menuName), 1)
1309
+ ])
1310
+ ]),
1311
+ default: M(() => [
1312
+ (s(!0), c(W, null, X(m.children, (K) => (s(), V(a(Me), {
1313
+ key: K.menuUrl,
1314
+ index: K.menuUrl
1315
+ }, {
1316
+ default: M(() => [
1317
+ e("span", qs, [
1318
+ e("span", Hs, [
1319
+ Q(B(K.icon)) ? (s(), V(a(N), {
1320
+ key: 0,
1321
+ name: B(K.icon),
1322
+ size: 16
1323
+ }, null, 8, ["name"])) : (s(), c("span", Xs, x(J(K.menuName)), 1))
1324
+ ]),
1325
+ e("span", Ys, x(K.menuName), 1)
1326
+ ])
1327
+ ]),
1328
+ _: 2
1329
+ }, 1032, ["index"]))), 128))
1330
+ ]),
1331
+ _: 2
1332
+ }, 1032, ["index"])) : (s(), V(a(Me), {
1333
+ key: 1,
1334
+ index: m.menuUrl
1335
+ }, {
1336
+ default: M(() => [
1337
+ e("span", Gs, [
1338
+ e("span", Js, [
1339
+ Q(B(m.icon)) ? (s(), V(a(N), {
1340
+ key: 0,
1341
+ name: B(m.icon),
1342
+ size: 16
1343
+ }, null, 8, ["name"])) : (s(), c("span", Zs, x(J(m.menuName)), 1))
1344
+ ]),
1345
+ e("span", Qs, x(m.menuName), 1)
1346
+ ])
1347
+ ]),
1348
+ _: 2
1349
+ }, 1032, ["index"]))
1350
+ ], 64))), 128))
1351
+ ]),
1352
+ _: 2
1353
+ }, 1032, ["index"])) : (s(), V(a(Me), {
1354
+ key: 1,
1355
+ index: n.menuUrl
1356
+ }, {
1357
+ default: M(() => [
1358
+ e("span", eo, [
1359
+ n.menuName !== "首页" ? (s(), c("span", to, [
1360
+ Q(B(n.icon)) ? (s(), V(a(N), {
1361
+ key: 0,
1362
+ name: B(n.icon),
1363
+ size: 16
1364
+ }, null, 8, ["name"])) : (s(), c("span", so, x(J(n.menuName)), 1))
1365
+ ])) : E("", !0),
1366
+ e("span", oo, x(n.menuName), 1)
1367
+ ])
1368
+ ]),
1369
+ _: 2
1370
+ }, 1032, ["index"]))
1371
+ ], 64))), 128))
1372
+ ]),
1373
+ _: 1
1374
+ }, 8, ["model-value", "background-color", "text-color", "active-text-color"]),
1375
+ e("div", ao, [
1376
+ e("div", {
1377
+ class: "top-menu__search",
1378
+ ref_key: "searchRef",
1379
+ ref: F
1380
+ }, [
1381
+ y(a(N), {
1382
+ name: "search",
1383
+ size: 14,
1384
+ class: "top-menu__search-icon"
1385
+ }),
1386
+ Te(e("input", {
1387
+ "onUpdate:modelValue": L[0] || (L[0] = (n) => T.value = n),
1388
+ type: "text",
1389
+ class: "top-menu__search-input",
1390
+ placeholder: "搜索菜单...",
1391
+ onFocus: L[1] || (L[1] = (n) => D.value = !0)
1392
+ }, null, 544), [
1393
+ [Ke, T.value]
1394
+ ]),
1395
+ y(ye, { name: "search-dropdown" }, {
1396
+ default: M(() => [
1397
+ D.value && (p.value.length > 0 || T.value) ? (s(), c("div", no, [
1398
+ p.value.length > 0 ? (s(), c("div", lo, [
1399
+ (s(!0), c(W, null, X(p.value, (n) => (s(), c("div", {
1400
+ key: n.path,
1401
+ class: "top-menu__search-item",
1402
+ onClick: (m) => _e(n.path)
1403
+ }, [
1404
+ n.title !== "首页" ? (s(), c("span", io, [
1405
+ Q(B(n.icon)) ? (s(), V(a(N), {
1406
+ key: 0,
1407
+ name: B(n.icon),
1408
+ size: 16
1409
+ }, null, 8, ["name"])) : (s(), c("span", co, x(J(n.title)), 1))
1410
+ ])) : E("", !0),
1411
+ e("span", uo, x(n.title), 1),
1412
+ n.parentTitle ? (s(), c("span", mo, x(n.parentTitle), 1)) : E("", !0)
1413
+ ], 8, ro))), 128))
1414
+ ])) : (s(), c("div", po, " 未找到匹配的菜单 "))
1415
+ ])) : E("", !0)
1416
+ ]),
1417
+ _: 1
1418
+ })
1419
+ ], 512),
1420
+ e("div", {
1421
+ class: "top-menu__action",
1422
+ onClick: ce,
1423
+ title: R.value ? "退出全屏" : "全屏"
1424
+ }, [
1425
+ y(a(N), {
1426
+ name: R.value ? "fullscreen-exit" : "fullscreen",
1427
+ size: 16
1428
+ }, null, 8, ["name"])
1429
+ ], 8, vo),
1430
+ e("div", {
1431
+ class: "top-menu__action",
1432
+ onClick: re,
1433
+ title: "换肤设置"
1434
+ }, [
1435
+ y(a(N), {
1436
+ name: "skin",
1437
+ size: 16
1438
+ })
1439
+ ]),
1440
+ e("div", {
1441
+ class: "top-menu__action",
1442
+ onClick: ne,
1443
+ title: "切换主题"
1444
+ }, [
1445
+ y(a(N), {
1446
+ name: a(l).isDark ? "sun" : "moon",
1447
+ size: 16
1448
+ }, null, 8, ["name"])
1449
+ ]),
1450
+ e("div", {
1451
+ class: "top-menu__user",
1452
+ ref_key: "dropdownRef",
1453
+ ref: H
1454
+ }, [
1455
+ e("div", {
1456
+ class: "top-menu__user-trigger",
1457
+ onClick: Ee(de, ["stop"])
1458
+ }, [
1459
+ e("div", ho, [
1460
+ e("span", null, x(((ee = a(_).userName) == null ? void 0 : ee.charAt(0)) || "U"), 1)
1461
+ ]),
1462
+ e("span", _o, x(a(_).userName), 1),
1463
+ e("span", {
1464
+ class: Y(["top-menu__user-arrow", { "is-active": A.value }])
1465
+ }, "▼", 2)
1466
+ ]),
1467
+ y(ye, { name: "dropdown" }, {
1468
+ default: M(() => {
1469
+ var n;
1470
+ return [
1471
+ A.value ? (s(), c("div", fo, [
1472
+ e("div", go, [
1473
+ e("div", yo, [
1474
+ e("span", null, x(((n = a(_).userName) == null ? void 0 : n.charAt(0)) || "U"), 1)
1475
+ ]),
1476
+ e("div", ko, [
1477
+ e("div", wo, x(a(_).userName), 1),
1478
+ e("div", bo, x(a(_).departmentName), 1)
1479
+ ])
1480
+ ]),
1481
+ L[7] || (L[7] = e("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1482
+ e("div", xo, [
1483
+ e("div", {
1484
+ class: "top-menu__dropdown-item",
1485
+ onClick: ge
1486
+ }, [
1487
+ y(a(N), {
1488
+ name: "user",
1489
+ size: 16
1490
+ }),
1491
+ L[3] || (L[3] = e("span", null, "个人信息", -1))
1492
+ ]),
1493
+ e("div", {
1494
+ class: "top-menu__dropdown-item",
1495
+ onClick: I
1496
+ }, [
1497
+ y(a(N), {
1498
+ name: "lock",
1499
+ size: 16
1500
+ }),
1501
+ L[4] || (L[4] = e("span", null, "修改密码", -1))
1502
+ ]),
1503
+ L[6] || (L[6] = e("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1504
+ e("div", {
1505
+ class: "top-menu__dropdown-item top-menu__dropdown-item--danger",
1506
+ onClick: w
1507
+ }, [
1508
+ y(a(N), {
1509
+ name: "logout",
1510
+ size: 16
1511
+ }),
1512
+ L[5] || (L[5] = e("span", null, "退出登录", -1))
1513
+ ])
1514
+ ])
1515
+ ])) : E("", !0)
1516
+ ];
1517
+ }),
1518
+ _: 1
1519
+ })
1520
+ ], 512)
1521
+ ]),
1522
+ y(a(Xe), {
1523
+ modelValue: O.value,
1524
+ "onUpdate:modelValue": L[2] || (L[2] = (n) => O.value = n),
1525
+ title: "换肤设置",
1526
+ direction: "rtl",
1527
+ size: "320px"
1528
+ }, {
1529
+ default: M(() => [
1530
+ e("div", Co, [
1531
+ e("div", $o, [
1532
+ L[11] || (L[11] = e("div", { class: "settings-title" }, "布局模式", -1)),
1533
+ e("div", Lo, [
1534
+ (s(), c(W, null, X(xe, (n) => e("div", {
1535
+ key: n.value,
1536
+ class: Y(["layout-option", { "is-active": Ce.value === n.value }]),
1537
+ onClick: (m) => $e(n.value)
1538
+ }, [
1539
+ e("div", So, [
1540
+ n.value === "sidebar" ? (s(), c("div", No, [...L[8] || (L[8] = [
1541
+ e("div", { class: "preview-aside" }, null, -1),
1542
+ e("div", { class: "preview-main" }, [
1543
+ e("div", { class: "preview-header" }),
1544
+ e("div", { class: "preview-content" })
1545
+ ], -1)
1546
+ ])])) : n.value === "top" ? (s(), c("div", Io, [...L[9] || (L[9] = [
1547
+ e("div", { class: "preview-header-full" }, null, -1),
1548
+ e("div", { class: "preview-content-full" }, null, -1)
1549
+ ])])) : (s(), c("div", zo, [...L[10] || (L[10] = [
1550
+ e("div", { class: "preview-header-mix" }, [
1551
+ e("div", { class: "preview-mix-left" })
1552
+ ], -1),
1553
+ e("div", { class: "preview-mix-body" }, [
1554
+ e("div", { class: "preview-mix-aside" }),
1555
+ e("div", { class: "preview-mix-content" })
1556
+ ], -1)
1557
+ ])]))
1558
+ ]),
1559
+ e("span", Uo, x(n.label), 1)
1560
+ ], 10, Mo)), 64))
1561
+ ])
1562
+ ]),
1563
+ e("div", To, [
1564
+ L[12] || (L[12] = e("div", { class: "settings-title" }, "主题色", -1)),
1565
+ e("div", Eo, [
1566
+ (s(), c(W, null, X(Le, (n) => e("div", {
1567
+ key: n.value,
1568
+ class: Y(["color-option", { "is-active": a(l).primaryColor === n.value }]),
1569
+ style: Ne({ backgroundColor: n.value }),
1570
+ title: n.label,
1571
+ onClick: (m) => fe(n.value)
1572
+ }, [
1573
+ a(l).primaryColor === n.value ? (s(), V(a(N), {
1574
+ key: 0,
1575
+ name: "check",
1576
+ size: 12,
1577
+ color: "#fff"
1578
+ })) : E("", !0)
1579
+ ], 14, Ao)), 64))
1580
+ ])
1581
+ ]),
1582
+ e("div", Po, [
1583
+ L[17] || (L[17] = e("div", { class: "settings-title" }, "功能设置", -1)),
1584
+ e("div", Do, [
1585
+ e("div", Vo, [
1586
+ L[14] || (L[14] = e("span", null, "灰色模式", -1)),
1587
+ e("div", {
1588
+ class: Y(["switch-wrapper", { "is-checked": P.value }]),
1589
+ onClick: ve
1590
+ }, [...L[13] || (L[13] = [
1591
+ e("span", { class: "switch-core" }, null, -1)
1592
+ ])], 2)
1593
+ ]),
1594
+ e("div", Oo, [
1595
+ L[16] || (L[16] = e("span", null, "暗黑模式", -1)),
1596
+ e("div", {
1597
+ class: Y(["switch-wrapper", { "is-checked": a(l).isDark }]),
1598
+ onClick: be
1599
+ }, [...L[15] || (L[15] = [
1600
+ e("span", { class: "switch-core" }, null, -1)
1601
+ ])], 2)
1602
+ ])
1603
+ ])
1604
+ ])
1605
+ ])
1606
+ ]),
1607
+ _: 1
1608
+ }, 8, ["modelValue"])
1609
+ ]);
1610
+ };
1611
+ }
1612
+ }), Ro = /* @__PURE__ */ ae(Bo, [["__scopeId", "data-v-da5e391c"]]), Fo = { class: "mix-top-menu" }, Ko = { class: "mix-top-menu__logo" }, Wo = ["src"], jo = { class: "mix-top-menu__logo-text" }, qo = { class: "mix-top-menu__menu-content" }, Ho = {
1613
+ key: 0,
1614
+ class: "mix-top-menu__menu-icon"
1615
+ }, Xo = {
1616
+ key: 1,
1617
+ class: "mix-top-menu__menu-char"
1618
+ }, Yo = { class: "mix-top-menu__menu-text" }, Go = { class: "mix-top-menu__actions" }, Jo = {
1619
+ key: 0,
1620
+ class: "mix-top-menu__search-dropdown"
1621
+ }, Zo = {
1622
+ key: 0,
1623
+ class: "mix-top-menu__search-results"
1624
+ }, Qo = ["onClick"], ea = {
1625
+ key: 0,
1626
+ class: "mix-top-menu__search-icon-item"
1627
+ }, ta = {
1628
+ key: 1,
1629
+ class: "mix-top-menu__search-char"
1630
+ }, sa = { class: "mix-top-menu__search-item-title" }, oa = {
1631
+ key: 1,
1632
+ class: "mix-top-menu__search-item-parent"
1633
+ }, aa = {
1634
+ key: 1,
1635
+ class: "mix-top-menu__search-empty"
1636
+ }, na = ["title"], la = { class: "mix-top-menu__avatar" }, ra = { class: "mix-top-menu__user-name" }, ia = {
1637
+ key: 0,
1638
+ class: "mix-top-menu__dropdown"
1639
+ }, ca = { class: "mix-top-menu__dropdown-header" }, da = { class: "mix-top-menu__dropdown-avatar" }, ua = { class: "mix-top-menu__dropdown-info" }, ma = { class: "mix-top-menu__dropdown-name" }, pa = { class: "mix-top-menu__dropdown-role" }, va = { class: "mix-top-menu__dropdown-menu" }, ha = { class: "settings-drawer" }, _a = { class: "settings-section" }, fa = { class: "settings-layout-options" }, ga = ["onClick"], ya = { class: "layout-option__preview" }, ka = {
1640
+ key: 0,
1641
+ class: "layout-preview-sidebar"
1642
+ }, wa = {
1643
+ key: 1,
1644
+ class: "layout-preview-top"
1645
+ }, ba = {
1646
+ key: 2,
1647
+ class: "layout-preview-mix"
1648
+ }, xa = { class: "layout-option__label" }, Ca = { class: "settings-section" }, $a = { class: "settings-color-options" }, La = ["title", "onClick"], Ma = { class: "settings-section" }, Sa = { class: "settings-switch-list" }, Na = { class: "settings-switch-item" }, Ia = { class: "settings-switch-item" }, za = /* @__PURE__ */ se({
1649
+ __name: "MixTopMenu",
1650
+ props: {
1651
+ logoSrc: { default: "/vite.svg" }
1652
+ },
1653
+ setup(t) {
1654
+ const r = t, d = we(), i = me(), o = ie(), l = pe(), _ = oe(), u = ze(), f = g(""), v = (n, m = "") => {
1655
+ const K = [];
1656
+ return n.forEach(($) => {
1657
+ $.children && $.children.length > 0 ? K.push(...v($.children, $.menuName)) : K.push({ ...$, parentTitle: m, title: $.menuName, path: $.menuUrl });
1658
+ }), K;
1659
+ }, p = b(() => B.value.trim() ? v(o.menuList).filter(
1660
+ (m) => m.title.toLowerCase().includes(B.value.toLowerCase())
1661
+ ) : []), h = b(() => {
1662
+ const n = o.menuList.find((m) => m.menuUrl === f.value);
1663
+ return (n == null ? void 0 : n.children) || [];
1664
+ }), k = b(() => o.menuList.find((n) => !!(d.path === n.menuUrl || n.children && n.children.some((m) => d.path.startsWith(m.menuUrl) || d.path === m.menuUrl)))), q = () => {
1665
+ k.value ? f.value = k.value.menuUrl : o.menuList.length > 0 && (f.value = o.menuList[0].menuUrl);
1666
+ }, A = (n) => {
1667
+ f.value = n;
1668
+ const m = o.menuList.find((K) => K.menuUrl === n);
1669
+ if (m)
1670
+ if (m.children && m.children.length > 0) {
1671
+ const K = m.children[0].menuUrl;
1672
+ d.path !== K && i.push(K);
1673
+ } else
1674
+ d.path !== n && i.push(n);
1675
+ }, H = b(() => l.isDark ? "#1d1e1f" : "#fff"), R = b(() => l.isDark ? "#cfd3dc" : "#303133"), O = b(() => "#409eff"), P = g(!1), D = g(null), T = g(!1), F = g(!1), j = g(!1), G = g(!1), B = g(""), J = g(null);
1676
+ Se(() => d.path, () => {
1677
+ q(), l.setMixSubMenus(h.value);
1678
+ }), Se(() => o.menuList, (n) => {
1679
+ n && n.length > 0 && (q(), l.setMixSubMenus(h.value));
1680
+ }, { immediate: !0 });
1681
+ const Q = /* @__PURE__ */ new Set([
1682
+ "arrow-up",
1683
+ "arrow-down",
1684
+ "arrow-left",
1685
+ "arrow-right",
1686
+ "caret-down",
1687
+ "caret-right",
1688
+ "plus",
1689
+ "minus",
1690
+ "close",
1691
+ "check",
1692
+ "edit",
1693
+ "delete",
1694
+ "copy",
1695
+ "download",
1696
+ "upload",
1697
+ "refresh",
1698
+ "search",
1699
+ "filter",
1700
+ "more",
1701
+ "setting",
1702
+ "share",
1703
+ "loading",
1704
+ "info",
1705
+ "success",
1706
+ "warning",
1707
+ "error",
1708
+ "question",
1709
+ "user",
1710
+ "user-add",
1711
+ "user-group",
1712
+ "logout",
1713
+ "login",
1714
+ "file",
1715
+ "folder",
1716
+ "folder-open",
1717
+ "document",
1718
+ "image",
1719
+ "video",
1720
+ "music",
1721
+ "camera",
1722
+ "mail",
1723
+ "phone",
1724
+ "chat",
1725
+ "bell",
1726
+ "message",
1727
+ "eye",
1728
+ "eye-off",
1729
+ "calendar",
1730
+ "clock",
1731
+ "history",
1732
+ "timer",
1733
+ "location",
1734
+ "map",
1735
+ "globe",
1736
+ "star",
1737
+ "heart",
1738
+ "thumb-up",
1739
+ "link",
1740
+ "external-link",
1741
+ "lock",
1742
+ "unlock",
1743
+ "key",
1744
+ "home",
1745
+ "menu",
1746
+ "menu-fold",
1747
+ "menu-unfold",
1748
+ "sidebar-fold",
1749
+ "sidebar-expand",
1750
+ "sidebar-left",
1751
+ "dashboard",
1752
+ "chart",
1753
+ "chart-pie",
1754
+ "chart-line",
1755
+ "report",
1756
+ "analytics",
1757
+ "system",
1758
+ "permission",
1759
+ "role",
1760
+ "user-manage",
1761
+ "log",
1762
+ "notification",
1763
+ "app",
1764
+ "list",
1765
+ "grid",
1766
+ "fullscreen",
1767
+ "fullscreen-exit",
1768
+ "zoom-in",
1769
+ "zoom-out",
1770
+ "print",
1771
+ "bookmark",
1772
+ "tag",
1773
+ "code",
1774
+ "terminal",
1775
+ "database",
1776
+ "server",
1777
+ "cloud",
1778
+ "gift",
1779
+ "moon",
1780
+ "sun",
1781
+ "theme",
1782
+ "skin"
1783
+ ]), ne = (n) => {
1784
+ if (!n || n === "") return "";
1785
+ if (n.startsWith("tineco-icon-")) {
1786
+ const K = n.replace("tineco-icon-", "");
1787
+ return {
1788
+ home: "home",
1789
+ dashboard: "dashboard",
1790
+ system: "system",
1791
+ user: "user",
1792
+ role: "role",
1793
+ menu: "list",
1794
+ setting: "setting",
1795
+ file: "file",
1796
+ folder: "folder",
1797
+ chart: "chart",
1798
+ report: "report",
1799
+ analytics: "analytics"
1800
+ }[K] || K;
1801
+ }
1802
+ return {
1803
+ dashboard: "dashboard",
1804
+ system: "system",
1805
+ user: "user",
1806
+ role: "role",
1807
+ menu: "list",
1808
+ setting: "setting",
1809
+ home: "home",
1810
+ chart: "chart",
1811
+ report: "report",
1812
+ analytics: "analytics",
1813
+ permission: "permission",
1814
+ log: "log",
1815
+ notification: "notification",
1816
+ app: "app",
1817
+ list: "list",
1818
+ grid: "grid"
1819
+ }[n] || n;
1820
+ }, ce = (n) => n ? n.charAt(0) : "", z = (n) => Q.has(n), de = () => {
1821
+ l.toggleTheme(), F.value = !1;
1822
+ }, le = () => {
1823
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1824
+ }, ue = () => {
1825
+ T.value = !!document.fullscreenElement;
1826
+ }, _e = () => {
1827
+ P.value = !P.value;
1828
+ }, re = () => {
1829
+ P.value = !1;
1830
+ }, te = () => {
1831
+ G.value = !1, B.value = "";
1832
+ }, ve = (n) => {
1833
+ i.push(n), te();
1834
+ }, be = () => {
1835
+ F.value = !0;
1836
+ }, xe = (n) => {
1837
+ j.value = n;
1838
+ const m = document.documentElement;
1839
+ n ? m.classList.add("grey-mode") : m.classList.remove("grey-mode");
1840
+ }, Ce = () => {
1841
+ xe(!j.value), F.value = !1;
1842
+ }, $e = () => {
1843
+ l.toggleTheme(), F.value = !1;
1844
+ }, Le = [
1845
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
1846
+ { value: "top", label: "顶部菜单", icon: "menu" },
1847
+ { value: "mix", label: "混合菜单", icon: "grid" }
1848
+ ], fe = b(() => l.layout), ge = (n) => {
1849
+ l.setLayout(n), F.value = !1;
1850
+ }, I = [
1851
+ { value: "#409eff", label: "默认蓝" },
1852
+ { value: "#1890ff", label: "科技蓝" },
1853
+ { value: "#52c41a", label: "极光绿" },
1854
+ { value: "#faad14", label: "日落橙" },
1855
+ { value: "#f5222d", label: "薄暮红" },
1856
+ { value: "#722ed1", label: "酱紫" }
1857
+ ], w = (n) => {
1858
+ l.setPrimaryColor(n), F.value = !1;
1859
+ }, Z = () => {
1860
+ re(), i.push("/profile");
1861
+ }, C = () => {
1862
+ re(), i.push("/change-password");
1863
+ }, S = () => {
1864
+ re(), u.logout(), _.clearUserInfo(), o.clearMenu(), i.push("/login");
1865
+ }, L = (n) => {
1866
+ D.value && !D.value.contains(n.target) && re(), J.value && !J.value.contains(n.target) && te();
1867
+ }, ee = (n) => {
1868
+ n.key === "Escape" && (te(), re());
1869
+ };
1870
+ return Re(() => {
1871
+ document.addEventListener("click", L), document.addEventListener("fullscreenchange", ue), document.addEventListener("keydown", ee), j.value = document.documentElement.classList.contains("grey-mode"), q();
1872
+ }), Fe(() => {
1873
+ document.removeEventListener("click", L), document.removeEventListener("fullscreenchange", ue), document.removeEventListener("keydown", ee);
1874
+ }), (n, m) => {
1875
+ var K;
1876
+ return s(), c("div", Fo, [
1877
+ e("div", Ko, [
1878
+ e("img", {
1879
+ src: r.logoSrc,
1880
+ alt: "Logo",
1881
+ class: "mix-top-menu__logo-img"
1882
+ }, null, 8, Wo),
1883
+ e("span", jo, x(a(l).appName), 1)
1884
+ ]),
1885
+ y(a(He), {
1886
+ "model-value": f.value,
1887
+ mode: "horizontal",
1888
+ "background-color": H.value,
1889
+ "text-color": R.value,
1890
+ "active-text-color": O.value,
1891
+ class: "mix-top-menu__menu",
1892
+ onSelect: A
1893
+ }, {
1894
+ default: M(() => [
1895
+ (s(!0), c(W, null, X(a(o).menuList, ($) => (s(), V(a(Me), {
1896
+ key: $.menuUrl,
1897
+ index: $.menuUrl
1898
+ }, {
1899
+ default: M(() => [
1900
+ e("span", qo, [
1901
+ $.menuName !== "首页" ? (s(), c("span", Ho, [
1902
+ z(ne($.icon)) ? (s(), V(a(N), {
1903
+ key: 0,
1904
+ name: ne($.icon),
1905
+ size: 16
1906
+ }, null, 8, ["name"])) : (s(), c("span", Xo, x(ce($.menuName)), 1))
1907
+ ])) : E("", !0),
1908
+ e("span", Yo, x($.menuName), 1)
1909
+ ])
1910
+ ]),
1911
+ _: 2
1912
+ }, 1032, ["index"]))), 128))
1913
+ ]),
1914
+ _: 1
1915
+ }, 8, ["model-value", "background-color", "text-color", "active-text-color"]),
1916
+ e("div", Go, [
1917
+ e("div", {
1918
+ class: "mix-top-menu__search",
1919
+ ref_key: "searchRef",
1920
+ ref: J
1921
+ }, [
1922
+ y(a(N), {
1923
+ name: "search",
1924
+ size: 14,
1925
+ class: "mix-top-menu__search-icon"
1926
+ }),
1927
+ Te(e("input", {
1928
+ "onUpdate:modelValue": m[0] || (m[0] = ($) => B.value = $),
1929
+ type: "text",
1930
+ class: "mix-top-menu__search-input",
1931
+ placeholder: "搜索菜单...",
1932
+ onFocus: m[1] || (m[1] = ($) => G.value = !0)
1933
+ }, null, 544), [
1934
+ [Ke, B.value]
1935
+ ]),
1936
+ y(ye, { name: "search-dropdown" }, {
1937
+ default: M(() => [
1938
+ G.value && (p.value.length > 0 || B.value) ? (s(), c("div", Jo, [
1939
+ p.value.length > 0 ? (s(), c("div", Zo, [
1940
+ (s(!0), c(W, null, X(p.value, ($) => (s(), c("div", {
1941
+ key: $.path,
1942
+ class: "mix-top-menu__search-item",
1943
+ onClick: (Ge) => ve($.path)
1944
+ }, [
1945
+ $.title !== "首页" ? (s(), c("span", ea, [
1946
+ z(ne($.icon)) ? (s(), V(a(N), {
1947
+ key: 0,
1948
+ name: ne($.icon),
1949
+ size: 16
1950
+ }, null, 8, ["name"])) : (s(), c("span", ta, x(ce($.title)), 1))
1951
+ ])) : E("", !0),
1952
+ e("span", sa, x($.title), 1),
1953
+ $.parentTitle ? (s(), c("span", oa, x($.parentTitle), 1)) : E("", !0)
1954
+ ], 8, Qo))), 128))
1955
+ ])) : (s(), c("div", aa, " 未找到匹配的菜单 "))
1956
+ ])) : E("", !0)
1957
+ ]),
1958
+ _: 1
1959
+ })
1960
+ ], 512),
1961
+ e("div", {
1962
+ class: "mix-top-menu__action",
1963
+ onClick: le,
1964
+ title: T.value ? "退出全屏" : "全屏"
1965
+ }, [
1966
+ y(a(N), {
1967
+ name: T.value ? "fullscreen-exit" : "fullscreen",
1968
+ size: 16
1969
+ }, null, 8, ["name"])
1970
+ ], 8, na),
1971
+ e("div", {
1972
+ class: "mix-top-menu__action",
1973
+ onClick: be,
1974
+ title: "换肤设置"
1975
+ }, [
1976
+ y(a(N), {
1977
+ name: "skin",
1978
+ size: 16
1979
+ })
1980
+ ]),
1981
+ e("div", {
1982
+ class: "mix-top-menu__action",
1983
+ onClick: de,
1984
+ title: "切换主题"
1985
+ }, [
1986
+ y(a(N), {
1987
+ name: a(l).isDark ? "sun" : "moon",
1988
+ size: 16
1989
+ }, null, 8, ["name"])
1990
+ ]),
1991
+ e("div", {
1992
+ class: "mix-top-menu__user",
1993
+ ref_key: "dropdownRef",
1994
+ ref: D
1995
+ }, [
1996
+ e("div", {
1997
+ class: "mix-top-menu__user-trigger",
1998
+ onClick: Ee(_e, ["stop"])
1999
+ }, [
2000
+ e("div", la, [
2001
+ e("span", null, x(((K = a(_).userName) == null ? void 0 : K.charAt(0)) || "U"), 1)
2002
+ ]),
2003
+ e("span", ra, x(a(_).userName), 1),
2004
+ e("span", {
2005
+ class: Y(["mix-top-menu__user-arrow", { "is-active": P.value }])
2006
+ }, "▼", 2)
2007
+ ]),
2008
+ y(ye, { name: "dropdown" }, {
2009
+ default: M(() => {
2010
+ var $;
2011
+ return [
2012
+ P.value ? (s(), c("div", ia, [
2013
+ e("div", ca, [
2014
+ e("div", da, [
2015
+ e("span", null, x((($ = a(_).userName) == null ? void 0 : $.charAt(0)) || "U"), 1)
2016
+ ]),
2017
+ e("div", ua, [
2018
+ e("div", ma, x(a(_).userName), 1),
2019
+ e("div", pa, x(a(_).departmentName), 1)
2020
+ ])
2021
+ ]),
2022
+ m[7] || (m[7] = e("div", { class: "mix-top-menu__dropdown-divider" }, null, -1)),
2023
+ e("div", va, [
2024
+ e("div", {
2025
+ class: "mix-top-menu__dropdown-item",
2026
+ onClick: Z
2027
+ }, [
2028
+ y(a(N), {
2029
+ name: "user",
2030
+ size: 16
2031
+ }),
2032
+ m[3] || (m[3] = e("span", null, "个人信息", -1))
2033
+ ]),
2034
+ e("div", {
2035
+ class: "mix-top-menu__dropdown-item",
2036
+ onClick: C
2037
+ }, [
2038
+ y(a(N), {
2039
+ name: "lock",
2040
+ size: 16
2041
+ }),
2042
+ m[4] || (m[4] = e("span", null, "修改密码", -1))
2043
+ ]),
2044
+ m[6] || (m[6] = e("div", { class: "mix-top-menu__dropdown-divider" }, null, -1)),
2045
+ e("div", {
2046
+ class: "mix-top-menu__dropdown-item mix-top-menu__dropdown-item--danger",
2047
+ onClick: S
2048
+ }, [
2049
+ y(a(N), {
2050
+ name: "logout",
2051
+ size: 16
2052
+ }),
2053
+ m[5] || (m[5] = e("span", null, "退出登录", -1))
2054
+ ])
2055
+ ])
2056
+ ])) : E("", !0)
2057
+ ];
2058
+ }),
2059
+ _: 1
2060
+ })
2061
+ ], 512)
2062
+ ]),
2063
+ y(a(Xe), {
2064
+ modelValue: F.value,
2065
+ "onUpdate:modelValue": m[2] || (m[2] = ($) => F.value = $),
2066
+ title: "换肤设置",
2067
+ direction: "rtl",
2068
+ size: "320px"
2069
+ }, {
2070
+ default: M(() => [
2071
+ e("div", ha, [
2072
+ e("div", _a, [
2073
+ m[11] || (m[11] = e("div", { class: "settings-title" }, "布局模式", -1)),
2074
+ e("div", fa, [
2075
+ (s(), c(W, null, X(Le, ($) => e("div", {
2076
+ key: $.value,
2077
+ class: Y(["layout-option", { "is-active": fe.value === $.value }]),
2078
+ onClick: (Ge) => ge($.value)
2079
+ }, [
2080
+ e("div", ya, [
2081
+ $.value === "sidebar" ? (s(), c("div", ka, [...m[8] || (m[8] = [
2082
+ e("div", { class: "preview-aside" }, null, -1),
2083
+ e("div", { class: "preview-main" }, [
2084
+ e("div", { class: "preview-header" }),
2085
+ e("div", { class: "preview-content" })
2086
+ ], -1)
2087
+ ])])) : $.value === "top" ? (s(), c("div", wa, [...m[9] || (m[9] = [
2088
+ e("div", { class: "preview-header-full" }, null, -1),
2089
+ e("div", { class: "preview-content-full" }, null, -1)
2090
+ ])])) : (s(), c("div", ba, [...m[10] || (m[10] = [
2091
+ e("div", { class: "preview-header-mix" }, [
2092
+ e("div", { class: "preview-mix-left" })
2093
+ ], -1),
2094
+ e("div", { class: "preview-mix-body" }, [
2095
+ e("div", { class: "preview-mix-aside" }),
2096
+ e("div", { class: "preview-mix-content" })
2097
+ ], -1)
2098
+ ])]))
2099
+ ]),
2100
+ e("span", xa, x($.label), 1)
2101
+ ], 10, ga)), 64))
2102
+ ])
2103
+ ]),
2104
+ e("div", Ca, [
2105
+ m[12] || (m[12] = e("div", { class: "settings-title" }, "主题色", -1)),
2106
+ e("div", $a, [
2107
+ (s(), c(W, null, X(I, ($) => e("div", {
2108
+ key: $.value,
2109
+ class: Y(["color-option", { "is-active": a(l).primaryColor === $.value }]),
2110
+ style: Ne({ backgroundColor: $.value }),
2111
+ title: $.label,
2112
+ onClick: (Ge) => w($.value)
2113
+ }, [
2114
+ a(l).primaryColor === $.value ? (s(), V(a(N), {
2115
+ key: 0,
2116
+ name: "check",
2117
+ size: 12,
2118
+ color: "#fff"
2119
+ })) : E("", !0)
2120
+ ], 14, La)), 64))
2121
+ ])
2122
+ ]),
2123
+ e("div", Ma, [
2124
+ m[17] || (m[17] = e("div", { class: "settings-title" }, "功能设置", -1)),
2125
+ e("div", Sa, [
2126
+ e("div", Na, [
2127
+ m[14] || (m[14] = e("span", null, "灰色模式", -1)),
2128
+ e("div", {
2129
+ class: Y(["switch-wrapper", { "is-checked": j.value }]),
2130
+ onClick: Ce
2131
+ }, [...m[13] || (m[13] = [
2132
+ e("span", { class: "switch-core" }, null, -1)
2133
+ ])], 2)
2134
+ ]),
2135
+ e("div", Ia, [
2136
+ m[16] || (m[16] = e("span", null, "暗黑模式", -1)),
2137
+ e("div", {
2138
+ class: Y(["switch-wrapper", { "is-checked": a(l).isDark }]),
2139
+ onClick: $e
2140
+ }, [...m[15] || (m[15] = [
2141
+ e("span", { class: "switch-core" }, null, -1)
2142
+ ])], 2)
2143
+ ])
2144
+ ])
2145
+ ])
2146
+ ])
2147
+ ]),
2148
+ _: 1
2149
+ }, 8, ["modelValue"])
2150
+ ]);
2151
+ };
2152
+ }
2153
+ }), Ua = /* @__PURE__ */ ae(za, [["__scopeId", "data-v-18f26903"]]), Ta = {
2154
+ key: 0,
2155
+ class: "layout layout--sidebar"
2156
+ }, Ea = { class: "layout__main" }, Aa = { class: "layout__header" }, Pa = { class: "layout__content" }, Da = {
2157
+ key: 1,
2158
+ class: "layout layout--top"
2159
+ }, Va = { class: "layout__top-menu" }, Oa = { class: "layout__main" }, Ba = { class: "layout__content" }, Ra = {
2160
+ key: 2,
2161
+ class: "layout layout--mix"
2162
+ }, Fa = { class: "layout__mix-top-menu" }, Ka = { class: "layout__mix-body" }, Wa = { class: "layout__content" }, ja = /* @__PURE__ */ se({
2163
+ __name: "index",
2164
+ props: {
2165
+ logoSrc: { default: "/vite.svg" }
2166
+ },
2167
+ setup(t) {
2168
+ const r = t, d = pe(), i = ie(), o = b(
2169
+ () => d.isCollapsed ? "64px" : "210px"
2170
+ ), l = b(() => d.layout), _ = b(() => l.value === "mix"), u = b(() => l.value === "sidebar" ? i.menuList : l.value === "mix" ? d.mixSubMenus : []), f = b(() => _.value ? u.value.length > 0 : !1);
2171
+ return (v, p) => {
2172
+ const h = nt("router-view");
2173
+ return s(), c(W, null, [
2174
+ l.value === "sidebar" ? (s(), c("div", Ta, [
2175
+ e("aside", {
2176
+ class: "layout__aside",
2177
+ style: Ne({ width: o.value })
2178
+ }, [
2179
+ y(Qe, {
2180
+ "menu-list": u.value,
2181
+ "show-logo": !0,
2182
+ "show-user": !0,
2183
+ "logo-src": r.logoSrc
2184
+ }, null, 8, ["menu-list", "logo-src"])
2185
+ ], 4),
2186
+ e("div", Ea, [
2187
+ e("header", Aa, [
2188
+ y(Ts)
2189
+ ]),
2190
+ e("main", Pa, [
2191
+ y(h)
2192
+ ])
2193
+ ])
2194
+ ])) : E("", !0),
2195
+ l.value === "top" ? (s(), c("div", Da, [
2196
+ e("div", Va, [
2197
+ y(Ro, {
2198
+ "logo-src": r.logoSrc
2199
+ }, null, 8, ["logo-src"])
2200
+ ]),
2201
+ e("div", Oa, [
2202
+ e("main", Ba, [
2203
+ y(h)
2204
+ ])
2205
+ ])
2206
+ ])) : E("", !0),
2207
+ l.value === "mix" ? (s(), c("div", Ra, [
2208
+ e("div", Fa, [
2209
+ y(Ua, {
2210
+ "logo-src": r.logoSrc
2211
+ }, null, 8, ["logo-src"])
2212
+ ]),
2213
+ e("div", Ka, [
2214
+ f.value ? (s(), c("aside", {
2215
+ key: 0,
2216
+ class: "layout__aside",
2217
+ style: Ne({ width: o.value })
2218
+ }, [
2219
+ y(Qe, {
2220
+ "menu-list": u.value,
2221
+ "show-logo": !1,
2222
+ "show-user": !1
2223
+ }, null, 8, ["menu-list"])
2224
+ ], 4)) : E("", !0),
2225
+ e("main", Wa, [
2226
+ y(h)
2227
+ ])
2228
+ ])
2229
+ ])) : E("", !0)
2230
+ ], 64);
2231
+ };
2232
+ }
2233
+ }), rt = /* @__PURE__ */ ae(ja, [["__scopeId", "data-v-3317ef3c"]]), qa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2234
+ __proto__: null,
2235
+ default: rt
2236
+ }, Symbol.toStringTag, { value: "Module" })), Ha = { class: "tabs-wrapper" }, Xa = { class: "tab-label" }, Ya = ["onClick"], Ga = /* @__PURE__ */ se({
2237
+ __name: "Tabs",
2238
+ setup(t) {
2239
+ const r = we(), d = me(), i = b(() => {
2240
+ const u = [];
2241
+ return r.matched.forEach((f) => {
2242
+ var v;
2243
+ (v = f.meta) != null && v.affix && u.push({
2244
+ name: f.name,
2245
+ title: f.meta.title,
2246
+ path: f.path,
2247
+ affix: !0
2248
+ });
2249
+ }), u;
2250
+ }), o = b(() => r.path), l = (u) => {
2251
+ d.push(u);
2252
+ }, _ = (u) => {
2253
+ const f = i.value.find((v) => v.path === u);
2254
+ if (!(f != null && f.affix) && u === o.value) {
2255
+ const v = i.value.findIndex((h) => h.path === u), p = i.value[v - 1] || i.value[v + 1];
2256
+ p && d.push(p.path);
2257
+ }
2258
+ };
2259
+ return (u, f) => (s(), c("div", Ha, [
2260
+ y(a(kt), {
2261
+ modelValue: o.value,
2262
+ "onUpdate:modelValue": f[0] || (f[0] = (v) => o.value = v),
2263
+ type: "card",
2264
+ onTabClick: l
2265
+ }, {
2266
+ default: M(() => [
2267
+ (s(!0), c(W, null, X(i.value, (v) => (s(), V(a(wt), {
2268
+ key: v.path,
2269
+ name: v.path,
2270
+ label: v.title,
2271
+ closable: !v.affix
2272
+ }, {
2273
+ label: M(() => [
2274
+ e("span", Xa, [
2275
+ he(x(v.title) + " ", 1),
2276
+ v.affix ? E("", !0) : (s(), c("span", {
2277
+ key: 0,
2278
+ class: "tab-close",
2279
+ onClick: Ee((p) => _(v.path), ["stop"])
2280
+ }, " ✕ ", 8, Ya))
2281
+ ])
2282
+ ]),
2283
+ _: 2
2284
+ }, 1032, ["name", "label", "closable"]))), 128))
2285
+ ]),
2286
+ _: 1
2287
+ }, 8, ["modelValue"])
2288
+ ]));
2289
+ }
2290
+ }), On = /* @__PURE__ */ ae(Ga, [["__scopeId", "data-v-9156d8cd"]]), Ja = {}, Za = { class: "footer" };
2291
+ function Qa(t, r) {
2292
+ return s(), c("div", Za, [...r[0] || (r[0] = [
2293
+ e("span", null, "Copyright © 2024 Xto Demo. All Rights Reserved.", -1)
2294
+ ])]);
2295
+ }
2296
+ const Bn = /* @__PURE__ */ ae(Ja, [["render", Qa], ["__scopeId", "data-v-4852826a"]]), en = { class: "login-page" }, tn = { class: "login-form-section" }, sn = { class: "form-container" }, on = { class: "input-wrapper" }, an = { class: "input-wrapper" }, nn = { class: "form-options" }, ln = { key: 0 }, rn = { key: 1 }, cn = /* @__PURE__ */ se({
2297
+ __name: "index",
2298
+ setup(t) {
2299
+ const r = me(), d = we(), i = g(!1), o = g(!1), l = We({
2300
+ uid: "",
2301
+ password: ""
2302
+ }), _ = {
2303
+ uid: [
2304
+ { required: !0, message: "请输入用户名", trigger: "blur" }
2305
+ ],
2306
+ password: [
2307
+ { required: !0, message: "请输入密码", trigger: "blur" },
2308
+ { min: 6, message: "密码长度至少6位", trigger: "blur" }
2309
+ ]
2310
+ }, u = g(), f = async () => {
2311
+ var v;
2312
+ try {
2313
+ await ((v = u.value) == null ? void 0 : v.validate()), i.value = !0;
2314
+ const p = await mt({
2315
+ appId: Be(),
2316
+ clientId: at(),
2317
+ uid: l.uid,
2318
+ password: l.password,
2319
+ code: !0
2320
+ });
2321
+ ot(p), bt.success("登录成功");
2322
+ const h = d.query.redirect || "/";
2323
+ r.push(h);
2324
+ } catch (p) {
2325
+ console.error("登录失败:", p);
2326
+ } finally {
2327
+ i.value = !1;
2328
+ }
2329
+ };
2330
+ return (v, p) => (s(), c("div", en, [
2331
+ p[10] || (p[10] = Ue('<div class="login-brand" data-v-15fc7de5><div class="brand-content" data-v-15fc7de5><div class="brand-logo" data-v-15fc7de5><div class="logo-icon" data-v-15fc7de5><svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-15fc7de5><rect width="48" height="48" rx="12" fill="currentColor" data-v-15fc7de5></rect><path d="M14 24L20 30L34 16" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-15fc7de5></path></svg></div><span class="logo-text" data-v-15fc7de5>XTO</span></div><div class="brand-slogan" data-v-15fc7de5><h1 data-v-15fc7de5>企业级后台管理解决方案</h1><p data-v-15fc7de5>开箱即用的中后台前端/设计解决方案</p></div><div class="brand-features" data-v-15fc7de5><div class="feature-item" data-v-15fc7de5><div class="feature-icon" data-v-15fc7de5><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-15fc7de5><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" data-v-15fc7de5></path></svg></div><div class="feature-text" data-v-15fc7de5><h4 data-v-15fc7de5>高性能</h4><p data-v-15fc7de5>极致的渲染性能与响应速度</p></div></div><div class="feature-item" data-v-15fc7de5><div class="feature-icon" data-v-15fc7de5><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-15fc7de5><rect x="3" y="3" width="18" height="18" rx="2" data-v-15fc7de5></rect><path d="M9 9h6M9 12h6M9 15h4" data-v-15fc7de5></path></svg></div><div class="feature-text" data-v-15fc7de5><h4 data-v-15fc7de5>丰富组件</h4><p data-v-15fc7de5>60+ 高质量业务组件</p></div></div><div class="feature-item" data-v-15fc7de5><div class="feature-icon" data-v-15fc7de5><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-15fc7de5><circle cx="12" cy="12" r="10" data-v-15fc7de5></circle><path d="M12 6v6l4 2" data-v-15fc7de5></path></svg></div><div class="feature-text" data-v-15fc7de5><h4 data-v-15fc7de5>持续更新</h4><p data-v-15fc7de5>活跃的社区与快速迭代</p></div></div></div><div class="brand-decoration" data-v-15fc7de5><div class="decoration-line" data-v-15fc7de5></div><div class="decoration-dots" data-v-15fc7de5><span data-v-15fc7de5></span><span data-v-15fc7de5></span><span data-v-15fc7de5></span></div></div></div><div class="brand-bg" data-v-15fc7de5><div class="bg-grid" data-v-15fc7de5></div><div class="bg-glow" data-v-15fc7de5></div><div class="bg-pattern" data-v-15fc7de5></div></div></div>', 1)),
2332
+ e("div", tn, [
2333
+ e("div", sn, [
2334
+ p[7] || (p[7] = e("div", { class: "form-header" }, [
2335
+ e("h2", null, "欢迎登录"),
2336
+ e("p", null, "请输入您的账户信息")
2337
+ ], -1)),
2338
+ y(a(xt), {
2339
+ ref_key: "formRef",
2340
+ ref: u,
2341
+ model: l,
2342
+ rules: _,
2343
+ class: "login-form",
2344
+ "label-width": "0"
2345
+ }, {
2346
+ default: M(() => [
2347
+ y(a(Ae), { prop: "uid" }, {
2348
+ default: M(() => [
2349
+ e("div", on, [
2350
+ p[3] || (p[3] = e("label", { class: "input-label" }, "用户名", -1)),
2351
+ y(a(Je), {
2352
+ modelValue: l.uid,
2353
+ "onUpdate:modelValue": p[0] || (p[0] = (h) => l.uid = h),
2354
+ placeholder: "请输入用户名",
2355
+ size: "large"
2356
+ }, {
2357
+ prefix: M(() => [
2358
+ y(a(N), {
2359
+ name: "user",
2360
+ size: 18
2361
+ })
2362
+ ]),
2363
+ _: 1
2364
+ }, 8, ["modelValue"])
2365
+ ])
2366
+ ]),
2367
+ _: 1
2368
+ }),
2369
+ y(a(Ae), { prop: "password" }, {
2370
+ default: M(() => [
2371
+ e("div", an, [
2372
+ p[4] || (p[4] = e("label", { class: "input-label" }, "密码", -1)),
2373
+ y(a(Je), {
2374
+ modelValue: l.password,
2375
+ "onUpdate:modelValue": p[1] || (p[1] = (h) => l.password = h),
2376
+ type: "password",
2377
+ placeholder: "请输入密码",
2378
+ size: "large",
2379
+ "show-password": "",
2380
+ onKeyup: gt(f, ["enter"])
2381
+ }, {
2382
+ prefix: M(() => [
2383
+ y(a(N), {
2384
+ name: "lock",
2385
+ size: 18
2386
+ })
2387
+ ]),
2388
+ _: 1
2389
+ }, 8, ["modelValue"])
2390
+ ])
2391
+ ]),
2392
+ _: 1
2393
+ }),
2394
+ e("div", nn, [
2395
+ y(a(Ct), {
2396
+ modelValue: o.value,
2397
+ "onUpdate:modelValue": p[2] || (p[2] = (h) => o.value = h)
2398
+ }, {
2399
+ default: M(() => [...p[5] || (p[5] = [
2400
+ he("记住我", -1)
2401
+ ])]),
2402
+ _: 1
2403
+ }, 8, ["modelValue"]),
2404
+ p[6] || (p[6] = e("a", {
2405
+ href: "#",
2406
+ class: "forgot-link"
2407
+ }, "忘记密码?", -1))
2408
+ ]),
2409
+ y(a(Ae), null, {
2410
+ default: M(() => [
2411
+ y(a(ke), {
2412
+ type: "primary",
2413
+ size: "large",
2414
+ loading: i.value,
2415
+ class: "login-btn",
2416
+ onClick: f
2417
+ }, {
2418
+ default: M(() => [
2419
+ i.value ? (s(), c("span", rn, "登录中...")) : (s(), c("span", ln, "登 录"))
2420
+ ]),
2421
+ _: 1
2422
+ }, 8, ["loading"])
2423
+ ]),
2424
+ _: 1
2425
+ })
2426
+ ]),
2427
+ _: 1
2428
+ }, 8, ["model"]),
2429
+ p[8] || (p[8] = Ue('<div class="form-footer" data-v-15fc7de5><p data-v-15fc7de5>其他登录方式</p><div class="social-login" data-v-15fc7de5><button class="social-btn" title="企业微信" data-v-15fc7de5><svg viewBox="0 0 24 24" fill="currentColor" data-v-15fc7de5><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z" data-v-15fc7de5></path></svg></button><button class="social-btn" title="钉钉" data-v-15fc7de5><svg viewBox="0 0 24 24" fill="currentColor" data-v-15fc7de5><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.64 6.8c-.15 1.58-.8 5.42-1.13 7.19-.14.75-.42 1-.68 1.03-.58.05-1.02-.38-1.58-.75-.88-.58-1.38-.94-2.23-1.5-.99-.65-.35-1.01.22-1.59.15-.15 2.71-2.48 2.76-2.69a.2.2 0 00-.05-.18c-.06-.05-.14-.03-.21-.02-.09.02-1.49.95-4.22 2.79-.4.27-.76.41-1.08.4-.36-.01-1.04-.2-1.55-.37-.63-.2-1.12-.31-1.08-.66.02-.18.27-.36.74-.55 2.92-1.27 4.86-2.11 5.83-2.51 2.78-1.16 3.35-1.36 3.73-1.36.08 0 .27.02.39.12.1.08.13.19.14.27-.01.06.01.24 0 .38z" data-v-15fc7de5></path></svg></button><button class="social-btn" title="飞书" data-v-15fc7de5><svg viewBox="0 0 24 24" fill="currentColor" data-v-15fc7de5><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" data-v-15fc7de5></path></svg></button></div></div>', 1))
2430
+ ]),
2431
+ p[9] || (p[9] = e("div", { class: "copyright" }, [
2432
+ e("p", null, "© 2024 XTO Team. All rights reserved.")
2433
+ ], -1))
2434
+ ])
2435
+ ]));
2436
+ }
2437
+ }), dn = /* @__PURE__ */ ae(cn, [["__scopeId", "data-v-15fc7de5"]]), un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2438
+ __proto__: null,
2439
+ default: dn
2440
+ }, Symbol.toStringTag, { value: "Module" })), mn = { class: "error-page" }, pn = { class: "error-container" }, vn = { class: "error-content" }, hn = { class: "error-actions" }, _n = /* @__PURE__ */ se({
2441
+ __name: "404",
2442
+ setup(t) {
2443
+ const r = me(), d = () => {
2444
+ r.push("/");
2445
+ };
2446
+ return (i, o) => (s(), c("div", mn, [
2447
+ e("div", pn, [
2448
+ o[7] || (o[7] = e("div", { class: "error-bg" }, [
2449
+ e("div", { class: "bg-circle circle-1" }),
2450
+ e("div", { class: "bg-circle circle-2" }),
2451
+ e("div", { class: "bg-circle circle-3" })
2452
+ ], -1)),
2453
+ e("div", vn, [
2454
+ o[5] || (o[5] = Ue('<div class="error-code" data-v-3a9e61ae><span class="code-digit" data-v-3a9e61ae>4</span><span class="code-zero" data-v-3a9e61ae><span class="zero-inner" data-v-3a9e61ae>0</span></span><span class="code-digit" data-v-3a9e61ae>4</span></div><div class="error-illustration" data-v-3a9e61ae><svg viewBox="0 0 200 120" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-3a9e61ae><rect x="40" y="20" width="120" height="80" rx="8" fill="var(--color-fill)" stroke="var(--color-border)" stroke-width="2" data-v-3a9e61ae></rect><rect x="50" y="30" width="100" height="60" rx="4" fill="var(--bg-color)" data-v-3a9e61ae></rect><line x1="60" y1="45" x2="140" y2="45" stroke="var(--color-border-light)" stroke-width="2" data-v-3a9e61ae></line><line x1="60" y1="55" x2="120" y2="55" stroke="var(--color-border-light)" stroke-width="2" data-v-3a9e61ae></line><line x1="60" y1="65" x2="100" y2="65" stroke="var(--color-border-light)" stroke-width="2" data-v-3a9e61ae></line><text x="100" y="75" text-anchor="middle" fill="var(--color-primary)" font-size="24" font-weight="600" data-v-3a9e61ae>?</text><circle cx="150" cy="35" r="12" stroke="var(--color-primary)" stroke-width="2" fill="none" data-v-3a9e61ae></circle><line x1="158" y1="43" x2="168" y2="53" stroke="var(--color-primary)" stroke-width="2" stroke-linecap="round" data-v-3a9e61ae></line></svg></div><h1 class="error-title" data-v-3a9e61ae>页面不存在</h1><p class="error-desc" data-v-3a9e61ae>抱歉,您访问的页面不存在或已被删除</p>', 4)),
2455
+ e("div", hn, [
2456
+ y(a(ke), {
2457
+ type: "primary",
2458
+ size: "large",
2459
+ onClick: d
2460
+ }, {
2461
+ icon: M(() => [...o[1] || (o[1] = [
2462
+ e("svg", {
2463
+ viewBox: "0 0 24 24",
2464
+ fill: "none",
2465
+ stroke: "currentColor",
2466
+ "stroke-width": "2"
2467
+ }, [
2468
+ e("path", { d: "M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2V9z" }),
2469
+ e("polyline", { points: "9,22 9,12 15,12 15,22" })
2470
+ ], -1)
2471
+ ])]),
2472
+ default: M(() => [
2473
+ o[2] || (o[2] = he(" 返回首页 ", -1))
2474
+ ]),
2475
+ _: 1
2476
+ }),
2477
+ y(a(ke), {
2478
+ size: "large",
2479
+ onClick: o[0] || (o[0] = (l) => a(r).go(-1))
2480
+ }, {
2481
+ icon: M(() => [...o[3] || (o[3] = [
2482
+ e("svg", {
2483
+ viewBox: "0 0 24 24",
2484
+ fill: "none",
2485
+ stroke: "currentColor",
2486
+ "stroke-width": "2"
2487
+ }, [
2488
+ e("path", { d: "M19 12H5M12 19l-7-7 7-7" })
2489
+ ], -1)
2490
+ ])]),
2491
+ default: M(() => [
2492
+ o[4] || (o[4] = he(" 返回上一页 ", -1))
2493
+ ]),
2494
+ _: 1
2495
+ })
2496
+ ]),
2497
+ o[6] || (o[6] = e("div", { class: "error-tip" }, [
2498
+ e("p", null, "您可以尝试:"),
2499
+ e("ul", null, [
2500
+ e("li", null, "检查您输入的网址是否正确"),
2501
+ e("li", null, "返回首页重新浏览"),
2502
+ e("li", null, "联系管理员反馈问题")
2503
+ ])
2504
+ ], -1))
2505
+ ])
2506
+ ])
2507
+ ]));
2508
+ }
2509
+ }), fn = /* @__PURE__ */ ae(_n, [["__scopeId", "data-v-3a9e61ae"]]), it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2510
+ __proto__: null,
2511
+ default: fn
2512
+ }, Symbol.toStringTag, { value: "Module" })), gn = { class: "error-page" }, yn = { class: "error-container" }, kn = { class: "error-content" }, wn = { class: "error-actions" }, bn = /* @__PURE__ */ se({
2513
+ __name: "403",
2514
+ setup(t) {
2515
+ const r = me(), d = () => {
2516
+ r.push("/");
2517
+ };
2518
+ return (i, o) => (s(), c("div", gn, [
2519
+ e("div", yn, [
2520
+ o[7] || (o[7] = e("div", { class: "error-bg" }, [
2521
+ e("div", { class: "bg-circle circle-1" }),
2522
+ e("div", { class: "bg-circle circle-2" }),
2523
+ e("div", { class: "bg-circle circle-3" })
2524
+ ], -1)),
2525
+ e("div", kn, [
2526
+ o[5] || (o[5] = Ue('<div class="error-code" data-v-c733ebac><span class="code-digit" data-v-c733ebac>4</span><span class="code-zero warning" data-v-c733ebac><span class="zero-inner" data-v-c733ebac>0</span></span><span class="code-digit" data-v-c733ebac>3</span></div><div class="error-illustration" data-v-c733ebac><svg viewBox="0 0 200 120" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-c733ebac><path d="M100 15 L150 35 L150 70 C150 95 100 110 100 110 C100 110 50 95 50 70 L50 35 Z" fill="var(--color-warning-lighter)" stroke="var(--color-warning)" stroke-width="2" data-v-c733ebac></path><rect x="85" y="55" width="30" height="25" rx="4" fill="var(--color-warning)" data-v-c733ebac></rect><path d="M92 55 V48 A8 8 0 0 1 108 48 V55" fill="none" stroke="var(--color-warning)" stroke-width="3" data-v-c733ebac></path><circle cx="100" cy="67" r="6" fill="none" stroke="#fff" stroke-width="2" data-v-c733ebac></circle><line x1="96" y1="63" x2="104" y2="71" stroke="#fff" stroke-width="2" data-v-c733ebac></line></svg></div><h1 class="error-title" data-v-c733ebac>无访问权限</h1><p class="error-desc" data-v-c733ebac>抱歉,您没有权限访问此页面,请联系管理员获取权限</p>', 4)),
2527
+ e("div", wn, [
2528
+ y(a(ke), {
2529
+ type: "primary",
2530
+ size: "large",
2531
+ onClick: d
2532
+ }, {
2533
+ icon: M(() => [...o[1] || (o[1] = [
2534
+ e("svg", {
2535
+ viewBox: "0 0 24 24",
2536
+ fill: "none",
2537
+ stroke: "currentColor",
2538
+ "stroke-width": "2"
2539
+ }, [
2540
+ e("path", { d: "M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2V9z" }),
2541
+ e("polyline", { points: "9,22 9,12 15,12 15,22" })
2542
+ ], -1)
2543
+ ])]),
2544
+ default: M(() => [
2545
+ o[2] || (o[2] = he(" 返回首页 ", -1))
2546
+ ]),
2547
+ _: 1
2548
+ }),
2549
+ y(a(ke), {
2550
+ size: "large",
2551
+ onClick: o[0] || (o[0] = (l) => a(r).go(-1))
2552
+ }, {
2553
+ icon: M(() => [...o[3] || (o[3] = [
2554
+ e("svg", {
2555
+ viewBox: "0 0 24 24",
2556
+ fill: "none",
2557
+ stroke: "currentColor",
2558
+ "stroke-width": "2"
2559
+ }, [
2560
+ e("path", { d: "M19 12H5M12 19l-7-7 7-7" })
2561
+ ], -1)
2562
+ ])]),
2563
+ default: M(() => [
2564
+ o[4] || (o[4] = he(" 返回上一页 ", -1))
2565
+ ]),
2566
+ _: 1
2567
+ })
2568
+ ]),
2569
+ o[6] || (o[6] = e("div", { class: "error-tip" }, [
2570
+ e("p", null, "可能的原因:"),
2571
+ e("ul", null, [
2572
+ e("li", null, "您的账号权限不足"),
2573
+ e("li", null, "该页面需要特定角色才能访问"),
2574
+ e("li", null, "您的登录状态已过期")
2575
+ ])
2576
+ ], -1))
2577
+ ])
2578
+ ])
2579
+ ]));
2580
+ }
2581
+ }), Rn = /* @__PURE__ */ ae(bn, [["__scopeId", "data-v-c733ebac"]]);
2582
+ function Fn() {
2583
+ const t = pe(), r = oe(), d = ze(), i = b(() => r.userName || ""), o = b(() => r.userInfo), l = b(() => t.appName), _ = b(() => d.isLoggedIn), u = b(() => t.isDark), f = b(() => t.theme), v = b(() => t.isCollapsed), p = b(() => t.layout);
2584
+ return {
2585
+ userName: i,
2586
+ userInfo: o,
2587
+ appName: l,
2588
+ isLoggedIn: _,
2589
+ isDark: u,
2590
+ theme: f,
2591
+ isCollapsed: v,
2592
+ layout: p,
2593
+ toggleTheme: () => {
2594
+ t.toggleTheme();
2595
+ },
2596
+ toggleCollapse: () => {
2597
+ t.toggleCollapse();
2598
+ }
2599
+ };
2600
+ }
2601
+ function Kn() {
2602
+ const t = oe();
2603
+ return {
2604
+ isLoggedIn: b(() => t.isLoggedIn)
2605
+ };
2606
+ }
2607
+ function Wn(t, r = {}) {
2608
+ const { rules: d, onSubmit: i } = r, o = g(), l = We({ ...t }), _ = g(!1), u = g(!1), f = g(!1), v = () => {
2609
+ k(), f.value = !1, u.value = !0;
2610
+ }, p = (A) => {
2611
+ Object.assign(l, A), f.value = !0, u.value = !0;
2612
+ }, h = () => {
2613
+ u.value = !1, k();
2614
+ }, k = () => {
2615
+ var A;
2616
+ Object.keys(t).forEach((H) => {
2617
+ l[H] = t[H];
2618
+ }), (A = o.value) == null || A.resetFields();
2619
+ };
2620
+ return {
2621
+ formRef: o,
2622
+ formData: l,
2623
+ rules: d,
2624
+ loading: _,
2625
+ visible: u,
2626
+ isEdit: f,
2627
+ openAdd: v,
2628
+ openEdit: p,
2629
+ close: h,
2630
+ resetForm: k,
2631
+ handleSubmit: async () => {
2632
+ var A;
2633
+ try {
2634
+ await ((A = o.value) == null ? void 0 : A.validate()), _.value = !0, await (i == null ? void 0 : i(l)), h();
2635
+ } catch (H) {
2636
+ console.error(H);
2637
+ } finally {
2638
+ _.value = !1;
2639
+ }
2640
+ }
2641
+ };
2642
+ }
2643
+ function jn(t) {
2644
+ const { fetchData: r, defaultPageSize: d = 10 } = t, i = g(!1), o = g([]), l = g(0), _ = g(1), u = g(d), f = We({}), v = async () => {
2645
+ i.value = !0;
2646
+ try {
2647
+ const R = {
2648
+ ...f,
2649
+ page: _.value,
2650
+ pageSize: u.value
2651
+ }, O = await r(R);
2652
+ o.value = O.list, l.value = O.total;
2653
+ } catch (R) {
2654
+ console.error(R);
2655
+ } finally {
2656
+ i.value = !1;
2657
+ }
2658
+ }, p = () => {
2659
+ _.value = 1, v();
2660
+ }, h = () => {
2661
+ Object.keys(f).forEach((R) => {
2662
+ f[R] = void 0;
2663
+ }), _.value = 1, v();
2664
+ }, k = (R) => {
2665
+ _.value = R, v();
2666
+ }, q = (R) => {
2667
+ u.value = R, _.value = 1, v();
2668
+ }, A = () => {
2669
+ v();
2670
+ }, H = b(() => ({
2671
+ current: _.value,
2672
+ pageSize: u.value,
2673
+ total: l.value
2674
+ }));
2675
+ return {
2676
+ loading: i,
2677
+ data: o,
2678
+ total: l,
2679
+ currentPage: _,
2680
+ pageSize: u,
2681
+ searchParams: f,
2682
+ pagination: H,
2683
+ getData: v,
2684
+ handleSearch: p,
2685
+ handleReset: h,
2686
+ handlePageChange: k,
2687
+ handleSizeChange: q,
2688
+ refresh: A
2689
+ };
2690
+ }
2691
+ const Ye = Ie("locale", () => {
2692
+ const t = U.get("locale") || "zh-CN", r = $t(t), d = g(t), i = Lt(), { t: o, messages: l, setLocale: _, mergeMessages: u } = Mt(), f = b(() => {
2693
+ const k = i.find((q) => q.code === d.value);
2694
+ return (k == null ? void 0 : k.name) || d.value;
2695
+ });
2696
+ return {
2697
+ locale: d,
2698
+ localeName: f,
2699
+ locales: i,
2700
+ messages: l,
2701
+ t: o,
2702
+ changeLocale: (k) => {
2703
+ d.value = k, _(k), U.set("locale", k), r.setLocale(k);
2704
+ },
2705
+ addMessages: (k) => {
2706
+ u(k);
2707
+ },
2708
+ initLocale: () => {
2709
+ _(t);
2710
+ },
2711
+ provider: r
2712
+ };
2713
+ }), xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2714
+ __proto__: null,
2715
+ useLocaleStore: Ye
2716
+ }, Symbol.toStringTag, { value: "Module" }));
2717
+ function qn() {
2718
+ const t = Ye();
2719
+ return {
2720
+ /** 当前语言代码 */
2721
+ locale: t.locale,
2722
+ /** 当前语言名称 */
2723
+ localeName: t.localeName,
2724
+ /** 支持的语言列表 */
2725
+ locales: t.locales,
2726
+ /** 翻译函数 */
2727
+ t: t.t,
2728
+ /** 当前语言包 */
2729
+ messages: t.messages,
2730
+ /** 切换语言 */
2731
+ setLocale: t.changeLocale,
2732
+ /** 添加自定义翻译 */
2733
+ addMessages: t.addMessages
2734
+ };
2735
+ }
2736
+ function Hn() {
2737
+ return Ye().t;
2738
+ }
2739
+ function Xn(t) {
2740
+ const r = oe(), d = ie();
2741
+ return r.isLoggedIn ? d.hasPermission(t) : !1;
2742
+ }
2743
+ function Yn(t) {
2744
+ return oe().isLoggedIn;
2745
+ }
2746
+ function Gn() {
2747
+ return !0;
2748
+ }
2749
+ const ct = [
2750
+ {
2751
+ path: "/login",
2752
+ name: "Login",
2753
+ component: () => Promise.resolve().then(() => un),
2754
+ meta: {
2755
+ title: "登录",
2756
+ hidden: !0
2757
+ }
2758
+ }
2759
+ ], dt = {
2760
+ path: "/",
2761
+ name: "Layout",
2762
+ component: () => Promise.resolve().then(() => qa),
2763
+ redirect: "/dashboard",
2764
+ children: [
2765
+ {
2766
+ path: "/dashboard",
2767
+ name: "Dashboard",
2768
+ component: () => import("./index-BMQao91y.js"),
2769
+ meta: {
2770
+ title: "仪表盘",
2771
+ icon: "dashboard",
2772
+ keepAlive: !0,
2773
+ affix: !0
2774
+ }
2775
+ },
2776
+ {
2777
+ path: "/system/user",
2778
+ name: "SystemUser",
2779
+ component: () => import("./index-D4LWXVnG.js"),
2780
+ meta: {
2781
+ title: "用户管理",
2782
+ icon: "user",
2783
+ keepAlive: !0
2784
+ }
2785
+ },
2786
+ {
2787
+ path: "/system/role",
2788
+ name: "SystemRole",
2789
+ component: () => import("./index-dk0diNwi.js"),
2790
+ meta: {
2791
+ title: "角色管理",
2792
+ icon: "role",
2793
+ keepAlive: !0
2794
+ }
2795
+ },
2796
+ {
2797
+ path: "/system/menu",
2798
+ name: "SystemMenu",
2799
+ component: () => import("./index-BYAkZ2gD.js"),
2800
+ meta: {
2801
+ title: "菜单管理",
2802
+ icon: "menu",
2803
+ keepAlive: !0
2804
+ }
2805
+ },
2806
+ // catch-all 路由:让 404 在 Layout 内部渲染,保持左侧菜单显示
2807
+ {
2808
+ path: "/:pathMatch(.*)*",
2809
+ name: "CatchAll",
2810
+ component: () => Promise.resolve().then(() => it),
2811
+ meta: {
2812
+ title: "404",
2813
+ hidden: !0
2814
+ }
2815
+ }
2816
+ ]
2817
+ }, Jn = [
2818
+ {
2819
+ path: "/dashboard",
2820
+ name: "Dashboard",
2821
+ component: () => import("./index-BMQao91y.js"),
2822
+ meta: {
2823
+ title: "仪表盘",
2824
+ icon: "dashboard",
2825
+ keepAlive: !0,
2826
+ affix: !0
2827
+ }
2828
+ },
2829
+ {
2830
+ path: "/system",
2831
+ name: "System",
2832
+ redirect: "/system/user",
2833
+ meta: {
2834
+ title: "系统管理",
2835
+ icon: "setting"
2836
+ },
2837
+ children: [
2838
+ {
2839
+ path: "user",
2840
+ name: "SystemUser",
2841
+ component: () => import("./index-D4LWXVnG.js"),
2842
+ meta: {
2843
+ title: "用户管理",
2844
+ icon: "user",
2845
+ keepAlive: !0
2846
+ }
2847
+ },
2848
+ {
2849
+ path: "role",
2850
+ name: "SystemRole",
2851
+ component: () => import("./index-dk0diNwi.js"),
2852
+ meta: {
2853
+ title: "角色管理",
2854
+ icon: "role",
2855
+ keepAlive: !0
2856
+ }
2857
+ },
2858
+ {
2859
+ path: "menu",
2860
+ name: "SystemMenu",
2861
+ component: () => import("./index-BYAkZ2gD.js"),
2862
+ meta: {
2863
+ title: "菜单管理",
2864
+ icon: "menu",
2865
+ keepAlive: !0
2866
+ }
2867
+ }
2868
+ ]
2869
+ }
2870
+ ], Cn = [
2871
+ {
2872
+ menuCode: "dashboard",
2873
+ menuName: "仪表盘",
2874
+ menuUrl: "/dashboard",
2875
+ icon: "dashboard",
2876
+ closable: !0,
2877
+ isDefault: !0,
2878
+ isOut: !1
2879
+ },
2880
+ {
2881
+ menuCode: "system",
2882
+ menuName: "系统管理",
2883
+ menuUrl: "/system",
2884
+ icon: "setting",
2885
+ closable: !1,
2886
+ isDefault: !1,
2887
+ isOut: !1,
2888
+ children: [
2889
+ {
2890
+ menuCode: "system_user",
2891
+ menuName: "用户管理",
2892
+ menuUrl: "/system/user",
2893
+ icon: "user",
2894
+ closable: !0,
2895
+ isDefault: !1,
2896
+ isOut: !1
2897
+ },
2898
+ {
2899
+ menuCode: "system_role",
2900
+ menuName: "角色管理",
2901
+ menuUrl: "/system/role",
2902
+ icon: "role",
2903
+ closable: !0,
2904
+ isDefault: !1,
2905
+ isOut: !1
2906
+ },
2907
+ {
2908
+ menuCode: "system_menu",
2909
+ menuName: "菜单管理",
2910
+ menuUrl: "/system/menu",
2911
+ icon: "menu",
2912
+ closable: !0,
2913
+ isDefault: !1,
2914
+ isOut: !1
2915
+ }
2916
+ ]
2917
+ }
2918
+ ], ut = je({
2919
+ history: qe(),
2920
+ routes: [...ct, dt],
2921
+ scrollBehavior: () => ({ left: 0, top: 0 })
2922
+ }), $n = ["/login"];
2923
+ ut.beforeEach(async (t, r, d) => {
2924
+ const i = pe();
2925
+ if (i.initTheme(), tt())
2926
+ if (t.path === "/login")
2927
+ d({ path: "/" });
2928
+ else {
2929
+ const o = oe();
2930
+ o.isLoggedIn || (o.setUserInfo({
2931
+ appId: Be(),
2932
+ userId: "1",
2933
+ userName: "管理员",
2934
+ departmentName: "技术部",
2935
+ email: "admin@example.com",
2936
+ mobilePhone: "13800138000",
2937
+ positionName: "管理员",
2938
+ avatar: ""
2939
+ }), ie().setMenuList(Cn)), t.name && t.meta.keepAlive && i.addCachedView(t.name), d();
2940
+ }
2941
+ else
2942
+ $n.includes(t.path) ? d() : d("/login");
2943
+ });
2944
+ function Zn() {
2945
+ const t = je({
2946
+ history: qe(),
2947
+ routes: [...ct, dt]
2948
+ });
2949
+ ut.matcher = t.matcher;
2950
+ }
2951
+ function Qn(t, r = {}) {
2952
+ const d = r.indexPath || "/dashboard", i = r.logoSrc || "/vite.svg", o = {
2953
+ path: "/:pathMatch(.*)*",
2954
+ name: "CatchAll",
2955
+ component: () => Promise.resolve().then(() => it),
2956
+ meta: {
2957
+ title: "404"
2958
+ }
2959
+ };
2960
+ return {
2961
+ path: "/",
2962
+ name: "Layout",
2963
+ component: se({
2964
+ name: "LayoutWrapper",
2965
+ render() {
2966
+ return yt(rt, { logoSrc: i });
2967
+ }
2968
+ }),
2969
+ redirect: d,
2970
+ children: [...t, o]
2971
+ };
2972
+ }
2973
+ function el(t, r = {}) {
2974
+ return je({
2975
+ history: qe(r.base),
2976
+ routes: t,
2977
+ scrollBehavior: () => ({ left: 0, top: 0 })
2978
+ });
2979
+ }
2980
+ const Ln = ["/login", "/404", "/403"];
2981
+ function tl(t, r = {}) {
2982
+ const d = r.whiteList || Ln, i = r.loginPath || "/login", o = r.homePath || "/";
2983
+ t.beforeEach(async (l, _, u) => {
2984
+ const f = pe(), v = oe(), p = ie();
2985
+ if (f.initTheme(), et())
2986
+ if (l.path === i)
2987
+ u({ path: o });
2988
+ else if (v.isLoggedIn)
2989
+ l.name && l.meta.keepAlive && f.addCachedView(l.name), u();
2990
+ else
2991
+ try {
2992
+ if (r.fetchUserInfo) {
2993
+ const k = await r.fetchUserInfo();
2994
+ v.setUserInfo(k);
2995
+ } else {
2996
+ const k = await pt();
2997
+ v.setUserInfo(k);
2998
+ }
2999
+ if (r.fetchMenu) {
3000
+ const k = await r.fetchMenu();
3001
+ p.setMenuList(k);
3002
+ } else {
3003
+ const k = await vt(r.appId);
3004
+ p.setMenuList(k);
3005
+ }
3006
+ r.onLoginSuccess && r.onLoginSuccess(), l.name && l.meta.keepAlive && f.addCachedView(l.name), u({ ...l, replace: !0 });
3007
+ } catch (k) {
3008
+ console.error("获取用户信息失败:", k), v.clearUserInfo(), p.clearMenu(), st(), u({ path: i, query: { redirect: l.fullPath } });
3009
+ }
3010
+ else
3011
+ d.includes(l.path) ? u() : u({ path: i, query: { redirect: l.fullPath } });
3012
+ }), t.afterEach(() => {
3013
+ });
3014
+ }
3015
+ var Mn = /* @__PURE__ */ ((t) => (t[t.ENABLED = 1] = "ENABLED", t[t.DISABLED = 0] = "DISABLED", t))(Mn || {}), Sn = /* @__PURE__ */ ((t) => (t[t.UNKNOWN = 0] = "UNKNOWN", t[t.MALE = 1] = "MALE", t[t.FEMALE = 2] = "FEMALE", t))(Sn || {}), Nn = /* @__PURE__ */ ((t) => (t[t.DIRECTORY = 0] = "DIRECTORY", t[t.MENU = 1] = "MENU", t[t.BUTTON = 2] = "BUTTON", t))(Nn || {});
3016
+ const sl = {
3017
+ 1: "启用",
3018
+ 0: "禁用"
3019
+ }, ol = {
3020
+ 0: "未知",
3021
+ 1: "男",
3022
+ 2: "女"
3023
+ }, al = {
3024
+ 0: "目录",
3025
+ 1: "菜单",
3026
+ 2: "按钮"
3027
+ }, nl = [
3028
+ {
3029
+ label: "启用",
3030
+ value: 1
3031
+ /* ENABLED */
3032
+ },
3033
+ {
3034
+ label: "禁用",
3035
+ value: 0
3036
+ /* DISABLED */
3037
+ }
3038
+ ], ll = [
3039
+ {
3040
+ label: "未知",
3041
+ value: 0
3042
+ /* UNKNOWN */
3043
+ },
3044
+ {
3045
+ label: "男",
3046
+ value: 1
3047
+ /* MALE */
3048
+ },
3049
+ {
3050
+ label: "女",
3051
+ value: 2
3052
+ /* FEMALE */
3053
+ }
3054
+ ], rl = [
3055
+ {
3056
+ label: "目录",
3057
+ value: 0
3058
+ /* DIRECTORY */
3059
+ },
3060
+ {
3061
+ label: "菜单",
3062
+ value: 1
3063
+ /* MENU */
3064
+ },
3065
+ {
3066
+ label: "按钮",
3067
+ value: 2
3068
+ /* BUTTON */
3069
+ }
3070
+ ], il = {
3071
+ mounted(t, r) {
3072
+ var _, u;
3073
+ const d = oe(), i = ie();
3074
+ if (!d.isLoggedIn) {
3075
+ (_ = t.parentNode) == null || _.removeChild(t);
3076
+ return;
3077
+ }
3078
+ const o = r.value, l = Array.isArray(o) ? o : [o];
3079
+ i.hasPermission(l) || (u = t.parentNode) == null || u.removeChild(t);
3080
+ }
3081
+ };
3082
+ function cl(t) {
3083
+ return ht({
3084
+ appId: t.appId,
3085
+ clientId: t.clientId,
3086
+ apiBaseUrl: t.apiBaseUrl
3087
+ }), t.locale && Promise.resolve().then(() => xn).then(({ useLocaleStore: r }) => {
3088
+ r().changeLocale(t.locale);
3089
+ }), {
3090
+ config: {
3091
+ appName: t.appName || "XTO App",
3092
+ appId: Be(),
3093
+ clientId: at(),
3094
+ apiBaseUrl: _t(),
3095
+ indexPath: t.indexPath || "/dashboard",
3096
+ loginPath: t.loginPath || "/login",
3097
+ locale: t.locale || "zh-CN"
3098
+ }
3099
+ };
3100
+ }
3101
+ export {
3102
+ pe as A,
3103
+ Kn as B,
3104
+ ze as C,
3105
+ Wn as D,
3106
+ qn as E,
3107
+ Bn as F,
3108
+ Sn as G,
3109
+ Ts as H,
3110
+ Ye as I,
3111
+ ie as J,
3112
+ jn as K,
3113
+ rt as L,
3114
+ Nn as M,
3115
+ oe as N,
3116
+ Mn as S,
3117
+ On as T,
3118
+ ae as _,
3119
+ nl as a,
3120
+ rl as b,
3121
+ Rn as c,
3122
+ ll as d,
3123
+ ol as e,
3124
+ al as f,
3125
+ fn as g,
3126
+ Qe as h,
3127
+ dn as i,
3128
+ sl as j,
3129
+ Qn as k,
3130
+ el as l,
3131
+ Hn as m,
3132
+ cl as n,
3133
+ Jn as o,
3134
+ Xn as p,
3135
+ Yn as q,
3136
+ Gn as r,
3137
+ dt as s,
3138
+ Cn as t,
3139
+ il as u,
3140
+ Zn as v,
3141
+ ut as w,
3142
+ tl as x,
3143
+ ct as y,
3144
+ Fn as z
3145
+ };