xto-fronted 0.4.99 → 0.4.101

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