mamba-layout 0.27.0 → 0.29.0
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.
- package/dist/index.js +127 -126
- package/dist/layout.global.js +26 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { getCurrentInstance as
|
|
2
|
-
import { Fold as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { createI18n as
|
|
1
|
+
import { getCurrentInstance as pt, readonly as mt, ref as N, computed as S, unref as f, onActivated as ht, onMounted as Re, onUnmounted as Ke, watch as re, provide as gt, defineComponent as M, openBlock as l, createElementBlock as y, normalizeClass as K, resolveComponent as L, Fragment as U, createBlock as k, resolveDynamicComponent as Ae, mergeProps as Je, withCtx as C, createCommentVNode as I, createElementVNode as d, toDisplayString as E, renderList as J, withDirectives as ft, vShow as vt, createVNode as _, renderSlot as Z, watchEffect as Oe, Transition as Ee } from "vue";
|
|
2
|
+
import { Fold as Fe, ArrowDown as _e, Moon as yt, Sunny as bt, Expand as At, User as _t, ArrowLeft as Ct, ArrowRight as he, Clock as St } from "@element-plus/icons-vue";
|
|
3
|
+
import { useRouter as He } from "vue-router";
|
|
4
|
+
import { createI18n as wt } from "vue-i18n";
|
|
5
5
|
function ie() {
|
|
6
|
-
const n =
|
|
6
|
+
const n = pt();
|
|
7
7
|
return n ? n.appContext.config.globalProperties.$route : null;
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const Pt = 3600 * 24 * 7, Ce = "UTC", Qe = "timezone", Tt = [
|
|
10
10
|
"UTC",
|
|
11
11
|
"Asia/Shanghai",
|
|
12
12
|
"Asia/Hong_Kong",
|
|
@@ -36,7 +36,7 @@ const wt = 3600 * 24 * 7, Ce = "UTC", He = "timezone", Pt = [
|
|
|
36
36
|
}
|
|
37
37
|
return e;
|
|
38
38
|
},
|
|
39
|
-
set(n, e, t =
|
|
39
|
+
set(n, e, t = Pt) {
|
|
40
40
|
const a = me(), o = {
|
|
41
41
|
value: e,
|
|
42
42
|
expire: t === null ? null : Date.now() + t * 1e3
|
|
@@ -47,23 +47,23 @@ const wt = 3600 * 24 * 7, Ce = "UTC", He = "timezone", Pt = [
|
|
|
47
47
|
var n;
|
|
48
48
|
(n = me()) == null || n.clear();
|
|
49
49
|
}
|
|
50
|
-
},
|
|
51
|
-
if (!
|
|
50
|
+
}, kt = (n) => typeof n == "object" && n !== null, De = (n) => {
|
|
51
|
+
if (!kt(n) || Object.prototype.toString.call(n) !== "[object Object]") return !1;
|
|
52
52
|
const e = Object.getPrototypeOf(n);
|
|
53
53
|
return e === null || e === Object.prototype;
|
|
54
54
|
};
|
|
55
|
-
function
|
|
55
|
+
function ze(n, e) {
|
|
56
56
|
if (!De(n)) return e;
|
|
57
57
|
if (!De(e)) return n;
|
|
58
58
|
const t = n;
|
|
59
59
|
return Object.keys(e).concat(Object.getOwnPropertySymbols(e)).forEach((a) => {
|
|
60
|
-
t[a] =
|
|
60
|
+
t[a] = ze(
|
|
61
61
|
t[a],
|
|
62
62
|
e[a]
|
|
63
63
|
);
|
|
64
64
|
}), t;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Ze() {
|
|
67
67
|
const n = typeof navigator > "u" ? "en-US" : navigator.language;
|
|
68
68
|
return String(W.get("locale", n)).includes("zh") ? "zh-CN" : "en-US";
|
|
69
69
|
}
|
|
@@ -72,15 +72,15 @@ const Ne = (n, e, t) => {
|
|
|
72
72
|
return ((a = e == null ? void 0 : e[t]) == null ? void 0 : a[n]) || "";
|
|
73
73
|
}, $ = (n, e, t = "") => {
|
|
74
74
|
const a = n;
|
|
75
|
-
return Ne(e, a,
|
|
76
|
-
}, le = (n = "") => n.replace(/【.*】/, ""),
|
|
75
|
+
return Ne(e, a, Ze()) || t || Ne(e, a, "en-US");
|
|
76
|
+
}, le = (n = "") => n.replace(/【.*】/, ""), je = (n, e, t) => {
|
|
77
77
|
var a, o, s, r, c;
|
|
78
78
|
for (const g of e) {
|
|
79
79
|
const i = ((a = g.path) == null ? void 0 : a.replace(/\/:(\w+)/g, "/([^/]+)")) || "", h = new RegExp(`^${i}$`);
|
|
80
80
|
if (((o = g.path) == null ? void 0 : o.toLowerCase()) === n || h.test(n))
|
|
81
81
|
return ((s = g.meta) == null ? void 0 : s.visible) === "0" && (t == null ? void 0 : t.path) || "";
|
|
82
82
|
if ((r = g.children) != null && r.length) {
|
|
83
|
-
const v =
|
|
83
|
+
const v = je(
|
|
84
84
|
n,
|
|
85
85
|
g.children,
|
|
86
86
|
((c = g.meta) == null ? void 0 : c.visible) === "1" ? g : t
|
|
@@ -89,25 +89,25 @@ const Ne = (n, e, t) => {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return "";
|
|
92
|
-
},
|
|
92
|
+
}, It = (n, e) => {
|
|
93
93
|
const t = n.resolve(e);
|
|
94
94
|
if (!(t != null && t.name)) return !1;
|
|
95
95
|
const a = String(t.name).split("-").filter((s) => !!s && s !== "index"), o = t.path.split("-").join("/").split("/").filter(Boolean);
|
|
96
96
|
return a.length === o.length && a.every((s, r) => s === o[r]);
|
|
97
|
-
}, ne = (n) => typeof n == "string" &&
|
|
97
|
+
}, ne = (n) => typeof n == "string" && qe(n) ? n : "", qe = (n) => {
|
|
98
98
|
try {
|
|
99
99
|
return new Intl.DateTimeFormat("en-US", { timeZone: n }).format(/* @__PURE__ */ new Date()), !0;
|
|
100
100
|
} catch {
|
|
101
101
|
return !1;
|
|
102
102
|
}
|
|
103
|
-
},
|
|
104
|
-
ne(W.get(
|
|
105
|
-
),
|
|
106
|
-
function
|
|
103
|
+
}, Ye = () => ne(Intl.DateTimeFormat().resolvedOptions().timeZone) || Ce, Se = N(
|
|
104
|
+
ne(W.get(Qe)) || Ye()
|
|
105
|
+
), Lt = () => mt(Se);
|
|
106
|
+
function xt(n) {
|
|
107
107
|
const e = ne(n);
|
|
108
|
-
e && (Se.value = e, W.set(
|
|
108
|
+
e && (Se.value = e, W.set(Qe, e, null));
|
|
109
109
|
}
|
|
110
|
-
const
|
|
110
|
+
const Et = (n) => {
|
|
111
111
|
const e = ne(n) || Ce, t = Me.get(e);
|
|
112
112
|
if (t) return t;
|
|
113
113
|
const a = new Intl.DateTimeFormat("en-US", {
|
|
@@ -121,8 +121,8 @@ const xt = (n) => {
|
|
|
121
121
|
hourCycle: "h23"
|
|
122
122
|
});
|
|
123
123
|
return Me.set(e, a), a;
|
|
124
|
-
},
|
|
125
|
-
const t = ne(n) || Ce, a =
|
|
124
|
+
}, Mt = (n, e) => Et(e).formatToParts(n).reduce((a, o) => (o.type !== "literal" && (a[o.type] = Number(o.value)), a), {}), Dt = (n, e = /* @__PURE__ */ new Date()) => {
|
|
125
|
+
const t = ne(n) || Ce, a = Mt(e, t), o = Date.UTC(
|
|
126
126
|
a.year || 0,
|
|
127
127
|
(a.month || 1) - 1,
|
|
128
128
|
a.day || 1,
|
|
@@ -132,19 +132,19 @@ const xt = (n) => {
|
|
|
132
132
|
e.getMilliseconds()
|
|
133
133
|
);
|
|
134
134
|
return Math.round((o - e.getTime()) / 6e4);
|
|
135
|
-
},
|
|
136
|
-
const t =
|
|
135
|
+
}, We = (n, e = /* @__PURE__ */ new Date()) => {
|
|
136
|
+
const t = Dt(n, e), a = t >= 0 ? "+" : "-", o = Math.abs(t), s = Math.floor(o / 60), r = o % 60;
|
|
137
137
|
return `UTC${a}${String(s).padStart(2, "0")}:${String(
|
|
138
138
|
r
|
|
139
139
|
).padStart(2, "0")}`;
|
|
140
|
-
},
|
|
140
|
+
}, Nt = (n, e = /* @__PURE__ */ new Date()) => `${n} (${We(n, e)})`, Bt = (n = /* @__PURE__ */ new Date()) => {
|
|
141
141
|
const e = new Set(
|
|
142
|
-
[
|
|
143
|
-
|
|
142
|
+
[Ye(), ...Tt, Se.value].filter(
|
|
143
|
+
qe
|
|
144
144
|
)
|
|
145
145
|
);
|
|
146
146
|
return Array.from(e).map((t) => {
|
|
147
|
-
const a =
|
|
147
|
+
const a = We(t, n);
|
|
148
148
|
return {
|
|
149
149
|
value: t,
|
|
150
150
|
label: `${t} (${a})`,
|
|
@@ -152,7 +152,7 @@ const xt = (n) => {
|
|
|
152
152
|
};
|
|
153
153
|
});
|
|
154
154
|
}, G = N("light");
|
|
155
|
-
function
|
|
155
|
+
function Xe() {
|
|
156
156
|
const n = "theme", e = "(prefers-color-scheme: dark)", t = N(!1);
|
|
157
157
|
let a = !1;
|
|
158
158
|
const o = (p) => p === "dark" || p === "light" ? p : null, s = () => typeof window > "u" || typeof window.matchMedia != "function" ? "light" : window.matchMedia(e).matches ? "dark" : "light", r = (p) => {
|
|
@@ -183,35 +183,35 @@ function We() {
|
|
|
183
183
|
syncThemeFromSetting: m
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
const
|
|
187
|
-
typeof location > "u" || (location.href =
|
|
188
|
-
},
|
|
186
|
+
const Ut = () => typeof location > "u" ? "" : location.href, Ge = (n) => (n == null ? void 0 : n.loginPath) || `/login?redirect=${encodeURIComponent(Ut())}`, ce = (n) => {
|
|
187
|
+
typeof location > "u" || (location.href = Ge(n));
|
|
188
|
+
}, Rt = (n) => (n == null ? void 0 : n.userCenterPath) || "/usercenter/home", Kt = (n) => {
|
|
189
189
|
var s;
|
|
190
190
|
const e = n.themeColor, t = {};
|
|
191
191
|
if (e)
|
|
192
192
|
for (const r in e) {
|
|
193
193
|
if (!e[r]) continue;
|
|
194
194
|
const c = "--layout-" + r.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
195
|
-
t[c] = e[r], r == "colorPrimary" &&
|
|
195
|
+
t[c] = e[r], r == "colorPrimary" && Jt(e[r]);
|
|
196
196
|
}
|
|
197
197
|
let a = document.getElementById("layout-style");
|
|
198
198
|
a && ((s = a.parentNode) == null || s.removeChild(a)), a = document.createElement("style"), a.id = "layout-style", document.head.appendChild(a);
|
|
199
199
|
const o = Object.keys(t).map((r) => r + ":" + t[r]).join(";");
|
|
200
200
|
a.innerHTML = `html:root{${o}}`;
|
|
201
201
|
};
|
|
202
|
-
function
|
|
202
|
+
function Jt(n) {
|
|
203
203
|
var o;
|
|
204
204
|
let e = document.getElementById("primary-style");
|
|
205
205
|
if (n == "theme-default" && e) {
|
|
206
206
|
(o = e.parentNode) == null || o.removeChild(e);
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
|
-
const t =
|
|
209
|
+
const t = Ot(n);
|
|
210
210
|
e || (e = document.createElement("style"), e.id = "primary-style", document.head.appendChild(e));
|
|
211
211
|
const a = Object.keys(t).map((s) => s + ":" + t[s]).join(";");
|
|
212
212
|
e.innerHTML = `html:root{${a}}`;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Ot(n) {
|
|
215
215
|
var g;
|
|
216
216
|
const e = ((g = n.match(/\d+/g)) == null ? void 0 : g.map(Number)) || [], [t, a, o] = e, s = `rgb(${t}, ${a}, ${o})`, r = (i) => {
|
|
217
217
|
const h = i / 100, m = Math.min(255, t + (255 - t) * h), v = Math.min(255, a + (255 - a) * h), p = Math.min(255, o + (255 - o) * h);
|
|
@@ -241,21 +241,23 @@ const ge = N({
|
|
|
241
241
|
function O() {
|
|
242
242
|
return ge;
|
|
243
243
|
}
|
|
244
|
-
const
|
|
244
|
+
const Ft = (n) => {
|
|
245
245
|
const e = O(), t = n && f(n) || {};
|
|
246
246
|
if (!(e != null && e.value)) return t;
|
|
247
|
-
ge.value =
|
|
248
|
-
const { syncThemeFromSetting: a } =
|
|
249
|
-
a(),
|
|
250
|
-
},
|
|
247
|
+
ge.value = ze(e.value, t);
|
|
248
|
+
const { syncThemeFromSetting: a } = Xe();
|
|
249
|
+
a(), Kt(ge.value);
|
|
250
|
+
}, Ht = 1024, Ve = N(), ae = N([]), z = N(), V = N(""), ee = N(""), fe = N(""), te = O(), ve = N(!0), ye = N(!1), Qt = N(), oe = () => {
|
|
251
251
|
var n;
|
|
252
252
|
return ((n = te.value.menus) == null ? void 0 : n.filter((e) => {
|
|
253
253
|
var t;
|
|
254
254
|
return ((t = e.meta) == null ? void 0 : t.appId) == ee.value;
|
|
255
255
|
})) || [];
|
|
256
|
-
},
|
|
256
|
+
}, $e = (n, e, t = 0, a) => {
|
|
257
257
|
var i, h, m, v;
|
|
258
|
-
const o = ie()
|
|
258
|
+
const o = ie();
|
|
259
|
+
if (!o) return;
|
|
260
|
+
const s = a ? [...a] : [], r = [], c = [];
|
|
259
261
|
for (const p in n) {
|
|
260
262
|
[...s], n[p];
|
|
261
263
|
const b = ((i = o.meta) == null ? void 0 : i.parent) || o.path, T = ((h = n[p].path) == null ? void 0 : h.replace(/\/:(\w+)/g, "/([^/]+)")) || "", B = new RegExp(`^${T}$`);
|
|
@@ -267,20 +269,20 @@ const Ot = (n) => {
|
|
|
267
269
|
b[t] = p.item, z.value = {
|
|
268
270
|
...p.item,
|
|
269
271
|
paths: b.slice(0, t + 1)
|
|
270
|
-
},
|
|
272
|
+
}, ee.value = ((m = p.item.meta) == null ? void 0 : m.appId) || "", Ve.value = e;
|
|
271
273
|
}
|
|
272
274
|
for (const p in n)
|
|
273
275
|
if (n[p].children && ((v = n[p].children) != null && v.length)) {
|
|
274
276
|
const b = n[p].children || [], T = [...s];
|
|
275
|
-
T[t] = n[p],
|
|
277
|
+
T[t] = n[p], $e(b, n[p], t + 1, T);
|
|
276
278
|
}
|
|
277
|
-
fe.value = o.meta.parentPath ||
|
|
279
|
+
fe.value = o.meta.parentPath || je(
|
|
278
280
|
o.path.toLowerCase(),
|
|
279
281
|
te.value.menus || []
|
|
280
282
|
) || o.path;
|
|
281
|
-
},
|
|
283
|
+
}, et = () => {
|
|
282
284
|
var a, o, s, r, c, g, i, h, m, v;
|
|
283
|
-
|
|
285
|
+
$e(te.value.menus || []), ee.value || (ee.value = ((s = (o = (a = te.value.menus) == null ? void 0 : a.find((p) => {
|
|
284
286
|
var b;
|
|
285
287
|
return (b = p.path) == null ? void 0 : b.startsWith(V.value);
|
|
286
288
|
})) == null ? void 0 : o.meta) == null ? void 0 : s.appId) || "");
|
|
@@ -288,32 +290,31 @@ const Ot = (n) => {
|
|
|
288
290
|
$(((g = (c = z.value) == null ? void 0 : c.meta) == null ? void 0 : g.translations) || {}, "name")
|
|
289
291
|
), t = ((i = z.value) == null ? void 0 : i.path) == ((h = n[1]) == null ? void 0 : h.path) ? "" : le($(((v = (m = n[1]) == null ? void 0 : m.meta) == null ? void 0 : v.translations) || {}, "name"));
|
|
290
292
|
document.title = e + (t ? ` - ${t}` : "");
|
|
291
|
-
},
|
|
293
|
+
}, Be = () => {
|
|
292
294
|
const n = ie();
|
|
293
|
-
V.value = "/" + (n.path.split("/").filter(Boolean).shift() || ""),
|
|
295
|
+
n && (V.value = "/" + (n.path.split("/").filter(Boolean).shift() || ""), et(), ae.value = oe());
|
|
294
296
|
}, be = () => {
|
|
295
|
-
const n = window.innerWidth <
|
|
297
|
+
const n = window.innerWidth < Ht;
|
|
296
298
|
ye.value = n, ve.value = !n;
|
|
297
299
|
};
|
|
298
300
|
be();
|
|
299
301
|
function H() {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
window.addEventListener("resize", be);
|
|
302
|
+
const n = ie();
|
|
303
|
+
return Be(), ht(() => {
|
|
304
|
+
Be();
|
|
304
305
|
}), Re(() => {
|
|
306
|
+
window.addEventListener("resize", be);
|
|
307
|
+
}), Ke(() => {
|
|
305
308
|
window.removeEventListener("resize", be);
|
|
306
|
-
})
|
|
307
|
-
const n = ie();
|
|
308
|
-
return re(
|
|
309
|
+
}), re(
|
|
309
310
|
() => V.value,
|
|
310
311
|
() => void (ae.value = oe())
|
|
311
|
-
), re(
|
|
312
|
+
), n && re(
|
|
312
313
|
() => [n.path, te.value.menus],
|
|
313
314
|
() => {
|
|
314
|
-
fe.value = "", z.value = void 0, V.value = "/" + (n.path.split("/").filter(Boolean).shift() || ""),
|
|
315
|
+
fe.value = "", z.value = void 0, V.value = "/" + (n.path.split("/").filter(Boolean).shift() || ""), et(), ae.value = oe(), ye.value && (ve.value = !1);
|
|
315
316
|
}
|
|
316
|
-
),
|
|
317
|
+
), gt("currentEndRoute", z), {
|
|
317
318
|
menus: ae,
|
|
318
319
|
currentEndRoute: z,
|
|
319
320
|
currentTabPath: V,
|
|
@@ -322,8 +323,8 @@ function H() {
|
|
|
322
323
|
sideOpen: ve,
|
|
323
324
|
isMobile: ye,
|
|
324
325
|
getMenus: oe,
|
|
325
|
-
currentEndParentRoute:
|
|
326
|
-
leftScrollRef:
|
|
326
|
+
currentEndParentRoute: Ve,
|
|
327
|
+
leftScrollRef: Qt
|
|
327
328
|
};
|
|
328
329
|
}
|
|
329
330
|
const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */ M({
|
|
@@ -349,7 +350,7 @@ const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */
|
|
|
349
350
|
for (const [a, o] of e)
|
|
350
351
|
t[a] = o;
|
|
351
352
|
return t;
|
|
352
|
-
},
|
|
353
|
+
}, tt = /* @__PURE__ */ D(jt, [["__scopeId", "data-v-ed060390"]]), qt = { key: 0 }, Yt = /* @__PURE__ */ M({
|
|
353
354
|
__name: "AsideSubMenuItem",
|
|
354
355
|
props: {
|
|
355
356
|
menu: {
|
|
@@ -370,9 +371,9 @@ const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */
|
|
|
370
371
|
return ((m = h.meta) == null ? void 0 : m.visible) != "0";
|
|
371
372
|
});
|
|
372
373
|
}
|
|
373
|
-
), { defaultParentActive: a, currentTabPath: o } = H(), s =
|
|
374
|
+
), { defaultParentActive: a, currentTabPath: o } = H(), s = He(), r = S(() => {
|
|
374
375
|
var i;
|
|
375
|
-
return e.level == 1 && !
|
|
376
|
+
return e.level == 1 && !It(s, e.menu.path || "") ? "div" : /^http/.test(e.menu.path || "") || !((i = e.menu.path) != null && i.startsWith(o.value)) ? "a" : "router-link";
|
|
376
377
|
}), c = S(() => {
|
|
377
378
|
var i;
|
|
378
379
|
return /^http/.test(e.menu.path || "") || !((i = e.menu.path) != null && i.startsWith(o.value)) ? {
|
|
@@ -390,7 +391,7 @@ const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */
|
|
|
390
391
|
var v, p;
|
|
391
392
|
const m = L("AsideSubMenuItem", !0);
|
|
392
393
|
return l(), y(U, null, [
|
|
393
|
-
(l(), k(Ae(r.value),
|
|
394
|
+
(l(), k(Ae(r.value), Je({
|
|
394
395
|
class: ["pt-1 pb-1 pl-3 pr-3 flex items-center gap-2 rounded-md", [
|
|
395
396
|
e.menu.path == f(a) ? "bg-[var(--ui-sidebar-active-bg,var(--el-fill-color))] text-[var(--ui-sidebar-active-fg)] font-medium" : "text-[var(--ui-sidebar-foreground)]",
|
|
396
397
|
(v = t.value) != null && v.length ? " h-7" : " h-9.5 cursor-pointer hover:bg-[var(--ui-sidebar-hover-bg)]"
|
|
@@ -400,7 +401,7 @@ const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */
|
|
|
400
401
|
default: C(() => {
|
|
401
402
|
var b, T, B, F;
|
|
402
403
|
return [
|
|
403
|
-
(b = t.value) != null && b.length ? I("", !0) : (l(), k(
|
|
404
|
+
(b = t.value) != null && b.length ? I("", !0) : (l(), k(tt, {
|
|
404
405
|
key: 0,
|
|
405
406
|
icon: g.value,
|
|
406
407
|
class: K(["text-md", [
|
|
@@ -427,7 +428,7 @@ const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */
|
|
|
427
428
|
}), Wt = { class: "h-full" }, Xt = {
|
|
428
429
|
key: 0,
|
|
429
430
|
class: ""
|
|
430
|
-
},
|
|
431
|
+
}, nt = /* @__PURE__ */ M({
|
|
431
432
|
__name: "AsideSubMenus",
|
|
432
433
|
props: {
|
|
433
434
|
menus: {
|
|
@@ -439,7 +440,7 @@ const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */
|
|
|
439
440
|
const e = n;
|
|
440
441
|
return (t, a) => {
|
|
441
442
|
var o;
|
|
442
|
-
return
|
|
443
|
+
return ft((l(), y("div", Wt, [
|
|
443
444
|
(o = e.menus) != null && o.length ? (l(), y("div", Xt, [
|
|
444
445
|
(l(!0), y(U, null, J(e.menus.filter((s) => {
|
|
445
446
|
var r;
|
|
@@ -450,7 +451,7 @@ const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */
|
|
|
450
451
|
}, null, 8, ["menu"]))), 128))
|
|
451
452
|
])) : I("", !0)
|
|
452
453
|
], 512)), [
|
|
453
|
-
[
|
|
454
|
+
[vt, e.menus.length]
|
|
454
455
|
]);
|
|
455
456
|
};
|
|
456
457
|
}
|
|
@@ -477,7 +478,7 @@ const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */
|
|
|
477
478
|
}, [
|
|
478
479
|
_(c, null, {
|
|
479
480
|
default: C(() => [
|
|
480
|
-
_(f(
|
|
481
|
+
_(f(Fe))
|
|
481
482
|
]),
|
|
482
483
|
_: 1
|
|
483
484
|
})
|
|
@@ -486,7 +487,7 @@ const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */
|
|
|
486
487
|
_(g, { ref: "leftScrollRef" }, {
|
|
487
488
|
default: C(() => [
|
|
488
489
|
d("div", Vt, [
|
|
489
|
-
_(
|
|
490
|
+
_(nt, { menus: f(e) }, null, 8, ["menus"])
|
|
490
491
|
])
|
|
491
492
|
]),
|
|
492
493
|
_: 1
|
|
@@ -496,19 +497,19 @@ const zt = { class: "menu-item-icon" }, Zt = ["innerHTML"], jt = /* @__PURE__ */
|
|
|
496
497
|
};
|
|
497
498
|
}
|
|
498
499
|
}), en = /* @__PURE__ */ D($t, [["__scopeId", "data-v-ff960d0f"]]);
|
|
499
|
-
function
|
|
500
|
+
function at() {
|
|
500
501
|
const n = O(), e = S(() => n.value.appList || []);
|
|
501
502
|
return {
|
|
502
503
|
appList: e,
|
|
503
504
|
getAppPath: (o) => (o == null ? void 0 : o.path) || "",
|
|
504
505
|
findAppById: (o) => {
|
|
505
506
|
if (o)
|
|
506
|
-
return
|
|
507
|
+
return ot(e.value, o);
|
|
507
508
|
}
|
|
508
509
|
};
|
|
509
510
|
}
|
|
510
|
-
const
|
|
511
|
-
(t, a) => t || (a.appId === e ? a :
|
|
511
|
+
const ot = (n, e) => n.reduce(
|
|
512
|
+
(t, a) => t || (a.appId === e ? a : ot(a.children || [], e)),
|
|
512
513
|
void 0
|
|
513
514
|
), tn = {
|
|
514
515
|
key: 0,
|
|
@@ -519,7 +520,7 @@ const at = (n, e) => n.reduce(
|
|
|
519
520
|
}, on = ["href"], sn = { class: "app-select__dropdown-icon text-xl" }, rn = { class: "app-select__dropdown-desc" }, ln = /* @__PURE__ */ M({
|
|
520
521
|
__name: "AppSelect",
|
|
521
522
|
setup(n) {
|
|
522
|
-
const { currentAppId: e } = H(), { appList: t, getAppPath: a } =
|
|
523
|
+
const { currentAppId: e } = H(), { appList: t, getAppPath: a } = at(), o = (s) => {
|
|
523
524
|
var r;
|
|
524
525
|
return e.value === s.appId || !!((r = s.children) != null && r.some((c) => c.appId === e.value));
|
|
525
526
|
};
|
|
@@ -592,8 +593,8 @@ const at = (n, e) => n.reduce(
|
|
|
592
593
|
}), X = /* @__PURE__ */ D(un, [["__scopeId", "data-v-824bbddc"]]), dn = /* @__PURE__ */ M({
|
|
593
594
|
__name: "ThemeToggle",
|
|
594
595
|
setup(n) {
|
|
595
|
-
const e = O(), { theme: t, isDark: a, toggleTheme: o } =
|
|
596
|
-
return
|
|
596
|
+
const e = O(), { theme: t, isDark: a, toggleTheme: o } = Xe();
|
|
597
|
+
return Oe(() => {
|
|
597
598
|
e.value.theme = t.value;
|
|
598
599
|
}), (s, r) => {
|
|
599
600
|
const c = L("el-icon");
|
|
@@ -601,7 +602,7 @@ const at = (n, e) => n.reduce(
|
|
|
601
602
|
default: C(() => [
|
|
602
603
|
_(c, null, {
|
|
603
604
|
default: C(() => [
|
|
604
|
-
f(a) ? (l(), k(f(
|
|
605
|
+
f(a) ? (l(), k(f(bt), { key: 1 })) : (l(), k(f(yt), { key: 0 }))
|
|
605
606
|
]),
|
|
606
607
|
_: 1
|
|
607
608
|
})
|
|
@@ -610,7 +611,7 @@ const at = (n, e) => n.reduce(
|
|
|
610
611
|
}, 8, ["onClick"]);
|
|
611
612
|
};
|
|
612
613
|
}
|
|
613
|
-
}),
|
|
614
|
+
}), st = /* @__PURE__ */ D(dn, [["__scopeId", "data-v-e6ea60b7"]]), pn = {
|
|
614
615
|
label: {
|
|
615
616
|
clickToChangeImage: "Click to change image"
|
|
616
617
|
},
|
|
@@ -1581,8 +1582,8 @@ const at = (n, e) => n.reduce(
|
|
|
1581
1582
|
}, se = {
|
|
1582
1583
|
"en-US": An,
|
|
1583
1584
|
"zh-CN": Ln
|
|
1584
|
-
}, ue =
|
|
1585
|
-
locale:
|
|
1585
|
+
}, ue = wt({
|
|
1586
|
+
locale: Ze(),
|
|
1586
1587
|
fallbackLocale: "en-US",
|
|
1587
1588
|
messages: se,
|
|
1588
1589
|
legacy: !1
|
|
@@ -1676,10 +1677,10 @@ const at = (n, e) => n.reduce(
|
|
|
1676
1677
|
});
|
|
1677
1678
|
};
|
|
1678
1679
|
}
|
|
1679
|
-
}),
|
|
1680
|
+
}), rt = /* @__PURE__ */ D(Dn, [["__scopeId", "data-v-48306ad1"]]), Nn = { class: "mobile-user-popover" }, Bn = ["href"], Un = /* @__PURE__ */ M({
|
|
1680
1681
|
__name: "AsideUserMobilePopover",
|
|
1681
1682
|
setup(n) {
|
|
1682
|
-
const { t: e } = ue.global, t = O(), a = S(() =>
|
|
1683
|
+
const { t: e } = ue.global, t = O(), a = S(() => Rt(t.value)), o = () => {
|
|
1683
1684
|
var s, r;
|
|
1684
1685
|
Promise.resolve((r = (s = t.value).onLogout) == null ? void 0 : r.call(s)).finally(() => {
|
|
1685
1686
|
t.value.onLogout || ce(t.value);
|
|
@@ -1704,7 +1705,7 @@ const at = (n, e) => n.reduce(
|
|
|
1704
1705
|
r[0] || (r[0] = d("i", { class: "metisicon-yonghu1" }, null, -1)),
|
|
1705
1706
|
d("span", null, E(f(e)("admin.label.profile")), 1)
|
|
1706
1707
|
], 8, Bn),
|
|
1707
|
-
_(
|
|
1708
|
+
_(rt),
|
|
1708
1709
|
r[2] || (r[2] = d("div", { class: "mobile-user-popover__divider" }, null, -1)),
|
|
1709
1710
|
d("div", {
|
|
1710
1711
|
class: "mobile-user-popover__item mobile-user-popover__item--danger",
|
|
@@ -1719,7 +1720,7 @@ const at = (n, e) => n.reduce(
|
|
|
1719
1720
|
});
|
|
1720
1721
|
};
|
|
1721
1722
|
}
|
|
1722
|
-
}),
|
|
1723
|
+
}), lt = /* @__PURE__ */ D(Un, [["__scopeId", "data-v-87e082b1"]]), Rn = { class: "header-right-mobile" }, Kn = /* @__PURE__ */ M({
|
|
1723
1724
|
__name: "HeaderRightMobile",
|
|
1724
1725
|
setup(n) {
|
|
1725
1726
|
const e = O(), t = S(
|
|
@@ -1732,8 +1733,8 @@ const at = (n, e) => n.reduce(
|
|
|
1732
1733
|
(s = (o = e.value).onLogin) != null && s.call(o) || ce(e.value);
|
|
1733
1734
|
};
|
|
1734
1735
|
return (o, s) => (l(), y("div", Rn, [
|
|
1735
|
-
_(
|
|
1736
|
-
t.value ? (l(), k(
|
|
1736
|
+
_(st),
|
|
1737
|
+
t.value ? (l(), k(lt, { key: 0 }, {
|
|
1737
1738
|
reference: C(() => [
|
|
1738
1739
|
_(X, { class: "header-right-mobile__action" }, {
|
|
1739
1740
|
default: C(() => [...s[0] || (s[0] = [
|
|
@@ -1773,7 +1774,7 @@ const at = (n, e) => n.reduce(
|
|
|
1773
1774
|
d("div", Fn, [
|
|
1774
1775
|
_(s, null, {
|
|
1775
1776
|
default: C(() => [
|
|
1776
|
-
_(f(
|
|
1777
|
+
_(f(At))
|
|
1777
1778
|
]),
|
|
1778
1779
|
_: 1
|
|
1779
1780
|
})
|
|
@@ -1813,7 +1814,7 @@ const at = (n, e) => n.reduce(
|
|
|
1813
1814
|
};
|
|
1814
1815
|
return (v, p) => {
|
|
1815
1816
|
const b = L("el-icon"), T = L("el-avatar");
|
|
1816
|
-
return l(), k(T,
|
|
1817
|
+
return l(), k(T, Je(v.$attrs, {
|
|
1817
1818
|
src: h.value,
|
|
1818
1819
|
"data-src": h.value,
|
|
1819
1820
|
alt: s.value,
|
|
@@ -1827,7 +1828,7 @@ const at = (n, e) => n.reduce(
|
|
|
1827
1828
|
"aria-hidden": "true"
|
|
1828
1829
|
}, {
|
|
1829
1830
|
default: C(() => [
|
|
1830
|
-
_(f(
|
|
1831
|
+
_(f(_t))
|
|
1831
1832
|
]),
|
|
1832
1833
|
_: 1
|
|
1833
1834
|
})) : I("", !0)
|
|
@@ -1836,7 +1837,7 @@ const at = (n, e) => n.reduce(
|
|
|
1836
1837
|
}, 16, ["src", "data-src", "alt", "class"]);
|
|
1837
1838
|
};
|
|
1838
1839
|
}
|
|
1839
|
-
}),
|
|
1840
|
+
}), Ue = /* @__PURE__ */ D(Zn, [["__scopeId", "data-v-50be58a7"]]), jn = {
|
|
1840
1841
|
key: 0,
|
|
1841
1842
|
class: "layout-breadcrumb text-xs",
|
|
1842
1843
|
"aria-label": "Breadcrumb"
|
|
@@ -1859,7 +1860,7 @@ const at = (n, e) => n.reduce(
|
|
|
1859
1860
|
backLabel: { default: "返回" }
|
|
1860
1861
|
},
|
|
1861
1862
|
setup(n) {
|
|
1862
|
-
const e = n, t = ie(), a =
|
|
1863
|
+
const e = n, t = ie(), a = He(), o = O(), s = H(), r = S(() => {
|
|
1863
1864
|
var Pe, Te, ke, Ie, Le, xe;
|
|
1864
1865
|
if ((Pe = e.items) != null && Pe.length)
|
|
1865
1866
|
return e.items.filter((Y) => Y.title);
|
|
@@ -1931,13 +1932,13 @@ const at = (n, e) => n.reduce(
|
|
|
1931
1932
|
if (w === P) return !0;
|
|
1932
1933
|
const x = w.replace(/\/:(\w+)/g, "/([^/]+)");
|
|
1933
1934
|
return new RegExp(`^${x}$`, "i").test(P);
|
|
1934
|
-
}, T = (u = "") => u ? u.split("?")[0].split("#")[0] : "", B = (u = "") => (T(u).replace(/\/+$/, "") || "/").toLowerCase(), F = (u) => /^https?:\/\//.test(u.path || ""),
|
|
1935
|
+
}, T = (u = "") => u ? u.split("?")[0].split("#")[0] : "", B = (u = "") => (T(u).replace(/\/+$/, "") || "/").toLowerCase(), F = (u) => /^https?:\/\//.test(u.path || ""), it = (u) => {
|
|
1935
1936
|
var A;
|
|
1936
1937
|
return !!((A = u.children) != null && A.some((w) => !w.disabled));
|
|
1937
|
-
}, we = (u, A) => u.disabled || A === r.value.length - 1 || !u.path ? !1 : F(u) || !
|
|
1938
|
+
}, we = (u, A) => u.disabled || A === r.value.length - 1 || !u.path ? !1 : F(u) || !it(u), ct = (u) => {
|
|
1938
1939
|
const A = u.to || de(u);
|
|
1939
1940
|
A && a.push(A);
|
|
1940
|
-
},
|
|
1941
|
+
}, ut = () => {
|
|
1941
1942
|
var A;
|
|
1942
1943
|
if (e.backTo) {
|
|
1943
1944
|
a.push(e.backTo);
|
|
@@ -1947,9 +1948,9 @@ const at = (n, e) => n.reduce(
|
|
|
1947
1948
|
a.back();
|
|
1948
1949
|
return;
|
|
1949
1950
|
}
|
|
1950
|
-
const u =
|
|
1951
|
+
const u = dt();
|
|
1951
1952
|
u && a.push(u);
|
|
1952
|
-
},
|
|
1953
|
+
}, dt = () => {
|
|
1953
1954
|
var w, P;
|
|
1954
1955
|
const u = e.parentPath || ((w = t.meta) == null ? void 0 : w.parentPath) || ((P = t.meta) == null ? void 0 : P.parent) || "";
|
|
1955
1956
|
if (u)
|
|
@@ -1977,11 +1978,11 @@ const at = (n, e) => n.reduce(
|
|
|
1977
1978
|
type: "button",
|
|
1978
1979
|
"aria-label": e.backLabel,
|
|
1979
1980
|
title: e.backLabel,
|
|
1980
|
-
onClick:
|
|
1981
|
+
onClick: ut
|
|
1981
1982
|
}, [
|
|
1982
1983
|
_(w, null, {
|
|
1983
1984
|
default: C(() => [
|
|
1984
|
-
_(f(
|
|
1985
|
+
_(f(Ct))
|
|
1985
1986
|
]),
|
|
1986
1987
|
_: 1
|
|
1987
1988
|
})
|
|
@@ -2008,7 +2009,7 @@ const at = (n, e) => n.reduce(
|
|
|
2008
2009
|
key: 2,
|
|
2009
2010
|
class: "layout-breadcrumb__link",
|
|
2010
2011
|
type: "button",
|
|
2011
|
-
onClick: (R) =>
|
|
2012
|
+
onClick: (R) => ct(P)
|
|
2012
2013
|
}, E(P.title), 9, Xn)) : (l(), y("span", Gn, E(P.title), 1))
|
|
2013
2014
|
]))), 128))
|
|
2014
2015
|
])) : I("", !0)
|
|
@@ -2024,8 +2025,8 @@ const at = (n, e) => n.reduce(
|
|
|
2024
2025
|
showLabel: { type: Boolean, default: !1 }
|
|
2025
2026
|
},
|
|
2026
2027
|
setup(n) {
|
|
2027
|
-
const e =
|
|
2028
|
-
|
|
2028
|
+
const e = Lt(), t = N(!1), a = S(() => e.value), o = S(() => Bt()), s = S(() => Nt(a.value)), r = (c) => {
|
|
2029
|
+
xt(c), t.value = !1;
|
|
2029
2030
|
};
|
|
2030
2031
|
return (c, g) => {
|
|
2031
2032
|
const i = L("el-icon"), h = L("el-popover");
|
|
@@ -2048,7 +2049,7 @@ const at = (n, e) => n.reduce(
|
|
|
2048
2049
|
default: C(() => [
|
|
2049
2050
|
_(i, null, {
|
|
2050
2051
|
default: C(() => [
|
|
2051
|
-
_(f(
|
|
2052
|
+
_(f(St))
|
|
2052
2053
|
]),
|
|
2053
2054
|
_: 1
|
|
2054
2055
|
}),
|
|
@@ -2116,7 +2117,7 @@ const at = (n, e) => n.reduce(
|
|
|
2116
2117
|
"popper-class": "top-userinfo-popover"
|
|
2117
2118
|
}, {
|
|
2118
2119
|
reference: C(() => [
|
|
2119
|
-
_(f(
|
|
2120
|
+
_(f(Ue), {
|
|
2120
2121
|
class: "user-info__trigger ml-2",
|
|
2121
2122
|
src: a.value.avatar,
|
|
2122
2123
|
name: s.value
|
|
@@ -2127,7 +2128,7 @@ const at = (n, e) => n.reduce(
|
|
|
2127
2128
|
return [
|
|
2128
2129
|
d("div", sa, [
|
|
2129
2130
|
d("div", ra, [
|
|
2130
|
-
_(f(
|
|
2131
|
+
_(f(Ue), {
|
|
2131
2132
|
class: "user-info__profile-avatar",
|
|
2132
2133
|
src: a.value.avatar,
|
|
2133
2134
|
name: s.value
|
|
@@ -2164,7 +2165,7 @@ const at = (n, e) => n.reduce(
|
|
|
2164
2165
|
href: v.path,
|
|
2165
2166
|
class: "user-info__item"
|
|
2166
2167
|
}, [
|
|
2167
|
-
_(
|
|
2168
|
+
_(tt, {
|
|
2168
2169
|
icon: v.icon || ((b = v.meta) == null ? void 0 : b.icon)
|
|
2169
2170
|
}, null, 8, ["icon"]),
|
|
2170
2171
|
d("span", null, E(f($)(((T = v.meta) == null ? void 0 : T.translations) || {}, "name", v.name)), 1)
|
|
@@ -2188,7 +2189,7 @@ const at = (n, e) => n.reduce(
|
|
|
2188
2189
|
}), ga = /* @__PURE__ */ D(ha, [["__scopeId", "data-v-ac052463"]]), fa = { class: "header-right" }, va = ["href"], ya = /* @__PURE__ */ M({
|
|
2189
2190
|
__name: "SHeaderRight",
|
|
2190
2191
|
setup(n) {
|
|
2191
|
-
const { t: e } = ue.global, t = O(), a = S(() => t.value.hideDoc ?? !1), o = S(() =>
|
|
2192
|
+
const { t: e } = ue.global, t = O(), a = S(() => t.value.hideDoc ?? !1), o = S(() => Ge(t.value)), s = S(() => t.value.user), r = S(() => {
|
|
2192
2193
|
var i, h;
|
|
2193
2194
|
return !!((i = s.value) != null && i.id || (h = s.value) != null && h.userId);
|
|
2194
2195
|
}), c = (i) => {
|
|
@@ -2230,8 +2231,8 @@ const at = (n, e) => n.reduce(
|
|
|
2230
2231
|
]),
|
|
2231
2232
|
_: 1
|
|
2232
2233
|
}, 8, ["href"])) : I("", !0),
|
|
2234
|
+
_(rt),
|
|
2233
2235
|
_(st),
|
|
2234
|
-
_(ot),
|
|
2235
2236
|
r.value ? (l(), k(ga, { key: 1 })) : (l(), y("a", {
|
|
2236
2237
|
key: 2,
|
|
2237
2238
|
class: "header-right__login",
|
|
@@ -2291,7 +2292,7 @@ const at = (n, e) => n.reduce(
|
|
|
2291
2292
|
}, La = /* @__PURE__ */ M({
|
|
2292
2293
|
__name: "AppSelectMobile",
|
|
2293
2294
|
setup(n) {
|
|
2294
|
-
const { currentAppId: e } = H(), { appList: t, getAppPath: a, findAppById: o } =
|
|
2295
|
+
const { currentAppId: e } = H(), { appList: t, getAppPath: a, findAppById: o } = at(), s = S(() => {
|
|
2295
2296
|
const c = o(e.value);
|
|
2296
2297
|
return c ? a(c) : "";
|
|
2297
2298
|
}), r = (c) => {
|
|
@@ -2347,7 +2348,7 @@ const at = (n, e) => n.reduce(
|
|
|
2347
2348
|
};
|
|
2348
2349
|
return (r, c) => {
|
|
2349
2350
|
const g = L("el-icon");
|
|
2350
|
-
return a.value ? (l(), k(
|
|
2351
|
+
return a.value ? (l(), k(lt, { key: 0 }, {
|
|
2351
2352
|
reference: C(() => [
|
|
2352
2353
|
d("div", xa, [
|
|
2353
2354
|
c[0] || (c[0] = d("div", { class: "aside-user-mobile__icon text-lg" }, [
|
|
@@ -2404,7 +2405,7 @@ const at = (n, e) => n.reduce(
|
|
|
2404
2405
|
}, [
|
|
2405
2406
|
_(r, null, {
|
|
2406
2407
|
default: C(() => [
|
|
2407
|
-
_(f(
|
|
2408
|
+
_(f(Fe))
|
|
2408
2409
|
]),
|
|
2409
2410
|
_: 1
|
|
2410
2411
|
})
|
|
@@ -2414,7 +2415,7 @@ const at = (n, e) => n.reduce(
|
|
|
2414
2415
|
_(c, { ref: "leftScrollRef" }, {
|
|
2415
2416
|
default: C(() => [
|
|
2416
2417
|
d("div", Ra, [
|
|
2417
|
-
_(
|
|
2418
|
+
_(nt, { menus: f(e) }, null, 8, ["menus"])
|
|
2418
2419
|
])
|
|
2419
2420
|
]),
|
|
2420
2421
|
_: 1
|
|
@@ -2443,7 +2444,7 @@ const at = (n, e) => n.reduce(
|
|
|
2443
2444
|
onLogout: (F = e.setting) == null ? void 0 : F.onLogout
|
|
2444
2445
|
};
|
|
2445
2446
|
});
|
|
2446
|
-
|
|
2447
|
+
Oe(() => void Ft(t.value));
|
|
2447
2448
|
const { isMobile: a, sideOpen: o } = H();
|
|
2448
2449
|
let s = "", r = !1;
|
|
2449
2450
|
const c = () => void (o.value = !1), g = (m) => {
|
|
@@ -2472,9 +2473,9 @@ const at = (n, e) => n.reduce(
|
|
|
2472
2473
|
}
|
|
2473
2474
|
},
|
|
2474
2475
|
{ immediate: !0 }
|
|
2475
|
-
),
|
|
2476
|
+
), Re(() => {
|
|
2476
2477
|
window.addEventListener("keydown", h);
|
|
2477
|
-
}),
|
|
2478
|
+
}), Ke(() => {
|
|
2478
2479
|
window.removeEventListener("keydown", h), typeof document < "u" && r && (document.body.style.overflow = s);
|
|
2479
2480
|
}), (m, v) => {
|
|
2480
2481
|
const p = L("router-view");
|
|
@@ -2527,16 +2528,16 @@ const at = (n, e) => n.reduce(
|
|
|
2527
2528
|
}), $a = /* @__PURE__ */ D(Za, [["__scopeId", "data-v-87720a5b"]]);
|
|
2528
2529
|
export {
|
|
2529
2530
|
$a as BaseLayout,
|
|
2530
|
-
|
|
2531
|
+
rt as LanguageSelect,
|
|
2531
2532
|
Ga as LayoutBreadcrumb,
|
|
2532
|
-
|
|
2533
|
+
st as ThemeToggle,
|
|
2533
2534
|
Va as TimezoneSelect,
|
|
2534
|
-
|
|
2535
|
+
Ue as UserAvatar,
|
|
2535
2536
|
ga as UserInfo,
|
|
2536
2537
|
ue as i18n,
|
|
2537
2538
|
se as messages,
|
|
2538
|
-
|
|
2539
|
+
at as useApp,
|
|
2539
2540
|
H as useLayoutState,
|
|
2540
2541
|
O as useSetting,
|
|
2541
|
-
|
|
2542
|
+
Xe as useTheme
|
|
2542
2543
|
};
|