xto-fronted 0.4.110 → 0.4.112

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