@morningfast/platform 0.0.8 → 0.0.9
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/assets/main/style.css +4 -1
- package/dist/chunks/{Login-BcNNVCnZ.js → Login-BivuNuD7.js} +1 -1
- package/dist/chunks/{SystemConfig-CjcXN9Ma.js → SystemConfig-C7yyDmB8.js} +1 -1
- package/dist/chunks/{application-config-CGx7DctK.js → application-config-DLHtmY_2.js} +2 -2
- package/dist/chunks/{config-CKUWu-5b.js → config-Cd-9BYBy.js} +11 -8
- package/dist/chunks/{main-Ln0xOplS.js → main-DfxJwsLt.js} +441 -902
- package/dist/chunks/route-items-Du868zKV.js +486 -0
- package/dist/index.js +8 -6
- package/dist/main/index.d.ts +3 -0
- package/dist/main/router/route-items.d.ts +15 -0
- package/dist/main.js +6 -4
- package/dist/sub/index.d.ts +2 -0
- package/dist/sub.js +3 -2
- package/package.json +1 -1
- /package/dist/chunks/{Forbidden-gf6y5Zsh.js → Forbidden-Cu2QQ-FY.js} +0 -0
- /package/dist/chunks/{NotFound-D0ybyfbK.js → NotFound-VRL7_aMx.js} +0 -0
- /package/dist/chunks/{_plugin-vue_export-helper-CZc-Y3Wh.js → _plugin-vue_export-helper-DvRHjpsZ.js} +0 -0
- /package/dist/chunks/{sub-DlD5e1ys.js → sub-D7y3UaHp.js} +0 -0
|
@@ -2,23 +2,22 @@ import { clearAuth as e, emitAuthExpired as t, getAccessToken as n, onAuthExpire
|
|
|
2
2
|
import { createRequestClient as i } from "../request.js";
|
|
3
3
|
import { t as a } from "./auth-C3RvRgcW.js";
|
|
4
4
|
import { i as o, n as s, r as c, t as l } from "./system-BbMsTIBR.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { createRouter as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { createPinia as
|
|
12
|
-
import { ArrowDown as
|
|
13
|
-
import { MpDrawer as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
5
|
+
import { a as u, i as d, r as f } from "./route-items-Du868zKV.js";
|
|
6
|
+
import { t as p } from "./_plugin-vue_export-helper-DvRHjpsZ.js";
|
|
7
|
+
import { createRouter as m, createWebHistory as h, useRoute as g, useRouter as _ } from "vue-router";
|
|
8
|
+
import v from "nprogress";
|
|
9
|
+
import y, { ElMessage as b } from "element-plus";
|
|
10
|
+
import { Fragment as x, Teleport as ee, Transition as S, TransitionGroup as C, computed as w, createApp as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createTextVNode as A, createVNode as j, defineComponent as M, nextTick as N, normalizeClass as P, normalizeStyle as F, onBeforeUnmount as te, onMounted as ne, onUnmounted as re, openBlock as I, ref as L, renderList as R, resolveComponent as z, resolveDynamicComponent as B, toDisplayString as V, unref as H, watch as U, watchEffect as W, withCtx as G, withKeys as K, withModifiers as q } from "vue";
|
|
11
|
+
import { createPinia as ie, defineStore as J } from "pinia";
|
|
12
|
+
import { ArrowDown as ae, ArrowRight as oe, ArrowUp as se, Back as ce, Brush as le, Close as ue, Connection as de, DArrowLeft as fe, DArrowRight as pe, Expand as me, Fold as he, FolderDelete as ge, House as _e, Menu as ve, Monitor as ye, Moon as be, Operation as xe, RefreshRight as Se, Search as Y, Setting as Ce, Sunny as we, SwitchButton as Te, TopRight as Ee, User as De } from "@element-plus/icons-vue";
|
|
13
|
+
import { MpDrawer as Oe, MpLoadingService as ke, registerMpFormFieldComponents as Ae } from "morningfast-plus/components";
|
|
14
|
+
import je from "sortablejs";
|
|
15
|
+
import Me from "element-plus/es/locale/lang/zh-cn";
|
|
16
16
|
import "element-plus/dist/index.css";
|
|
17
17
|
import "element-plus/theme-chalk/dark/css-vars.css";
|
|
18
18
|
import "nprogress/nprogress.css";
|
|
19
|
-
import { addGlobalUncaughtErrorHandler as Be, registerMicroApps as Ve, start as He } from "qiankun";
|
|
20
19
|
//#region src/main/auth/expired.ts
|
|
21
|
-
function
|
|
20
|
+
function Ne(t) {
|
|
22
21
|
return r(() => {
|
|
23
22
|
if (e(), t.currentRoute.value.path === "/login") return;
|
|
24
23
|
let n = `${t.currentRoute.value.fullPath || "/"}`;
|
|
@@ -30,18 +29,18 @@ function Ue(t) {
|
|
|
30
29
|
}
|
|
31
30
|
//#endregion
|
|
32
31
|
//#region src/main/app/runtime-config.ts
|
|
33
|
-
var
|
|
34
|
-
function
|
|
35
|
-
|
|
32
|
+
var Pe = { apiBaseUrl: "/api" };
|
|
33
|
+
function Fe(e) {
|
|
34
|
+
Pe = e;
|
|
36
35
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
36
|
+
function Ie() {
|
|
37
|
+
return Pe;
|
|
39
38
|
}
|
|
40
|
-
var { http:
|
|
41
|
-
baseURL:
|
|
39
|
+
var { http: Le, createApi: Re, requestManager: ze } = i({
|
|
40
|
+
baseURL: Ie().apiBaseUrl,
|
|
42
41
|
getToken: n,
|
|
43
42
|
onError(e) {
|
|
44
|
-
|
|
43
|
+
b.error(e);
|
|
45
44
|
},
|
|
46
45
|
onUnauthorized(e) {
|
|
47
46
|
t({
|
|
@@ -52,64 +51,64 @@ var { http: qe, createApi: Je, requestManager: Ye } = i({
|
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
53
|
});
|
|
55
|
-
function
|
|
56
|
-
|
|
54
|
+
function Be() {
|
|
55
|
+
Le.defaults.baseURL = Ie().apiBaseUrl;
|
|
57
56
|
}
|
|
58
57
|
//#endregion
|
|
59
58
|
//#region src/main/router/guard.ts
|
|
60
|
-
var
|
|
61
|
-
function
|
|
59
|
+
var Ve = "/login", He = "/403";
|
|
60
|
+
function Ue(e) {
|
|
62
61
|
e.beforeEach(async (e, t) => {
|
|
63
|
-
|
|
62
|
+
v.start(), e.path !== t.path && ze.setCurrentPage(e.path);
|
|
64
63
|
let n = a(), r = !!e.meta.public;
|
|
65
64
|
if (n.initialized || await n.initAuth(), !n.isAuthenticated && !r) return {
|
|
66
|
-
path:
|
|
65
|
+
path: Ve,
|
|
67
66
|
query: { redirect: e.fullPath }
|
|
68
67
|
};
|
|
69
|
-
if (n.isAuthenticated && e.path ===
|
|
68
|
+
if (n.isAuthenticated && e.path === Ve) return { path: "/" };
|
|
70
69
|
let i = e.meta.permission;
|
|
71
|
-
return
|
|
72
|
-
path:
|
|
70
|
+
return We(i, n.hasPermission) ? !0 : {
|
|
71
|
+
path: He,
|
|
73
72
|
query: { redirect: e.fullPath }
|
|
74
73
|
};
|
|
75
74
|
}), e.afterEach((e) => {
|
|
76
|
-
l().setRouteTitle(String(e.meta.title ?? "Morningfast UI")),
|
|
75
|
+
l().setRouteTitle(String(e.meta.title ?? "Morningfast UI")), v.done();
|
|
77
76
|
}), e.onError(() => {
|
|
78
|
-
|
|
77
|
+
v.done();
|
|
79
78
|
});
|
|
80
79
|
}
|
|
81
|
-
function
|
|
80
|
+
function We(e, t) {
|
|
82
81
|
return e ? Array.isArray(e) ? e.every((e) => t(e)) : t(e) : !0;
|
|
83
82
|
}
|
|
84
83
|
//#endregion
|
|
85
84
|
//#region src/main/stores/tabs.ts
|
|
86
|
-
var
|
|
87
|
-
function
|
|
85
|
+
var X = "/dashboard", Ge = "tabs-state";
|
|
86
|
+
function Z() {
|
|
88
87
|
return {
|
|
89
|
-
path:
|
|
90
|
-
fullPath:
|
|
88
|
+
path: X,
|
|
89
|
+
fullPath: X,
|
|
91
90
|
title: "首页",
|
|
92
91
|
icon: "House"
|
|
93
92
|
};
|
|
94
93
|
}
|
|
95
|
-
function
|
|
94
|
+
function Ke() {
|
|
96
95
|
return {
|
|
97
|
-
tabs: [
|
|
98
|
-
activeTab:
|
|
96
|
+
tabs: [Z()],
|
|
97
|
+
activeTab: X,
|
|
99
98
|
lastActiveTab: ""
|
|
100
99
|
};
|
|
101
100
|
}
|
|
102
|
-
function
|
|
103
|
-
let t =
|
|
101
|
+
function qe(e) {
|
|
102
|
+
let t = Ke();
|
|
104
103
|
if (!e) return t;
|
|
105
|
-
let n = Array.isArray(e.tabs) ? e.tabs.filter(Boolean).map(
|
|
104
|
+
let n = Array.isArray(e.tabs) ? e.tabs.filter(Boolean).map(Je) : [], r = Ye([Z(), ...n]).sort((e, t) => e.path === "/dashboard" ? -1 : +(t.path === "/dashboard"));
|
|
106
105
|
return {
|
|
107
106
|
tabs: r,
|
|
108
107
|
activeTab: r.some((t) => t.path === e.activeTab) ? String(e.activeTab || "/dashboard") : r[0]?.path || "/dashboard",
|
|
109
108
|
lastActiveTab: r.some((t) => t.path === e.lastActiveTab) ? String(e.lastActiveTab || "") : ""
|
|
110
109
|
};
|
|
111
110
|
}
|
|
112
|
-
function
|
|
111
|
+
function Je(e) {
|
|
113
112
|
return {
|
|
114
113
|
path: String(e.path || "/dashboard"),
|
|
115
114
|
fullPath: String(e.fullPath || e.path || "/dashboard"),
|
|
@@ -117,11 +116,11 @@ function it(e) {
|
|
|
117
116
|
icon: e.icon ? String(e.icon) : void 0
|
|
118
117
|
};
|
|
119
118
|
}
|
|
120
|
-
function
|
|
119
|
+
function Ye(e) {
|
|
121
120
|
let t = /* @__PURE__ */ new Set();
|
|
122
121
|
return e.filter((e) => t.has(e.path) ? !1 : (t.add(e.path), !0));
|
|
123
122
|
}
|
|
124
|
-
function
|
|
123
|
+
function Xe(e) {
|
|
125
124
|
return {
|
|
126
125
|
tabs: e.tabs.map((e) => ({
|
|
127
126
|
path: e.path,
|
|
@@ -133,10 +132,10 @@ function ot(e) {
|
|
|
133
132
|
lastActiveTab: e.lastActiveTab
|
|
134
133
|
};
|
|
135
134
|
}
|
|
136
|
-
var
|
|
137
|
-
let e = L([
|
|
135
|
+
var Q = J("tabs", () => {
|
|
136
|
+
let e = L([Z()]), t = L(X), n = L(""), r = L(!1), i = w(() => e.value.map((e) => e.path));
|
|
138
137
|
async function a() {
|
|
139
|
-
r.value && await o(
|
|
138
|
+
r.value && await o(Ge, Xe({
|
|
140
139
|
tabs: e.value,
|
|
141
140
|
activeTab: t.value,
|
|
142
141
|
lastActiveTab: n.value
|
|
@@ -144,7 +143,7 @@ var Y = ce("tabs", () => {
|
|
|
144
143
|
}
|
|
145
144
|
async function l() {
|
|
146
145
|
if (r.value) return;
|
|
147
|
-
let i =
|
|
146
|
+
let i = qe(await s(Ge, null));
|
|
148
147
|
e.value = i.tabs, t.value = i.activeTab, n.value = i.lastActiveTab, r.value = !0, await a();
|
|
149
148
|
}
|
|
150
149
|
async function u(r) {
|
|
@@ -176,10 +175,10 @@ var Y = ce("tabs", () => {
|
|
|
176
175
|
n >= 0 && (e.value = x(e.value.slice(0, n + 1)), y(), await a());
|
|
177
176
|
}
|
|
178
177
|
async function g() {
|
|
179
|
-
e.value = [
|
|
178
|
+
e.value = [Z()], t.value = X, n.value = "", await a();
|
|
180
179
|
}
|
|
181
180
|
async function _() {
|
|
182
|
-
e.value = [], t.value = "", n.value = "", await c(
|
|
181
|
+
e.value = [], t.value = "", n.value = "", await c(Ge);
|
|
183
182
|
}
|
|
184
183
|
async function v(e) {
|
|
185
184
|
t.value && t.value !== e && (n.value = t.value), t.value = e, await a();
|
|
@@ -191,7 +190,7 @@ var Y = ce("tabs", () => {
|
|
|
191
190
|
e.value = x(e.value);
|
|
192
191
|
}
|
|
193
192
|
function x(e) {
|
|
194
|
-
return
|
|
193
|
+
return Ye([Z(), ...e.filter((e) => e.path !== X)]);
|
|
195
194
|
}
|
|
196
195
|
return {
|
|
197
196
|
activeTab: t,
|
|
@@ -209,222 +208,7 @@ var Y = ce("tabs", () => {
|
|
|
209
208
|
tabPaths: i,
|
|
210
209
|
tabs: e
|
|
211
210
|
};
|
|
212
|
-
}),
|
|
213
|
-
{
|
|
214
|
-
label: "默认蓝",
|
|
215
|
-
value: "#409EFF"
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
label: "深蓝色",
|
|
219
|
-
value: "#0960BE"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
label: "靛蓝色",
|
|
223
|
-
value: "#045277"
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
label: "天空蓝",
|
|
227
|
-
value: "#78B5FE"
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
label: "深绿色",
|
|
231
|
-
value: "#0C522B"
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
label: "翡翠绿",
|
|
235
|
-
value: "#009773"
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
label: "浅绿色",
|
|
239
|
-
value: "#0BD092"
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
label: "紫罗兰",
|
|
243
|
-
value: "#7166F0"
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
label: "樱花粉",
|
|
247
|
-
value: "#FFB7C5"
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
label: "柠檬黄",
|
|
251
|
-
value: "#EFBD48"
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
label: "橙黄色",
|
|
255
|
-
value: "#C1420B"
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
label: "玫瑰红",
|
|
259
|
-
value: "#BB1B1B"
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
label: "锌色灰",
|
|
263
|
-
value: "#3F3F46"
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
label: "中性灰",
|
|
267
|
-
value: "#404040"
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
label: "石板灰",
|
|
271
|
-
value: "#344256"
|
|
272
|
-
}
|
|
273
|
-
];
|
|
274
|
-
function dt() {
|
|
275
|
-
return localStorage.getItem(st) || "#409EFF";
|
|
276
|
-
}
|
|
277
|
-
function ft() {
|
|
278
|
-
let e = localStorage.getItem(ct);
|
|
279
|
-
return e === "light" || e === "dark" || e === "system" ? e : "light";
|
|
280
|
-
}
|
|
281
|
-
function pt(e) {
|
|
282
|
-
localStorage.setItem(st, e);
|
|
283
|
-
}
|
|
284
|
-
function mt(e) {
|
|
285
|
-
localStorage.setItem(ct, e);
|
|
286
|
-
}
|
|
287
|
-
function ht() {
|
|
288
|
-
let e = localStorage.getItem(lt);
|
|
289
|
-
return e === "none" || e === "header" || e === "sidebar" ? e : "none";
|
|
290
|
-
}
|
|
291
|
-
function gt(e) {
|
|
292
|
-
localStorage.setItem(lt, e);
|
|
293
|
-
}
|
|
294
|
-
function _t() {
|
|
295
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
296
|
-
}
|
|
297
|
-
function vt(e) {
|
|
298
|
-
return e === "dark" || e === "system" && _t();
|
|
299
|
-
}
|
|
300
|
-
function yt(e) {
|
|
301
|
-
let t = vt(e);
|
|
302
|
-
document.documentElement.classList.toggle("dark", t), document.documentElement.style.colorScheme = t ? "dark" : "light";
|
|
303
|
-
}
|
|
304
|
-
function bt(e) {
|
|
305
|
-
let t = document.documentElement, n = t.classList.contains("dark");
|
|
306
|
-
t.style.setProperty("--el-color-primary", e), t.style.setProperty("--el-color-primary-light-3", X(e, n ? "#000000" : "#ffffff", .3)), t.style.setProperty("--el-color-primary-light-5", X(e, n ? "#000000" : "#ffffff", .5)), t.style.setProperty("--el-color-primary-light-7", X(e, n ? "#000000" : "#ffffff", .7)), t.style.setProperty("--el-color-primary-light-8", X(e, n ? "#000000" : "#ffffff", .8)), t.style.setProperty("--el-color-primary-light-9", X(e, n ? "#000000" : "#ffffff", .9)), t.style.setProperty("--el-color-primary-dark-2", X(e, n ? "#ffffff" : "#000000", .2));
|
|
307
|
-
}
|
|
308
|
-
function xt() {
|
|
309
|
-
yt(ft()), bt(dt()), St(ht());
|
|
310
|
-
}
|
|
311
|
-
function St(e) {
|
|
312
|
-
document.documentElement.setAttribute("data-theme-position", e);
|
|
313
|
-
}
|
|
314
|
-
function Ct(e = 50) {
|
|
315
|
-
return new Promise((t) => {
|
|
316
|
-
setTimeout(() => {
|
|
317
|
-
bt(dt()), t();
|
|
318
|
-
}, e);
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
async function wt(e, t) {
|
|
322
|
-
if (!document.startViewTransition) {
|
|
323
|
-
t(), await Ct();
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
let n = e.clientX, r = e.clientY, i = Math.hypot(Math.max(n, innerWidth - n), Math.max(r, innerHeight - r));
|
|
327
|
-
try {
|
|
328
|
-
document.startViewTransition(() => {
|
|
329
|
-
t();
|
|
330
|
-
}).ready.then(() => {
|
|
331
|
-
let e = 100 * n / innerWidth, t = 100 * r / innerHeight, a = Math.hypot(innerWidth, innerHeight) / Math.SQRT2, o = 100 * i / a, s = [`circle(0% at ${e}% ${t}%)`, `circle(${o}% at ${e}% ${t}%)`], c = document.documentElement.classList.contains("dark");
|
|
332
|
-
document.documentElement.animate({ clipPath: c ? s.reverse() : s }, {
|
|
333
|
-
duration: 400,
|
|
334
|
-
easing: "ease-in",
|
|
335
|
-
fill: "both",
|
|
336
|
-
pseudoElement: c ? "::view-transition-old(root)" : "::view-transition-new(root)"
|
|
337
|
-
});
|
|
338
|
-
}), await Ct();
|
|
339
|
-
} catch {
|
|
340
|
-
t(), await Ct();
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
function X(e, t, n) {
|
|
344
|
-
let [r, i, a] = Tt(e), [o, s, c] = Tt(t), l = (e, t) => Math.round(e * (1 - n) + t * n);
|
|
345
|
-
return `rgb(${l(r, o)}, ${l(i, s)}, ${l(a, c)})`;
|
|
346
|
-
}
|
|
347
|
-
function Tt(e) {
|
|
348
|
-
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = Number.parseInt(n, 16);
|
|
349
|
-
return [
|
|
350
|
-
r >> 16 & 255,
|
|
351
|
-
r >> 8 & 255,
|
|
352
|
-
r & 255
|
|
353
|
-
];
|
|
354
|
-
}
|
|
355
|
-
//#endregion
|
|
356
|
-
//#region src/main/stores/app.ts
|
|
357
|
-
var Et = "sidebar-collapsed", Dt = "menu-search-placement", Ot = "layout-mode", kt = "top-menu-path", Z = ce("app", () => {
|
|
358
|
-
let e = L(localStorage.getItem(Et) === "true"), t = L(!1), n = L("theme"), r = L(ft()), i = L(dt()), a = L(ht()), o = L(localStorage.getItem(Ot) || "side"), s = L(localStorage.getItem(Dt) || "header"), c = L(localStorage.getItem(kt) || ""), l = L(!0), u = T(() => vt(r.value)), d = T(() => o.value === "top" ? ["header"] : ["header", "sidebar"]), f = T(() => o.value !== "top" && s.value === "sidebar");
|
|
359
|
-
function p() {
|
|
360
|
-
e.value = !e.value;
|
|
361
|
-
}
|
|
362
|
-
function m(t) {
|
|
363
|
-
e.value = t, localStorage.setItem(Et, String(e.value));
|
|
364
|
-
}
|
|
365
|
-
function h(e = "theme") {
|
|
366
|
-
n.value = e, t.value = !0;
|
|
367
|
-
}
|
|
368
|
-
function g() {
|
|
369
|
-
t.value = !1;
|
|
370
|
-
}
|
|
371
|
-
function _(e) {
|
|
372
|
-
t.value = e;
|
|
373
|
-
}
|
|
374
|
-
function v(e) {
|
|
375
|
-
r.value = e, mt(e), yt(e), bt(i.value);
|
|
376
|
-
}
|
|
377
|
-
function y() {
|
|
378
|
-
v(_t() && r.value === "system" || u.value ? "light" : "dark");
|
|
379
|
-
}
|
|
380
|
-
function b(e) {
|
|
381
|
-
i.value = e, pt(e), bt(e);
|
|
382
|
-
}
|
|
383
|
-
function x(e) {
|
|
384
|
-
a.value = e, gt(e), St(e);
|
|
385
|
-
}
|
|
386
|
-
function S(e) {
|
|
387
|
-
o.value = e, localStorage.setItem(Ot, e), e === "top" && s.value === "sidebar" && ee("header");
|
|
388
|
-
}
|
|
389
|
-
function ee(e) {
|
|
390
|
-
let t = o.value === "top" ? "header" : e;
|
|
391
|
-
s.value = t, localStorage.setItem(Dt, t);
|
|
392
|
-
}
|
|
393
|
-
function C(e) {
|
|
394
|
-
c.value = e, localStorage.setItem(kt, e);
|
|
395
|
-
}
|
|
396
|
-
function w() {
|
|
397
|
-
xt();
|
|
398
|
-
}
|
|
399
|
-
return {
|
|
400
|
-
closeSettings: g,
|
|
401
|
-
initializePreferences: w,
|
|
402
|
-
isDark: u,
|
|
403
|
-
layoutMode: o,
|
|
404
|
-
menuSearchPlacement: s,
|
|
405
|
-
menuSearchPlacementOptions: d,
|
|
406
|
-
openSettings: h,
|
|
407
|
-
isSidebarMenuSearch: f,
|
|
408
|
-
settingsActiveTab: n,
|
|
409
|
-
selectedTopMenuPath: c,
|
|
410
|
-
setLayoutMode: S,
|
|
411
|
-
setMenuSearchPlacement: ee,
|
|
412
|
-
setSelectedTopMenuPath: C,
|
|
413
|
-
setSettingsVisible: _,
|
|
414
|
-
setSidebarCollapsed: m,
|
|
415
|
-
setThemeColor: b,
|
|
416
|
-
setThemeColorPosition: x,
|
|
417
|
-
setThemeMode: v,
|
|
418
|
-
settingsVisible: t,
|
|
419
|
-
sidebarCollapsed: e,
|
|
420
|
-
shortcutTipVisible: l,
|
|
421
|
-
themeColor: i,
|
|
422
|
-
themeColorPosition: a,
|
|
423
|
-
themeMode: r,
|
|
424
|
-
toggleDarkMode: y,
|
|
425
|
-
toggleSidebar: p
|
|
426
|
-
};
|
|
427
|
-
}), At = ["src", "alt"], jt = /* @__PURE__ */ M({
|
|
211
|
+
}), Ze = ["src", "alt"], Qe = /* @__PURE__ */ M({
|
|
428
212
|
__name: "ThemedSvgImage",
|
|
429
213
|
props: {
|
|
430
214
|
src: {},
|
|
@@ -445,7 +229,7 @@ var Et = "sidebar-collapsed", Dt = "menu-search-placement", Ot = "layout-mode",
|
|
|
445
229
|
let n = e.replaceAll("#409EFF", t);
|
|
446
230
|
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`;
|
|
447
231
|
}
|
|
448
|
-
return
|
|
232
|
+
return W((e) => {
|
|
449
233
|
let n = !1, o = t.src, s = t.primaryColor;
|
|
450
234
|
r.value = o, i(o).then((e) => {
|
|
451
235
|
n || (r.value = a(e, s));
|
|
@@ -454,79 +238,79 @@ var Et = "sidebar-collapsed", Dt = "menu-search-placement", Ot = "layout-mode",
|
|
|
454
238
|
}), e(() => {
|
|
455
239
|
n = !0;
|
|
456
240
|
});
|
|
457
|
-
}), (t, n) => (
|
|
241
|
+
}), (t, n) => (I(), O("img", {
|
|
458
242
|
src: r.value,
|
|
459
243
|
alt: e.alt
|
|
460
|
-
}, null, 8,
|
|
244
|
+
}, null, 8, Ze));
|
|
461
245
|
}
|
|
462
|
-
}),
|
|
246
|
+
}), $e = "data:image/svg+xml,%3csvg%20viewBox='0%200%2064%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='64'%20height='48'%20rx='3'%20fill='%23c5cede'%20fill-opacity='0.04'/%3e%3crect%20x='4'%20y='4'%20width='11'%20height='40'%20rx='1.5'%20fill='%23409EFF'/%3e%3crect%20x='6.5'%20y='7'%20width='2'%20height='2'%20rx='1'%20fill='white'%20fill-opacity='0.95'/%3e%3crect%20x='6.5'%20y='11'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='6.5'%20y='14.5'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='6.5'%20y='18'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='17'%20y='4'%20width='43'%20height='7'%20rx='1.5'%20fill='%23409EFF'/%3e%3crect%20x='19.5'%20y='7.25'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='27.5'%20y='7.25'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='35.5'%20y='7.25'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='17'%20y='13'%20width='43'%20height='31'%20rx='1.5'%20fill='%23c5cede'%20fill-opacity='0.06'/%3e%3c/svg%3e", et = "data:image/svg+xml,%3csvg%20viewBox='0%200%2064%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='64'%20height='48'%20rx='3'%20fill='%23c5cede'%20fill-opacity='0.04'/%3e%3crect%20x='4'%20y='4'%20width='11'%20height='40'%20rx='1.5'%20fill='%23409EFF'/%3e%3crect%20x='6.5'%20y='7'%20width='2'%20height='2'%20rx='1'%20fill='white'%20fill-opacity='0.95'/%3e%3crect%20x='6.5'%20y='11'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='6.5'%20y='14.5'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='6.5'%20y='18'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='17'%20y='4'%20width='43'%20height='40'%20rx='1.5'%20fill='%23c5cede'%20fill-opacity='0.06'/%3e%3c/svg%3e", tt = "data:image/svg+xml,%3csvg%20viewBox='0%200%2064%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='64'%20height='48'%20rx='3'%20fill='%23c5cede'%20fill-opacity='0.04'/%3e%3crect%20x='4'%20y='4'%20width='56'%20height='7'%20rx='1.5'%20fill='%23409EFF'/%3e%3crect%20x='7'%20y='6.5'%20width='2'%20height='2'%20rx='1'%20fill='white'%20fill-opacity='0.95'/%3e%3crect%20x='11'%20y='7.25'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='19'%20y='7.25'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='27'%20y='7.25'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='4'%20y='13'%20width='56'%20height='31'%20rx='1.5'%20fill='%23c5cede'%20fill-opacity='0.06'/%3e%3c/svg%3e", nt = "data:image/svg+xml,%3csvg%20viewBox='0%200%2064%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='64'%20height='48'%20rx='3'%20fill='%23c5cede'%20fill-opacity='0.04'/%3e%3crect%20x='4'%20y='4'%20width='56'%20height='7'%20rx='1.5'%20fill='%23409EFF'/%3e%3crect%20x='7'%20y='6.5'%20width='2'%20height='2'%20rx='1'%20fill='white'%20fill-opacity='0.95'/%3e%3crect%20x='11'%20y='7.25'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='19'%20y='7.25'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='27'%20y='7.25'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='4'%20y='13'%20width='56'%20height='31'%20rx='1.5'%20fill='%23c5cede'%20fill-opacity='0.06'/%3e%3crect%20x='8'%20y='18'%20width='17'%20height='4'%20rx='1'%20fill='%23c5cede'%20fill-opacity='0.16'/%3e%3crect%20x='8'%20y='26'%20width='30'%20height='4'%20rx='1'%20fill='%23c5cede'%20fill-opacity='0.12'/%3e%3c/svg%3e", rt = "data:image/svg+xml,%3csvg%20viewBox='0%200%2064%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='64'%20height='48'%20rx='3'%20fill='%23c5cede'%20fill-opacity='0.04'/%3e%3crect%20x='4'%20y='4'%20width='56'%20height='40'%20rx='2'%20fill='%23c5cede'%20fill-opacity='0.05'/%3e%3crect%20x='7'%20y='7'%20width='50'%20height='5'%20rx='1.5'%20fill='%23c5cede'%20fill-opacity='0.14'/%3e%3crect%20x='7'%20y='16'%20width='22'%20height='4'%20rx='1'%20fill='%23c5cede'%20fill-opacity='0.18'/%3e%3crect%20x='7'%20y='23'%20width='35'%20height='4'%20rx='1'%20fill='%23c5cede'%20fill-opacity='0.12'/%3e%3crect%20x='7'%20y='30'%20width='16'%20height='4'%20rx='1'%20fill='%23c5cede'%20fill-opacity='0.1'/%3e%3crect%20x='45'%20y='18'%20width='12'%20height='16'%20rx='2'%20fill='%23c5cede'%20fill-opacity='0.08'/%3e%3c/svg%3e", it = "data:image/svg+xml,%3csvg%20viewBox='0%200%2064%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='64'%20height='48'%20rx='3'%20fill='%23c5cede'%20fill-opacity='0.04'/%3e%3crect%20x='4'%20y='4'%20width='11'%20height='40'%20rx='1.5'%20fill='%23409EFF'/%3e%3crect%20x='6.5'%20y='7'%20width='2'%20height='2'%20rx='1'%20fill='white'%20fill-opacity='0.95'/%3e%3crect%20x='6.5'%20y='11'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='6.5'%20y='14.5'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='6.5'%20y='18'%20width='6'%20height='1.5'%20rx='0.75'%20fill='white'%20fill-opacity='0.75'/%3e%3crect%20x='17'%20y='4'%20width='43'%20height='40'%20rx='1.5'%20fill='%23c5cede'%20fill-opacity='0.06'/%3e%3crect%20x='21'%20y='10'%20width='14'%20height='4'%20rx='1'%20fill='%23c5cede'%20fill-opacity='0.16'/%3e%3crect%20x='21'%20y='18'%20width='24'%20height='4'%20rx='1'%20fill='%23c5cede'%20fill-opacity='0.12'/%3e%3crect%20x='21'%20y='26'%20width='18'%20height='4'%20rx='1'%20fill='%23c5cede'%20fill-opacity='0.1'/%3e%3c/svg%3e", at = { class: "settings-section" }, ot = { class: "settings-mode-grid" }, st = ["onClick"], ct = { class: "settings-section" }, lt = {
|
|
463
247
|
key: 0,
|
|
464
248
|
class: "settings-section__header"
|
|
465
|
-
},
|
|
249
|
+
}, ut = {
|
|
466
250
|
key: 1,
|
|
467
251
|
class: "settings-position-grid"
|
|
468
|
-
},
|
|
252
|
+
}, dt = ["onClick"], ft = { class: "settings-position-card__label" }, pt = { class: "settings-section" }, mt = { class: "settings-color-grid" }, ht = ["onClick"], gt = { class: "settings-color-card__label" }, _t = { class: "settings-color-card__swatch settings-color-card__swatch--custom" }, vt = { class: "settings-section" }, yt = { class: "settings-layout-grid" }, bt = ["onClick"], xt = { class: "settings-layout-card__label" }, St = { class: "settings-section" }, Ct = { class: "settings-inline-setting" }, wt = {
|
|
469
253
|
key: 0,
|
|
470
254
|
class: "settings-section"
|
|
471
|
-
},
|
|
255
|
+
}, Tt = { class: "settings-menu-search-grid" }, Et = ["onClick"], Dt = { class: "settings-placeholder" }, Ot = { class: "settings-placeholder" }, kt = /* @__PURE__ */ M({
|
|
472
256
|
__name: "SystemSettingsDrawer",
|
|
473
257
|
setup(e) {
|
|
474
|
-
let t =
|
|
258
|
+
let t = f(), n = w(() => !u.some((e) => e.value.toLowerCase() === t.themeColor.toLowerCase())), r = [
|
|
475
259
|
{
|
|
476
260
|
label: "浅色",
|
|
477
261
|
value: "light",
|
|
478
|
-
icon:
|
|
262
|
+
icon: we
|
|
479
263
|
},
|
|
480
264
|
{
|
|
481
265
|
label: "深色",
|
|
482
266
|
value: "dark",
|
|
483
|
-
icon:
|
|
267
|
+
icon: be
|
|
484
268
|
},
|
|
485
269
|
{
|
|
486
270
|
label: "跟随系统",
|
|
487
271
|
value: "system",
|
|
488
|
-
icon:
|
|
272
|
+
icon: ye
|
|
489
273
|
}
|
|
490
274
|
], i = [
|
|
491
275
|
{
|
|
492
276
|
label: "不应用",
|
|
493
277
|
value: "none",
|
|
494
|
-
previewSrc:
|
|
278
|
+
previewSrc: rt
|
|
495
279
|
},
|
|
496
280
|
{
|
|
497
281
|
label: "顶部",
|
|
498
282
|
value: "header",
|
|
499
|
-
previewSrc:
|
|
283
|
+
previewSrc: nt
|
|
500
284
|
},
|
|
501
285
|
{
|
|
502
286
|
label: "侧边栏",
|
|
503
287
|
value: "sidebar",
|
|
504
|
-
previewSrc:
|
|
288
|
+
previewSrc: it
|
|
505
289
|
}
|
|
506
290
|
], a = [
|
|
507
291
|
{
|
|
508
292
|
label: "侧边导航",
|
|
509
293
|
value: "side",
|
|
510
|
-
previewSrc:
|
|
294
|
+
previewSrc: et
|
|
511
295
|
},
|
|
512
296
|
{
|
|
513
297
|
label: "顶部导航",
|
|
514
298
|
value: "top",
|
|
515
|
-
previewSrc:
|
|
299
|
+
previewSrc: tt
|
|
516
300
|
},
|
|
517
301
|
{
|
|
518
302
|
label: "混合导航",
|
|
519
303
|
value: "mix",
|
|
520
|
-
previewSrc:
|
|
304
|
+
previewSrc: $e
|
|
521
305
|
}
|
|
522
306
|
], o = [{
|
|
523
307
|
label: "顶部搜索",
|
|
524
308
|
value: "header",
|
|
525
|
-
icon:
|
|
309
|
+
icon: Y
|
|
526
310
|
}, {
|
|
527
311
|
label: "侧边搜索",
|
|
528
312
|
value: "sidebar",
|
|
529
|
-
icon:
|
|
313
|
+
icon: ve
|
|
530
314
|
}];
|
|
531
315
|
function s(e) {
|
|
532
316
|
e && t.setThemeColor(e);
|
|
@@ -535,8 +319,8 @@ var Et = "sidebar-collapsed", Dt = "menu-search-placement", Ot = "layout-mode",
|
|
|
535
319
|
e || t.closeSettings();
|
|
536
320
|
}
|
|
537
321
|
return (e, l) => {
|
|
538
|
-
let
|
|
539
|
-
return
|
|
322
|
+
let d = z("el-icon"), f = z("el-color-picker"), p = z("el-tab-pane"), m = z("el-switch"), h = z("el-empty"), g = z("el-tabs");
|
|
323
|
+
return I(), E(H(Oe), {
|
|
540
324
|
"model-value": H(t).settingsVisible,
|
|
541
325
|
title: "主题设置",
|
|
542
326
|
direction: "rtl",
|
|
@@ -545,52 +329,52 @@ var Et = "sidebar-collapsed", Dt = "menu-search-placement", Ot = "layout-mode",
|
|
|
545
329
|
"show-footer": !1,
|
|
546
330
|
"onUpdate:modelValue": c
|
|
547
331
|
}, {
|
|
548
|
-
default:
|
|
332
|
+
default: G(() => [j(g, {
|
|
549
333
|
modelValue: H(t).settingsActiveTab,
|
|
550
334
|
"onUpdate:modelValue": l[0] ||= (e) => H(t).settingsActiveTab = e,
|
|
551
335
|
class: "settings-tabs"
|
|
552
336
|
}, {
|
|
553
|
-
default:
|
|
554
|
-
j(
|
|
337
|
+
default: G(() => [
|
|
338
|
+
j(p, {
|
|
555
339
|
label: "外观",
|
|
556
340
|
name: "theme"
|
|
557
341
|
}, {
|
|
558
|
-
default:
|
|
559
|
-
k("div",
|
|
342
|
+
default: G(() => [
|
|
343
|
+
k("div", at, [l[1] ||= k("div", { class: "settings-section__header" }, [k("span", { class: "settings-section__title" }, "主题模式"), k("span", { class: "settings-section__desc" }, "选择浅色、深色或跟随系统")], -1), k("div", ot, [(I(), O(x, null, R(r, (e) => k("button", {
|
|
560
344
|
key: e.value,
|
|
561
345
|
type: "button",
|
|
562
346
|
class: P(["settings-mode-card", { "is-active": H(t).themeMode === e.value }]),
|
|
563
347
|
onClick: (n) => H(t).setThemeMode(e.value)
|
|
564
|
-
}, [j(
|
|
565
|
-
default:
|
|
348
|
+
}, [j(d, { size: 20 }, {
|
|
349
|
+
default: G(() => [(I(), E(B(e.icon)))]),
|
|
566
350
|
_: 2
|
|
567
|
-
}, 1024), k("strong", null, V(e.label), 1)], 10,
|
|
568
|
-
k("div",
|
|
351
|
+
}, 1024), k("strong", null, V(e.label), 1)], 10, st)), 64))])]),
|
|
352
|
+
k("div", ct, [H(t).isDark ? D("", !0) : (I(), O("div", lt, [...l[2] ||= [k("span", { class: "settings-section__title" }, "主题色应用", -1), k("span", { class: "settings-section__desc" }, "选择主题色应用位置", -1)]])), H(t).isDark ? D("", !0) : (I(), O("div", ut, [(I(), O(x, null, R(i, (e) => k("button", {
|
|
569
353
|
key: e.value,
|
|
570
354
|
type: "button",
|
|
571
355
|
class: P(["settings-position-card", { "is-active": H(t).themeColorPosition === e.value }]),
|
|
572
356
|
onClick: (n) => H(t).setThemeColorPosition(e.value)
|
|
573
|
-
}, [j(
|
|
357
|
+
}, [j(Qe, {
|
|
574
358
|
class: "settings-position-card__preview",
|
|
575
359
|
src: e.previewSrc,
|
|
576
360
|
"primary-color": H(t).themeColor
|
|
577
|
-
}, null, 8, ["src", "primary-color"]), k("span",
|
|
578
|
-
k("div",
|
|
361
|
+
}, null, 8, ["src", "primary-color"]), k("span", ft, V(e.label), 1)], 10, dt)), 64))]))]),
|
|
362
|
+
k("div", pt, [l[4] ||= k("div", { class: "settings-section__header" }, [k("span", { class: "settings-section__title" }, "主题色"), k("span", { class: "settings-section__desc" }, "选择系统主题颜色")], -1), k("div", mt, [(I(!0), O(x, null, R(H(u), (e) => (I(), O("button", {
|
|
579
363
|
key: e.value,
|
|
580
364
|
type: "button",
|
|
581
365
|
class: P(["settings-color-card", { "is-active": H(t).themeColor === e.value }]),
|
|
582
366
|
onClick: (n) => H(t).setThemeColor(e.value)
|
|
583
367
|
}, [k("span", {
|
|
584
368
|
class: "settings-color-card__swatch",
|
|
585
|
-
style:
|
|
586
|
-
}, null, 4), k("span",
|
|
587
|
-
j(
|
|
369
|
+
style: F({ backgroundColor: e.value })
|
|
370
|
+
}, null, 4), k("span", gt, V(e.label), 1)], 10, ht))), 128)), k("div", { class: P(["settings-color-card settings-color-card--custom", { "is-active": n.value }]) }, [
|
|
371
|
+
j(f, {
|
|
588
372
|
class: "settings-color-card__picker",
|
|
589
373
|
"model-value": H(t).themeColor,
|
|
590
374
|
"onUpdate:modelValue": s
|
|
591
375
|
}, null, 8, ["model-value"]),
|
|
592
|
-
k("span",
|
|
593
|
-
default:
|
|
376
|
+
k("span", _t, [j(d, { size: 18 }, {
|
|
377
|
+
default: G(() => [j(H(le))]),
|
|
594
378
|
_: 1
|
|
595
379
|
})]),
|
|
596
380
|
l[3] ||= k("span", { class: "settings-color-card__label" }, "自定义", -1)
|
|
@@ -598,49 +382,49 @@ var Et = "sidebar-collapsed", Dt = "menu-search-placement", Ot = "layout-mode",
|
|
|
598
382
|
]),
|
|
599
383
|
_: 1
|
|
600
384
|
}),
|
|
601
|
-
j(
|
|
385
|
+
j(p, {
|
|
602
386
|
label: "布局",
|
|
603
387
|
name: "layout"
|
|
604
388
|
}, {
|
|
605
|
-
default:
|
|
606
|
-
k("div",
|
|
389
|
+
default: G(() => [
|
|
390
|
+
k("div", vt, [l[5] ||= k("div", { class: "settings-section__header" }, [k("span", { class: "settings-section__title" }, "布局模式"), k("span", { class: "settings-section__desc" }, "切换侧边、顶部或混合导航")], -1), k("div", yt, [(I(), O(x, null, R(a, (e) => k("button", {
|
|
607
391
|
key: e.value,
|
|
608
392
|
type: "button",
|
|
609
393
|
class: P(["settings-layout-card", { "is-active": H(t).layoutMode === e.value }]),
|
|
610
394
|
onClick: (n) => H(t).setLayoutMode(e.value)
|
|
611
|
-
}, [j(
|
|
395
|
+
}, [j(Qe, {
|
|
612
396
|
class: "settings-layout-card__preview",
|
|
613
397
|
src: e.previewSrc,
|
|
614
398
|
"primary-color": H(t).themeColor
|
|
615
|
-
}, null, 8, ["src", "primary-color"]), k("span",
|
|
616
|
-
k("div",
|
|
399
|
+
}, null, 8, ["src", "primary-color"]), k("span", xt, V(e.label), 1)], 10, bt)), 64))])]),
|
|
400
|
+
k("div", St, [k("div", Ct, [l[6] ||= k("div", null, [k("strong", null, "默认折叠侧边栏"), k("p", null, "适合屏幕较窄或想保留更多内容区空间")], -1), j(m, {
|
|
617
401
|
"model-value": H(t).sidebarCollapsed,
|
|
618
402
|
"onUpdate:modelValue": H(t).setSidebarCollapsed
|
|
619
403
|
}, null, 8, ["model-value", "onUpdate:modelValue"])])]),
|
|
620
|
-
H(t).layoutMode === "top" ? D("", !0) : (
|
|
404
|
+
H(t).layoutMode === "top" ? D("", !0) : (I(), O("div", wt, [l[7] ||= k("div", { class: "settings-section__header" }, [k("span", { class: "settings-section__title" }, "菜单搜索位置"), k("span", { class: "settings-section__desc" }, "顶部或侧边栏顶部搜索")], -1), k("div", Tt, [(I(), O(x, null, R(o, (e) => k("button", {
|
|
621
405
|
key: e.value,
|
|
622
406
|
type: "button",
|
|
623
407
|
class: P(["settings-mode-card", { "is-active": H(t).menuSearchPlacement === e.value }]),
|
|
624
408
|
onClick: (n) => H(t).setMenuSearchPlacement(e.value)
|
|
625
|
-
}, [j(
|
|
626
|
-
default:
|
|
409
|
+
}, [j(d, { size: 20 }, {
|
|
410
|
+
default: G(() => [(I(), E(B(e.icon)))]),
|
|
627
411
|
_: 2
|
|
628
|
-
}, 1024), k("strong", null, V(e.label), 1)], 10,
|
|
412
|
+
}, 1024), k("strong", null, V(e.label), 1)], 10, Et)), 64))])]))
|
|
629
413
|
]),
|
|
630
414
|
_: 1
|
|
631
415
|
}),
|
|
632
|
-
j(
|
|
416
|
+
j(p, {
|
|
633
417
|
label: "快捷键",
|
|
634
418
|
name: "shortcut"
|
|
635
419
|
}, {
|
|
636
|
-
default:
|
|
420
|
+
default: G(() => [k("div", Dt, [j(h, { description: "快捷键配置稍后接入,这里先预留入口。" })])]),
|
|
637
421
|
_: 1
|
|
638
422
|
}),
|
|
639
|
-
j(
|
|
423
|
+
j(p, {
|
|
640
424
|
label: "通用",
|
|
641
425
|
name: "general"
|
|
642
426
|
}, {
|
|
643
|
-
default:
|
|
427
|
+
default: G(() => [k("div", Ot, [j(h, { description: "通用设置稍后扩展,这里先保留结构。" })])]),
|
|
644
428
|
_: 1
|
|
645
429
|
})
|
|
646
430
|
]),
|
|
@@ -650,66 +434,66 @@ var Et = "sidebar-collapsed", Dt = "menu-search-placement", Ot = "layout-mode",
|
|
|
650
434
|
}, 8, ["model-value"]);
|
|
651
435
|
};
|
|
652
436
|
}
|
|
653
|
-
}),
|
|
437
|
+
}), At = /* @__PURE__ */ M({
|
|
654
438
|
__name: "AppContentView",
|
|
655
439
|
props: { refreshKey: {} },
|
|
656
440
|
setup(e) {
|
|
657
441
|
return (t, n) => {
|
|
658
442
|
let r = z("router-view"), i = z("el-main");
|
|
659
|
-
return
|
|
660
|
-
default:
|
|
661
|
-
default:
|
|
443
|
+
return I(), E(i, { class: "app-layout__main" }, {
|
|
444
|
+
default: G(() => [j(r, null, {
|
|
445
|
+
default: G(({ Component: t, route: n }) => [(I(), E(B(t), { key: `${n.fullPath}:${e.refreshKey}` }))]),
|
|
662
446
|
_: 1
|
|
663
447
|
})]),
|
|
664
448
|
_: 1
|
|
665
449
|
});
|
|
666
450
|
};
|
|
667
451
|
}
|
|
668
|
-
}),
|
|
452
|
+
}), jt = ["title"], Mt = /* @__PURE__ */ p(/* @__PURE__ */ M({
|
|
669
453
|
__name: "ThemeToggleButton",
|
|
670
454
|
setup(e) {
|
|
671
|
-
let t =
|
|
455
|
+
let t = f();
|
|
672
456
|
async function n(e) {
|
|
673
|
-
await
|
|
457
|
+
await d(e, () => {
|
|
674
458
|
t.toggleDarkMode();
|
|
675
459
|
});
|
|
676
460
|
}
|
|
677
461
|
return (e, r) => {
|
|
678
462
|
let i = z("el-icon");
|
|
679
|
-
return
|
|
463
|
+
return I(), O("button", {
|
|
680
464
|
type: "button",
|
|
681
465
|
class: "app-layout__header-tool-btn theme-icon-btn",
|
|
682
466
|
title: H(t).isDark ? "切换浅色模式" : "切换深色模式",
|
|
683
467
|
onClick: n
|
|
684
468
|
}, [j(i, { size: 20 }, {
|
|
685
|
-
default:
|
|
469
|
+
default: G(() => [(I(), E(B(H(t).isDark ? H(we) : H(be))))]),
|
|
686
470
|
_: 1
|
|
687
|
-
})], 8,
|
|
471
|
+
})], 8, jt);
|
|
688
472
|
};
|
|
689
473
|
}
|
|
690
474
|
}), [["__scopeId", "data-v-73aaf569"]]);
|
|
691
475
|
//#endregion
|
|
692
476
|
//#region src/main/layouts/composables/useAppMenus.ts
|
|
693
|
-
function
|
|
694
|
-
let e =
|
|
477
|
+
function Nt() {
|
|
478
|
+
let e = g(), t = _(), n = f(), r = a(), i = w(() => Pt(t.options.routes.find((e) => e.path === "/")?.children ?? [], "", r.hasPermission)), o = w(() => i.value), s = w(() => n.layoutMode === "mix" ? i.value.find((e) => e.fullPath === n.selectedTopMenuPath)?.children ?? [] : i.value), c = w(() => Ft(i.value).filter((e) => !e.children?.length)), l = w(() => Ft(s.value).filter((e) => !e.children?.length));
|
|
695
479
|
return {
|
|
696
|
-
activeMenu:
|
|
697
|
-
activeTopMenuPath:
|
|
480
|
+
activeMenu: w(() => e.path),
|
|
481
|
+
activeTopMenuPath: w(() => {
|
|
698
482
|
let t = e.path;
|
|
699
483
|
return o.value.find((e) => t === e.fullPath || t.startsWith(`${e.fullPath}/`))?.fullPath || n.selectedTopMenuPath;
|
|
700
484
|
}),
|
|
701
485
|
allMenus: i,
|
|
702
486
|
flatMenus: c,
|
|
703
487
|
flatSideMenus: l,
|
|
704
|
-
findFirstLeafNode:
|
|
705
|
-
findFirstLeafPath:
|
|
488
|
+
findFirstLeafNode: It,
|
|
489
|
+
findFirstLeafPath: Lt,
|
|
706
490
|
sideMenus: s,
|
|
707
491
|
topMenus: o
|
|
708
492
|
};
|
|
709
493
|
}
|
|
710
|
-
function
|
|
711
|
-
return e.filter((e) => !e.meta?.hidden &&
|
|
712
|
-
let r =
|
|
494
|
+
function Pt(e, t, n) {
|
|
495
|
+
return e.filter((e) => !e.meta?.hidden && zt(e, n)).map((e) => {
|
|
496
|
+
let r = Vt(e.path, t), i = e.children?.length ? Pt(e.children, r, n) : void 0;
|
|
713
497
|
return {
|
|
714
498
|
path: e.path,
|
|
715
499
|
fullPath: r,
|
|
@@ -717,104 +501,104 @@ function mn(e, t, n) {
|
|
|
717
501
|
icon: e.meta?.icon ? String(e.meta.icon) : void 0,
|
|
718
502
|
children: i
|
|
719
503
|
};
|
|
720
|
-
}).filter((t) => t.children?.length || !
|
|
504
|
+
}).filter((t) => t.children?.length || !Bt(e, t.path));
|
|
721
505
|
}
|
|
722
|
-
function
|
|
723
|
-
return e.flatMap((e) => [e, ...
|
|
506
|
+
function Ft(e) {
|
|
507
|
+
return e.flatMap((e) => [e, ...Ft(e.children ?? [])]);
|
|
724
508
|
}
|
|
725
|
-
function
|
|
509
|
+
function It(e) {
|
|
726
510
|
if (!e.children?.length) return e;
|
|
727
511
|
for (let t of e.children) {
|
|
728
|
-
let e =
|
|
512
|
+
let e = It(t);
|
|
729
513
|
if (e) return e;
|
|
730
514
|
}
|
|
731
515
|
return null;
|
|
732
516
|
}
|
|
733
|
-
function
|
|
517
|
+
function Lt(e, t, n = "") {
|
|
734
518
|
for (let r of e) {
|
|
735
|
-
let e =
|
|
736
|
-
if (e === t) return
|
|
519
|
+
let e = Vt(r.path, n);
|
|
520
|
+
if (e === t) return Rt(r, n);
|
|
737
521
|
if (r.children?.length) {
|
|
738
|
-
let n =
|
|
522
|
+
let n = Lt(r.children, t, e);
|
|
739
523
|
if (n) return n;
|
|
740
524
|
}
|
|
741
525
|
}
|
|
742
526
|
return null;
|
|
743
527
|
}
|
|
744
|
-
function
|
|
745
|
-
let n =
|
|
528
|
+
function Rt(e, t) {
|
|
529
|
+
let n = Vt(e.path, t);
|
|
746
530
|
if (e.component) return n;
|
|
747
531
|
let r = e.children ?? [];
|
|
748
532
|
for (let e of r) {
|
|
749
|
-
let t =
|
|
533
|
+
let t = Vt(e.path, n);
|
|
750
534
|
if (e.component) return t;
|
|
751
535
|
}
|
|
752
536
|
for (let e of r) {
|
|
753
|
-
let t =
|
|
537
|
+
let t = Rt(e, n);
|
|
754
538
|
if (t) return t;
|
|
755
539
|
}
|
|
756
540
|
return null;
|
|
757
541
|
}
|
|
758
|
-
function
|
|
542
|
+
function zt(e, t) {
|
|
759
543
|
let n = e.meta?.permission;
|
|
760
544
|
return n ? Array.isArray(n) ? n.every((e) => t(String(e))) : t(String(n)) : !0;
|
|
761
545
|
}
|
|
762
|
-
function
|
|
546
|
+
function Bt(e, t) {
|
|
763
547
|
let n = e.find((e) => e.path === t);
|
|
764
548
|
return !!(n?.redirect && !n.component && !n.children?.length);
|
|
765
549
|
}
|
|
766
|
-
function
|
|
550
|
+
function Vt(e, t) {
|
|
767
551
|
return e.startsWith("/") ? e : `${t}/${e}`.replace(/\/+/g, "/");
|
|
768
552
|
}
|
|
769
553
|
//#endregion
|
|
770
554
|
//#region src/main/layouts/utils/menuIcons.ts
|
|
771
|
-
var
|
|
772
|
-
Connection:
|
|
773
|
-
House:
|
|
774
|
-
Setting:
|
|
775
|
-
User:
|
|
555
|
+
var Ht = {
|
|
556
|
+
Connection: de,
|
|
557
|
+
House: _e,
|
|
558
|
+
Setting: Ce,
|
|
559
|
+
User: De
|
|
776
560
|
};
|
|
777
|
-
function
|
|
778
|
-
return e ?
|
|
561
|
+
function $(e) {
|
|
562
|
+
return e ? Ht[e] ?? _e : _e;
|
|
779
563
|
}
|
|
780
564
|
//#endregion
|
|
781
565
|
//#region src/main/layouts/components/AppHeaderMenuNode.vue
|
|
782
|
-
var
|
|
566
|
+
var Ut = /* @__PURE__ */ M({
|
|
783
567
|
name: "AppHeaderMenuNode",
|
|
784
568
|
__name: "AppHeaderMenuNode",
|
|
785
569
|
props: { node: {} },
|
|
786
570
|
setup(e) {
|
|
787
571
|
return (t, n) => {
|
|
788
572
|
let r = z("el-icon"), i = z("AppHeaderMenuNode", !0), a = z("el-sub-menu"), o = z("el-menu-item");
|
|
789
|
-
return e.node.children?.length ? (
|
|
573
|
+
return e.node.children?.length ? (I(), E(a, {
|
|
790
574
|
key: 0,
|
|
791
575
|
index: e.node.fullPath
|
|
792
576
|
}, {
|
|
793
|
-
title:
|
|
794
|
-
default:
|
|
577
|
+
title: G(() => [e.node.icon ? (I(), E(r, { key: 0 }, {
|
|
578
|
+
default: G(() => [(I(), E(B(H($)(e.node.icon))))]),
|
|
795
579
|
_: 1
|
|
796
580
|
})) : D("", !0), k("span", null, V(e.node.title), 1)]),
|
|
797
|
-
default:
|
|
581
|
+
default: G(() => [(I(!0), O(x, null, R(e.node.children, (e) => (I(), E(i, {
|
|
798
582
|
key: e.fullPath,
|
|
799
583
|
node: e
|
|
800
584
|
}, null, 8, ["node"]))), 128))]),
|
|
801
585
|
_: 1
|
|
802
|
-
}, 8, ["index"])) : (
|
|
586
|
+
}, 8, ["index"])) : (I(), E(o, {
|
|
803
587
|
key: 1,
|
|
804
588
|
index: e.node.fullPath
|
|
805
589
|
}, {
|
|
806
|
-
default:
|
|
807
|
-
default:
|
|
590
|
+
default: G(() => [e.node.icon ? (I(), E(r, { key: 0 }, {
|
|
591
|
+
default: G(() => [(I(), E(B(H($)(e.node.icon))))]),
|
|
808
592
|
_: 1
|
|
809
593
|
})) : D("", !0), k("span", null, V(e.node.title), 1)]),
|
|
810
594
|
_: 1
|
|
811
595
|
}, 8, ["index"]));
|
|
812
596
|
};
|
|
813
597
|
}
|
|
814
|
-
}),
|
|
598
|
+
}), Wt = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.5%204.5V8.25C13.5%209.49264%2012.4926%2010.5%2011.25%2010.5H4.5'%20stroke='%23fff'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.5%207.5L4.5%2010.5L7.5%2013.5'%20stroke='%23fff'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e", Gt = { class: "app-menu-search-item__icon" }, Kt = { class: "app-menu-search-item__body" }, qt = {
|
|
815
599
|
key: 0,
|
|
816
600
|
class: "app-menu-search-item__actions"
|
|
817
|
-
},
|
|
601
|
+
}, Jt = { class: "app-menu-search-item__enter" }, Yt = ["src"], Xt = /* @__PURE__ */ M({
|
|
818
602
|
__name: "AppMenuSearchItem",
|
|
819
603
|
props: {
|
|
820
604
|
active: { type: Boolean },
|
|
@@ -830,7 +614,7 @@ var wn = /* @__PURE__ */ M({
|
|
|
830
614
|
let n = t;
|
|
831
615
|
return (t, r) => {
|
|
832
616
|
let i = z("el-icon");
|
|
833
|
-
return
|
|
617
|
+
return I(), O("div", {
|
|
834
618
|
class: P(["app-menu-search-item", { "is-active": e.active }]),
|
|
835
619
|
onMouseenter: r[4] ||= (t) => n("enter", e.item)
|
|
836
620
|
}, [k("div", {
|
|
@@ -838,26 +622,26 @@ var wn = /* @__PURE__ */ M({
|
|
|
838
622
|
role: "button",
|
|
839
623
|
tabindex: "0",
|
|
840
624
|
onClick: r[1] ||= (t) => n("select", e.item),
|
|
841
|
-
onKeydown: [r[2] ||=
|
|
625
|
+
onKeydown: [r[2] ||= K(q((t) => n("select", e.item), ["prevent"]), ["enter"]), r[3] ||= K(q((t) => n("select", e.item), ["prevent"]), ["space"])]
|
|
842
626
|
}, [
|
|
843
|
-
k("span",
|
|
844
|
-
default:
|
|
627
|
+
k("span", Gt, [j(i, null, {
|
|
628
|
+
default: G(() => [(I(), E(B(H($)(e.item.icon))))]),
|
|
845
629
|
_: 1
|
|
846
630
|
})]),
|
|
847
|
-
k("span",
|
|
848
|
-
j(
|
|
849
|
-
default:
|
|
850
|
-
src: H(
|
|
631
|
+
k("span", Kt, [k("strong", null, V(e.item.title), 1), k("span", null, V(e.item.fullPath), 1)]),
|
|
632
|
+
j(S, { name: "app-menu-search-actions" }, {
|
|
633
|
+
default: G(() => [e.active ? (I(), O("span", qt, [k("span", Jt, [k("img", {
|
|
634
|
+
src: H(Wt),
|
|
851
635
|
alt: "",
|
|
852
636
|
"aria-hidden": "true"
|
|
853
|
-
}, null, 8,
|
|
637
|
+
}, null, 8, Yt)]), e.removable ? (I(), O("button", {
|
|
854
638
|
key: 0,
|
|
855
639
|
class: "app-menu-search-item__remove",
|
|
856
640
|
type: "button",
|
|
857
641
|
"aria-label": "删除搜索历史",
|
|
858
|
-
onClick: r[0] ||=
|
|
642
|
+
onClick: r[0] ||= q((t) => n("remove", e.item), ["stop"])
|
|
859
643
|
}, [j(i, null, {
|
|
860
|
-
default:
|
|
644
|
+
default: G(() => [j(H(ue))]),
|
|
861
645
|
_: 1
|
|
862
646
|
})])) : D("", !0)])) : D("", !0)]),
|
|
863
647
|
_: 1
|
|
@@ -865,57 +649,57 @@ var wn = /* @__PURE__ */ M({
|
|
|
865
649
|
], 32)], 34);
|
|
866
650
|
};
|
|
867
651
|
}
|
|
868
|
-
}),
|
|
652
|
+
}), Zt = { class: "app-menu-search__control" }, Qt = {
|
|
869
653
|
key: 0,
|
|
870
654
|
class: "app-menu-search__section"
|
|
871
|
-
},
|
|
655
|
+
}, $t = {
|
|
872
656
|
key: 1,
|
|
873
657
|
class: "app-menu-search__section"
|
|
874
|
-
},
|
|
658
|
+
}, en = {
|
|
875
659
|
key: 2,
|
|
876
660
|
class: "app-menu-search__empty"
|
|
877
|
-
},
|
|
661
|
+
}, tn = { class: "app-menu-search__footer" }, nn = "menu-search-history", rn = 8, an = 70, on = 28, sn = 520, cn = /* @__PURE__ */ M({
|
|
878
662
|
__name: "AppMenuSearch",
|
|
879
663
|
props: { modelValue: { type: Boolean } },
|
|
880
664
|
emits: ["update:modelValue"],
|
|
881
665
|
setup(e, { emit: t }) {
|
|
882
|
-
let n = e, r = t, i =
|
|
666
|
+
let n = e, r = t, i = _(), { flatMenus: a } = Nt(), o = L(), s = L(), c = L(""), l = L(0), u = L(null), d = L(B()), f = w(() => c.value.trim().toLowerCase()), p = w(() => f.value ? a.value.filter((e) => {
|
|
883
667
|
let t = e.title.toLowerCase(), n = e.fullPath.toLowerCase();
|
|
884
668
|
return t.includes(f.value) || n.includes(f.value);
|
|
885
|
-
}) : []), m =
|
|
669
|
+
}) : []), m = w(() => c.value ? p.value : d.value), h = w(() => c.value ? !p.value.length : !d.value.length);
|
|
886
670
|
U(() => n.modelValue, (e) => {
|
|
887
671
|
if (!e) {
|
|
888
|
-
|
|
672
|
+
J();
|
|
889
673
|
return;
|
|
890
674
|
}
|
|
891
|
-
d.value =
|
|
675
|
+
d.value = B(), c.value = "", u.value = d.value[0] ?? null, l.value = 0, document.body.classList.add("app-menu-search-open"), ie(), N(() => {
|
|
892
676
|
o.value?.focus?.(), s.value?.setScrollTop?.(0);
|
|
893
677
|
});
|
|
894
678
|
}), U(p, (e) => {
|
|
895
679
|
u.value = e[0] ?? null, s.value?.setScrollTop?.(0);
|
|
896
|
-
}),
|
|
897
|
-
|
|
680
|
+
}), te(() => {
|
|
681
|
+
J();
|
|
898
682
|
});
|
|
899
683
|
function g() {
|
|
900
|
-
r("update:modelValue", !1),
|
|
684
|
+
r("update:modelValue", !1), J();
|
|
901
685
|
}
|
|
902
|
-
function
|
|
686
|
+
function v(e) {
|
|
903
687
|
u.value = e;
|
|
904
688
|
}
|
|
905
689
|
function y(e) {
|
|
906
|
-
|
|
690
|
+
re(e), g(), i.push(e.fullPath);
|
|
907
691
|
}
|
|
908
692
|
function b(e) {
|
|
909
693
|
let t = d.value.filter((t) => t.fullPath !== e.fullPath);
|
|
910
|
-
|
|
694
|
+
W(t), u.value?.fullPath === e.fullPath && (u.value = t[0] ?? null);
|
|
911
695
|
}
|
|
912
|
-
function
|
|
913
|
-
|
|
696
|
+
function T() {
|
|
697
|
+
W([]), u.value = null;
|
|
914
698
|
}
|
|
915
|
-
function
|
|
699
|
+
function M(e) {
|
|
916
700
|
l.value = e.scrollTop;
|
|
917
701
|
}
|
|
918
|
-
function
|
|
702
|
+
function P(e) {
|
|
919
703
|
if (n.modelValue && !e.isComposing) {
|
|
920
704
|
if (e.code === "Escape") {
|
|
921
705
|
e.preventDefault(), g();
|
|
@@ -925,25 +709,25 @@ var wn = /* @__PURE__ */ M({
|
|
|
925
709
|
e.preventDefault(), y(u.value);
|
|
926
710
|
return;
|
|
927
711
|
}
|
|
928
|
-
(e.code === "ArrowDown" || e.code === "ArrowUp") && (e.preventDefault(),
|
|
712
|
+
(e.code === "ArrowDown" || e.code === "ArrowUp") && (e.preventDefault(), F(e.code === "ArrowDown" ? 1 : -1));
|
|
929
713
|
}
|
|
930
714
|
}
|
|
931
|
-
function
|
|
715
|
+
function F(e) {
|
|
932
716
|
let t = m.value;
|
|
933
717
|
if (!t.length) return;
|
|
934
|
-
let n =
|
|
718
|
+
let n = K((u.value ? t.findIndex((e) => e.fullPath === u.value?.fullPath) : -1) + e, 0, t.length - 1), r = t[n];
|
|
935
719
|
r && (u.value = r, ne(n));
|
|
936
720
|
}
|
|
937
721
|
function ne(e) {
|
|
938
|
-
let t =
|
|
939
|
-
t < n ? s.value?.setScrollTop?.(t) : t > r && s.value?.setScrollTop?.(t -
|
|
722
|
+
let t = on + e * an, n = l.value, r = l.value + sn - an;
|
|
723
|
+
t < n ? s.value?.setScrollTop?.(t) : t > r && s.value?.setScrollTop?.(t - sn + an);
|
|
940
724
|
}
|
|
941
|
-
function
|
|
942
|
-
|
|
725
|
+
function re(e) {
|
|
726
|
+
W([e, ...d.value.filter((t) => t.fullPath !== e.fullPath)].slice(0, rn));
|
|
943
727
|
}
|
|
944
|
-
function
|
|
728
|
+
function B() {
|
|
945
729
|
try {
|
|
946
|
-
let e = localStorage.getItem(
|
|
730
|
+
let e = localStorage.getItem(nn);
|
|
947
731
|
if (!e) return [];
|
|
948
732
|
let t = JSON.parse(e), n = new Set(a.value.map((e) => e.fullPath));
|
|
949
733
|
return t.filter((e) => n.has(e.fullPath));
|
|
@@ -951,35 +735,35 @@ var wn = /* @__PURE__ */ M({
|
|
|
951
735
|
return [];
|
|
952
736
|
}
|
|
953
737
|
}
|
|
954
|
-
function
|
|
738
|
+
function W(e) {
|
|
955
739
|
if (d.value = e, !e.length) {
|
|
956
|
-
localStorage.removeItem(
|
|
740
|
+
localStorage.removeItem(nn);
|
|
957
741
|
return;
|
|
958
742
|
}
|
|
959
|
-
localStorage.setItem(
|
|
743
|
+
localStorage.setItem(nn, JSON.stringify(e));
|
|
960
744
|
}
|
|
961
|
-
function
|
|
745
|
+
function K(e, t, n) {
|
|
962
746
|
return Math.min(Math.max(e, t), n);
|
|
963
747
|
}
|
|
964
|
-
function
|
|
965
|
-
window.removeEventListener("keydown",
|
|
748
|
+
function ie() {
|
|
749
|
+
window.removeEventListener("keydown", P, !0), window.addEventListener("keydown", P, !0);
|
|
966
750
|
}
|
|
967
|
-
function
|
|
968
|
-
document.body.classList.remove("app-menu-search-open"), window.removeEventListener("keydown",
|
|
751
|
+
function J() {
|
|
752
|
+
document.body.classList.remove("app-menu-search-open"), window.removeEventListener("keydown", P, !0);
|
|
969
753
|
}
|
|
970
754
|
return (t, n) => {
|
|
971
755
|
let r = z("el-icon"), i = z("el-input"), a = z("el-scrollbar");
|
|
972
|
-
return
|
|
973
|
-
default:
|
|
756
|
+
return I(), E(ee, { to: "body" }, [j(S, { name: "app-menu-search-fade" }, {
|
|
757
|
+
default: G(() => [e.modelValue ? (I(), O("section", {
|
|
974
758
|
key: 0,
|
|
975
759
|
class: "app-menu-search",
|
|
976
760
|
tabindex: "-1",
|
|
977
|
-
onClick:
|
|
761
|
+
onClick: q(g, ["self"])
|
|
978
762
|
}, [k("div", {
|
|
979
763
|
class: "app-menu-search__panel",
|
|
980
|
-
onClick: n[1] ||=
|
|
764
|
+
onClick: n[1] ||= q(() => {}, ["stop"])
|
|
981
765
|
}, [
|
|
982
|
-
k("div",
|
|
766
|
+
k("div", Zt, [j(i, {
|
|
983
767
|
ref_key: "searchInputRef",
|
|
984
768
|
ref: o,
|
|
985
769
|
modelValue: c.value,
|
|
@@ -988,8 +772,8 @@ var wn = /* @__PURE__ */ M({
|
|
|
988
772
|
placeholder: "搜索页面名称或路径",
|
|
989
773
|
clearable: ""
|
|
990
774
|
}, {
|
|
991
|
-
prefix:
|
|
992
|
-
default:
|
|
775
|
+
prefix: G(() => [j(r, null, {
|
|
776
|
+
default: G(() => [j(H(Y))]),
|
|
993
777
|
_: 1
|
|
994
778
|
})]),
|
|
995
779
|
_: 1
|
|
@@ -999,56 +783,56 @@ var wn = /* @__PURE__ */ M({
|
|
|
999
783
|
ref: s,
|
|
1000
784
|
class: "app-menu-search__scroll",
|
|
1001
785
|
"max-height": "520px",
|
|
1002
|
-
onScroll:
|
|
786
|
+
onScroll: M
|
|
1003
787
|
}, {
|
|
1004
|
-
default:
|
|
1005
|
-
p.value.length ? (
|
|
788
|
+
default: G(() => [
|
|
789
|
+
p.value.length ? (I(), O("div", Qt, [n[2] ||= k("div", { class: "app-menu-search__section-title" }, "页面", -1), j(C, {
|
|
1006
790
|
name: "app-menu-search-list",
|
|
1007
791
|
tag: "div",
|
|
1008
792
|
class: "app-menu-search__list"
|
|
1009
793
|
}, {
|
|
1010
|
-
default:
|
|
794
|
+
default: G(() => [(I(!0), O(x, null, R(p.value, (e) => (I(), E(Xt, {
|
|
1011
795
|
key: e.fullPath,
|
|
1012
796
|
active: u.value?.fullPath === e.fullPath,
|
|
1013
797
|
item: e,
|
|
1014
|
-
onEnter:
|
|
798
|
+
onEnter: v,
|
|
1015
799
|
onSelect: y
|
|
1016
800
|
}, null, 8, ["active", "item"]))), 128))]),
|
|
1017
801
|
_: 1
|
|
1018
802
|
})])) : D("", !0),
|
|
1019
|
-
!c.value && d.value.length ? (
|
|
803
|
+
!c.value && d.value.length ? (I(), O("div", $t, [k("div", { class: "app-menu-search__section-header" }, [n[3] ||= k("div", { class: "app-menu-search__section-title" }, "搜索历史", -1), k("button", {
|
|
1020
804
|
class: "app-menu-search__clear",
|
|
1021
805
|
type: "button",
|
|
1022
|
-
onClick:
|
|
1023
|
-
}, " 清空 ")]), j(
|
|
806
|
+
onClick: T
|
|
807
|
+
}, " 清空 ")]), j(C, {
|
|
1024
808
|
name: "app-menu-search-list",
|
|
1025
809
|
tag: "div",
|
|
1026
810
|
class: "app-menu-search__list"
|
|
1027
811
|
}, {
|
|
1028
|
-
default:
|
|
812
|
+
default: G(() => [(I(!0), O(x, null, R(d.value, (e) => (I(), E(Xt, {
|
|
1029
813
|
key: e.fullPath,
|
|
1030
814
|
active: u.value?.fullPath === e.fullPath,
|
|
1031
815
|
item: e,
|
|
1032
816
|
removable: "",
|
|
1033
|
-
onEnter:
|
|
817
|
+
onEnter: v,
|
|
1034
818
|
onRemove: b,
|
|
1035
819
|
onSelect: y
|
|
1036
820
|
}, null, 8, ["active", "item"]))), 128))]),
|
|
1037
821
|
_: 1
|
|
1038
822
|
})])) : D("", !0),
|
|
1039
|
-
h.value ? (
|
|
823
|
+
h.value ? (I(), O("div", en, V(c.value ? "没有匹配的页面" : "没有搜索历史"), 1)) : D("", !0)
|
|
1040
824
|
]),
|
|
1041
825
|
_: 1
|
|
1042
826
|
}, 512),
|
|
1043
|
-
k("div",
|
|
827
|
+
k("div", tn, [
|
|
1044
828
|
n[5] ||= k("span", null, [k("kbd", null, "Enter"), A("选择")], -1),
|
|
1045
829
|
k("span", null, [
|
|
1046
830
|
j(r, null, {
|
|
1047
|
-
default:
|
|
831
|
+
default: G(() => [j(H(ae))]),
|
|
1048
832
|
_: 1
|
|
1049
833
|
}),
|
|
1050
834
|
j(r, null, {
|
|
1051
|
-
default:
|
|
835
|
+
default: G(() => [j(H(se))]),
|
|
1052
836
|
_: 1
|
|
1053
837
|
}),
|
|
1054
838
|
n[4] ||= A("切换", -1)
|
|
@@ -1063,148 +847,148 @@ var wn = /* @__PURE__ */ M({
|
|
|
1063
847
|
});
|
|
1064
848
|
//#endregion
|
|
1065
849
|
//#region src/main/layouts/composables/useShortcutLabel.ts
|
|
1066
|
-
function
|
|
1067
|
-
let e =
|
|
850
|
+
function ln() {
|
|
851
|
+
let e = w(() => typeof navigator > "u" ? !1 : /Mac|iPhone|iPad|iPod/i.test(navigator.platform));
|
|
1068
852
|
return {
|
|
1069
853
|
isMac: e,
|
|
1070
|
-
searchShortcutLabel:
|
|
854
|
+
searchShortcutLabel: w(() => e.value ? "⌘ K" : "Ctrl K")
|
|
1071
855
|
};
|
|
1072
856
|
}
|
|
1073
857
|
//#endregion
|
|
1074
858
|
//#region src/main/layouts/components/AppMenuSearchTrigger.vue?vue&type=script&setup=true&lang.ts
|
|
1075
|
-
var
|
|
859
|
+
var un = { class: "app-menu-search-trigger__shortcut" }, dn = /* @__PURE__ */ M({
|
|
1076
860
|
__name: "AppMenuSearchTrigger",
|
|
1077
861
|
props: { layoutMode: {} },
|
|
1078
862
|
emits: ["open"],
|
|
1079
863
|
setup(e, { emit: t }) {
|
|
1080
|
-
let n = t, { searchShortcutLabel: r } =
|
|
864
|
+
let n = t, { searchShortcutLabel: r } = ln();
|
|
1081
865
|
return (t, i) => {
|
|
1082
866
|
let a = z("el-icon");
|
|
1083
|
-
return
|
|
867
|
+
return I(), O("button", {
|
|
1084
868
|
class: P(["app-menu-search-trigger", `app-menu-search-trigger--${e.layoutMode}`]),
|
|
1085
869
|
type: "button",
|
|
1086
870
|
"aria-label": "搜索页面",
|
|
1087
871
|
onClick: i[0] ||= (e) => n("open")
|
|
1088
872
|
}, [
|
|
1089
873
|
j(a, null, {
|
|
1090
|
-
default:
|
|
874
|
+
default: G(() => [j(H(Y))]),
|
|
1091
875
|
_: 1
|
|
1092
876
|
}),
|
|
1093
877
|
i[1] ||= k("span", { class: "app-menu-search-trigger__text" }, "搜索页面", -1),
|
|
1094
|
-
k("span",
|
|
878
|
+
k("span", un, V(H(r)), 1)
|
|
1095
879
|
], 2);
|
|
1096
880
|
};
|
|
1097
881
|
}
|
|
1098
|
-
}),
|
|
882
|
+
}), fn = { class: "app-layout__header-left" }, pn = {
|
|
1099
883
|
key: 0,
|
|
1100
884
|
class: "app-layout__header-brand"
|
|
1101
|
-
},
|
|
885
|
+
}, mn = ["src", "alt"], hn = { class: "app-layout__header-right" }, gn = { class: "app-layout__user" }, _n = { class: "app-layout__user-copy" }, vn = /* @__PURE__ */ M({
|
|
1102
886
|
__name: "AppHeader",
|
|
1103
887
|
props: { breadcrumbItems: {} },
|
|
1104
888
|
setup(e) {
|
|
1105
|
-
let t = e, n =
|
|
1106
|
-
|
|
1107
|
-
window.addEventListener("keydown",
|
|
1108
|
-
}),
|
|
1109
|
-
window.removeEventListener("keydown",
|
|
889
|
+
let t = e, n = f(), r = a(), i = l(), o = Q(), s = _(), c = g(), u = L(!1), { activeTopMenuPath: d, findFirstLeafNode: p, findFirstLeafPath: m, topMenus: h } = Nt(), v = w(() => n.themeColorPosition === "header" ? i.logoHeader : i.logoExpanded), y = w(() => n.themeColorPosition === "header" && v.value === i.logoExpanded);
|
|
890
|
+
ne(() => {
|
|
891
|
+
window.addEventListener("keydown", M, { capture: !0 });
|
|
892
|
+
}), te(() => {
|
|
893
|
+
window.removeEventListener("keydown", M, { capture: !0 });
|
|
1110
894
|
});
|
|
1111
|
-
function
|
|
1112
|
-
if (n !== t.breadcrumbItems.length - 1) return
|
|
895
|
+
function b(e, n) {
|
|
896
|
+
if (n !== t.breadcrumbItems.length - 1) return m(s.options.routes, e.path) || e.path || "/";
|
|
1113
897
|
}
|
|
1114
|
-
async function
|
|
898
|
+
async function ee() {
|
|
1115
899
|
await o.resetTabs(), n.setSelectedTopMenuPath(""), await r.logout(), s.push("/login");
|
|
1116
900
|
}
|
|
1117
|
-
function
|
|
901
|
+
function S(e) {
|
|
1118
902
|
s.push(e);
|
|
1119
903
|
}
|
|
1120
|
-
function
|
|
1121
|
-
let t =
|
|
904
|
+
function C(e) {
|
|
905
|
+
let t = h.value.find((t) => t.fullPath === e);
|
|
1122
906
|
if (!t) return;
|
|
1123
907
|
n.setSelectedTopMenuPath(t.fullPath);
|
|
1124
|
-
let r =
|
|
908
|
+
let r = p(t)?.fullPath || t.fullPath;
|
|
1125
909
|
s.push(r);
|
|
1126
910
|
}
|
|
1127
|
-
function
|
|
911
|
+
function T() {
|
|
1128
912
|
u.value = !0;
|
|
1129
913
|
}
|
|
1130
|
-
function
|
|
1131
|
-
e.defaultPrevented || e.repeat || u.value || !(/Mac|iPhone|iPad|iPod/i.test(navigator.platform) ? e.metaKey : e.ctrlKey) || e.code !== "KeyK" || (e.preventDefault(),
|
|
914
|
+
function M(e) {
|
|
915
|
+
e.defaultPrevented || e.repeat || u.value || !(/Mac|iPhone|iPad|iPod/i.test(navigator.platform) ? e.metaKey : e.ctrlKey) || e.code !== "KeyK" || (e.preventDefault(), T());
|
|
1132
916
|
}
|
|
1133
917
|
return (t, a) => {
|
|
1134
|
-
let o = z("el-icon"), s = z("el-menu"), l = z("el-menu-item"), f = z("el-breadcrumb-item"), p = z("el-breadcrumb"),
|
|
1135
|
-
return
|
|
1136
|
-
default:
|
|
1137
|
-
k("div",
|
|
1138
|
-
H(n).layoutMode === "mix" ? D("", !0) : (
|
|
1139
|
-
src:
|
|
918
|
+
let o = z("el-icon"), s = z("el-menu"), l = z("el-menu-item"), f = z("el-breadcrumb-item"), p = z("el-breadcrumb"), m = z("el-avatar"), g = z("el-dropdown-item"), _ = z("el-dropdown-menu"), w = z("el-dropdown"), M = z("el-header");
|
|
919
|
+
return I(), O(x, null, [j(M, { class: "app-layout__header" }, {
|
|
920
|
+
default: G(() => [
|
|
921
|
+
k("div", fn, [
|
|
922
|
+
H(n).layoutMode === "mix" ? D("", !0) : (I(), O("div", pn, [k("img", {
|
|
923
|
+
src: v.value,
|
|
1140
924
|
alt: H(i).systemName,
|
|
1141
|
-
class: P(["app-layout__header-brand-image", { "is-fallback-inverted":
|
|
1142
|
-
}, null, 10,
|
|
1143
|
-
H(n).layoutMode === "top" ? D("", !0) : (
|
|
925
|
+
class: P(["app-layout__header-brand-image", { "is-fallback-inverted": y.value }])
|
|
926
|
+
}, null, 10, mn)])),
|
|
927
|
+
H(n).layoutMode === "top" ? D("", !0) : (I(), O("button", {
|
|
1144
928
|
key: 1,
|
|
1145
929
|
type: "button",
|
|
1146
930
|
class: "app-layout__header-tool-btn app-layout__header-tool-btn--collapse",
|
|
1147
931
|
onClick: a[0] ||= (e) => H(n).toggleSidebar()
|
|
1148
932
|
}, [j(o, null, {
|
|
1149
|
-
default:
|
|
933
|
+
default: G(() => [(I(), E(B(H(n).sidebarCollapsed ? H(me) : H(he))))]),
|
|
1150
934
|
_: 1
|
|
1151
935
|
})])),
|
|
1152
|
-
H(n).layoutMode === "top" ? (
|
|
936
|
+
H(n).layoutMode === "top" ? (I(), E(s, {
|
|
1153
937
|
key: 2,
|
|
1154
938
|
mode: "horizontal",
|
|
1155
939
|
ellipsis: !1,
|
|
1156
940
|
"default-active": H(c).path,
|
|
1157
941
|
class: "app-layout__header-menu",
|
|
1158
|
-
onSelect:
|
|
942
|
+
onSelect: S
|
|
1159
943
|
}, {
|
|
1160
|
-
default:
|
|
944
|
+
default: G(() => [(I(!0), O(x, null, R(H(h), (e) => (I(), E(Ut, {
|
|
1161
945
|
key: e.fullPath,
|
|
1162
946
|
node: e
|
|
1163
947
|
}, null, 8, ["node"]))), 128))]),
|
|
1164
948
|
_: 1
|
|
1165
|
-
}, 8, ["default-active"])) : H(n).layoutMode === "mix" ? (
|
|
949
|
+
}, 8, ["default-active"])) : H(n).layoutMode === "mix" ? (I(), E(s, {
|
|
1166
950
|
key: 3,
|
|
1167
951
|
mode: "horizontal",
|
|
1168
952
|
ellipsis: !1,
|
|
1169
953
|
"default-active": H(d),
|
|
1170
954
|
class: "app-layout__header-menu app-layout__header-menu--mix",
|
|
1171
|
-
onSelect:
|
|
955
|
+
onSelect: C
|
|
1172
956
|
}, {
|
|
1173
|
-
default:
|
|
957
|
+
default: G(() => [(I(!0), O(x, null, R(H(h), (e) => (I(), E(l, {
|
|
1174
958
|
key: e.fullPath,
|
|
1175
959
|
index: e.fullPath
|
|
1176
960
|
}, {
|
|
1177
|
-
default:
|
|
961
|
+
default: G(() => [A(V(e.title), 1)]),
|
|
1178
962
|
_: 2
|
|
1179
963
|
}, 1032, ["index"]))), 128))]),
|
|
1180
964
|
_: 1
|
|
1181
965
|
}, 8, ["default-active"])) : D("", !0),
|
|
1182
|
-
H(n).layoutMode === "side" ? (
|
|
966
|
+
H(n).layoutMode === "side" ? (I(), E(p, {
|
|
1183
967
|
key: 4,
|
|
1184
|
-
"separator-icon": H(
|
|
968
|
+
"separator-icon": H(oe)
|
|
1185
969
|
}, {
|
|
1186
|
-
default:
|
|
970
|
+
default: G(() => [(I(!0), O(x, null, R(e.breadcrumbItems, (e, t) => (I(), E(f, {
|
|
1187
971
|
key: e.path || String(e.name),
|
|
1188
|
-
to:
|
|
972
|
+
to: b(e, t)
|
|
1189
973
|
}, {
|
|
1190
|
-
default:
|
|
974
|
+
default: G(() => [A(V(e.meta.title), 1)]),
|
|
1191
975
|
_: 2
|
|
1192
976
|
}, 1032, ["to"]))), 128))]),
|
|
1193
977
|
_: 1
|
|
1194
978
|
}, 8, ["separator-icon"])) : D("", !0)
|
|
1195
979
|
]),
|
|
1196
|
-
H(n).layoutMode !== "mix" && !H(n).isSidebarMenuSearch ? (
|
|
980
|
+
H(n).layoutMode !== "mix" && !H(n).isSidebarMenuSearch ? (I(), O("div", {
|
|
1197
981
|
key: 0,
|
|
1198
982
|
class: P(["app-layout__header-search", `app-layout__header-search--${H(n).layoutMode}`])
|
|
1199
|
-
}, [j(
|
|
983
|
+
}, [j(dn, {
|
|
1200
984
|
"layout-mode": H(n).layoutMode,
|
|
1201
|
-
onOpen:
|
|
985
|
+
onOpen: T
|
|
1202
986
|
}, null, 8, ["layout-mode"])], 2)) : D("", !0),
|
|
1203
|
-
k("div",
|
|
1204
|
-
H(n).layoutMode === "mix" && !H(n).isSidebarMenuSearch ? (
|
|
987
|
+
k("div", hn, [
|
|
988
|
+
H(n).layoutMode === "mix" && !H(n).isSidebarMenuSearch ? (I(), E(dn, {
|
|
1205
989
|
key: 0,
|
|
1206
990
|
"layout-mode": H(n).layoutMode,
|
|
1207
|
-
onOpen:
|
|
991
|
+
onOpen: T
|
|
1208
992
|
}, null, 8, ["layout-mode"])) : D("", !0),
|
|
1209
993
|
k("button", {
|
|
1210
994
|
type: "button",
|
|
@@ -1215,35 +999,35 @@ var Wn = { class: "app-menu-search-trigger__shortcut" }, Gn = /* @__PURE__ */ M(
|
|
|
1215
999
|
size: 18,
|
|
1216
1000
|
class: "app-layout__header-tool-icon"
|
|
1217
1001
|
}, {
|
|
1218
|
-
default:
|
|
1002
|
+
default: G(() => [j(H(le))]),
|
|
1219
1003
|
_: 1
|
|
1220
1004
|
})]),
|
|
1221
|
-
j(
|
|
1222
|
-
j(
|
|
1223
|
-
dropdown:
|
|
1224
|
-
default:
|
|
1225
|
-
default:
|
|
1226
|
-
default:
|
|
1005
|
+
j(Mt),
|
|
1006
|
+
j(w, { onCommand: ee }, {
|
|
1007
|
+
dropdown: G(() => [j(_, null, {
|
|
1008
|
+
default: G(() => [j(g, { disabled: "" }, {
|
|
1009
|
+
default: G(() => [j(o, null, {
|
|
1010
|
+
default: G(() => [j(H(Ce))]),
|
|
1227
1011
|
_: 1
|
|
1228
1012
|
}), a[3] ||= A(" 个人设置 ", -1)]),
|
|
1229
1013
|
_: 1
|
|
1230
|
-
}), j(
|
|
1231
|
-
default:
|
|
1232
|
-
default:
|
|
1014
|
+
}), j(g, { command: "logout" }, {
|
|
1015
|
+
default: G(() => [j(o, null, {
|
|
1016
|
+
default: G(() => [j(H(Te))]),
|
|
1233
1017
|
_: 1
|
|
1234
1018
|
}), a[4] ||= A(" 退出登录 ", -1)]),
|
|
1235
1019
|
_: 1
|
|
1236
1020
|
})]),
|
|
1237
1021
|
_: 1
|
|
1238
1022
|
})]),
|
|
1239
|
-
default:
|
|
1240
|
-
j(
|
|
1241
|
-
default:
|
|
1023
|
+
default: G(() => [k("div", gn, [
|
|
1024
|
+
j(m, { size: 32 }, {
|
|
1025
|
+
default: G(() => [A(V(H(r).userName.slice(0, 1)), 1)]),
|
|
1242
1026
|
_: 1
|
|
1243
1027
|
}),
|
|
1244
|
-
k("div",
|
|
1028
|
+
k("div", _n, [k("strong", null, V(H(r).userName), 1), k("span", null, V(H(r).userRoleLabel), 1)]),
|
|
1245
1029
|
j(o, null, {
|
|
1246
|
-
default:
|
|
1030
|
+
default: G(() => [j(H(ae))]),
|
|
1247
1031
|
_: 1
|
|
1248
1032
|
})
|
|
1249
1033
|
])]),
|
|
@@ -1252,7 +1036,7 @@ var Wn = { class: "app-menu-search-trigger__shortcut" }, Gn = /* @__PURE__ */ M(
|
|
|
1252
1036
|
])
|
|
1253
1037
|
]),
|
|
1254
1038
|
_: 1
|
|
1255
|
-
}), j(
|
|
1039
|
+
}), j(cn, {
|
|
1256
1040
|
modelValue: u.value,
|
|
1257
1041
|
"onUpdate:modelValue": a[2] ||= (e) => u.value = e
|
|
1258
1042
|
}, null, 8, ["modelValue"])], 64);
|
|
@@ -1261,40 +1045,40 @@ var Wn = { class: "app-menu-search-trigger__shortcut" }, Gn = /* @__PURE__ */ M(
|
|
|
1261
1045
|
});
|
|
1262
1046
|
//#endregion
|
|
1263
1047
|
//#region src/main/layouts/utils/menuSearch.ts
|
|
1264
|
-
function
|
|
1048
|
+
function yn(e, t) {
|
|
1265
1049
|
let n = t.trim().toLowerCase();
|
|
1266
1050
|
if (!n) return [...e];
|
|
1267
1051
|
let r = [];
|
|
1268
1052
|
for (let t of e) {
|
|
1269
|
-
let e =
|
|
1270
|
-
!(
|
|
1053
|
+
let e = yn(t.children ?? [], n);
|
|
1054
|
+
!(Sn(t) && xn(t, n)) && !e.length || r.push({
|
|
1271
1055
|
...t,
|
|
1272
1056
|
children: e.length ? e : void 0
|
|
1273
1057
|
});
|
|
1274
1058
|
}
|
|
1275
1059
|
return r;
|
|
1276
1060
|
}
|
|
1277
|
-
function
|
|
1278
|
-
let n =
|
|
1061
|
+
function bn(e, t) {
|
|
1062
|
+
let n = Cn(e), r = t.trim();
|
|
1279
1063
|
if (!r) return n;
|
|
1280
1064
|
let i = Array.from(e), a = e.toLowerCase(), o = r.toLowerCase(), s = a.indexOf(o);
|
|
1281
|
-
return s < 0 ? n : `${
|
|
1065
|
+
return s < 0 ? n : `${Cn(i.slice(0, s).join(""))}<mark class="app-menu-search-highlight">${Cn(i.slice(s, s + r.length).join(""))}</mark>${Cn(i.slice(s + r.length).join(""))}`;
|
|
1282
1066
|
}
|
|
1283
|
-
function
|
|
1067
|
+
function xn(e, t) {
|
|
1284
1068
|
return e.title.toLowerCase().includes(t);
|
|
1285
1069
|
}
|
|
1286
|
-
function
|
|
1070
|
+
function Sn(e) {
|
|
1287
1071
|
return !e.children?.length;
|
|
1288
1072
|
}
|
|
1289
|
-
function
|
|
1073
|
+
function Cn(e) {
|
|
1290
1074
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
1291
1075
|
}
|
|
1292
1076
|
//#endregion
|
|
1293
1077
|
//#region src/main/layouts/components/AppSidebarSearch.vue?vue&type=script&setup=true&lang.ts
|
|
1294
|
-
var
|
|
1078
|
+
var wn = {
|
|
1295
1079
|
key: 0,
|
|
1296
1080
|
class: "app-sidebar-search"
|
|
1297
|
-
},
|
|
1081
|
+
}, Tn = /* @__PURE__ */ M({
|
|
1298
1082
|
__name: "AppSidebarSearch",
|
|
1299
1083
|
props: {
|
|
1300
1084
|
collapsed: { type: Boolean },
|
|
@@ -1305,21 +1089,21 @@ var ir = {
|
|
|
1305
1089
|
let n = t;
|
|
1306
1090
|
return (t, r) => {
|
|
1307
1091
|
let i = z("el-icon"), a = z("el-input");
|
|
1308
|
-
return e.collapsed ? D("", !0) : (
|
|
1092
|
+
return e.collapsed ? D("", !0) : (I(), O("div", wn, [j(a, {
|
|
1309
1093
|
"model-value": e.keyword,
|
|
1310
1094
|
placeholder: "搜索菜单",
|
|
1311
1095
|
clearable: "",
|
|
1312
1096
|
"onUpdate:modelValue": r[0] ||= (e) => n("update:keyword", e)
|
|
1313
1097
|
}, {
|
|
1314
|
-
prefix:
|
|
1315
|
-
default:
|
|
1098
|
+
prefix: G(() => [j(i, null, {
|
|
1099
|
+
default: G(() => [j(H(Y))]),
|
|
1316
1100
|
_: 1
|
|
1317
1101
|
})]),
|
|
1318
1102
|
_: 1
|
|
1319
1103
|
}, 8, ["model-value"])]));
|
|
1320
1104
|
};
|
|
1321
1105
|
}
|
|
1322
|
-
}),
|
|
1106
|
+
}), En = ["innerHTML"], Dn = ["innerHTML"], On = /* @__PURE__ */ M({
|
|
1323
1107
|
name: "AppSidebarNode",
|
|
1324
1108
|
__name: "AppSidebarNode",
|
|
1325
1109
|
props: {
|
|
@@ -1327,40 +1111,40 @@ var ir = {
|
|
|
1327
1111
|
keyword: {}
|
|
1328
1112
|
},
|
|
1329
1113
|
setup(e) {
|
|
1330
|
-
let t = e, n =
|
|
1114
|
+
let t = e, n = w(() => bn(t.node.title, t.keyword ?? ""));
|
|
1331
1115
|
return (t, r) => {
|
|
1332
1116
|
let i = z("el-icon"), a = z("AppSidebarNode", !0), o = z("el-sub-menu"), s = z("el-menu-item");
|
|
1333
|
-
return e.node.children?.length ? (
|
|
1117
|
+
return e.node.children?.length ? (I(), E(o, {
|
|
1334
1118
|
key: 0,
|
|
1335
1119
|
index: e.node.fullPath
|
|
1336
1120
|
}, {
|
|
1337
|
-
title:
|
|
1338
|
-
default:
|
|
1121
|
+
title: G(() => [j(i, null, {
|
|
1122
|
+
default: G(() => [(I(), E(B(H($)(e.node.icon))))]),
|
|
1339
1123
|
_: 1
|
|
1340
|
-
}), k("span", { innerHTML: n.value }, null, 8,
|
|
1341
|
-
default:
|
|
1124
|
+
}), k("span", { innerHTML: n.value }, null, 8, En)]),
|
|
1125
|
+
default: G(() => [(I(!0), O(x, null, R(e.node.children, (t) => (I(), E(a, {
|
|
1342
1126
|
key: t.fullPath,
|
|
1343
1127
|
node: t,
|
|
1344
1128
|
keyword: e.keyword
|
|
1345
1129
|
}, null, 8, ["node", "keyword"]))), 128))]),
|
|
1346
1130
|
_: 1
|
|
1347
|
-
}, 8, ["index"])) : (
|
|
1131
|
+
}, 8, ["index"])) : (I(), E(s, {
|
|
1348
1132
|
key: 1,
|
|
1349
1133
|
index: e.node.fullPath
|
|
1350
1134
|
}, {
|
|
1351
|
-
default:
|
|
1135
|
+
default: G(() => [k("span", { innerHTML: n.value }, null, 8, Dn)]),
|
|
1352
1136
|
_: 1
|
|
1353
1137
|
}, 8, ["index"]));
|
|
1354
1138
|
};
|
|
1355
1139
|
}
|
|
1356
|
-
}),
|
|
1140
|
+
}), kn = {
|
|
1357
1141
|
key: 0,
|
|
1358
1142
|
class: "app-layout__brand"
|
|
1359
|
-
},
|
|
1143
|
+
}, An = ["src", "alt"], jn = ["src", "alt"], Mn = /* @__PURE__ */ M({
|
|
1360
1144
|
name: "AppSidebar",
|
|
1361
1145
|
__name: "AppSidebar",
|
|
1362
1146
|
setup(e) {
|
|
1363
|
-
let t =
|
|
1147
|
+
let t = f(), n = l(), { activeMenu: r, sideMenus: i } = Nt(), a = L(""), o = w(() => t.isSidebarMenuSearch ? yn(i.value, a.value) : i.value), s = w(() => !t.isSidebarMenuSearch || !a.value.trim() ? [] : c(o.value));
|
|
1364
1148
|
U(() => t.isSidebarMenuSearch, (e) => {
|
|
1365
1149
|
e || (a.value = "");
|
|
1366
1150
|
});
|
|
@@ -1371,37 +1155,37 @@ var ir = {
|
|
|
1371
1155
|
}
|
|
1372
1156
|
return (e, i) => {
|
|
1373
1157
|
let c = z("el-menu"), l = z("el-scrollbar"), u = z("el-aside");
|
|
1374
|
-
return H(t).layoutMode === "top" ? D("", !0) : (
|
|
1158
|
+
return H(t).layoutMode === "top" ? D("", !0) : (I(), E(u, {
|
|
1375
1159
|
key: 0,
|
|
1376
1160
|
width: H(t).sidebarCollapsed ? "72px" : "220px",
|
|
1377
1161
|
class: P(["app-layout__aside", { "is-mix-mode": H(t).layoutMode === "mix" }])
|
|
1378
1162
|
}, {
|
|
1379
|
-
default:
|
|
1380
|
-
H(t).layoutMode === "mix" ? (
|
|
1163
|
+
default: G(() => [
|
|
1164
|
+
H(t).layoutMode === "mix" ? (I(), O("div", kn, [j(S, {
|
|
1381
1165
|
name: "brand-fade",
|
|
1382
1166
|
mode: "out-in"
|
|
1383
1167
|
}, {
|
|
1384
|
-
default:
|
|
1168
|
+
default: G(() => [H(t).sidebarCollapsed ? (I(), O("img", {
|
|
1385
1169
|
key: "collapsed",
|
|
1386
1170
|
src: H(n).logoCollapsed,
|
|
1387
1171
|
alt: H(n).systemName,
|
|
1388
1172
|
class: "app-layout__brand-image app-layout__brand-image--collapsed"
|
|
1389
|
-
}, null, 8,
|
|
1173
|
+
}, null, 8, An)) : (I(), O("img", {
|
|
1390
1174
|
key: "expanded",
|
|
1391
1175
|
src: H(n).logoExpanded,
|
|
1392
1176
|
alt: H(n).systemName,
|
|
1393
1177
|
class: "app-layout__brand-image app-layout__brand-image--expanded"
|
|
1394
|
-
}, null, 8,
|
|
1178
|
+
}, null, 8, jn))]),
|
|
1395
1179
|
_: 1
|
|
1396
1180
|
})])) : D("", !0),
|
|
1397
|
-
H(t).isSidebarMenuSearch ? (
|
|
1181
|
+
H(t).isSidebarMenuSearch ? (I(), E(Tn, {
|
|
1398
1182
|
key: 1,
|
|
1399
1183
|
collapsed: H(t).sidebarCollapsed,
|
|
1400
1184
|
keyword: a.value,
|
|
1401
1185
|
"onUpdate:keyword": i[0] ||= (e) => a.value = e
|
|
1402
1186
|
}, null, 8, ["collapsed", "keyword"])) : D("", !0),
|
|
1403
1187
|
j(l, null, {
|
|
1404
|
-
default:
|
|
1188
|
+
default: G(() => [j(c, {
|
|
1405
1189
|
collapse: H(t).sidebarCollapsed,
|
|
1406
1190
|
"default-active": H(r),
|
|
1407
1191
|
"default-openeds": s.value,
|
|
@@ -1409,7 +1193,7 @@ var ir = {
|
|
|
1409
1193
|
router: "",
|
|
1410
1194
|
"unique-opened": ""
|
|
1411
1195
|
}, {
|
|
1412
|
-
default:
|
|
1196
|
+
default: G(() => [(I(!0), O(x, null, R(o.value, (e) => (I(), E(On, {
|
|
1413
1197
|
key: e.fullPath,
|
|
1414
1198
|
node: e,
|
|
1415
1199
|
keyword: H(t).isSidebarMenuSearch ? a.value : ""
|
|
@@ -1430,13 +1214,13 @@ var ir = {
|
|
|
1430
1214
|
});
|
|
1431
1215
|
//#endregion
|
|
1432
1216
|
//#region src/main/composables/useSortable.ts
|
|
1433
|
-
function
|
|
1217
|
+
function Nn(e = {}) {
|
|
1434
1218
|
let t = L(null);
|
|
1435
1219
|
function n() {
|
|
1436
1220
|
t.value?.destroy(), t.value = null;
|
|
1437
1221
|
}
|
|
1438
1222
|
function r(r) {
|
|
1439
|
-
r && (n(), t.value =
|
|
1223
|
+
r && (n(), t.value = je.create(r, {
|
|
1440
1224
|
animation: e.animation ?? 150,
|
|
1441
1225
|
chosenClass: e.chosenClass,
|
|
1442
1226
|
direction: e.direction,
|
|
@@ -1462,7 +1246,7 @@ function pr(e = {}) {
|
|
|
1462
1246
|
swapThreshold: e.swapThreshold
|
|
1463
1247
|
}));
|
|
1464
1248
|
}
|
|
1465
|
-
return
|
|
1249
|
+
return te(() => {
|
|
1466
1250
|
n();
|
|
1467
1251
|
}), {
|
|
1468
1252
|
destroy: n,
|
|
@@ -1472,7 +1256,7 @@ function pr(e = {}) {
|
|
|
1472
1256
|
}
|
|
1473
1257
|
//#endregion
|
|
1474
1258
|
//#region src/main/layouts/components/AppTabsContextMenu.vue?vue&type=script&setup=true&lang.ts
|
|
1475
|
-
var
|
|
1259
|
+
var Pn = ["disabled"], Fn = ["disabled"], In = ["disabled"], Ln = ["disabled"], Rn = ["disabled"], zn = /* @__PURE__ */ M({
|
|
1476
1260
|
__name: "AppTabsContextMenu",
|
|
1477
1261
|
props: {
|
|
1478
1262
|
hasLeftTabs: { type: Boolean },
|
|
@@ -1524,22 +1308,22 @@ var mr = ["disabled"], hr = ["disabled"], gr = ["disabled"], _r = ["disabled"],
|
|
|
1524
1308
|
}
|
|
1525
1309
|
return (t, n) => {
|
|
1526
1310
|
let f = z("el-icon");
|
|
1527
|
-
return e.visible && e.targetTab ? (
|
|
1311
|
+
return e.visible && e.targetTab ? (I(), O("div", {
|
|
1528
1312
|
key: 0,
|
|
1529
1313
|
class: "app-tabs-menu",
|
|
1530
|
-
style:
|
|
1314
|
+
style: F({
|
|
1531
1315
|
left: `${e.position.x}px`,
|
|
1532
1316
|
top: `${e.position.y}px`
|
|
1533
1317
|
}),
|
|
1534
|
-
onMousedown: n[8] ||=
|
|
1535
|
-
onContextmenu: n[9] ||=
|
|
1318
|
+
onMousedown: n[8] ||= q(() => {}, ["stop"]),
|
|
1319
|
+
onContextmenu: n[9] ||= q(() => {}, ["prevent"])
|
|
1536
1320
|
}, [
|
|
1537
1321
|
k("button", {
|
|
1538
1322
|
class: "app-tabs-menu__item",
|
|
1539
1323
|
type: "button",
|
|
1540
1324
|
onClick: n[0] ||= (e) => i(a)
|
|
1541
1325
|
}, [j(f, null, {
|
|
1542
|
-
default:
|
|
1326
|
+
default: G(() => [j(H(Se))]),
|
|
1543
1327
|
_: 1
|
|
1544
1328
|
}), n[10] ||= k("span", null, "重新加载", -1)]),
|
|
1545
1329
|
k("button", {
|
|
@@ -1548,15 +1332,15 @@ var mr = ["disabled"], hr = ["disabled"], gr = ["disabled"], _r = ["disabled"],
|
|
|
1548
1332
|
disabled: !e.hasLastActive,
|
|
1549
1333
|
onClick: n[1] ||= (t) => i(o, !e.hasLastActive)
|
|
1550
1334
|
}, [j(f, null, {
|
|
1551
|
-
default:
|
|
1335
|
+
default: G(() => [j(H(ce))]),
|
|
1552
1336
|
_: 1
|
|
1553
|
-
}), n[11] ||= k("span", null, "切换上一个页签", -1)], 8,
|
|
1337
|
+
}), n[11] ||= k("span", null, "切换上一个页签", -1)], 8, Pn),
|
|
1554
1338
|
k("button", {
|
|
1555
1339
|
class: "app-tabs-menu__item",
|
|
1556
1340
|
type: "button",
|
|
1557
1341
|
onClick: n[2] ||= (e) => i(s)
|
|
1558
1342
|
}, [j(f, null, {
|
|
1559
|
-
default:
|
|
1343
|
+
default: G(() => [j(H(Ee))]),
|
|
1560
1344
|
_: 1
|
|
1561
1345
|
}), n[12] ||= k("span", null, "在新窗口打开", -1)]),
|
|
1562
1346
|
n[18] ||= k("div", { class: "app-tabs-menu__divider" }, null, -1),
|
|
@@ -1566,63 +1350,63 @@ var mr = ["disabled"], hr = ["disabled"], gr = ["disabled"], _r = ["disabled"],
|
|
|
1566
1350
|
disabled: e.isTargetHome,
|
|
1567
1351
|
onClick: n[3] ||= (t) => i(c, e.isTargetHome)
|
|
1568
1352
|
}, [j(f, null, {
|
|
1569
|
-
default:
|
|
1353
|
+
default: G(() => [j(H(ue))]),
|
|
1570
1354
|
_: 1
|
|
1571
|
-
}), n[13] ||= k("span", null, "关闭当前页签", -1)], 8,
|
|
1355
|
+
}), n[13] ||= k("span", null, "关闭当前页签", -1)], 8, Fn),
|
|
1572
1356
|
k("button", {
|
|
1573
1357
|
class: "app-tabs-menu__item",
|
|
1574
1358
|
type: "button",
|
|
1575
1359
|
disabled: !e.hasMultipleTabs,
|
|
1576
1360
|
onClick: n[4] ||= (t) => i(l, !e.hasMultipleTabs)
|
|
1577
1361
|
}, [j(f, null, {
|
|
1578
|
-
default:
|
|
1362
|
+
default: G(() => [j(H(xe))]),
|
|
1579
1363
|
_: 1
|
|
1580
|
-
}), n[14] ||= k("span", null, "关闭其他页签", -1)], 8,
|
|
1364
|
+
}), n[14] ||= k("span", null, "关闭其他页签", -1)], 8, In),
|
|
1581
1365
|
k("button", {
|
|
1582
1366
|
class: "app-tabs-menu__item",
|
|
1583
1367
|
type: "button",
|
|
1584
1368
|
disabled: !e.hasLeftTabs,
|
|
1585
1369
|
onClick: n[5] ||= (t) => i(u, !e.hasLeftTabs)
|
|
1586
1370
|
}, [j(f, null, {
|
|
1587
|
-
default:
|
|
1371
|
+
default: G(() => [j(H(fe))]),
|
|
1588
1372
|
_: 1
|
|
1589
|
-
}), n[15] ||= k("span", null, "关闭左侧页签", -1)], 8,
|
|
1373
|
+
}), n[15] ||= k("span", null, "关闭左侧页签", -1)], 8, Ln),
|
|
1590
1374
|
k("button", {
|
|
1591
1375
|
class: "app-tabs-menu__item",
|
|
1592
1376
|
type: "button",
|
|
1593
1377
|
disabled: !e.hasRightTabs,
|
|
1594
1378
|
onClick: n[6] ||= (t) => i(d, !e.hasRightTabs)
|
|
1595
1379
|
}, [j(f, null, {
|
|
1596
|
-
default:
|
|
1380
|
+
default: G(() => [j(H(pe))]),
|
|
1597
1381
|
_: 1
|
|
1598
|
-
}), n[16] ||= k("span", null, "关闭右侧页签", -1)], 8,
|
|
1382
|
+
}), n[16] ||= k("span", null, "关闭右侧页签", -1)], 8, Rn),
|
|
1599
1383
|
n[19] ||= k("div", { class: "app-tabs-menu__divider" }, null, -1),
|
|
1600
1384
|
k("button", {
|
|
1601
1385
|
class: "app-tabs-menu__item",
|
|
1602
1386
|
type: "button",
|
|
1603
1387
|
onClick: n[7] ||= (e) => i(() => r("closeAll"))
|
|
1604
1388
|
}, [j(f, null, {
|
|
1605
|
-
default:
|
|
1389
|
+
default: G(() => [j(H(ge))]),
|
|
1606
1390
|
_: 1
|
|
1607
1391
|
}), n[17] ||= k("span", null, "关闭全部页签", -1)])
|
|
1608
1392
|
], 36)) : D("", !0);
|
|
1609
1393
|
};
|
|
1610
1394
|
}
|
|
1611
|
-
}),
|
|
1395
|
+
}), Bn = {
|
|
1612
1396
|
key: 0,
|
|
1613
1397
|
class: "app-layout__tabs"
|
|
1614
|
-
},
|
|
1398
|
+
}, Vn = { class: "app-layout__tabs-bar" }, Hn = [
|
|
1615
1399
|
"data-path",
|
|
1616
1400
|
"onClick",
|
|
1617
1401
|
"onContextmenu"
|
|
1618
|
-
],
|
|
1402
|
+
], Un = { class: "app-layout__tab-label" }, Wn = ["onClick"], Gn = /* @__PURE__ */ M({
|
|
1619
1403
|
__name: "AppTabs",
|
|
1620
1404
|
emits: ["refresh"],
|
|
1621
1405
|
setup(e, { emit: t }) {
|
|
1622
|
-
let n = t, r =
|
|
1406
|
+
let n = t, r = _(), i = Q(), a = L(!1), o = L(!1), s = L(!1), c = L({
|
|
1623
1407
|
x: 0,
|
|
1624
1408
|
y: 0
|
|
1625
|
-
}), l = L(null), u = L(null), d =
|
|
1409
|
+
}), l = L(null), u = L(null), d = w(() => l.value ? i.tabs.findIndex((e) => e.path === l.value?.path) : -1), f = w(() => l.value?.path === i.activeTab), p = w(() => d.value > 0), m = w(() => d.value >= 0 && d.value < i.tabs.length - 1), h = w(() => i.tabs.length > 1), g = w(() => !!(i.lastActiveTab && i.tabPaths.includes(i.lastActiveTab))), { init: v } = Nn({
|
|
1626
1410
|
animation: 150,
|
|
1627
1411
|
chosenClass: "sortable-chosen",
|
|
1628
1412
|
direction: "horizontal",
|
|
@@ -1647,21 +1431,21 @@ var mr = ["disabled"], hr = ["disabled"], gr = ["disabled"], _r = ["disabled"],
|
|
|
1647
1431
|
swapThreshold: .65
|
|
1648
1432
|
});
|
|
1649
1433
|
async function y(e) {
|
|
1650
|
-
e && (i.setActiveTab(e), await r.push(e), await
|
|
1434
|
+
e && (i.setActiveTab(e), await r.push(e), await M());
|
|
1651
1435
|
}
|
|
1652
1436
|
async function b(e) {
|
|
1653
1437
|
if (e === "/dashboard") return;
|
|
1654
1438
|
let t = i.tabs.findIndex((t) => t.path === e), n = i.activeTab === e;
|
|
1655
1439
|
if (await i.removeTab(e), !n) return;
|
|
1656
1440
|
let a = i.tabs[t] ?? i.tabs[t - 1];
|
|
1657
|
-
a ? await y(a.path) : (i.setActiveTab(""), r.push(
|
|
1441
|
+
a ? await y(a.path) : (i.setActiveTab(""), r.push(X));
|
|
1658
1442
|
}
|
|
1659
|
-
async function
|
|
1660
|
-
i.activeTab !== e && await y(e), o.value = !1, await N(), await
|
|
1443
|
+
async function ee(e) {
|
|
1444
|
+
i.activeTab !== e && await y(e), o.value = !1, await N(), await M(), o.value = !0, n("refresh"), window.setTimeout(() => {
|
|
1661
1445
|
o.value = !1;
|
|
1662
1446
|
}, 600);
|
|
1663
1447
|
}
|
|
1664
|
-
function
|
|
1448
|
+
function S(e, t) {
|
|
1665
1449
|
e.preventDefault(), C(e.clientX, e.clientY, t);
|
|
1666
1450
|
}
|
|
1667
1451
|
function C(e, t, n) {
|
|
@@ -1670,16 +1454,16 @@ var mr = ["disabled"], hr = ["disabled"], gr = ["disabled"], _r = ["disabled"],
|
|
|
1670
1454
|
y: Math.min(t, window.innerHeight - 260)
|
|
1671
1455
|
};
|
|
1672
1456
|
}
|
|
1673
|
-
function
|
|
1457
|
+
function T(e) {
|
|
1674
1458
|
let t = i.tabs.find((e) => e.path === i.activeTab) ?? i.tabs.at(-1);
|
|
1675
1459
|
if (!t) return;
|
|
1676
1460
|
let n = e.currentTarget.getBoundingClientRect();
|
|
1677
1461
|
C(n.left, n.bottom + 4, t);
|
|
1678
1462
|
}
|
|
1679
|
-
function
|
|
1463
|
+
function A(e) {
|
|
1680
1464
|
!u.value || Math.abs(e.deltaY) <= Math.abs(e.deltaX) || (e.preventDefault(), u.value.scrollLeft += e.deltaY);
|
|
1681
1465
|
}
|
|
1682
|
-
async function
|
|
1466
|
+
async function M() {
|
|
1683
1467
|
await N(), await new Promise((e) => window.requestAnimationFrame(() => e(null))), await new Promise((e) => window.requestAnimationFrame(() => e(null)));
|
|
1684
1468
|
let e = u.value, t = e?.querySelector(".app-layout__tab.is-active");
|
|
1685
1469
|
if (!e || !t) return;
|
|
@@ -1694,108 +1478,108 @@ var mr = ["disabled"], hr = ["disabled"], gr = ["disabled"], _r = ["disabled"],
|
|
|
1694
1478
|
behavior: "smooth"
|
|
1695
1479
|
});
|
|
1696
1480
|
}
|
|
1697
|
-
function
|
|
1481
|
+
function F() {
|
|
1698
1482
|
s.value = !1, l.value = null;
|
|
1699
1483
|
}
|
|
1700
|
-
async function
|
|
1484
|
+
async function te(e) {
|
|
1701
1485
|
await i.closeOtherTabs(e), await y(e);
|
|
1702
1486
|
}
|
|
1703
|
-
async function
|
|
1487
|
+
async function W(e) {
|
|
1704
1488
|
await i.closeLeftTabs(e), i.tabPaths.includes(i.activeTab) || await y(e);
|
|
1705
1489
|
}
|
|
1706
|
-
async function
|
|
1490
|
+
async function K(e) {
|
|
1707
1491
|
await i.closeRightTabs(e), i.tabPaths.includes(i.activeTab) || await y(e);
|
|
1708
1492
|
}
|
|
1709
|
-
async function
|
|
1710
|
-
await i.closeAllTabs(), r.push(
|
|
1493
|
+
async function ie() {
|
|
1494
|
+
await i.closeAllTabs(), r.push(X);
|
|
1711
1495
|
}
|
|
1712
|
-
function
|
|
1496
|
+
function J() {
|
|
1713
1497
|
let e = i.lastActiveTab;
|
|
1714
1498
|
!e || !i.tabPaths.includes(e) || y(e);
|
|
1715
1499
|
}
|
|
1716
|
-
function
|
|
1500
|
+
function oe(e) {
|
|
1717
1501
|
window.open(e, "_blank", "noopener,noreferrer");
|
|
1718
1502
|
}
|
|
1719
|
-
function
|
|
1720
|
-
e.button !== 2 &&
|
|
1503
|
+
function se(e) {
|
|
1504
|
+
e.button !== 2 && F();
|
|
1721
1505
|
}
|
|
1722
|
-
return
|
|
1723
|
-
document.addEventListener("mousedown",
|
|
1724
|
-
}),
|
|
1725
|
-
document.removeEventListener("mousedown",
|
|
1506
|
+
return ne(() => {
|
|
1507
|
+
document.addEventListener("mousedown", se), v(u.value), M();
|
|
1508
|
+
}), re(() => {
|
|
1509
|
+
document.removeEventListener("mousedown", se);
|
|
1726
1510
|
}), U(() => i.tabs.map((e) => e.path).join("|"), () => {
|
|
1727
1511
|
a.value || N(() => {
|
|
1728
|
-
|
|
1512
|
+
v(u.value), M();
|
|
1729
1513
|
});
|
|
1730
1514
|
}), U(() => i.activeTab, () => {
|
|
1731
|
-
|
|
1515
|
+
M();
|
|
1732
1516
|
}), (e, t) => {
|
|
1733
1517
|
let n = z("el-icon");
|
|
1734
|
-
return H(i).tabs.length ? (
|
|
1518
|
+
return H(i).tabs.length ? (I(), O("div", Bn, [k("div", Vn, [
|
|
1735
1519
|
k("div", {
|
|
1736
1520
|
ref_key: "tabsScrollRef",
|
|
1737
1521
|
ref: u,
|
|
1738
1522
|
class: "app-layout__tabs-scroll",
|
|
1739
|
-
onWheel:
|
|
1740
|
-
}, [(
|
|
1523
|
+
onWheel: A
|
|
1524
|
+
}, [(I(!0), O(x, null, R(H(i).tabs, (e) => (I(), O("div", {
|
|
1741
1525
|
key: e.path,
|
|
1742
1526
|
class: P(["app-layout__tab", { "is-active": H(i).activeTab === e.path }]),
|
|
1743
1527
|
"data-path": e.path,
|
|
1744
1528
|
onClick: (t) => y(e.fullPath),
|
|
1745
|
-
onContextmenu: (t) =>
|
|
1529
|
+
onContextmenu: (t) => S(t, e)
|
|
1746
1530
|
}, [
|
|
1747
|
-
e.icon ? (
|
|
1531
|
+
e.icon ? (I(), E(n, {
|
|
1748
1532
|
key: 0,
|
|
1749
1533
|
class: "app-layout__tab-icon"
|
|
1750
1534
|
}, {
|
|
1751
|
-
default:
|
|
1535
|
+
default: G(() => [(I(), E(B(H($)(e.icon))))]),
|
|
1752
1536
|
_: 2
|
|
1753
1537
|
}, 1024)) : D("", !0),
|
|
1754
|
-
k("span",
|
|
1755
|
-
e.path === H("/dashboard") ? D("", !0) : (
|
|
1538
|
+
k("span", Un, V(e.title), 1),
|
|
1539
|
+
e.path === H("/dashboard") ? D("", !0) : (I(), O("button", {
|
|
1756
1540
|
key: 1,
|
|
1757
1541
|
class: "app-layout__tab-close",
|
|
1758
1542
|
type: "button",
|
|
1759
|
-
onClick:
|
|
1760
|
-
}, " × ", 8,
|
|
1761
|
-
], 42,
|
|
1543
|
+
onClick: q((t) => b(e.path), ["stop"])
|
|
1544
|
+
}, " × ", 8, Wn))
|
|
1545
|
+
], 42, Hn))), 128))], 544),
|
|
1762
1546
|
k("button", {
|
|
1763
1547
|
class: "app-layout__tabs-action",
|
|
1764
1548
|
type: "button",
|
|
1765
1549
|
title: "页签操作",
|
|
1766
|
-
onClick:
|
|
1550
|
+
onClick: T
|
|
1767
1551
|
}, [j(n, null, {
|
|
1768
|
-
default:
|
|
1552
|
+
default: G(() => [j(H(ae))]),
|
|
1769
1553
|
_: 1
|
|
1770
1554
|
})]),
|
|
1771
1555
|
k("button", {
|
|
1772
1556
|
class: "app-layout__tabs-action",
|
|
1773
1557
|
type: "button",
|
|
1774
1558
|
title: "刷新当前页签",
|
|
1775
|
-
onClick: t[0] ||= (e) =>
|
|
1559
|
+
onClick: t[0] ||= (e) => ee(H(i).activeTab)
|
|
1776
1560
|
}, [j(n, { class: P({ "is-rotating": o.value }) }, {
|
|
1777
|
-
default:
|
|
1561
|
+
default: G(() => [j(H(Se))]),
|
|
1778
1562
|
_: 1
|
|
1779
1563
|
}, 8, ["class"])])
|
|
1780
|
-
]), j(
|
|
1564
|
+
]), j(zn, {
|
|
1781
1565
|
visible: s.value,
|
|
1782
1566
|
"has-left-tabs": p.value,
|
|
1783
1567
|
"has-multiple-tabs": h.value,
|
|
1784
1568
|
"has-right-tabs": m.value,
|
|
1785
1569
|
"has-last-active": g.value,
|
|
1786
|
-
"is-target-home": l.value?.path === H(
|
|
1570
|
+
"is-target-home": l.value?.path === H(X),
|
|
1787
1571
|
"is-target-active": f.value,
|
|
1788
1572
|
position: c.value,
|
|
1789
1573
|
"target-tab": l.value,
|
|
1790
|
-
onClose:
|
|
1791
|
-
onCloseAll:
|
|
1792
|
-
onCloseLeft:
|
|
1793
|
-
onCloseOthers:
|
|
1794
|
-
onCloseRight:
|
|
1574
|
+
onClose: F,
|
|
1575
|
+
onCloseAll: ie,
|
|
1576
|
+
onCloseLeft: W,
|
|
1577
|
+
onCloseOthers: te,
|
|
1578
|
+
onCloseRight: K,
|
|
1795
1579
|
onCloseTab: b,
|
|
1796
|
-
onOpenInNewTab:
|
|
1797
|
-
onSwitchPrev:
|
|
1798
|
-
onRefresh:
|
|
1580
|
+
onOpenInNewTab: oe,
|
|
1581
|
+
onSwitchPrev: J,
|
|
1582
|
+
onRefresh: ee
|
|
1799
1583
|
}, null, 8, [
|
|
1800
1584
|
"visible",
|
|
1801
1585
|
"has-left-tabs",
|
|
@@ -1809,10 +1593,10 @@ var mr = ["disabled"], hr = ["disabled"], gr = ["disabled"], _r = ["disabled"],
|
|
|
1809
1593
|
])])) : D("", !0);
|
|
1810
1594
|
};
|
|
1811
1595
|
}
|
|
1812
|
-
}),
|
|
1596
|
+
}), Kn = /* @__PURE__ */ M({
|
|
1813
1597
|
__name: "AppLayout",
|
|
1814
1598
|
setup(e) {
|
|
1815
|
-
let t =
|
|
1599
|
+
let t = g(), n = Q(), r = f(), i = L(0), a = w(() => t.matched.filter((e) => e.meta?.title));
|
|
1816
1600
|
function o() {
|
|
1817
1601
|
i.value += 1;
|
|
1818
1602
|
}
|
|
@@ -1833,40 +1617,40 @@ var mr = ["disabled"], hr = ["disabled"], gr = ["disabled"], _r = ["disabled"],
|
|
|
1833
1617
|
}
|
|
1834
1618
|
return (e, t) => {
|
|
1835
1619
|
let n = z("el-container");
|
|
1836
|
-
return
|
|
1837
|
-
default:
|
|
1838
|
-
default:
|
|
1839
|
-
j(
|
|
1840
|
-
j(
|
|
1841
|
-
j(
|
|
1620
|
+
return I(), O(x, null, [j(n, { class: "app-layout" }, {
|
|
1621
|
+
default: G(() => [j(Mn), j(n, { direction: "vertical" }, {
|
|
1622
|
+
default: G(() => [
|
|
1623
|
+
j(vn, { "breadcrumb-items": a.value }, null, 8, ["breadcrumb-items"]),
|
|
1624
|
+
j(Gn, { onRefresh: o }),
|
|
1625
|
+
j(At, { "refresh-key": i.value }, null, 8, ["refresh-key"])
|
|
1842
1626
|
]),
|
|
1843
1627
|
_: 1
|
|
1844
1628
|
})]),
|
|
1845
1629
|
_: 1
|
|
1846
|
-
}), j(
|
|
1630
|
+
}), j(kt)], 64);
|
|
1847
1631
|
};
|
|
1848
1632
|
}
|
|
1849
1633
|
});
|
|
1850
1634
|
//#endregion
|
|
1851
1635
|
//#region src/main/router/base-routes.ts
|
|
1852
|
-
function
|
|
1636
|
+
function qn(e = []) {
|
|
1853
1637
|
return [{
|
|
1854
1638
|
path: "/login",
|
|
1855
1639
|
name: "login",
|
|
1856
|
-
component: () => import("./Login-
|
|
1640
|
+
component: () => import("./Login-BivuNuD7.js"),
|
|
1857
1641
|
meta: {
|
|
1858
1642
|
title: "登录",
|
|
1859
1643
|
public: !0
|
|
1860
1644
|
}
|
|
1861
1645
|
}, {
|
|
1862
1646
|
path: "/",
|
|
1863
|
-
component:
|
|
1647
|
+
component: Kn,
|
|
1864
1648
|
redirect: "/dashboard",
|
|
1865
1649
|
children: [
|
|
1866
1650
|
{
|
|
1867
1651
|
path: "403",
|
|
1868
1652
|
name: "forbidden",
|
|
1869
|
-
component: () => import("./Forbidden-
|
|
1653
|
+
component: () => import("./Forbidden-Cu2QQ-FY.js"),
|
|
1870
1654
|
meta: {
|
|
1871
1655
|
title: "暂无权限",
|
|
1872
1656
|
public: !0,
|
|
@@ -1885,7 +1669,7 @@ function Dr(e = []) {
|
|
|
1885
1669
|
children: [{
|
|
1886
1670
|
path: "apps",
|
|
1887
1671
|
name: "config-apps",
|
|
1888
|
-
component: () => import("./application-config-
|
|
1672
|
+
component: () => import("./application-config-DLHtmY_2.js"),
|
|
1889
1673
|
meta: {
|
|
1890
1674
|
title: "应用配置",
|
|
1891
1675
|
icon: "Connection"
|
|
@@ -1893,7 +1677,7 @@ function Dr(e = []) {
|
|
|
1893
1677
|
}, {
|
|
1894
1678
|
path: "system",
|
|
1895
1679
|
name: "config-system",
|
|
1896
|
-
component: () => import("./SystemConfig-
|
|
1680
|
+
component: () => import("./SystemConfig-C7yyDmB8.js"),
|
|
1897
1681
|
meta: {
|
|
1898
1682
|
title: "系统配置",
|
|
1899
1683
|
icon: "Setting"
|
|
@@ -1903,7 +1687,7 @@ function Dr(e = []) {
|
|
|
1903
1687
|
{
|
|
1904
1688
|
path: ":pathMatch(.*)*",
|
|
1905
1689
|
name: "not-found",
|
|
1906
|
-
component: () => import("./NotFound-
|
|
1690
|
+
component: () => import("./NotFound-VRL7_aMx.js"),
|
|
1907
1691
|
meta: {
|
|
1908
1692
|
title: "页面不存在",
|
|
1909
1693
|
public: !0,
|
|
@@ -1915,26 +1699,26 @@ function Dr(e = []) {
|
|
|
1915
1699
|
}
|
|
1916
1700
|
//#endregion
|
|
1917
1701
|
//#region src/main/router/index.ts
|
|
1918
|
-
function
|
|
1919
|
-
let t = Array.isArray(e) ? { businessRoutes: e } : e, n =
|
|
1920
|
-
history: t.history ??
|
|
1921
|
-
routes:
|
|
1702
|
+
function Jn(e = []) {
|
|
1703
|
+
let t = Array.isArray(e) ? { businessRoutes: e } : e, n = m({
|
|
1704
|
+
history: t.history ?? h("/"),
|
|
1705
|
+
routes: qn(t.businessRoutes ?? []),
|
|
1922
1706
|
scrollBehavior: t.scrollBehavior ?? (() => ({ top: 0 }))
|
|
1923
1707
|
});
|
|
1924
|
-
return
|
|
1708
|
+
return Ue(n), t.setupRouter?.(n), n;
|
|
1925
1709
|
}
|
|
1926
1710
|
//#endregion
|
|
1927
1711
|
//#region src/main/directives/index.ts
|
|
1928
|
-
var
|
|
1712
|
+
var Yn = {
|
|
1929
1713
|
mounted(e, t) {
|
|
1930
|
-
|
|
1714
|
+
Xn(e, t.value);
|
|
1931
1715
|
},
|
|
1932
1716
|
updated(e, t) {
|
|
1933
|
-
|
|
1717
|
+
Xn(e, t.value);
|
|
1934
1718
|
}
|
|
1935
1719
|
};
|
|
1936
|
-
function
|
|
1937
|
-
let n = a(), r =
|
|
1720
|
+
function Xn(e, t) {
|
|
1721
|
+
let n = a(), r = Zn(t), i = typeof t == "object" && !Array.isArray(t) && t.mode || "all", o = typeof t == "object" && !Array.isArray(t) ? !!t.disabled : !1, s = i === "any" ? r.some((e) => n.hasPermission(e)) : r.every((e) => n.hasPermission(e));
|
|
1938
1722
|
if (!r.length || s) {
|
|
1939
1723
|
e.style.display = "", e.hidden = !1, o && (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
|
|
1940
1724
|
return;
|
|
@@ -1945,30 +1729,30 @@ function Ar(e, t) {
|
|
|
1945
1729
|
}
|
|
1946
1730
|
e.style.display = "none", e.hidden = !0;
|
|
1947
1731
|
}
|
|
1948
|
-
function
|
|
1732
|
+
function Zn(e) {
|
|
1949
1733
|
return typeof e == "string" ? e ? [e] : [] : Array.isArray(e) ? e : e.permissions ?? [];
|
|
1950
1734
|
}
|
|
1951
|
-
function
|
|
1952
|
-
e.directive("permission",
|
|
1735
|
+
function Qn(e) {
|
|
1736
|
+
e.directive("permission", Yn);
|
|
1953
1737
|
}
|
|
1954
1738
|
//#endregion
|
|
1955
1739
|
//#region src/main/app/create-app.ts
|
|
1956
|
-
async function
|
|
1957
|
-
|
|
1958
|
-
let t =
|
|
1740
|
+
async function $n(e) {
|
|
1741
|
+
Fe(e.appConfig), Be();
|
|
1742
|
+
let t = Jn({
|
|
1959
1743
|
businessRoutes: e.businessRoutes,
|
|
1960
1744
|
history: e.routerHistory,
|
|
1961
1745
|
scrollBehavior: e.routerScrollBehavior,
|
|
1962
1746
|
setupRouter: e.setupRouter
|
|
1963
|
-
}), n =
|
|
1747
|
+
}), n = T(e.rootComponent), r = ie(), i = {
|
|
1964
1748
|
app: n,
|
|
1965
1749
|
router: t,
|
|
1966
1750
|
pinia: r,
|
|
1967
|
-
http:
|
|
1968
|
-
requestManager:
|
|
1751
|
+
http: Le,
|
|
1752
|
+
requestManager: ze
|
|
1969
1753
|
};
|
|
1970
|
-
|
|
1971
|
-
let a =
|
|
1754
|
+
Ae(), n.use(y, { locale: Me }), n.use(r), n.use(t), Qn(n), Ne(t), await e.setupApp?.(i), await e.beforePlatformInit?.(i);
|
|
1755
|
+
let a = f(r), o = l(r), s = Q(r), c = ke({ fullscreen: !0 });
|
|
1972
1756
|
try {
|
|
1973
1757
|
await Promise.all([
|
|
1974
1758
|
a.initializePreferences(),
|
|
@@ -1986,249 +1770,4 @@ async function Nr(e) {
|
|
|
1986
1770
|
return await e.afterMount?.(d), n;
|
|
1987
1771
|
}
|
|
1988
1772
|
//#endregion
|
|
1989
|
-
|
|
1990
|
-
var Q = I({}), Pr = I({});
|
|
1991
|
-
function Fr() {
|
|
1992
|
-
return Q;
|
|
1993
|
-
}
|
|
1994
|
-
function Ir(e) {
|
|
1995
|
-
return Pr[e];
|
|
1996
|
-
}
|
|
1997
|
-
function Lr(e) {
|
|
1998
|
-
return p(d()).find((t) => e === t.activeRule || e.startsWith(`${t.activeRule}/`));
|
|
1999
|
-
}
|
|
2000
|
-
function Rr(e) {
|
|
2001
|
-
return Q[e.name] || (Q[e.name] = {
|
|
2002
|
-
name: e.name,
|
|
2003
|
-
title: e.title,
|
|
2004
|
-
entry: e.entry,
|
|
2005
|
-
activeRule: e.activeRule,
|
|
2006
|
-
status: "idle",
|
|
2007
|
-
updatedAt: Date.now()
|
|
2008
|
-
}, Q[e.name]);
|
|
2009
|
-
}
|
|
2010
|
-
function zr(e) {
|
|
2011
|
-
Gr(e, {
|
|
2012
|
-
status: "loading",
|
|
2013
|
-
message: void 0
|
|
2014
|
-
});
|
|
2015
|
-
}
|
|
2016
|
-
function Br(e) {
|
|
2017
|
-
Gr(e, {
|
|
2018
|
-
status: "mounted",
|
|
2019
|
-
message: void 0
|
|
2020
|
-
});
|
|
2021
|
-
}
|
|
2022
|
-
function Vr(e, t) {
|
|
2023
|
-
Kr(e, {
|
|
2024
|
-
status: "error",
|
|
2025
|
-
message: qr(t)
|
|
2026
|
-
});
|
|
2027
|
-
}
|
|
2028
|
-
function Hr(e, t) {
|
|
2029
|
-
let n = Q[e];
|
|
2030
|
-
return n ? (n.status = "error", n.message = qr(t), n.updatedAt = Date.now(), !0) : !1;
|
|
2031
|
-
}
|
|
2032
|
-
function Ur(e, t, n) {
|
|
2033
|
-
Pr[t] = {
|
|
2034
|
-
path: t,
|
|
2035
|
-
name: e.name,
|
|
2036
|
-
title: e.title,
|
|
2037
|
-
entry: e.entry,
|
|
2038
|
-
activeRule: e.activeRule,
|
|
2039
|
-
message: qr(n),
|
|
2040
|
-
updatedAt: Date.now()
|
|
2041
|
-
};
|
|
2042
|
-
}
|
|
2043
|
-
function Wr(e) {
|
|
2044
|
-
delete Pr[e];
|
|
2045
|
-
}
|
|
2046
|
-
function Gr(e, t) {
|
|
2047
|
-
let n = Q[e];
|
|
2048
|
-
n && (n.status = t.status, n.message = t.message, n.updatedAt = Date.now());
|
|
2049
|
-
}
|
|
2050
|
-
function Kr(e, t) {
|
|
2051
|
-
let n = Rr(e);
|
|
2052
|
-
n.title = e.title, n.entry = e.entry, n.activeRule = e.activeRule, n.status = t.status, n.message = t.message, n.updatedAt = Date.now();
|
|
2053
|
-
}
|
|
2054
|
-
function qr(e) {
|
|
2055
|
-
let t = Jr(e);
|
|
2056
|
-
return t ? Xr(Yr(t)) : "子应用入口不可访问、服务未启动,或加载过程中发生异常。";
|
|
2057
|
-
}
|
|
2058
|
-
function Jr(e) {
|
|
2059
|
-
return e instanceof Error ? e.message : typeof e == "string" ? e : "";
|
|
2060
|
-
}
|
|
2061
|
-
function Yr(e) {
|
|
2062
|
-
return e.trim().replace(/^(application ['"][^'"]+['"] died in status [A-Z_]+:\s*)\1+/, "$1");
|
|
2063
|
-
}
|
|
2064
|
-
function Xr(e) {
|
|
2065
|
-
let t = e.trim(), n = t.toLowerCase(), r = t.match(/application ['"]([^'"]+)['"]/)?.[1], i = r ? `子应用“${r}”` : "子应用";
|
|
2066
|
-
return n.includes("cannot use import statement outside a module") ? `${i}入口已响应,但脚本格式不是 qiankun 当前加载方式可执行的格式。请确认子应用使用 qiankun dev 模式启动,或检查子应用构建配置是否输出 qiankun 需要的入口格式;同时确认主应用配置的入口地址指向子应用 dev server,而不是普通静态文件地址。` : n.includes("unexpected token <") ? `${i}入口返回了 HTML,但 qiankun 正在按脚本解析。请检查入口地址是否填错、子应用服务是否启动,以及访问入口时是否被重定向到了登录页或 404 页面。` : n.includes("failed to fetch") || n.includes("networkerror") || n.includes("load failed") || n.includes("loading source code") || n.includes("loading_source_code") ? `${i}入口资源加载失败。请确认子应用服务已启动、入口地址可直接访问,并检查浏览器控制台是否有跨域、404 或网络连接错误。` : n.includes("application died in status not_mounted") ? `${i}加载后挂载失败。请检查子应用是否正确导出了 qiankun 生命周期,并确认挂载容器和路由基座配置正确。` : t;
|
|
2067
|
-
}
|
|
2068
|
-
//#endregion
|
|
2069
|
-
//#region src/main/micro-apps/types.ts
|
|
2070
|
-
var Zr = "morningfast:theme-change", Qr = !1, $r = !1;
|
|
2071
|
-
function ei() {
|
|
2072
|
-
if (Qr) {
|
|
2073
|
-
ti();
|
|
2074
|
-
return;
|
|
2075
|
-
}
|
|
2076
|
-
Qr = !0;
|
|
2077
|
-
let e = p(d());
|
|
2078
|
-
e.forEach(Rr), Ve(e.map((e) => ({
|
|
2079
|
-
name: e.name,
|
|
2080
|
-
entry: e.entry,
|
|
2081
|
-
container: e.container,
|
|
2082
|
-
activeRule: e.activeRule,
|
|
2083
|
-
props: ri(e)
|
|
2084
|
-
})), {
|
|
2085
|
-
beforeLoad: [async (e) => {
|
|
2086
|
-
Wr(window.location.pathname), zr(e.name);
|
|
2087
|
-
}],
|
|
2088
|
-
afterMount: [async (e) => {
|
|
2089
|
-
Wr(window.location.pathname), Br(e.name);
|
|
2090
|
-
}]
|
|
2091
|
-
}), Be((t) => {
|
|
2092
|
-
let n = t instanceof ErrorEvent ? t.error || t.message : t, r = ni(n) || ni(t);
|
|
2093
|
-
if (r && Hr(r, n)) {
|
|
2094
|
-
let t = e.find((e) => e.name === r);
|
|
2095
|
-
t && Ur(t, window.location.pathname, n);
|
|
2096
|
-
return;
|
|
2097
|
-
}
|
|
2098
|
-
e.forEach((e) => {
|
|
2099
|
-
(window.location.pathname === e.activeRule || window.location.pathname.startsWith(`${e.activeRule}/`)) && (Vr(e, n), Ur(e, window.location.pathname, n));
|
|
2100
|
-
});
|
|
2101
|
-
}), ti(), ii();
|
|
2102
|
-
}
|
|
2103
|
-
function ti() {
|
|
2104
|
-
$r || document.querySelector("#micro-app-container") && ($r = !0, He({
|
|
2105
|
-
prefetch: !1,
|
|
2106
|
-
sandbox: { experimentalStyleIsolation: !0 },
|
|
2107
|
-
urlRerouteOnly: !0
|
|
2108
|
-
}));
|
|
2109
|
-
}
|
|
2110
|
-
function ni(e) {
|
|
2111
|
-
return (e instanceof Error ? e.message : String(e || "")).match(/application ['"]?([^'"\s]+)['"]?/i)?.[1];
|
|
2112
|
-
}
|
|
2113
|
-
function ri(e) {
|
|
2114
|
-
let t = Z();
|
|
2115
|
-
return {
|
|
2116
|
-
basePath: e.activeRule,
|
|
2117
|
-
app: f(e),
|
|
2118
|
-
runtime: {
|
|
2119
|
-
env: "production",
|
|
2120
|
-
apiBaseUrl: "/api"
|
|
2121
|
-
},
|
|
2122
|
-
theme: oi(t.isDark),
|
|
2123
|
-
getRuntimeProps: () => ({ theme: oi(t.isDark) })
|
|
2124
|
-
};
|
|
2125
|
-
}
|
|
2126
|
-
function ii() {
|
|
2127
|
-
let e = Z();
|
|
2128
|
-
U(() => [
|
|
2129
|
-
e.isDark,
|
|
2130
|
-
e.themeColor,
|
|
2131
|
-
e.themeColorPosition
|
|
2132
|
-
], () => {
|
|
2133
|
-
window.setTimeout(() => {
|
|
2134
|
-
ai(oi(e.isDark));
|
|
2135
|
-
}, 0);
|
|
2136
|
-
});
|
|
2137
|
-
}
|
|
2138
|
-
function ai(e) {
|
|
2139
|
-
window.dispatchEvent(new CustomEvent(Zr, { detail: e }));
|
|
2140
|
-
}
|
|
2141
|
-
function oi(e) {
|
|
2142
|
-
let t = getComputedStyle(document.documentElement);
|
|
2143
|
-
return {
|
|
2144
|
-
colorPrimary: $(t, "--el-color-primary", "#409EFF"),
|
|
2145
|
-
colorPrimaryLight3: $(t, "--el-color-primary-light-3", "#79bbff"),
|
|
2146
|
-
colorPrimaryLight5: $(t, "--el-color-primary-light-5", "#a0cfff"),
|
|
2147
|
-
colorPrimaryLight7: $(t, "--el-color-primary-light-7", "#c6e2ff"),
|
|
2148
|
-
colorPrimaryLight8: $(t, "--el-color-primary-light-8", "#d9ecff"),
|
|
2149
|
-
colorPrimaryLight9: $(t, "--el-color-primary-light-9", "#ecf5ff"),
|
|
2150
|
-
colorPrimaryDark2: $(t, "--el-color-primary-dark-2", "#337ecc"),
|
|
2151
|
-
mode: e ? "dark" : "light"
|
|
2152
|
-
};
|
|
2153
|
-
}
|
|
2154
|
-
function $(e, t, n) {
|
|
2155
|
-
return e.getPropertyValue(t).trim() || n;
|
|
2156
|
-
}
|
|
2157
|
-
//#endregion
|
|
2158
|
-
//#region src/main/pages/micro/MicroAppView.vue?vue&type=script&setup=true&lang.ts
|
|
2159
|
-
var si = { class: "micro-app-page" }, ci = {
|
|
2160
|
-
key: 0,
|
|
2161
|
-
class: "micro-app-page__state micro-app-page__state--error"
|
|
2162
|
-
}, li = { class: "micro-app-page__body" }, ui = { class: "micro-app-page__desc" }, di = { class: "micro-app-page__meta" }, fi = { key: 0 }, pi = { key: 1 }, mi = { key: 2 }, hi = { class: "micro-app-page__actions" }, gi = ["id"], _i = /* @__PURE__ */ u(/* @__PURE__ */ M({
|
|
2163
|
-
name: "MicroAppView",
|
|
2164
|
-
__name: "MicroAppView",
|
|
2165
|
-
setup(e) {
|
|
2166
|
-
let t = _(), n = Fr(), r = L(""), i = null, a = T(() => Lr(t.path)), o = T(() => {
|
|
2167
|
-
let e = a.value;
|
|
2168
|
-
return e ? n[e.name] : void 0;
|
|
2169
|
-
}), s = T(() => Ir(t.path)), c = T(() => o.value?.title || a.value?.title || s.value?.title || "未知子应用"), l = T(() => o.value?.entry || a.value?.entry || s.value?.entry || "-"), u = T(() => o.value?.message ? o.value.message : s.value?.message ? s.value.message : a.value ? "子应用暂时无法访问,请稍后重试。" : "当前路径没有匹配到子应用配置,请检查应用配置里的路由前缀。"), d = T(() => t.path.startsWith("/micro/")), f = T(() => o.value?.status === "error" || !!s.value || !!r.value || d.value && !a.value);
|
|
2170
|
-
U(() => t.path, () => {
|
|
2171
|
-
N(() => {
|
|
2172
|
-
ei(), p();
|
|
2173
|
-
});
|
|
2174
|
-
}, { immediate: !0 }), ie(() => {
|
|
2175
|
-
N(() => {
|
|
2176
|
-
ei(), p();
|
|
2177
|
-
});
|
|
2178
|
-
}), U(() => o.value?.status, (e) => {
|
|
2179
|
-
e === "mounted" && (h(), r.value = "");
|
|
2180
|
-
}), re(() => {
|
|
2181
|
-
h();
|
|
2182
|
-
});
|
|
2183
|
-
function p() {
|
|
2184
|
-
h(), r.value = "", !(!d.value || !a.value) && (i = window.setTimeout(() => {
|
|
2185
|
-
o.value?.status !== "mounted" && (r.value = "子应用暂时无法访问,请稍后重试。");
|
|
2186
|
-
}, 15e3));
|
|
2187
|
-
}
|
|
2188
|
-
function h() {
|
|
2189
|
-
i !== null && (window.clearTimeout(i), i = null);
|
|
2190
|
-
}
|
|
2191
|
-
function g() {
|
|
2192
|
-
window.location.reload();
|
|
2193
|
-
}
|
|
2194
|
-
function v() {
|
|
2195
|
-
let e = l.value;
|
|
2196
|
-
e && e !== "-" && window.open(e, "_blank", "noopener,noreferrer");
|
|
2197
|
-
}
|
|
2198
|
-
return (e, t) => {
|
|
2199
|
-
let n = z("el-icon"), i = z("el-button");
|
|
2200
|
-
return F(), O("div", si, [f.value ? (F(), O("div", ci, [j(n, { class: "micro-app-page__icon" }, {
|
|
2201
|
-
default: W(() => [j(H(Pe))]),
|
|
2202
|
-
_: 1
|
|
2203
|
-
}), k("div", li, [
|
|
2204
|
-
t[6] ||= k("p", { class: "micro-app-page__title" }, "子应用加载失败", -1),
|
|
2205
|
-
k("p", ui, V(u.value), 1),
|
|
2206
|
-
k("dl", di, [
|
|
2207
|
-
k("div", null, [t[0] ||= k("dt", null, "应用", -1), k("dd", null, V(c.value), 1)]),
|
|
2208
|
-
H(!1) ? (F(), O("div", fi, [t[1] ||= k("dt", null, "入口", -1), k("dd", null, V(l.value), 1)])) : D("", !0),
|
|
2209
|
-
o.value?.message ? (F(), O("div", pi, [t[2] ||= k("dt", null, "原因", -1), k("dd", null, V(o.value.message), 1)])) : r.value ? (F(), O("div", mi, [t[3] ||= k("dt", null, "原因", -1), k("dd", null, V(r.value), 1)])) : D("", !0)
|
|
2210
|
-
]),
|
|
2211
|
-
k("div", hi, [j(i, {
|
|
2212
|
-
type: "primary",
|
|
2213
|
-
icon: H(De),
|
|
2214
|
-
onClick: g
|
|
2215
|
-
}, {
|
|
2216
|
-
default: W(() => [...t[4] ||= [A("重新加载", -1)]]),
|
|
2217
|
-
_: 1
|
|
2218
|
-
}, 8, ["icon"]), H(!1) && (o.value?.entry || a.value?.entry) ? (F(), E(i, {
|
|
2219
|
-
key: 0,
|
|
2220
|
-
icon: H(Se),
|
|
2221
|
-
onClick: v
|
|
2222
|
-
}, {
|
|
2223
|
-
default: W(() => [...t[5] ||= [A(" 打开入口 ", -1)]]),
|
|
2224
|
-
_: 1
|
|
2225
|
-
}, 8, ["icon"])) : D("", !0)])
|
|
2226
|
-
])])) : D("", !0), k("section", {
|
|
2227
|
-
id: H(m),
|
|
2228
|
-
class: "micro-app-page__container"
|
|
2229
|
-
}, null, 8, gi)]);
|
|
2230
|
-
};
|
|
2231
|
-
}
|
|
2232
|
-
}), [["__scopeId", "data-v-90c11f85"]]);
|
|
2233
|
-
//#endregion
|
|
2234
|
-
export { Z as a, Xe as c, Ye as d, Ue as f, Dr as i, Je as l, Nr as n, q as o, Or as r, Y as s, _i as t, qe as u };
|
|
1773
|
+
export { Q as a, Le as c, X as i, ze as l, Jn as n, Be as o, qn as r, Re as s, $n as t, Ne as u };
|