xto-fronted 0.8.0 → 0.8.1

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