xto-fronted 0.4.102 → 0.4.103

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