xto-fronted 0.4.68 → 0.4.70

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