xto-fronted 0.4.78 → 0.4.80

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