xto-fronted 0.4.68 → 0.4.69

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