@morningfast/platform 0.0.6 → 0.0.8
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 -4
- package/dist/chunks/{Login-rBkUOl6l.js → Login-BcNNVCnZ.js} +1 -1
- package/dist/chunks/{SystemConfig-DxkDxCnC.js → SystemConfig-CjcXN9Ma.js} +1 -1
- package/dist/chunks/{application-config-0d6f-odq.js → application-config-CGx7DctK.js} +4 -4
- package/dist/chunks/{config-DkMAgPn_.js → config-CKUWu-5b.js} +2 -9
- package/dist/chunks/{main-CfTD1njJ.js → main-Ln0xOplS.js} +911 -475
- package/dist/index.js +6 -7
- package/dist/main/index.d.ts +1 -0
- package/dist/main/micro-apps/config.d.ts +2 -2
- package/dist/main.js +4 -5
- package/package.json +1 -1
- package/dist/assets/main.css +0 -1
- package/dist/chunks/MicroAppView-DqTrIZZa.js +0 -249
- package/dist/chunks/app-Cn5iHmfI.js +0 -221
- /package/dist/chunks/{_plugin-vue_export-helper-DvRHjpsZ.js → _plugin-vue_export-helper-CZc-Y3Wh.js} +0 -0
|
@@ -2,22 +2,23 @@ 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 { t as u } from "./_plugin-vue_export-helper-CZc-Y3Wh.js";
|
|
6
|
+
import { n as d, o as f, r as p, t as m } from "./config-CKUWu-5b.js";
|
|
7
|
+
import { createRouter as h, createWebHistory as g, useRoute as _, useRouter as v } from "vue-router";
|
|
8
|
+
import y from "nprogress";
|
|
9
|
+
import b, { ElMessage as x } from "element-plus";
|
|
10
|
+
import { Fragment as S, Teleport as ee, Transition as C, TransitionGroup as w, computed as T, createApp as te, 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 ne, onBeforeUnmount as re, onMounted as ie, onUnmounted as ae, openBlock as F, reactive 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 oe, withCtx as W, withKeys as G, withModifiers as K } from "vue";
|
|
11
|
+
import { createPinia as se, defineStore as ce } from "pinia";
|
|
12
|
+
import { ArrowDown as le, ArrowRight as ue, ArrowUp as de, Back as fe, Brush as pe, Close as me, Connection as he, DArrowLeft as ge, DArrowRight as _e, Expand as ve, Fold as ye, FolderDelete as be, House as xe, Link as Se, Menu as Ce, Monitor as we, Moon as Te, Operation as Ee, RefreshRight as De, Search as Oe, Setting as ke, Sunny as Ae, SwitchButton as je, TopRight as Me, User as Ne, WarningFilled as Pe } from "@element-plus/icons-vue";
|
|
13
|
+
import { MpDrawer as Fe, MpLoadingService as Ie, registerMpFormFieldComponents as Le } from "morningfast-plus/components";
|
|
14
|
+
import Re from "sortablejs";
|
|
15
|
+
import ze 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";
|
|
19
20
|
//#region src/main/auth/expired.ts
|
|
20
|
-
function
|
|
21
|
+
function Ue(t) {
|
|
21
22
|
return r(() => {
|
|
22
23
|
if (e(), t.currentRoute.value.path === "/login") return;
|
|
23
24
|
let n = `${t.currentRoute.value.fullPath || "/"}`;
|
|
@@ -29,18 +30,18 @@ function Ne(t) {
|
|
|
29
30
|
}
|
|
30
31
|
//#endregion
|
|
31
32
|
//#region src/main/app/runtime-config.ts
|
|
32
|
-
var
|
|
33
|
-
function
|
|
34
|
-
|
|
33
|
+
var We = { apiBaseUrl: "/api" };
|
|
34
|
+
function Ge(e) {
|
|
35
|
+
We = e;
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
37
|
+
function Ke() {
|
|
38
|
+
return We;
|
|
38
39
|
}
|
|
39
|
-
var { http:
|
|
40
|
-
baseURL:
|
|
40
|
+
var { http: qe, createApi: Je, requestManager: Ye } = i({
|
|
41
|
+
baseURL: Ke().apiBaseUrl,
|
|
41
42
|
getToken: n,
|
|
42
43
|
onError(e) {
|
|
43
|
-
|
|
44
|
+
x.error(e);
|
|
44
45
|
},
|
|
45
46
|
onUnauthorized(e) {
|
|
46
47
|
t({
|
|
@@ -51,64 +52,64 @@ var { http: Le, createApi: Re, requestManager: ze } = i({
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
});
|
|
54
|
-
function
|
|
55
|
-
|
|
55
|
+
function Xe() {
|
|
56
|
+
qe.defaults.baseURL = Ke().apiBaseUrl;
|
|
56
57
|
}
|
|
57
58
|
//#endregion
|
|
58
59
|
//#region src/main/router/guard.ts
|
|
59
|
-
var
|
|
60
|
-
function
|
|
60
|
+
var Ze = "/login", Qe = "/403";
|
|
61
|
+
function $e(e) {
|
|
61
62
|
e.beforeEach(async (e, t) => {
|
|
62
|
-
|
|
63
|
+
y.start(), e.path !== t.path && Ye.setCurrentPage(e.path);
|
|
63
64
|
let n = a(), r = !!e.meta.public;
|
|
64
65
|
if (n.initialized || await n.initAuth(), !n.isAuthenticated && !r) return {
|
|
65
|
-
path:
|
|
66
|
+
path: Ze,
|
|
66
67
|
query: { redirect: e.fullPath }
|
|
67
68
|
};
|
|
68
|
-
if (n.isAuthenticated && e.path ===
|
|
69
|
+
if (n.isAuthenticated && e.path === Ze) return { path: "/" };
|
|
69
70
|
let i = e.meta.permission;
|
|
70
|
-
return
|
|
71
|
-
path:
|
|
71
|
+
return et(i, n.hasPermission) ? !0 : {
|
|
72
|
+
path: Qe,
|
|
72
73
|
query: { redirect: e.fullPath }
|
|
73
74
|
};
|
|
74
75
|
}), e.afterEach((e) => {
|
|
75
|
-
l().setRouteTitle(String(e.meta.title ?? "Morningfast UI")),
|
|
76
|
+
l().setRouteTitle(String(e.meta.title ?? "Morningfast UI")), y.done();
|
|
76
77
|
}), e.onError(() => {
|
|
77
|
-
|
|
78
|
+
y.done();
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function et(e, t) {
|
|
81
82
|
return e ? Array.isArray(e) ? e.every((e) => t(e)) : t(e) : !0;
|
|
82
83
|
}
|
|
83
84
|
//#endregion
|
|
84
85
|
//#region src/main/stores/tabs.ts
|
|
85
|
-
var
|
|
86
|
-
function
|
|
86
|
+
var q = "/dashboard", tt = "tabs-state";
|
|
87
|
+
function J() {
|
|
87
88
|
return {
|
|
88
|
-
path:
|
|
89
|
-
fullPath:
|
|
89
|
+
path: q,
|
|
90
|
+
fullPath: q,
|
|
90
91
|
title: "首页",
|
|
91
92
|
icon: "House"
|
|
92
93
|
};
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
+
function nt() {
|
|
95
96
|
return {
|
|
96
|
-
tabs: [
|
|
97
|
-
activeTab:
|
|
97
|
+
tabs: [J()],
|
|
98
|
+
activeTab: q,
|
|
98
99
|
lastActiveTab: ""
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
-
let t =
|
|
102
|
+
function rt(e) {
|
|
103
|
+
let t = nt();
|
|
103
104
|
if (!e) return t;
|
|
104
|
-
let n = Array.isArray(e.tabs) ? e.tabs.filter(Boolean).map(
|
|
105
|
+
let n = Array.isArray(e.tabs) ? e.tabs.filter(Boolean).map(it) : [], r = at([J(), ...n]).sort((e, t) => e.path === "/dashboard" ? -1 : +(t.path === "/dashboard"));
|
|
105
106
|
return {
|
|
106
107
|
tabs: r,
|
|
107
108
|
activeTab: r.some((t) => t.path === e.activeTab) ? String(e.activeTab || "/dashboard") : r[0]?.path || "/dashboard",
|
|
108
109
|
lastActiveTab: r.some((t) => t.path === e.lastActiveTab) ? String(e.lastActiveTab || "") : ""
|
|
109
110
|
};
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
+
function it(e) {
|
|
112
113
|
return {
|
|
113
114
|
path: String(e.path || "/dashboard"),
|
|
114
115
|
fullPath: String(e.fullPath || e.path || "/dashboard"),
|
|
@@ -116,11 +117,11 @@ function Je(e) {
|
|
|
116
117
|
icon: e.icon ? String(e.icon) : void 0
|
|
117
118
|
};
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function at(e) {
|
|
120
121
|
let t = /* @__PURE__ */ new Set();
|
|
121
122
|
return e.filter((e) => t.has(e.path) ? !1 : (t.add(e.path), !0));
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function ot(e) {
|
|
124
125
|
return {
|
|
125
126
|
tabs: e.tabs.map((e) => ({
|
|
126
127
|
path: e.path,
|
|
@@ -132,10 +133,10 @@ function Xe(e) {
|
|
|
132
133
|
lastActiveTab: e.lastActiveTab
|
|
133
134
|
};
|
|
134
135
|
}
|
|
135
|
-
var
|
|
136
|
-
let e = L([
|
|
136
|
+
var Y = ce("tabs", () => {
|
|
137
|
+
let e = L([J()]), t = L(q), n = L(""), r = L(!1), i = T(() => e.value.map((e) => e.path));
|
|
137
138
|
async function a() {
|
|
138
|
-
r.value && await o(
|
|
139
|
+
r.value && await o(tt, ot({
|
|
139
140
|
tabs: e.value,
|
|
140
141
|
activeTab: t.value,
|
|
141
142
|
lastActiveTab: n.value
|
|
@@ -143,7 +144,7 @@ var Q = J("tabs", () => {
|
|
|
143
144
|
}
|
|
144
145
|
async function l() {
|
|
145
146
|
if (r.value) return;
|
|
146
|
-
let i =
|
|
147
|
+
let i = rt(await s(tt, null));
|
|
147
148
|
e.value = i.tabs, t.value = i.activeTab, n.value = i.lastActiveTab, r.value = !0, await a();
|
|
148
149
|
}
|
|
149
150
|
async function u(r) {
|
|
@@ -175,10 +176,10 @@ var Q = J("tabs", () => {
|
|
|
175
176
|
n >= 0 && (e.value = x(e.value.slice(0, n + 1)), y(), await a());
|
|
176
177
|
}
|
|
177
178
|
async function g() {
|
|
178
|
-
e.value = [
|
|
179
|
+
e.value = [J()], t.value = q, n.value = "", await a();
|
|
179
180
|
}
|
|
180
181
|
async function _() {
|
|
181
|
-
e.value = [], t.value = "", n.value = "", await c(
|
|
182
|
+
e.value = [], t.value = "", n.value = "", await c(tt);
|
|
182
183
|
}
|
|
183
184
|
async function v(e) {
|
|
184
185
|
t.value && t.value !== e && (n.value = t.value), t.value = e, await a();
|
|
@@ -190,7 +191,7 @@ var Q = J("tabs", () => {
|
|
|
190
191
|
e.value = x(e.value);
|
|
191
192
|
}
|
|
192
193
|
function x(e) {
|
|
193
|
-
return
|
|
194
|
+
return at([J(), ...e.filter((e) => e.path !== q)]);
|
|
194
195
|
}
|
|
195
196
|
return {
|
|
196
197
|
activeTab: t,
|
|
@@ -208,7 +209,222 @@ var Q = J("tabs", () => {
|
|
|
208
209
|
tabPaths: i,
|
|
209
210
|
tabs: e
|
|
210
211
|
};
|
|
211
|
-
}),
|
|
212
|
+
}), st = "theme-color", ct = "theme-mode", lt = "theme-position", ut = [
|
|
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({
|
|
212
428
|
__name: "ThemedSvgImage",
|
|
213
429
|
props: {
|
|
214
430
|
src: {},
|
|
@@ -229,7 +445,7 @@ var Q = J("tabs", () => {
|
|
|
229
445
|
let n = e.replaceAll("#409EFF", t);
|
|
230
446
|
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`;
|
|
231
447
|
}
|
|
232
|
-
return
|
|
448
|
+
return oe((e) => {
|
|
233
449
|
let n = !1, o = t.src, s = t.primaryColor;
|
|
234
450
|
r.value = o, i(o).then((e) => {
|
|
235
451
|
n || (r.value = a(e, s));
|
|
@@ -238,79 +454,79 @@ var Q = J("tabs", () => {
|
|
|
238
454
|
}), e(() => {
|
|
239
455
|
n = !0;
|
|
240
456
|
});
|
|
241
|
-
}), (t, n) => (
|
|
457
|
+
}), (t, n) => (F(), O("img", {
|
|
242
458
|
src: r.value,
|
|
243
459
|
alt: e.alt
|
|
244
|
-
}, null, 8,
|
|
460
|
+
}, null, 8, At));
|
|
245
461
|
}
|
|
246
|
-
}),
|
|
462
|
+
}), Mt = "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", 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='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", Pt = "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", Ft = "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", 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='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", Lt = "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", Rt = { class: "settings-section" }, zt = { class: "settings-mode-grid" }, Bt = ["onClick"], Vt = { class: "settings-section" }, Ht = {
|
|
247
463
|
key: 0,
|
|
248
464
|
class: "settings-section__header"
|
|
249
|
-
},
|
|
465
|
+
}, Ut = {
|
|
250
466
|
key: 1,
|
|
251
467
|
class: "settings-position-grid"
|
|
252
|
-
},
|
|
468
|
+
}, Wt = ["onClick"], Gt = { class: "settings-position-card__label" }, Kt = { class: "settings-section" }, qt = { class: "settings-color-grid" }, Jt = ["onClick"], Yt = { class: "settings-color-card__label" }, Xt = { class: "settings-color-card__swatch settings-color-card__swatch--custom" }, Zt = { class: "settings-section" }, Qt = { class: "settings-layout-grid" }, $t = ["onClick"], en = { class: "settings-layout-card__label" }, tn = { class: "settings-section" }, nn = { class: "settings-inline-setting" }, rn = {
|
|
253
469
|
key: 0,
|
|
254
470
|
class: "settings-section"
|
|
255
|
-
},
|
|
471
|
+
}, an = { class: "settings-menu-search-grid" }, on = ["onClick"], sn = { class: "settings-placeholder" }, cn = { class: "settings-placeholder" }, ln = /* @__PURE__ */ M({
|
|
256
472
|
__name: "SystemSettingsDrawer",
|
|
257
473
|
setup(e) {
|
|
258
|
-
let t =
|
|
474
|
+
let t = Z(), n = T(() => !ut.some((e) => e.value.toLowerCase() === t.themeColor.toLowerCase())), r = [
|
|
259
475
|
{
|
|
260
476
|
label: "浅色",
|
|
261
477
|
value: "light",
|
|
262
|
-
icon:
|
|
478
|
+
icon: Ae
|
|
263
479
|
},
|
|
264
480
|
{
|
|
265
481
|
label: "深色",
|
|
266
482
|
value: "dark",
|
|
267
|
-
icon:
|
|
483
|
+
icon: Te
|
|
268
484
|
},
|
|
269
485
|
{
|
|
270
486
|
label: "跟随系统",
|
|
271
487
|
value: "system",
|
|
272
|
-
icon:
|
|
488
|
+
icon: we
|
|
273
489
|
}
|
|
274
490
|
], i = [
|
|
275
491
|
{
|
|
276
492
|
label: "不应用",
|
|
277
493
|
value: "none",
|
|
278
|
-
previewSrc:
|
|
494
|
+
previewSrc: It
|
|
279
495
|
},
|
|
280
496
|
{
|
|
281
497
|
label: "顶部",
|
|
282
498
|
value: "header",
|
|
283
|
-
previewSrc:
|
|
499
|
+
previewSrc: Ft
|
|
284
500
|
},
|
|
285
501
|
{
|
|
286
502
|
label: "侧边栏",
|
|
287
503
|
value: "sidebar",
|
|
288
|
-
previewSrc:
|
|
504
|
+
previewSrc: Lt
|
|
289
505
|
}
|
|
290
506
|
], a = [
|
|
291
507
|
{
|
|
292
508
|
label: "侧边导航",
|
|
293
509
|
value: "side",
|
|
294
|
-
previewSrc:
|
|
510
|
+
previewSrc: Nt
|
|
295
511
|
},
|
|
296
512
|
{
|
|
297
513
|
label: "顶部导航",
|
|
298
514
|
value: "top",
|
|
299
|
-
previewSrc:
|
|
515
|
+
previewSrc: Pt
|
|
300
516
|
},
|
|
301
517
|
{
|
|
302
518
|
label: "混合导航",
|
|
303
519
|
value: "mix",
|
|
304
|
-
previewSrc:
|
|
520
|
+
previewSrc: Mt
|
|
305
521
|
}
|
|
306
522
|
], o = [{
|
|
307
523
|
label: "顶部搜索",
|
|
308
524
|
value: "header",
|
|
309
|
-
icon:
|
|
525
|
+
icon: Oe
|
|
310
526
|
}, {
|
|
311
527
|
label: "侧边搜索",
|
|
312
528
|
value: "sidebar",
|
|
313
|
-
icon:
|
|
529
|
+
icon: Ce
|
|
314
530
|
}];
|
|
315
531
|
function s(e) {
|
|
316
532
|
e && t.setThemeColor(e);
|
|
@@ -319,8 +535,8 @@ var Q = J("tabs", () => {
|
|
|
319
535
|
e || t.closeSettings();
|
|
320
536
|
}
|
|
321
537
|
return (e, l) => {
|
|
322
|
-
let u = z("el-icon"),
|
|
323
|
-
return
|
|
538
|
+
let u = z("el-icon"), d = z("el-color-picker"), f = z("el-tab-pane"), p = z("el-switch"), m = z("el-empty"), h = z("el-tabs");
|
|
539
|
+
return F(), E(H(Fe), {
|
|
324
540
|
"model-value": H(t).settingsVisible,
|
|
325
541
|
title: "主题设置",
|
|
326
542
|
direction: "rtl",
|
|
@@ -329,52 +545,52 @@ var Q = J("tabs", () => {
|
|
|
329
545
|
"show-footer": !1,
|
|
330
546
|
"onUpdate:modelValue": c
|
|
331
547
|
}, {
|
|
332
|
-
default:
|
|
548
|
+
default: W(() => [j(h, {
|
|
333
549
|
modelValue: H(t).settingsActiveTab,
|
|
334
550
|
"onUpdate:modelValue": l[0] ||= (e) => H(t).settingsActiveTab = e,
|
|
335
551
|
class: "settings-tabs"
|
|
336
552
|
}, {
|
|
337
|
-
default:
|
|
338
|
-
j(
|
|
553
|
+
default: W(() => [
|
|
554
|
+
j(f, {
|
|
339
555
|
label: "外观",
|
|
340
556
|
name: "theme"
|
|
341
557
|
}, {
|
|
342
|
-
default:
|
|
343
|
-
k("div",
|
|
558
|
+
default: W(() => [
|
|
559
|
+
k("div", Rt, [l[1] ||= k("div", { class: "settings-section__header" }, [k("span", { class: "settings-section__title" }, "主题模式"), k("span", { class: "settings-section__desc" }, "选择浅色、深色或跟随系统")], -1), k("div", zt, [(F(), O(S, null, R(r, (e) => k("button", {
|
|
344
560
|
key: e.value,
|
|
345
561
|
type: "button",
|
|
346
562
|
class: P(["settings-mode-card", { "is-active": H(t).themeMode === e.value }]),
|
|
347
563
|
onClick: (n) => H(t).setThemeMode(e.value)
|
|
348
564
|
}, [j(u, { size: 20 }, {
|
|
349
|
-
default:
|
|
565
|
+
default: W(() => [(F(), E(B(e.icon)))]),
|
|
350
566
|
_: 2
|
|
351
|
-
}, 1024), k("strong", null, V(e.label), 1)], 10,
|
|
352
|
-
k("div",
|
|
567
|
+
}, 1024), k("strong", null, V(e.label), 1)], 10, Bt)), 64))])]),
|
|
568
|
+
k("div", Vt, [H(t).isDark ? D("", !0) : (F(), O("div", Ht, [...l[2] ||= [k("span", { class: "settings-section__title" }, "主题色应用", -1), k("span", { class: "settings-section__desc" }, "选择主题色应用位置", -1)]])), H(t).isDark ? D("", !0) : (F(), O("div", Ut, [(F(), O(S, null, R(i, (e) => k("button", {
|
|
353
569
|
key: e.value,
|
|
354
570
|
type: "button",
|
|
355
571
|
class: P(["settings-position-card", { "is-active": H(t).themeColorPosition === e.value }]),
|
|
356
572
|
onClick: (n) => H(t).setThemeColorPosition(e.value)
|
|
357
|
-
}, [j(
|
|
573
|
+
}, [j(jt, {
|
|
358
574
|
class: "settings-position-card__preview",
|
|
359
575
|
src: e.previewSrc,
|
|
360
576
|
"primary-color": H(t).themeColor
|
|
361
|
-
}, null, 8, ["src", "primary-color"]), k("span",
|
|
362
|
-
k("div",
|
|
577
|
+
}, null, 8, ["src", "primary-color"]), k("span", Gt, V(e.label), 1)], 10, Wt)), 64))]))]),
|
|
578
|
+
k("div", Kt, [l[4] ||= k("div", { class: "settings-section__header" }, [k("span", { class: "settings-section__title" }, "主题色"), k("span", { class: "settings-section__desc" }, "选择系统主题颜色")], -1), k("div", qt, [(F(!0), O(S, null, R(H(ut), (e) => (F(), O("button", {
|
|
363
579
|
key: e.value,
|
|
364
580
|
type: "button",
|
|
365
581
|
class: P(["settings-color-card", { "is-active": H(t).themeColor === e.value }]),
|
|
366
582
|
onClick: (n) => H(t).setThemeColor(e.value)
|
|
367
583
|
}, [k("span", {
|
|
368
584
|
class: "settings-color-card__swatch",
|
|
369
|
-
style:
|
|
370
|
-
}, null, 4), k("span",
|
|
371
|
-
j(
|
|
585
|
+
style: ne({ backgroundColor: e.value })
|
|
586
|
+
}, null, 4), k("span", Yt, V(e.label), 1)], 10, Jt))), 128)), k("div", { class: P(["settings-color-card settings-color-card--custom", { "is-active": n.value }]) }, [
|
|
587
|
+
j(d, {
|
|
372
588
|
class: "settings-color-card__picker",
|
|
373
589
|
"model-value": H(t).themeColor,
|
|
374
590
|
"onUpdate:modelValue": s
|
|
375
591
|
}, null, 8, ["model-value"]),
|
|
376
|
-
k("span",
|
|
377
|
-
default:
|
|
592
|
+
k("span", Xt, [j(u, { size: 18 }, {
|
|
593
|
+
default: W(() => [j(H(pe))]),
|
|
378
594
|
_: 1
|
|
379
595
|
})]),
|
|
380
596
|
l[3] ||= k("span", { class: "settings-color-card__label" }, "自定义", -1)
|
|
@@ -382,49 +598,49 @@ var Q = J("tabs", () => {
|
|
|
382
598
|
]),
|
|
383
599
|
_: 1
|
|
384
600
|
}),
|
|
385
|
-
j(
|
|
601
|
+
j(f, {
|
|
386
602
|
label: "布局",
|
|
387
603
|
name: "layout"
|
|
388
604
|
}, {
|
|
389
|
-
default:
|
|
390
|
-
k("div",
|
|
605
|
+
default: W(() => [
|
|
606
|
+
k("div", Zt, [l[5] ||= k("div", { class: "settings-section__header" }, [k("span", { class: "settings-section__title" }, "布局模式"), k("span", { class: "settings-section__desc" }, "切换侧边、顶部或混合导航")], -1), k("div", Qt, [(F(), O(S, null, R(a, (e) => k("button", {
|
|
391
607
|
key: e.value,
|
|
392
608
|
type: "button",
|
|
393
609
|
class: P(["settings-layout-card", { "is-active": H(t).layoutMode === e.value }]),
|
|
394
610
|
onClick: (n) => H(t).setLayoutMode(e.value)
|
|
395
|
-
}, [j(
|
|
611
|
+
}, [j(jt, {
|
|
396
612
|
class: "settings-layout-card__preview",
|
|
397
613
|
src: e.previewSrc,
|
|
398
614
|
"primary-color": H(t).themeColor
|
|
399
|
-
}, null, 8, ["src", "primary-color"]), k("span",
|
|
400
|
-
k("div",
|
|
615
|
+
}, null, 8, ["src", "primary-color"]), k("span", en, V(e.label), 1)], 10, $t)), 64))])]),
|
|
616
|
+
k("div", tn, [k("div", nn, [l[6] ||= k("div", null, [k("strong", null, "默认折叠侧边栏"), k("p", null, "适合屏幕较窄或想保留更多内容区空间")], -1), j(p, {
|
|
401
617
|
"model-value": H(t).sidebarCollapsed,
|
|
402
618
|
"onUpdate:modelValue": H(t).setSidebarCollapsed
|
|
403
619
|
}, null, 8, ["model-value", "onUpdate:modelValue"])])]),
|
|
404
|
-
H(t).layoutMode === "top" ? D("", !0) : (
|
|
620
|
+
H(t).layoutMode === "top" ? D("", !0) : (F(), O("div", rn, [l[7] ||= k("div", { class: "settings-section__header" }, [k("span", { class: "settings-section__title" }, "菜单搜索位置"), k("span", { class: "settings-section__desc" }, "顶部或侧边栏顶部搜索")], -1), k("div", an, [(F(), O(S, null, R(o, (e) => k("button", {
|
|
405
621
|
key: e.value,
|
|
406
622
|
type: "button",
|
|
407
623
|
class: P(["settings-mode-card", { "is-active": H(t).menuSearchPlacement === e.value }]),
|
|
408
624
|
onClick: (n) => H(t).setMenuSearchPlacement(e.value)
|
|
409
625
|
}, [j(u, { size: 20 }, {
|
|
410
|
-
default:
|
|
626
|
+
default: W(() => [(F(), E(B(e.icon)))]),
|
|
411
627
|
_: 2
|
|
412
|
-
}, 1024), k("strong", null, V(e.label), 1)], 10,
|
|
628
|
+
}, 1024), k("strong", null, V(e.label), 1)], 10, on)), 64))])]))
|
|
413
629
|
]),
|
|
414
630
|
_: 1
|
|
415
631
|
}),
|
|
416
|
-
j(
|
|
632
|
+
j(f, {
|
|
417
633
|
label: "快捷键",
|
|
418
634
|
name: "shortcut"
|
|
419
635
|
}, {
|
|
420
|
-
default:
|
|
636
|
+
default: W(() => [k("div", sn, [j(m, { description: "快捷键配置稍后接入,这里先预留入口。" })])]),
|
|
421
637
|
_: 1
|
|
422
638
|
}),
|
|
423
|
-
j(
|
|
639
|
+
j(f, {
|
|
424
640
|
label: "通用",
|
|
425
641
|
name: "general"
|
|
426
642
|
}, {
|
|
427
|
-
default:
|
|
643
|
+
default: W(() => [k("div", cn, [j(m, { description: "通用设置稍后扩展,这里先保留结构。" })])]),
|
|
428
644
|
_: 1
|
|
429
645
|
})
|
|
430
646
|
]),
|
|
@@ -434,66 +650,66 @@ var Q = J("tabs", () => {
|
|
|
434
650
|
}, 8, ["model-value"]);
|
|
435
651
|
};
|
|
436
652
|
}
|
|
437
|
-
}),
|
|
653
|
+
}), un = /* @__PURE__ */ M({
|
|
438
654
|
__name: "AppContentView",
|
|
439
655
|
props: { refreshKey: {} },
|
|
440
656
|
setup(e) {
|
|
441
657
|
return (t, n) => {
|
|
442
658
|
let r = z("router-view"), i = z("el-main");
|
|
443
|
-
return
|
|
444
|
-
default:
|
|
445
|
-
default:
|
|
659
|
+
return F(), E(i, { class: "app-layout__main" }, {
|
|
660
|
+
default: W(() => [j(r, null, {
|
|
661
|
+
default: W(({ Component: t, route: n }) => [(F(), E(B(t), { key: `${n.fullPath}:${e.refreshKey}` }))]),
|
|
446
662
|
_: 1
|
|
447
663
|
})]),
|
|
448
664
|
_: 1
|
|
449
665
|
});
|
|
450
666
|
};
|
|
451
667
|
}
|
|
452
|
-
}),
|
|
668
|
+
}), dn = ["title"], fn = /* @__PURE__ */ u(/* @__PURE__ */ M({
|
|
453
669
|
__name: "ThemeToggleButton",
|
|
454
670
|
setup(e) {
|
|
455
|
-
let t =
|
|
671
|
+
let t = Z();
|
|
456
672
|
async function n(e) {
|
|
457
|
-
await
|
|
673
|
+
await wt(e, () => {
|
|
458
674
|
t.toggleDarkMode();
|
|
459
675
|
});
|
|
460
676
|
}
|
|
461
677
|
return (e, r) => {
|
|
462
678
|
let i = z("el-icon");
|
|
463
|
-
return
|
|
679
|
+
return F(), O("button", {
|
|
464
680
|
type: "button",
|
|
465
681
|
class: "app-layout__header-tool-btn theme-icon-btn",
|
|
466
682
|
title: H(t).isDark ? "切换浅色模式" : "切换深色模式",
|
|
467
683
|
onClick: n
|
|
468
684
|
}, [j(i, { size: 20 }, {
|
|
469
|
-
default:
|
|
685
|
+
default: W(() => [(F(), E(B(H(t).isDark ? H(Ae) : H(Te))))]),
|
|
470
686
|
_: 1
|
|
471
|
-
})], 8,
|
|
687
|
+
})], 8, dn);
|
|
472
688
|
};
|
|
473
689
|
}
|
|
474
690
|
}), [["__scopeId", "data-v-73aaf569"]]);
|
|
475
691
|
//#endregion
|
|
476
692
|
//#region src/main/layouts/composables/useAppMenus.ts
|
|
477
|
-
function
|
|
478
|
-
let e =
|
|
693
|
+
function pn() {
|
|
694
|
+
let e = _(), t = v(), n = Z(), r = a(), i = T(() => mn(t.options.routes.find((e) => e.path === "/")?.children ?? [], "", r.hasPermission)), o = T(() => i.value), s = T(() => n.layoutMode === "mix" ? i.value.find((e) => e.fullPath === n.selectedTopMenuPath)?.children ?? [] : i.value), c = T(() => hn(i.value).filter((e) => !e.children?.length)), l = T(() => hn(s.value).filter((e) => !e.children?.length));
|
|
479
695
|
return {
|
|
480
|
-
activeMenu:
|
|
481
|
-
activeTopMenuPath:
|
|
696
|
+
activeMenu: T(() => e.path),
|
|
697
|
+
activeTopMenuPath: T(() => {
|
|
482
698
|
let t = e.path;
|
|
483
699
|
return o.value.find((e) => t === e.fullPath || t.startsWith(`${e.fullPath}/`))?.fullPath || n.selectedTopMenuPath;
|
|
484
700
|
}),
|
|
485
701
|
allMenus: i,
|
|
486
702
|
flatMenus: c,
|
|
487
703
|
flatSideMenus: l,
|
|
488
|
-
findFirstLeafNode:
|
|
489
|
-
findFirstLeafPath:
|
|
704
|
+
findFirstLeafNode: gn,
|
|
705
|
+
findFirstLeafPath: _n,
|
|
490
706
|
sideMenus: s,
|
|
491
707
|
topMenus: o
|
|
492
708
|
};
|
|
493
709
|
}
|
|
494
|
-
function
|
|
495
|
-
return e.filter((e) => !e.meta?.hidden &&
|
|
496
|
-
let r =
|
|
710
|
+
function mn(e, t, n) {
|
|
711
|
+
return e.filter((e) => !e.meta?.hidden && yn(e, n)).map((e) => {
|
|
712
|
+
let r = xn(e.path, t), i = e.children?.length ? mn(e.children, r, n) : void 0;
|
|
497
713
|
return {
|
|
498
714
|
path: e.path,
|
|
499
715
|
fullPath: r,
|
|
@@ -501,104 +717,104 @@ function Pt(e, t, n) {
|
|
|
501
717
|
icon: e.meta?.icon ? String(e.meta.icon) : void 0,
|
|
502
718
|
children: i
|
|
503
719
|
};
|
|
504
|
-
}).filter((t) => t.children?.length || !
|
|
720
|
+
}).filter((t) => t.children?.length || !bn(e, t.path));
|
|
505
721
|
}
|
|
506
|
-
function
|
|
507
|
-
return e.flatMap((e) => [e, ...
|
|
722
|
+
function hn(e) {
|
|
723
|
+
return e.flatMap((e) => [e, ...hn(e.children ?? [])]);
|
|
508
724
|
}
|
|
509
|
-
function
|
|
725
|
+
function gn(e) {
|
|
510
726
|
if (!e.children?.length) return e;
|
|
511
727
|
for (let t of e.children) {
|
|
512
|
-
let e =
|
|
728
|
+
let e = gn(t);
|
|
513
729
|
if (e) return e;
|
|
514
730
|
}
|
|
515
731
|
return null;
|
|
516
732
|
}
|
|
517
|
-
function
|
|
733
|
+
function _n(e, t, n = "") {
|
|
518
734
|
for (let r of e) {
|
|
519
|
-
let e =
|
|
520
|
-
if (e === t) return
|
|
735
|
+
let e = xn(r.path, n);
|
|
736
|
+
if (e === t) return vn(r, n);
|
|
521
737
|
if (r.children?.length) {
|
|
522
|
-
let n =
|
|
738
|
+
let n = _n(r.children, t, e);
|
|
523
739
|
if (n) return n;
|
|
524
740
|
}
|
|
525
741
|
}
|
|
526
742
|
return null;
|
|
527
743
|
}
|
|
528
|
-
function
|
|
529
|
-
let n =
|
|
744
|
+
function vn(e, t) {
|
|
745
|
+
let n = xn(e.path, t);
|
|
530
746
|
if (e.component) return n;
|
|
531
747
|
let r = e.children ?? [];
|
|
532
748
|
for (let e of r) {
|
|
533
|
-
let t =
|
|
749
|
+
let t = xn(e.path, n);
|
|
534
750
|
if (e.component) return t;
|
|
535
751
|
}
|
|
536
752
|
for (let e of r) {
|
|
537
|
-
let t =
|
|
753
|
+
let t = vn(e, n);
|
|
538
754
|
if (t) return t;
|
|
539
755
|
}
|
|
540
756
|
return null;
|
|
541
757
|
}
|
|
542
|
-
function
|
|
758
|
+
function yn(e, t) {
|
|
543
759
|
let n = e.meta?.permission;
|
|
544
760
|
return n ? Array.isArray(n) ? n.every((e) => t(String(e))) : t(String(n)) : !0;
|
|
545
761
|
}
|
|
546
|
-
function
|
|
762
|
+
function bn(e, t) {
|
|
547
763
|
let n = e.find((e) => e.path === t);
|
|
548
764
|
return !!(n?.redirect && !n.component && !n.children?.length);
|
|
549
765
|
}
|
|
550
|
-
function
|
|
766
|
+
function xn(e, t) {
|
|
551
767
|
return e.startsWith("/") ? e : `${t}/${e}`.replace(/\/+/g, "/");
|
|
552
768
|
}
|
|
553
769
|
//#endregion
|
|
554
770
|
//#region src/main/layouts/utils/menuIcons.ts
|
|
555
|
-
var
|
|
556
|
-
Connection:
|
|
557
|
-
House:
|
|
558
|
-
Setting:
|
|
559
|
-
User:
|
|
771
|
+
var Sn = {
|
|
772
|
+
Connection: he,
|
|
773
|
+
House: xe,
|
|
774
|
+
Setting: ke,
|
|
775
|
+
User: Ne
|
|
560
776
|
};
|
|
561
|
-
function
|
|
562
|
-
return e ?
|
|
777
|
+
function Cn(e) {
|
|
778
|
+
return e ? Sn[e] ?? xe : xe;
|
|
563
779
|
}
|
|
564
780
|
//#endregion
|
|
565
781
|
//#region src/main/layouts/components/AppHeaderMenuNode.vue
|
|
566
|
-
var
|
|
782
|
+
var wn = /* @__PURE__ */ M({
|
|
567
783
|
name: "AppHeaderMenuNode",
|
|
568
784
|
__name: "AppHeaderMenuNode",
|
|
569
785
|
props: { node: {} },
|
|
570
786
|
setup(e) {
|
|
571
787
|
return (t, n) => {
|
|
572
788
|
let r = z("el-icon"), i = z("AppHeaderMenuNode", !0), a = z("el-sub-menu"), o = z("el-menu-item");
|
|
573
|
-
return e.node.children?.length ? (
|
|
789
|
+
return e.node.children?.length ? (F(), E(a, {
|
|
574
790
|
key: 0,
|
|
575
791
|
index: e.node.fullPath
|
|
576
792
|
}, {
|
|
577
|
-
title:
|
|
578
|
-
default:
|
|
793
|
+
title: W(() => [e.node.icon ? (F(), E(r, { key: 0 }, {
|
|
794
|
+
default: W(() => [(F(), E(B(H(Cn)(e.node.icon))))]),
|
|
579
795
|
_: 1
|
|
580
796
|
})) : D("", !0), k("span", null, V(e.node.title), 1)]),
|
|
581
|
-
default:
|
|
797
|
+
default: W(() => [(F(!0), O(S, null, R(e.node.children, (e) => (F(), E(i, {
|
|
582
798
|
key: e.fullPath,
|
|
583
799
|
node: e
|
|
584
800
|
}, null, 8, ["node"]))), 128))]),
|
|
585
801
|
_: 1
|
|
586
|
-
}, 8, ["index"])) : (
|
|
802
|
+
}, 8, ["index"])) : (F(), E(o, {
|
|
587
803
|
key: 1,
|
|
588
804
|
index: e.node.fullPath
|
|
589
805
|
}, {
|
|
590
|
-
default:
|
|
591
|
-
default:
|
|
806
|
+
default: W(() => [e.node.icon ? (F(), E(r, { key: 0 }, {
|
|
807
|
+
default: W(() => [(F(), E(B(H(Cn)(e.node.icon))))]),
|
|
592
808
|
_: 1
|
|
593
809
|
})) : D("", !0), k("span", null, V(e.node.title), 1)]),
|
|
594
810
|
_: 1
|
|
595
811
|
}, 8, ["index"]));
|
|
596
812
|
};
|
|
597
813
|
}
|
|
598
|
-
}),
|
|
814
|
+
}), Tn = "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", En = { class: "app-menu-search-item__icon" }, Dn = { class: "app-menu-search-item__body" }, On = {
|
|
599
815
|
key: 0,
|
|
600
816
|
class: "app-menu-search-item__actions"
|
|
601
|
-
},
|
|
817
|
+
}, kn = { class: "app-menu-search-item__enter" }, An = ["src"], jn = /* @__PURE__ */ M({
|
|
602
818
|
__name: "AppMenuSearchItem",
|
|
603
819
|
props: {
|
|
604
820
|
active: { type: Boolean },
|
|
@@ -614,7 +830,7 @@ var Ut = /* @__PURE__ */ M({
|
|
|
614
830
|
let n = t;
|
|
615
831
|
return (t, r) => {
|
|
616
832
|
let i = z("el-icon");
|
|
617
|
-
return
|
|
833
|
+
return F(), O("div", {
|
|
618
834
|
class: P(["app-menu-search-item", { "is-active": e.active }]),
|
|
619
835
|
onMouseenter: r[4] ||= (t) => n("enter", e.item)
|
|
620
836
|
}, [k("div", {
|
|
@@ -622,26 +838,26 @@ var Ut = /* @__PURE__ */ M({
|
|
|
622
838
|
role: "button",
|
|
623
839
|
tabindex: "0",
|
|
624
840
|
onClick: r[1] ||= (t) => n("select", e.item),
|
|
625
|
-
onKeydown: [r[2] ||= K(
|
|
841
|
+
onKeydown: [r[2] ||= G(K((t) => n("select", e.item), ["prevent"]), ["enter"]), r[3] ||= G(K((t) => n("select", e.item), ["prevent"]), ["space"])]
|
|
626
842
|
}, [
|
|
627
|
-
k("span",
|
|
628
|
-
default:
|
|
843
|
+
k("span", En, [j(i, null, {
|
|
844
|
+
default: W(() => [(F(), E(B(H(Cn)(e.item.icon))))]),
|
|
629
845
|
_: 1
|
|
630
846
|
})]),
|
|
631
|
-
k("span",
|
|
632
|
-
j(
|
|
633
|
-
default:
|
|
634
|
-
src: H(
|
|
847
|
+
k("span", Dn, [k("strong", null, V(e.item.title), 1), k("span", null, V(e.item.fullPath), 1)]),
|
|
848
|
+
j(C, { name: "app-menu-search-actions" }, {
|
|
849
|
+
default: W(() => [e.active ? (F(), O("span", On, [k("span", kn, [k("img", {
|
|
850
|
+
src: H(Tn),
|
|
635
851
|
alt: "",
|
|
636
852
|
"aria-hidden": "true"
|
|
637
|
-
}, null, 8,
|
|
853
|
+
}, null, 8, An)]), e.removable ? (F(), O("button", {
|
|
638
854
|
key: 0,
|
|
639
855
|
class: "app-menu-search-item__remove",
|
|
640
856
|
type: "button",
|
|
641
857
|
"aria-label": "删除搜索历史",
|
|
642
|
-
onClick: r[0] ||=
|
|
858
|
+
onClick: r[0] ||= K((t) => n("remove", e.item), ["stop"])
|
|
643
859
|
}, [j(i, null, {
|
|
644
|
-
default:
|
|
860
|
+
default: W(() => [j(H(me))]),
|
|
645
861
|
_: 1
|
|
646
862
|
})])) : D("", !0)])) : D("", !0)]),
|
|
647
863
|
_: 1
|
|
@@ -649,57 +865,57 @@ var Ut = /* @__PURE__ */ M({
|
|
|
649
865
|
], 32)], 34);
|
|
650
866
|
};
|
|
651
867
|
}
|
|
652
|
-
}),
|
|
868
|
+
}), Mn = { class: "app-menu-search__control" }, Nn = {
|
|
653
869
|
key: 0,
|
|
654
870
|
class: "app-menu-search__section"
|
|
655
|
-
},
|
|
871
|
+
}, Pn = {
|
|
656
872
|
key: 1,
|
|
657
873
|
class: "app-menu-search__section"
|
|
658
|
-
},
|
|
874
|
+
}, Fn = {
|
|
659
875
|
key: 2,
|
|
660
876
|
class: "app-menu-search__empty"
|
|
661
|
-
},
|
|
877
|
+
}, In = { class: "app-menu-search__footer" }, Ln = "menu-search-history", Rn = 8, zn = 70, Bn = 28, Vn = 520, Hn = /* @__PURE__ */ M({
|
|
662
878
|
__name: "AppMenuSearch",
|
|
663
879
|
props: { modelValue: { type: Boolean } },
|
|
664
880
|
emits: ["update:modelValue"],
|
|
665
881
|
setup(e, { emit: t }) {
|
|
666
|
-
let n = e, r = t, i =
|
|
882
|
+
let n = e, r = t, i = v(), { flatMenus: a } = pn(), o = L(), s = L(), c = L(""), l = L(0), u = L(null), d = L(ae()), f = T(() => c.value.trim().toLowerCase()), p = T(() => f.value ? a.value.filter((e) => {
|
|
667
883
|
let t = e.title.toLowerCase(), n = e.fullPath.toLowerCase();
|
|
668
884
|
return t.includes(f.value) || n.includes(f.value);
|
|
669
|
-
}) : []), m =
|
|
885
|
+
}) : []), m = T(() => c.value ? p.value : d.value), h = T(() => c.value ? !p.value.length : !d.value.length);
|
|
670
886
|
U(() => n.modelValue, (e) => {
|
|
671
887
|
if (!e) {
|
|
672
|
-
|
|
888
|
+
G();
|
|
673
889
|
return;
|
|
674
890
|
}
|
|
675
|
-
d.value =
|
|
891
|
+
d.value = ae(), c.value = "", u.value = d.value[0] ?? null, l.value = 0, document.body.classList.add("app-menu-search-open"), oe(), N(() => {
|
|
676
892
|
o.value?.focus?.(), s.value?.setScrollTop?.(0);
|
|
677
893
|
});
|
|
678
894
|
}), U(p, (e) => {
|
|
679
895
|
u.value = e[0] ?? null, s.value?.setScrollTop?.(0);
|
|
680
|
-
}),
|
|
681
|
-
|
|
896
|
+
}), re(() => {
|
|
897
|
+
G();
|
|
682
898
|
});
|
|
683
899
|
function g() {
|
|
684
|
-
r("update:modelValue", !1),
|
|
900
|
+
r("update:modelValue", !1), G();
|
|
685
901
|
}
|
|
686
|
-
function
|
|
902
|
+
function _(e) {
|
|
687
903
|
u.value = e;
|
|
688
904
|
}
|
|
689
905
|
function y(e) {
|
|
690
|
-
|
|
906
|
+
ie(e), g(), i.push(e.fullPath);
|
|
691
907
|
}
|
|
692
908
|
function b(e) {
|
|
693
909
|
let t = d.value.filter((t) => t.fullPath !== e.fullPath);
|
|
694
|
-
|
|
910
|
+
I(t), u.value?.fullPath === e.fullPath && (u.value = t[0] ?? null);
|
|
695
911
|
}
|
|
696
|
-
function
|
|
697
|
-
|
|
912
|
+
function x() {
|
|
913
|
+
I([]), u.value = null;
|
|
698
914
|
}
|
|
699
|
-
function
|
|
915
|
+
function te(e) {
|
|
700
916
|
l.value = e.scrollTop;
|
|
701
917
|
}
|
|
702
|
-
function
|
|
918
|
+
function M(e) {
|
|
703
919
|
if (n.modelValue && !e.isComposing) {
|
|
704
920
|
if (e.code === "Escape") {
|
|
705
921
|
e.preventDefault(), g();
|
|
@@ -709,25 +925,25 @@ var Ut = /* @__PURE__ */ M({
|
|
|
709
925
|
e.preventDefault(), y(u.value);
|
|
710
926
|
return;
|
|
711
927
|
}
|
|
712
|
-
(e.code === "ArrowDown" || e.code === "ArrowUp") && (e.preventDefault(),
|
|
928
|
+
(e.code === "ArrowDown" || e.code === "ArrowUp") && (e.preventDefault(), P(e.code === "ArrowDown" ? 1 : -1));
|
|
713
929
|
}
|
|
714
930
|
}
|
|
715
|
-
function
|
|
931
|
+
function P(e) {
|
|
716
932
|
let t = m.value;
|
|
717
933
|
if (!t.length) return;
|
|
718
|
-
let n =
|
|
934
|
+
let n = B((u.value ? t.findIndex((e) => e.fullPath === u.value?.fullPath) : -1) + e, 0, t.length - 1), r = t[n];
|
|
719
935
|
r && (u.value = r, ne(n));
|
|
720
936
|
}
|
|
721
937
|
function ne(e) {
|
|
722
|
-
let t =
|
|
723
|
-
t < n ? s.value?.setScrollTop?.(t) : t > r && s.value?.setScrollTop?.(t -
|
|
938
|
+
let t = Bn + e * zn, n = l.value, r = l.value + Vn - zn;
|
|
939
|
+
t < n ? s.value?.setScrollTop?.(t) : t > r && s.value?.setScrollTop?.(t - Vn + zn);
|
|
724
940
|
}
|
|
725
|
-
function
|
|
726
|
-
|
|
941
|
+
function ie(e) {
|
|
942
|
+
I([e, ...d.value.filter((t) => t.fullPath !== e.fullPath)].slice(0, Rn));
|
|
727
943
|
}
|
|
728
|
-
function
|
|
944
|
+
function ae() {
|
|
729
945
|
try {
|
|
730
|
-
let e = localStorage.getItem(
|
|
946
|
+
let e = localStorage.getItem(Ln);
|
|
731
947
|
if (!e) return [];
|
|
732
948
|
let t = JSON.parse(e), n = new Set(a.value.map((e) => e.fullPath));
|
|
733
949
|
return t.filter((e) => n.has(e.fullPath));
|
|
@@ -735,35 +951,35 @@ var Ut = /* @__PURE__ */ M({
|
|
|
735
951
|
return [];
|
|
736
952
|
}
|
|
737
953
|
}
|
|
738
|
-
function
|
|
954
|
+
function I(e) {
|
|
739
955
|
if (d.value = e, !e.length) {
|
|
740
|
-
localStorage.removeItem(
|
|
956
|
+
localStorage.removeItem(Ln);
|
|
741
957
|
return;
|
|
742
958
|
}
|
|
743
|
-
localStorage.setItem(
|
|
959
|
+
localStorage.setItem(Ln, JSON.stringify(e));
|
|
744
960
|
}
|
|
745
|
-
function
|
|
961
|
+
function B(e, t, n) {
|
|
746
962
|
return Math.min(Math.max(e, t), n);
|
|
747
963
|
}
|
|
748
|
-
function
|
|
749
|
-
window.removeEventListener("keydown",
|
|
964
|
+
function oe() {
|
|
965
|
+
window.removeEventListener("keydown", M, !0), window.addEventListener("keydown", M, !0);
|
|
750
966
|
}
|
|
751
|
-
function
|
|
752
|
-
document.body.classList.remove("app-menu-search-open"), window.removeEventListener("keydown",
|
|
967
|
+
function G() {
|
|
968
|
+
document.body.classList.remove("app-menu-search-open"), window.removeEventListener("keydown", M, !0);
|
|
753
969
|
}
|
|
754
970
|
return (t, n) => {
|
|
755
971
|
let r = z("el-icon"), i = z("el-input"), a = z("el-scrollbar");
|
|
756
|
-
return
|
|
757
|
-
default:
|
|
972
|
+
return F(), E(ee, { to: "body" }, [j(C, { name: "app-menu-search-fade" }, {
|
|
973
|
+
default: W(() => [e.modelValue ? (F(), O("section", {
|
|
758
974
|
key: 0,
|
|
759
975
|
class: "app-menu-search",
|
|
760
976
|
tabindex: "-1",
|
|
761
|
-
onClick:
|
|
977
|
+
onClick: K(g, ["self"])
|
|
762
978
|
}, [k("div", {
|
|
763
979
|
class: "app-menu-search__panel",
|
|
764
|
-
onClick: n[1] ||=
|
|
980
|
+
onClick: n[1] ||= K(() => {}, ["stop"])
|
|
765
981
|
}, [
|
|
766
|
-
k("div",
|
|
982
|
+
k("div", Mn, [j(i, {
|
|
767
983
|
ref_key: "searchInputRef",
|
|
768
984
|
ref: o,
|
|
769
985
|
modelValue: c.value,
|
|
@@ -772,8 +988,8 @@ var Ut = /* @__PURE__ */ M({
|
|
|
772
988
|
placeholder: "搜索页面名称或路径",
|
|
773
989
|
clearable: ""
|
|
774
990
|
}, {
|
|
775
|
-
prefix:
|
|
776
|
-
default:
|
|
991
|
+
prefix: W(() => [j(r, null, {
|
|
992
|
+
default: W(() => [j(H(Oe))]),
|
|
777
993
|
_: 1
|
|
778
994
|
})]),
|
|
779
995
|
_: 1
|
|
@@ -783,56 +999,56 @@ var Ut = /* @__PURE__ */ M({
|
|
|
783
999
|
ref: s,
|
|
784
1000
|
class: "app-menu-search__scroll",
|
|
785
1001
|
"max-height": "520px",
|
|
786
|
-
onScroll:
|
|
1002
|
+
onScroll: te
|
|
787
1003
|
}, {
|
|
788
|
-
default:
|
|
789
|
-
p.value.length ? (
|
|
1004
|
+
default: W(() => [
|
|
1005
|
+
p.value.length ? (F(), O("div", Nn, [n[2] ||= k("div", { class: "app-menu-search__section-title" }, "页面", -1), j(w, {
|
|
790
1006
|
name: "app-menu-search-list",
|
|
791
1007
|
tag: "div",
|
|
792
1008
|
class: "app-menu-search__list"
|
|
793
1009
|
}, {
|
|
794
|
-
default:
|
|
1010
|
+
default: W(() => [(F(!0), O(S, null, R(p.value, (e) => (F(), E(jn, {
|
|
795
1011
|
key: e.fullPath,
|
|
796
1012
|
active: u.value?.fullPath === e.fullPath,
|
|
797
1013
|
item: e,
|
|
798
|
-
onEnter:
|
|
1014
|
+
onEnter: _,
|
|
799
1015
|
onSelect: y
|
|
800
1016
|
}, null, 8, ["active", "item"]))), 128))]),
|
|
801
1017
|
_: 1
|
|
802
1018
|
})])) : D("", !0),
|
|
803
|
-
!c.value && d.value.length ? (
|
|
1019
|
+
!c.value && d.value.length ? (F(), O("div", Pn, [k("div", { class: "app-menu-search__section-header" }, [n[3] ||= k("div", { class: "app-menu-search__section-title" }, "搜索历史", -1), k("button", {
|
|
804
1020
|
class: "app-menu-search__clear",
|
|
805
1021
|
type: "button",
|
|
806
|
-
onClick:
|
|
807
|
-
}, " 清空 ")]), j(
|
|
1022
|
+
onClick: x
|
|
1023
|
+
}, " 清空 ")]), j(w, {
|
|
808
1024
|
name: "app-menu-search-list",
|
|
809
1025
|
tag: "div",
|
|
810
1026
|
class: "app-menu-search__list"
|
|
811
1027
|
}, {
|
|
812
|
-
default:
|
|
1028
|
+
default: W(() => [(F(!0), O(S, null, R(d.value, (e) => (F(), E(jn, {
|
|
813
1029
|
key: e.fullPath,
|
|
814
1030
|
active: u.value?.fullPath === e.fullPath,
|
|
815
1031
|
item: e,
|
|
816
1032
|
removable: "",
|
|
817
|
-
onEnter:
|
|
1033
|
+
onEnter: _,
|
|
818
1034
|
onRemove: b,
|
|
819
1035
|
onSelect: y
|
|
820
1036
|
}, null, 8, ["active", "item"]))), 128))]),
|
|
821
1037
|
_: 1
|
|
822
1038
|
})])) : D("", !0),
|
|
823
|
-
h.value ? (
|
|
1039
|
+
h.value ? (F(), O("div", Fn, V(c.value ? "没有匹配的页面" : "没有搜索历史"), 1)) : D("", !0)
|
|
824
1040
|
]),
|
|
825
1041
|
_: 1
|
|
826
1042
|
}, 512),
|
|
827
|
-
k("div",
|
|
1043
|
+
k("div", In, [
|
|
828
1044
|
n[5] ||= k("span", null, [k("kbd", null, "Enter"), A("选择")], -1),
|
|
829
1045
|
k("span", null, [
|
|
830
1046
|
j(r, null, {
|
|
831
|
-
default:
|
|
1047
|
+
default: W(() => [j(H(le))]),
|
|
832
1048
|
_: 1
|
|
833
1049
|
}),
|
|
834
1050
|
j(r, null, {
|
|
835
|
-
default:
|
|
1051
|
+
default: W(() => [j(H(de))]),
|
|
836
1052
|
_: 1
|
|
837
1053
|
}),
|
|
838
1054
|
n[4] ||= A("切换", -1)
|
|
@@ -847,148 +1063,148 @@ var Ut = /* @__PURE__ */ M({
|
|
|
847
1063
|
});
|
|
848
1064
|
//#endregion
|
|
849
1065
|
//#region src/main/layouts/composables/useShortcutLabel.ts
|
|
850
|
-
function
|
|
851
|
-
let e =
|
|
1066
|
+
function Un() {
|
|
1067
|
+
let e = T(() => typeof navigator > "u" ? !1 : /Mac|iPhone|iPad|iPod/i.test(navigator.platform));
|
|
852
1068
|
return {
|
|
853
1069
|
isMac: e,
|
|
854
|
-
searchShortcutLabel:
|
|
1070
|
+
searchShortcutLabel: T(() => e.value ? "⌘ K" : "Ctrl K")
|
|
855
1071
|
};
|
|
856
1072
|
}
|
|
857
1073
|
//#endregion
|
|
858
1074
|
//#region src/main/layouts/components/AppMenuSearchTrigger.vue?vue&type=script&setup=true&lang.ts
|
|
859
|
-
var
|
|
1075
|
+
var Wn = { class: "app-menu-search-trigger__shortcut" }, Gn = /* @__PURE__ */ M({
|
|
860
1076
|
__name: "AppMenuSearchTrigger",
|
|
861
1077
|
props: { layoutMode: {} },
|
|
862
1078
|
emits: ["open"],
|
|
863
1079
|
setup(e, { emit: t }) {
|
|
864
|
-
let n = t, { searchShortcutLabel: r } =
|
|
1080
|
+
let n = t, { searchShortcutLabel: r } = Un();
|
|
865
1081
|
return (t, i) => {
|
|
866
1082
|
let a = z("el-icon");
|
|
867
|
-
return
|
|
1083
|
+
return F(), O("button", {
|
|
868
1084
|
class: P(["app-menu-search-trigger", `app-menu-search-trigger--${e.layoutMode}`]),
|
|
869
1085
|
type: "button",
|
|
870
1086
|
"aria-label": "搜索页面",
|
|
871
1087
|
onClick: i[0] ||= (e) => n("open")
|
|
872
1088
|
}, [
|
|
873
1089
|
j(a, null, {
|
|
874
|
-
default:
|
|
1090
|
+
default: W(() => [j(H(Oe))]),
|
|
875
1091
|
_: 1
|
|
876
1092
|
}),
|
|
877
1093
|
i[1] ||= k("span", { class: "app-menu-search-trigger__text" }, "搜索页面", -1),
|
|
878
|
-
k("span",
|
|
1094
|
+
k("span", Wn, V(H(r)), 1)
|
|
879
1095
|
], 2);
|
|
880
1096
|
};
|
|
881
1097
|
}
|
|
882
|
-
}),
|
|
1098
|
+
}), Kn = { class: "app-layout__header-left" }, qn = {
|
|
883
1099
|
key: 0,
|
|
884
1100
|
class: "app-layout__header-brand"
|
|
885
|
-
},
|
|
1101
|
+
}, Jn = ["src", "alt"], Yn = { class: "app-layout__header-right" }, Xn = { class: "app-layout__user" }, Zn = { class: "app-layout__user-copy" }, Qn = /* @__PURE__ */ M({
|
|
886
1102
|
__name: "AppHeader",
|
|
887
1103
|
props: { breadcrumbItems: {} },
|
|
888
1104
|
setup(e) {
|
|
889
|
-
let t = e, n =
|
|
890
|
-
|
|
891
|
-
window.addEventListener("keydown",
|
|
892
|
-
}),
|
|
893
|
-
window.removeEventListener("keydown",
|
|
1105
|
+
let t = e, n = Z(), r = a(), i = l(), o = Y(), s = v(), c = _(), u = L(!1), { activeTopMenuPath: d, findFirstLeafNode: f, findFirstLeafPath: p, topMenus: m } = pn(), h = T(() => n.themeColorPosition === "header" ? i.logoHeader : i.logoExpanded), g = T(() => n.themeColorPosition === "header" && h.value === i.logoExpanded);
|
|
1106
|
+
ie(() => {
|
|
1107
|
+
window.addEventListener("keydown", w, { capture: !0 });
|
|
1108
|
+
}), re(() => {
|
|
1109
|
+
window.removeEventListener("keydown", w, { capture: !0 });
|
|
894
1110
|
});
|
|
895
|
-
function
|
|
896
|
-
if (n !== t.breadcrumbItems.length - 1) return
|
|
1111
|
+
function y(e, n) {
|
|
1112
|
+
if (n !== t.breadcrumbItems.length - 1) return p(s.options.routes, e.path) || e.path || "/";
|
|
897
1113
|
}
|
|
898
|
-
async function
|
|
1114
|
+
async function b() {
|
|
899
1115
|
await o.resetTabs(), n.setSelectedTopMenuPath(""), await r.logout(), s.push("/login");
|
|
900
1116
|
}
|
|
901
|
-
function
|
|
1117
|
+
function x(e) {
|
|
902
1118
|
s.push(e);
|
|
903
1119
|
}
|
|
904
|
-
function
|
|
905
|
-
let t =
|
|
1120
|
+
function ee(e) {
|
|
1121
|
+
let t = m.value.find((t) => t.fullPath === e);
|
|
906
1122
|
if (!t) return;
|
|
907
1123
|
n.setSelectedTopMenuPath(t.fullPath);
|
|
908
|
-
let r =
|
|
1124
|
+
let r = f(t)?.fullPath || t.fullPath;
|
|
909
1125
|
s.push(r);
|
|
910
1126
|
}
|
|
911
|
-
function
|
|
1127
|
+
function C() {
|
|
912
1128
|
u.value = !0;
|
|
913
1129
|
}
|
|
914
|
-
function
|
|
915
|
-
e.defaultPrevented || e.repeat || u.value || !(/Mac|iPhone|iPad|iPod/i.test(navigator.platform) ? e.metaKey : e.ctrlKey) || e.code !== "KeyK" || (e.preventDefault(),
|
|
1130
|
+
function w(e) {
|
|
1131
|
+
e.defaultPrevented || e.repeat || u.value || !(/Mac|iPhone|iPad|iPod/i.test(navigator.platform) ? e.metaKey : e.ctrlKey) || e.code !== "KeyK" || (e.preventDefault(), C());
|
|
916
1132
|
}
|
|
917
1133
|
return (t, a) => {
|
|
918
|
-
let o = z("el-icon"), s = z("el-menu"), l = z("el-menu-item"), f = z("el-breadcrumb-item"), p = z("el-breadcrumb"),
|
|
919
|
-
return
|
|
920
|
-
default:
|
|
921
|
-
k("div",
|
|
922
|
-
H(n).layoutMode === "mix" ? D("", !0) : (
|
|
923
|
-
src:
|
|
1134
|
+
let o = z("el-icon"), s = z("el-menu"), l = z("el-menu-item"), f = z("el-breadcrumb-item"), p = z("el-breadcrumb"), _ = z("el-avatar"), v = z("el-dropdown-item"), w = z("el-dropdown-menu"), T = z("el-dropdown"), te = z("el-header");
|
|
1135
|
+
return F(), O(S, null, [j(te, { class: "app-layout__header" }, {
|
|
1136
|
+
default: W(() => [
|
|
1137
|
+
k("div", Kn, [
|
|
1138
|
+
H(n).layoutMode === "mix" ? D("", !0) : (F(), O("div", qn, [k("img", {
|
|
1139
|
+
src: h.value,
|
|
924
1140
|
alt: H(i).systemName,
|
|
925
|
-
class: P(["app-layout__header-brand-image", { "is-fallback-inverted":
|
|
926
|
-
}, null, 10,
|
|
927
|
-
H(n).layoutMode === "top" ? D("", !0) : (
|
|
1141
|
+
class: P(["app-layout__header-brand-image", { "is-fallback-inverted": g.value }])
|
|
1142
|
+
}, null, 10, Jn)])),
|
|
1143
|
+
H(n).layoutMode === "top" ? D("", !0) : (F(), O("button", {
|
|
928
1144
|
key: 1,
|
|
929
1145
|
type: "button",
|
|
930
1146
|
class: "app-layout__header-tool-btn app-layout__header-tool-btn--collapse",
|
|
931
1147
|
onClick: a[0] ||= (e) => H(n).toggleSidebar()
|
|
932
1148
|
}, [j(o, null, {
|
|
933
|
-
default:
|
|
1149
|
+
default: W(() => [(F(), E(B(H(n).sidebarCollapsed ? H(ve) : H(ye))))]),
|
|
934
1150
|
_: 1
|
|
935
1151
|
})])),
|
|
936
|
-
H(n).layoutMode === "top" ? (
|
|
1152
|
+
H(n).layoutMode === "top" ? (F(), E(s, {
|
|
937
1153
|
key: 2,
|
|
938
1154
|
mode: "horizontal",
|
|
939
1155
|
ellipsis: !1,
|
|
940
1156
|
"default-active": H(c).path,
|
|
941
1157
|
class: "app-layout__header-menu",
|
|
942
|
-
onSelect:
|
|
1158
|
+
onSelect: x
|
|
943
1159
|
}, {
|
|
944
|
-
default:
|
|
1160
|
+
default: W(() => [(F(!0), O(S, null, R(H(m), (e) => (F(), E(wn, {
|
|
945
1161
|
key: e.fullPath,
|
|
946
1162
|
node: e
|
|
947
1163
|
}, null, 8, ["node"]))), 128))]),
|
|
948
1164
|
_: 1
|
|
949
|
-
}, 8, ["default-active"])) : H(n).layoutMode === "mix" ? (
|
|
1165
|
+
}, 8, ["default-active"])) : H(n).layoutMode === "mix" ? (F(), E(s, {
|
|
950
1166
|
key: 3,
|
|
951
1167
|
mode: "horizontal",
|
|
952
1168
|
ellipsis: !1,
|
|
953
1169
|
"default-active": H(d),
|
|
954
1170
|
class: "app-layout__header-menu app-layout__header-menu--mix",
|
|
955
|
-
onSelect:
|
|
1171
|
+
onSelect: ee
|
|
956
1172
|
}, {
|
|
957
|
-
default:
|
|
1173
|
+
default: W(() => [(F(!0), O(S, null, R(H(m), (e) => (F(), E(l, {
|
|
958
1174
|
key: e.fullPath,
|
|
959
1175
|
index: e.fullPath
|
|
960
1176
|
}, {
|
|
961
|
-
default:
|
|
1177
|
+
default: W(() => [A(V(e.title), 1)]),
|
|
962
1178
|
_: 2
|
|
963
1179
|
}, 1032, ["index"]))), 128))]),
|
|
964
1180
|
_: 1
|
|
965
1181
|
}, 8, ["default-active"])) : D("", !0),
|
|
966
|
-
H(n).layoutMode === "side" ? (
|
|
1182
|
+
H(n).layoutMode === "side" ? (F(), E(p, {
|
|
967
1183
|
key: 4,
|
|
968
|
-
"separator-icon": H(
|
|
1184
|
+
"separator-icon": H(ue)
|
|
969
1185
|
}, {
|
|
970
|
-
default:
|
|
1186
|
+
default: W(() => [(F(!0), O(S, null, R(e.breadcrumbItems, (e, t) => (F(), E(f, {
|
|
971
1187
|
key: e.path || String(e.name),
|
|
972
|
-
to:
|
|
1188
|
+
to: y(e, t)
|
|
973
1189
|
}, {
|
|
974
|
-
default:
|
|
1190
|
+
default: W(() => [A(V(e.meta.title), 1)]),
|
|
975
1191
|
_: 2
|
|
976
1192
|
}, 1032, ["to"]))), 128))]),
|
|
977
1193
|
_: 1
|
|
978
1194
|
}, 8, ["separator-icon"])) : D("", !0)
|
|
979
1195
|
]),
|
|
980
|
-
H(n).layoutMode !== "mix" && !H(n).isSidebarMenuSearch ? (
|
|
1196
|
+
H(n).layoutMode !== "mix" && !H(n).isSidebarMenuSearch ? (F(), O("div", {
|
|
981
1197
|
key: 0,
|
|
982
1198
|
class: P(["app-layout__header-search", `app-layout__header-search--${H(n).layoutMode}`])
|
|
983
|
-
}, [j(
|
|
1199
|
+
}, [j(Gn, {
|
|
984
1200
|
"layout-mode": H(n).layoutMode,
|
|
985
|
-
onOpen:
|
|
1201
|
+
onOpen: C
|
|
986
1202
|
}, null, 8, ["layout-mode"])], 2)) : D("", !0),
|
|
987
|
-
k("div",
|
|
988
|
-
H(n).layoutMode === "mix" && !H(n).isSidebarMenuSearch ? (
|
|
1203
|
+
k("div", Yn, [
|
|
1204
|
+
H(n).layoutMode === "mix" && !H(n).isSidebarMenuSearch ? (F(), E(Gn, {
|
|
989
1205
|
key: 0,
|
|
990
1206
|
"layout-mode": H(n).layoutMode,
|
|
991
|
-
onOpen:
|
|
1207
|
+
onOpen: C
|
|
992
1208
|
}, null, 8, ["layout-mode"])) : D("", !0),
|
|
993
1209
|
k("button", {
|
|
994
1210
|
type: "button",
|
|
@@ -999,35 +1215,35 @@ var un = { class: "app-menu-search-trigger__shortcut" }, dn = /* @__PURE__ */ M(
|
|
|
999
1215
|
size: 18,
|
|
1000
1216
|
class: "app-layout__header-tool-icon"
|
|
1001
1217
|
}, {
|
|
1002
|
-
default:
|
|
1218
|
+
default: W(() => [j(H(pe))]),
|
|
1003
1219
|
_: 1
|
|
1004
1220
|
})]),
|
|
1005
|
-
j(
|
|
1006
|
-
j(
|
|
1007
|
-
dropdown:
|
|
1008
|
-
default:
|
|
1009
|
-
default:
|
|
1010
|
-
default:
|
|
1221
|
+
j(fn),
|
|
1222
|
+
j(T, { onCommand: b }, {
|
|
1223
|
+
dropdown: W(() => [j(w, null, {
|
|
1224
|
+
default: W(() => [j(v, { disabled: "" }, {
|
|
1225
|
+
default: W(() => [j(o, null, {
|
|
1226
|
+
default: W(() => [j(H(ke))]),
|
|
1011
1227
|
_: 1
|
|
1012
1228
|
}), a[3] ||= A(" 个人设置 ", -1)]),
|
|
1013
1229
|
_: 1
|
|
1014
|
-
}), j(
|
|
1015
|
-
default:
|
|
1016
|
-
default:
|
|
1230
|
+
}), j(v, { command: "logout" }, {
|
|
1231
|
+
default: W(() => [j(o, null, {
|
|
1232
|
+
default: W(() => [j(H(je))]),
|
|
1017
1233
|
_: 1
|
|
1018
1234
|
}), a[4] ||= A(" 退出登录 ", -1)]),
|
|
1019
1235
|
_: 1
|
|
1020
1236
|
})]),
|
|
1021
1237
|
_: 1
|
|
1022
1238
|
})]),
|
|
1023
|
-
default:
|
|
1024
|
-
j(
|
|
1025
|
-
default:
|
|
1239
|
+
default: W(() => [k("div", Xn, [
|
|
1240
|
+
j(_, { size: 32 }, {
|
|
1241
|
+
default: W(() => [A(V(H(r).userName.slice(0, 1)), 1)]),
|
|
1026
1242
|
_: 1
|
|
1027
1243
|
}),
|
|
1028
|
-
k("div",
|
|
1244
|
+
k("div", Zn, [k("strong", null, V(H(r).userName), 1), k("span", null, V(H(r).userRoleLabel), 1)]),
|
|
1029
1245
|
j(o, null, {
|
|
1030
|
-
default:
|
|
1246
|
+
default: W(() => [j(H(le))]),
|
|
1031
1247
|
_: 1
|
|
1032
1248
|
})
|
|
1033
1249
|
])]),
|
|
@@ -1036,7 +1252,7 @@ var un = { class: "app-menu-search-trigger__shortcut" }, dn = /* @__PURE__ */ M(
|
|
|
1036
1252
|
])
|
|
1037
1253
|
]),
|
|
1038
1254
|
_: 1
|
|
1039
|
-
}), j(
|
|
1255
|
+
}), j(Hn, {
|
|
1040
1256
|
modelValue: u.value,
|
|
1041
1257
|
"onUpdate:modelValue": a[2] ||= (e) => u.value = e
|
|
1042
1258
|
}, null, 8, ["modelValue"])], 64);
|
|
@@ -1045,40 +1261,40 @@ var un = { class: "app-menu-search-trigger__shortcut" }, dn = /* @__PURE__ */ M(
|
|
|
1045
1261
|
});
|
|
1046
1262
|
//#endregion
|
|
1047
1263
|
//#region src/main/layouts/utils/menuSearch.ts
|
|
1048
|
-
function
|
|
1264
|
+
function $n(e, t) {
|
|
1049
1265
|
let n = t.trim().toLowerCase();
|
|
1050
1266
|
if (!n) return [...e];
|
|
1051
1267
|
let r = [];
|
|
1052
1268
|
for (let t of e) {
|
|
1053
|
-
let e =
|
|
1054
|
-
!(
|
|
1269
|
+
let e = $n(t.children ?? [], n);
|
|
1270
|
+
!(nr(t) && tr(t, n)) && !e.length || r.push({
|
|
1055
1271
|
...t,
|
|
1056
1272
|
children: e.length ? e : void 0
|
|
1057
1273
|
});
|
|
1058
1274
|
}
|
|
1059
1275
|
return r;
|
|
1060
1276
|
}
|
|
1061
|
-
function
|
|
1062
|
-
let n =
|
|
1277
|
+
function er(e, t) {
|
|
1278
|
+
let n = rr(e), r = t.trim();
|
|
1063
1279
|
if (!r) return n;
|
|
1064
1280
|
let i = Array.from(e), a = e.toLowerCase(), o = r.toLowerCase(), s = a.indexOf(o);
|
|
1065
|
-
return s < 0 ? n : `${
|
|
1281
|
+
return s < 0 ? n : `${rr(i.slice(0, s).join(""))}<mark class="app-menu-search-highlight">${rr(i.slice(s, s + r.length).join(""))}</mark>${rr(i.slice(s + r.length).join(""))}`;
|
|
1066
1282
|
}
|
|
1067
|
-
function
|
|
1283
|
+
function tr(e, t) {
|
|
1068
1284
|
return e.title.toLowerCase().includes(t);
|
|
1069
1285
|
}
|
|
1070
|
-
function
|
|
1286
|
+
function nr(e) {
|
|
1071
1287
|
return !e.children?.length;
|
|
1072
1288
|
}
|
|
1073
|
-
function
|
|
1289
|
+
function rr(e) {
|
|
1074
1290
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
1075
1291
|
}
|
|
1076
1292
|
//#endregion
|
|
1077
1293
|
//#region src/main/layouts/components/AppSidebarSearch.vue?vue&type=script&setup=true&lang.ts
|
|
1078
|
-
var
|
|
1294
|
+
var ir = {
|
|
1079
1295
|
key: 0,
|
|
1080
1296
|
class: "app-sidebar-search"
|
|
1081
|
-
},
|
|
1297
|
+
}, ar = /* @__PURE__ */ M({
|
|
1082
1298
|
__name: "AppSidebarSearch",
|
|
1083
1299
|
props: {
|
|
1084
1300
|
collapsed: { type: Boolean },
|
|
@@ -1089,21 +1305,21 @@ var wn = {
|
|
|
1089
1305
|
let n = t;
|
|
1090
1306
|
return (t, r) => {
|
|
1091
1307
|
let i = z("el-icon"), a = z("el-input");
|
|
1092
|
-
return e.collapsed ? D("", !0) : (
|
|
1308
|
+
return e.collapsed ? D("", !0) : (F(), O("div", ir, [j(a, {
|
|
1093
1309
|
"model-value": e.keyword,
|
|
1094
1310
|
placeholder: "搜索菜单",
|
|
1095
1311
|
clearable: "",
|
|
1096
1312
|
"onUpdate:modelValue": r[0] ||= (e) => n("update:keyword", e)
|
|
1097
1313
|
}, {
|
|
1098
|
-
prefix:
|
|
1099
|
-
default:
|
|
1314
|
+
prefix: W(() => [j(i, null, {
|
|
1315
|
+
default: W(() => [j(H(Oe))]),
|
|
1100
1316
|
_: 1
|
|
1101
1317
|
})]),
|
|
1102
1318
|
_: 1
|
|
1103
1319
|
}, 8, ["model-value"])]));
|
|
1104
1320
|
};
|
|
1105
1321
|
}
|
|
1106
|
-
}),
|
|
1322
|
+
}), or = ["innerHTML"], sr = ["innerHTML"], cr = /* @__PURE__ */ M({
|
|
1107
1323
|
name: "AppSidebarNode",
|
|
1108
1324
|
__name: "AppSidebarNode",
|
|
1109
1325
|
props: {
|
|
@@ -1111,93 +1327,89 @@ var wn = {
|
|
|
1111
1327
|
keyword: {}
|
|
1112
1328
|
},
|
|
1113
1329
|
setup(e) {
|
|
1114
|
-
let t = e, n =
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
return (t, n) => {
|
|
1119
|
-
let a = z("el-icon"), o = z("AppSidebarNode", !0), s = z("el-sub-menu"), c = z("el-menu-item");
|
|
1120
|
-
return e.node.children?.length ? (I(), E(s, {
|
|
1330
|
+
let t = e, n = T(() => er(t.node.title, t.keyword ?? ""));
|
|
1331
|
+
return (t, r) => {
|
|
1332
|
+
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 ? (F(), E(o, {
|
|
1121
1334
|
key: 0,
|
|
1122
1335
|
index: e.node.fullPath
|
|
1123
1336
|
}, {
|
|
1124
|
-
title:
|
|
1125
|
-
default:
|
|
1337
|
+
title: W(() => [j(i, null, {
|
|
1338
|
+
default: W(() => [(F(), E(B(H(Cn)(e.node.icon))))]),
|
|
1126
1339
|
_: 1
|
|
1127
|
-
}), k("span", { innerHTML:
|
|
1128
|
-
default:
|
|
1340
|
+
}), k("span", { innerHTML: n.value }, null, 8, or)]),
|
|
1341
|
+
default: W(() => [(F(!0), O(S, null, R(e.node.children, (t) => (F(), E(a, {
|
|
1129
1342
|
key: t.fullPath,
|
|
1130
1343
|
node: t,
|
|
1131
1344
|
keyword: e.keyword
|
|
1132
1345
|
}, null, 8, ["node", "keyword"]))), 128))]),
|
|
1133
1346
|
_: 1
|
|
1134
|
-
}, 8, ["index"])) : (
|
|
1347
|
+
}, 8, ["index"])) : (F(), E(s, {
|
|
1135
1348
|
key: 1,
|
|
1136
|
-
index: e.node.fullPath
|
|
1137
|
-
onClick: i
|
|
1349
|
+
index: e.node.fullPath
|
|
1138
1350
|
}, {
|
|
1139
|
-
default:
|
|
1351
|
+
default: W(() => [k("span", { innerHTML: n.value }, null, 8, sr)]),
|
|
1140
1352
|
_: 1
|
|
1141
1353
|
}, 8, ["index"]));
|
|
1142
1354
|
};
|
|
1143
1355
|
}
|
|
1144
|
-
}),
|
|
1356
|
+
}), lr = {
|
|
1145
1357
|
key: 0,
|
|
1146
1358
|
class: "app-layout__brand"
|
|
1147
|
-
},
|
|
1359
|
+
}, ur = ["src", "alt"], dr = ["src", "alt"], fr = /* @__PURE__ */ M({
|
|
1148
1360
|
name: "AppSidebar",
|
|
1149
1361
|
__name: "AppSidebar",
|
|
1150
1362
|
setup(e) {
|
|
1151
|
-
let t =
|
|
1363
|
+
let t = Z(), n = l(), { activeMenu: r, sideMenus: i } = pn(), a = L(""), o = T(() => t.isSidebarMenuSearch ? $n(i.value, a.value) : i.value), s = T(() => !t.isSidebarMenuSearch || !a.value.trim() ? [] : c(o.value));
|
|
1152
1364
|
U(() => t.isSidebarMenuSearch, (e) => {
|
|
1153
1365
|
e || (a.value = "");
|
|
1154
1366
|
});
|
|
1155
|
-
function
|
|
1367
|
+
function c(e) {
|
|
1156
1368
|
let t = [];
|
|
1157
|
-
for (let n of e) n.children?.length && (t.push(n.fullPath), t.push(...
|
|
1369
|
+
for (let n of e) n.children?.length && (t.push(n.fullPath), t.push(...c(n.children)));
|
|
1158
1370
|
return t;
|
|
1159
1371
|
}
|
|
1160
1372
|
return (e, i) => {
|
|
1161
|
-
let
|
|
1162
|
-
return H(t).layoutMode === "top" ? D("", !0) : (
|
|
1373
|
+
let c = z("el-menu"), l = z("el-scrollbar"), u = z("el-aside");
|
|
1374
|
+
return H(t).layoutMode === "top" ? D("", !0) : (F(), E(u, {
|
|
1163
1375
|
key: 0,
|
|
1164
1376
|
width: H(t).sidebarCollapsed ? "72px" : "220px",
|
|
1165
1377
|
class: P(["app-layout__aside", { "is-mix-mode": H(t).layoutMode === "mix" }])
|
|
1166
1378
|
}, {
|
|
1167
|
-
default:
|
|
1168
|
-
H(t).layoutMode === "mix" ? (
|
|
1379
|
+
default: W(() => [
|
|
1380
|
+
H(t).layoutMode === "mix" ? (F(), O("div", lr, [j(C, {
|
|
1169
1381
|
name: "brand-fade",
|
|
1170
1382
|
mode: "out-in"
|
|
1171
1383
|
}, {
|
|
1172
|
-
default:
|
|
1384
|
+
default: W(() => [H(t).sidebarCollapsed ? (F(), O("img", {
|
|
1173
1385
|
key: "collapsed",
|
|
1174
1386
|
src: H(n).logoCollapsed,
|
|
1175
1387
|
alt: H(n).systemName,
|
|
1176
1388
|
class: "app-layout__brand-image app-layout__brand-image--collapsed"
|
|
1177
|
-
}, null, 8,
|
|
1389
|
+
}, null, 8, ur)) : (F(), O("img", {
|
|
1178
1390
|
key: "expanded",
|
|
1179
1391
|
src: H(n).logoExpanded,
|
|
1180
1392
|
alt: H(n).systemName,
|
|
1181
1393
|
class: "app-layout__brand-image app-layout__brand-image--expanded"
|
|
1182
|
-
}, null, 8,
|
|
1394
|
+
}, null, 8, dr))]),
|
|
1183
1395
|
_: 1
|
|
1184
1396
|
})])) : D("", !0),
|
|
1185
|
-
H(t).isSidebarMenuSearch ? (
|
|
1397
|
+
H(t).isSidebarMenuSearch ? (F(), E(ar, {
|
|
1186
1398
|
key: 1,
|
|
1187
1399
|
collapsed: H(t).sidebarCollapsed,
|
|
1188
1400
|
keyword: a.value,
|
|
1189
1401
|
"onUpdate:keyword": i[0] ||= (e) => a.value = e
|
|
1190
1402
|
}, null, 8, ["collapsed", "keyword"])) : D("", !0),
|
|
1191
|
-
j(
|
|
1192
|
-
default:
|
|
1193
|
-
key: c.value,
|
|
1403
|
+
j(l, null, {
|
|
1404
|
+
default: W(() => [j(c, {
|
|
1194
1405
|
collapse: H(t).sidebarCollapsed,
|
|
1195
1406
|
"default-active": H(r),
|
|
1196
1407
|
"default-openeds": s.value,
|
|
1197
1408
|
class: "app-layout__menu",
|
|
1198
|
-
router: ""
|
|
1409
|
+
router: "",
|
|
1410
|
+
"unique-opened": ""
|
|
1199
1411
|
}, {
|
|
1200
|
-
default:
|
|
1412
|
+
default: W(() => [(F(!0), O(S, null, R(o.value, (e) => (F(), E(cr, {
|
|
1201
1413
|
key: e.fullPath,
|
|
1202
1414
|
node: e,
|
|
1203
1415
|
keyword: H(t).isSidebarMenuSearch ? a.value : ""
|
|
@@ -1207,7 +1419,7 @@ var wn = {
|
|
|
1207
1419
|
"collapse",
|
|
1208
1420
|
"default-active",
|
|
1209
1421
|
"default-openeds"
|
|
1210
|
-
])
|
|
1422
|
+
])]),
|
|
1211
1423
|
_: 1
|
|
1212
1424
|
})
|
|
1213
1425
|
]),
|
|
@@ -1218,13 +1430,13 @@ var wn = {
|
|
|
1218
1430
|
});
|
|
1219
1431
|
//#endregion
|
|
1220
1432
|
//#region src/main/composables/useSortable.ts
|
|
1221
|
-
function
|
|
1433
|
+
function pr(e = {}) {
|
|
1222
1434
|
let t = L(null);
|
|
1223
1435
|
function n() {
|
|
1224
1436
|
t.value?.destroy(), t.value = null;
|
|
1225
1437
|
}
|
|
1226
1438
|
function r(r) {
|
|
1227
|
-
r && (n(), t.value =
|
|
1439
|
+
r && (n(), t.value = Re.create(r, {
|
|
1228
1440
|
animation: e.animation ?? 150,
|
|
1229
1441
|
chosenClass: e.chosenClass,
|
|
1230
1442
|
direction: e.direction,
|
|
@@ -1250,7 +1462,7 @@ function Nn(e = {}) {
|
|
|
1250
1462
|
swapThreshold: e.swapThreshold
|
|
1251
1463
|
}));
|
|
1252
1464
|
}
|
|
1253
|
-
return
|
|
1465
|
+
return re(() => {
|
|
1254
1466
|
n();
|
|
1255
1467
|
}), {
|
|
1256
1468
|
destroy: n,
|
|
@@ -1260,7 +1472,7 @@ function Nn(e = {}) {
|
|
|
1260
1472
|
}
|
|
1261
1473
|
//#endregion
|
|
1262
1474
|
//#region src/main/layouts/components/AppTabsContextMenu.vue?vue&type=script&setup=true&lang.ts
|
|
1263
|
-
var
|
|
1475
|
+
var mr = ["disabled"], hr = ["disabled"], gr = ["disabled"], _r = ["disabled"], vr = ["disabled"], yr = /* @__PURE__ */ M({
|
|
1264
1476
|
__name: "AppTabsContextMenu",
|
|
1265
1477
|
props: {
|
|
1266
1478
|
hasLeftTabs: { type: Boolean },
|
|
@@ -1312,22 +1524,22 @@ var Pn = ["disabled"], Fn = ["disabled"], In = ["disabled"], Ln = ["disabled"],
|
|
|
1312
1524
|
}
|
|
1313
1525
|
return (t, n) => {
|
|
1314
1526
|
let f = z("el-icon");
|
|
1315
|
-
return e.visible && e.targetTab ? (
|
|
1527
|
+
return e.visible && e.targetTab ? (F(), O("div", {
|
|
1316
1528
|
key: 0,
|
|
1317
1529
|
class: "app-tabs-menu",
|
|
1318
|
-
style:
|
|
1530
|
+
style: ne({
|
|
1319
1531
|
left: `${e.position.x}px`,
|
|
1320
1532
|
top: `${e.position.y}px`
|
|
1321
1533
|
}),
|
|
1322
|
-
onMousedown: n[8] ||=
|
|
1323
|
-
onContextmenu: n[9] ||=
|
|
1534
|
+
onMousedown: n[8] ||= K(() => {}, ["stop"]),
|
|
1535
|
+
onContextmenu: n[9] ||= K(() => {}, ["prevent"])
|
|
1324
1536
|
}, [
|
|
1325
1537
|
k("button", {
|
|
1326
1538
|
class: "app-tabs-menu__item",
|
|
1327
1539
|
type: "button",
|
|
1328
1540
|
onClick: n[0] ||= (e) => i(a)
|
|
1329
1541
|
}, [j(f, null, {
|
|
1330
|
-
default:
|
|
1542
|
+
default: W(() => [j(H(De))]),
|
|
1331
1543
|
_: 1
|
|
1332
1544
|
}), n[10] ||= k("span", null, "重新加载", -1)]),
|
|
1333
1545
|
k("button", {
|
|
@@ -1336,15 +1548,15 @@ var Pn = ["disabled"], Fn = ["disabled"], In = ["disabled"], Ln = ["disabled"],
|
|
|
1336
1548
|
disabled: !e.hasLastActive,
|
|
1337
1549
|
onClick: n[1] ||= (t) => i(o, !e.hasLastActive)
|
|
1338
1550
|
}, [j(f, null, {
|
|
1339
|
-
default:
|
|
1551
|
+
default: W(() => [j(H(fe))]),
|
|
1340
1552
|
_: 1
|
|
1341
|
-
}), n[11] ||= k("span", null, "切换上一个页签", -1)], 8,
|
|
1553
|
+
}), n[11] ||= k("span", null, "切换上一个页签", -1)], 8, mr),
|
|
1342
1554
|
k("button", {
|
|
1343
1555
|
class: "app-tabs-menu__item",
|
|
1344
1556
|
type: "button",
|
|
1345
1557
|
onClick: n[2] ||= (e) => i(s)
|
|
1346
1558
|
}, [j(f, null, {
|
|
1347
|
-
default:
|
|
1559
|
+
default: W(() => [j(H(Me))]),
|
|
1348
1560
|
_: 1
|
|
1349
1561
|
}), n[12] ||= k("span", null, "在新窗口打开", -1)]),
|
|
1350
1562
|
n[18] ||= k("div", { class: "app-tabs-menu__divider" }, null, -1),
|
|
@@ -1354,63 +1566,63 @@ var Pn = ["disabled"], Fn = ["disabled"], In = ["disabled"], Ln = ["disabled"],
|
|
|
1354
1566
|
disabled: e.isTargetHome,
|
|
1355
1567
|
onClick: n[3] ||= (t) => i(c, e.isTargetHome)
|
|
1356
1568
|
}, [j(f, null, {
|
|
1357
|
-
default:
|
|
1569
|
+
default: W(() => [j(H(me))]),
|
|
1358
1570
|
_: 1
|
|
1359
|
-
}), n[13] ||= k("span", null, "关闭当前页签", -1)], 8,
|
|
1571
|
+
}), n[13] ||= k("span", null, "关闭当前页签", -1)], 8, hr),
|
|
1360
1572
|
k("button", {
|
|
1361
1573
|
class: "app-tabs-menu__item",
|
|
1362
1574
|
type: "button",
|
|
1363
1575
|
disabled: !e.hasMultipleTabs,
|
|
1364
1576
|
onClick: n[4] ||= (t) => i(l, !e.hasMultipleTabs)
|
|
1365
1577
|
}, [j(f, null, {
|
|
1366
|
-
default:
|
|
1578
|
+
default: W(() => [j(H(Ee))]),
|
|
1367
1579
|
_: 1
|
|
1368
|
-
}), n[14] ||= k("span", null, "关闭其他页签", -1)], 8,
|
|
1580
|
+
}), n[14] ||= k("span", null, "关闭其他页签", -1)], 8, gr),
|
|
1369
1581
|
k("button", {
|
|
1370
1582
|
class: "app-tabs-menu__item",
|
|
1371
1583
|
type: "button",
|
|
1372
1584
|
disabled: !e.hasLeftTabs,
|
|
1373
1585
|
onClick: n[5] ||= (t) => i(u, !e.hasLeftTabs)
|
|
1374
1586
|
}, [j(f, null, {
|
|
1375
|
-
default:
|
|
1587
|
+
default: W(() => [j(H(ge))]),
|
|
1376
1588
|
_: 1
|
|
1377
|
-
}), n[15] ||= k("span", null, "关闭左侧页签", -1)], 8,
|
|
1589
|
+
}), n[15] ||= k("span", null, "关闭左侧页签", -1)], 8, _r),
|
|
1378
1590
|
k("button", {
|
|
1379
1591
|
class: "app-tabs-menu__item",
|
|
1380
1592
|
type: "button",
|
|
1381
1593
|
disabled: !e.hasRightTabs,
|
|
1382
1594
|
onClick: n[6] ||= (t) => i(d, !e.hasRightTabs)
|
|
1383
1595
|
}, [j(f, null, {
|
|
1384
|
-
default:
|
|
1596
|
+
default: W(() => [j(H(_e))]),
|
|
1385
1597
|
_: 1
|
|
1386
|
-
}), n[16] ||= k("span", null, "关闭右侧页签", -1)], 8,
|
|
1598
|
+
}), n[16] ||= k("span", null, "关闭右侧页签", -1)], 8, vr),
|
|
1387
1599
|
n[19] ||= k("div", { class: "app-tabs-menu__divider" }, null, -1),
|
|
1388
1600
|
k("button", {
|
|
1389
1601
|
class: "app-tabs-menu__item",
|
|
1390
1602
|
type: "button",
|
|
1391
1603
|
onClick: n[7] ||= (e) => i(() => r("closeAll"))
|
|
1392
1604
|
}, [j(f, null, {
|
|
1393
|
-
default:
|
|
1605
|
+
default: W(() => [j(H(be))]),
|
|
1394
1606
|
_: 1
|
|
1395
1607
|
}), n[17] ||= k("span", null, "关闭全部页签", -1)])
|
|
1396
1608
|
], 36)) : D("", !0);
|
|
1397
1609
|
};
|
|
1398
1610
|
}
|
|
1399
|
-
}),
|
|
1611
|
+
}), br = {
|
|
1400
1612
|
key: 0,
|
|
1401
1613
|
class: "app-layout__tabs"
|
|
1402
|
-
},
|
|
1614
|
+
}, xr = { class: "app-layout__tabs-bar" }, Sr = [
|
|
1403
1615
|
"data-path",
|
|
1404
1616
|
"onClick",
|
|
1405
1617
|
"onContextmenu"
|
|
1406
|
-
],
|
|
1618
|
+
], Cr = { class: "app-layout__tab-label" }, wr = ["onClick"], Tr = /* @__PURE__ */ M({
|
|
1407
1619
|
__name: "AppTabs",
|
|
1408
1620
|
emits: ["refresh"],
|
|
1409
1621
|
setup(e, { emit: t }) {
|
|
1410
|
-
let n = t, r =
|
|
1622
|
+
let n = t, r = v(), i = Y(), a = L(!1), o = L(!1), s = L(!1), c = L({
|
|
1411
1623
|
x: 0,
|
|
1412
1624
|
y: 0
|
|
1413
|
-
}), l = L(null), u = L(null), d =
|
|
1625
|
+
}), l = L(null), u = L(null), d = T(() => l.value ? i.tabs.findIndex((e) => e.path === l.value?.path) : -1), f = T(() => l.value?.path === i.activeTab), p = T(() => d.value > 0), m = T(() => d.value >= 0 && d.value < i.tabs.length - 1), h = T(() => i.tabs.length > 1), g = T(() => !!(i.lastActiveTab && i.tabPaths.includes(i.lastActiveTab))), { init: _ } = pr({
|
|
1414
1626
|
animation: 150,
|
|
1415
1627
|
chosenClass: "sortable-chosen",
|
|
1416
1628
|
direction: "horizontal",
|
|
@@ -1435,21 +1647,21 @@ var Pn = ["disabled"], Fn = ["disabled"], In = ["disabled"], Ln = ["disabled"],
|
|
|
1435
1647
|
swapThreshold: .65
|
|
1436
1648
|
});
|
|
1437
1649
|
async function y(e) {
|
|
1438
|
-
e && (i.setActiveTab(e), await r.push(e), await
|
|
1650
|
+
e && (i.setActiveTab(e), await r.push(e), await A());
|
|
1439
1651
|
}
|
|
1440
1652
|
async function b(e) {
|
|
1441
1653
|
if (e === "/dashboard") return;
|
|
1442
1654
|
let t = i.tabs.findIndex((t) => t.path === e), n = i.activeTab === e;
|
|
1443
1655
|
if (await i.removeTab(e), !n) return;
|
|
1444
1656
|
let a = i.tabs[t] ?? i.tabs[t - 1];
|
|
1445
|
-
a ? await y(a.path) : (i.setActiveTab(""), r.push(
|
|
1657
|
+
a ? await y(a.path) : (i.setActiveTab(""), r.push(q));
|
|
1446
1658
|
}
|
|
1447
|
-
async function
|
|
1448
|
-
i.activeTab !== e && await y(e), o.value = !1, await N(), await
|
|
1659
|
+
async function x(e) {
|
|
1660
|
+
i.activeTab !== e && await y(e), o.value = !1, await N(), await A(), o.value = !0, n("refresh"), window.setTimeout(() => {
|
|
1449
1661
|
o.value = !1;
|
|
1450
1662
|
}, 600);
|
|
1451
1663
|
}
|
|
1452
|
-
function
|
|
1664
|
+
function ee(e, t) {
|
|
1453
1665
|
e.preventDefault(), C(e.clientX, e.clientY, t);
|
|
1454
1666
|
}
|
|
1455
1667
|
function C(e, t, n) {
|
|
@@ -1458,16 +1670,16 @@ var Pn = ["disabled"], Fn = ["disabled"], In = ["disabled"], Ln = ["disabled"],
|
|
|
1458
1670
|
y: Math.min(t, window.innerHeight - 260)
|
|
1459
1671
|
};
|
|
1460
1672
|
}
|
|
1461
|
-
function
|
|
1673
|
+
function w(e) {
|
|
1462
1674
|
let t = i.tabs.find((e) => e.path === i.activeTab) ?? i.tabs.at(-1);
|
|
1463
1675
|
if (!t) return;
|
|
1464
1676
|
let n = e.currentTarget.getBoundingClientRect();
|
|
1465
1677
|
C(n.left, n.bottom + 4, t);
|
|
1466
1678
|
}
|
|
1467
|
-
function
|
|
1679
|
+
function te(e) {
|
|
1468
1680
|
!u.value || Math.abs(e.deltaY) <= Math.abs(e.deltaX) || (e.preventDefault(), u.value.scrollLeft += e.deltaY);
|
|
1469
1681
|
}
|
|
1470
|
-
async function
|
|
1682
|
+
async function A() {
|
|
1471
1683
|
await N(), await new Promise((e) => window.requestAnimationFrame(() => e(null))), await new Promise((e) => window.requestAnimationFrame(() => e(null)));
|
|
1472
1684
|
let e = u.value, t = e?.querySelector(".app-layout__tab.is-active");
|
|
1473
1685
|
if (!e || !t) return;
|
|
@@ -1482,108 +1694,108 @@ var Pn = ["disabled"], Fn = ["disabled"], In = ["disabled"], Ln = ["disabled"],
|
|
|
1482
1694
|
behavior: "smooth"
|
|
1483
1695
|
});
|
|
1484
1696
|
}
|
|
1485
|
-
function
|
|
1697
|
+
function M() {
|
|
1486
1698
|
s.value = !1, l.value = null;
|
|
1487
1699
|
}
|
|
1488
|
-
async function
|
|
1700
|
+
async function ne(e) {
|
|
1489
1701
|
await i.closeOtherTabs(e), await y(e);
|
|
1490
1702
|
}
|
|
1491
|
-
async function
|
|
1703
|
+
async function re(e) {
|
|
1492
1704
|
await i.closeLeftTabs(e), i.tabPaths.includes(i.activeTab) || await y(e);
|
|
1493
1705
|
}
|
|
1494
|
-
async function
|
|
1706
|
+
async function I(e) {
|
|
1495
1707
|
await i.closeRightTabs(e), i.tabPaths.includes(i.activeTab) || await y(e);
|
|
1496
1708
|
}
|
|
1497
|
-
async function
|
|
1498
|
-
await i.closeAllTabs(), r.push(
|
|
1709
|
+
async function oe() {
|
|
1710
|
+
await i.closeAllTabs(), r.push(q);
|
|
1499
1711
|
}
|
|
1500
|
-
function
|
|
1712
|
+
function G() {
|
|
1501
1713
|
let e = i.lastActiveTab;
|
|
1502
1714
|
!e || !i.tabPaths.includes(e) || y(e);
|
|
1503
1715
|
}
|
|
1504
|
-
function
|
|
1716
|
+
function se(e) {
|
|
1505
1717
|
window.open(e, "_blank", "noopener,noreferrer");
|
|
1506
1718
|
}
|
|
1507
|
-
function
|
|
1508
|
-
e.button !== 2 &&
|
|
1719
|
+
function ce(e) {
|
|
1720
|
+
e.button !== 2 && M();
|
|
1509
1721
|
}
|
|
1510
|
-
return
|
|
1511
|
-
document.addEventListener("mousedown",
|
|
1512
|
-
}),
|
|
1513
|
-
document.removeEventListener("mousedown",
|
|
1722
|
+
return ie(() => {
|
|
1723
|
+
document.addEventListener("mousedown", ce), _(u.value), A();
|
|
1724
|
+
}), ae(() => {
|
|
1725
|
+
document.removeEventListener("mousedown", ce);
|
|
1514
1726
|
}), U(() => i.tabs.map((e) => e.path).join("|"), () => {
|
|
1515
1727
|
a.value || N(() => {
|
|
1516
|
-
|
|
1728
|
+
_(u.value), A();
|
|
1517
1729
|
});
|
|
1518
1730
|
}), U(() => i.activeTab, () => {
|
|
1519
|
-
|
|
1731
|
+
A();
|
|
1520
1732
|
}), (e, t) => {
|
|
1521
1733
|
let n = z("el-icon");
|
|
1522
|
-
return H(i).tabs.length ? (
|
|
1734
|
+
return H(i).tabs.length ? (F(), O("div", br, [k("div", xr, [
|
|
1523
1735
|
k("div", {
|
|
1524
1736
|
ref_key: "tabsScrollRef",
|
|
1525
1737
|
ref: u,
|
|
1526
1738
|
class: "app-layout__tabs-scroll",
|
|
1527
|
-
onWheel:
|
|
1528
|
-
}, [(
|
|
1739
|
+
onWheel: te
|
|
1740
|
+
}, [(F(!0), O(S, null, R(H(i).tabs, (e) => (F(), O("div", {
|
|
1529
1741
|
key: e.path,
|
|
1530
1742
|
class: P(["app-layout__tab", { "is-active": H(i).activeTab === e.path }]),
|
|
1531
1743
|
"data-path": e.path,
|
|
1532
1744
|
onClick: (t) => y(e.fullPath),
|
|
1533
|
-
onContextmenu: (t) =>
|
|
1745
|
+
onContextmenu: (t) => ee(t, e)
|
|
1534
1746
|
}, [
|
|
1535
|
-
e.icon ? (
|
|
1747
|
+
e.icon ? (F(), E(n, {
|
|
1536
1748
|
key: 0,
|
|
1537
1749
|
class: "app-layout__tab-icon"
|
|
1538
1750
|
}, {
|
|
1539
|
-
default:
|
|
1751
|
+
default: W(() => [(F(), E(B(H(Cn)(e.icon))))]),
|
|
1540
1752
|
_: 2
|
|
1541
1753
|
}, 1024)) : D("", !0),
|
|
1542
|
-
k("span",
|
|
1543
|
-
e.path === H("/dashboard") ? D("", !0) : (
|
|
1754
|
+
k("span", Cr, V(e.title), 1),
|
|
1755
|
+
e.path === H("/dashboard") ? D("", !0) : (F(), O("button", {
|
|
1544
1756
|
key: 1,
|
|
1545
1757
|
class: "app-layout__tab-close",
|
|
1546
1758
|
type: "button",
|
|
1547
|
-
onClick:
|
|
1548
|
-
}, " × ", 8,
|
|
1549
|
-
], 42,
|
|
1759
|
+
onClick: K((t) => b(e.path), ["stop"])
|
|
1760
|
+
}, " × ", 8, wr))
|
|
1761
|
+
], 42, Sr))), 128))], 544),
|
|
1550
1762
|
k("button", {
|
|
1551
1763
|
class: "app-layout__tabs-action",
|
|
1552
1764
|
type: "button",
|
|
1553
1765
|
title: "页签操作",
|
|
1554
|
-
onClick:
|
|
1766
|
+
onClick: w
|
|
1555
1767
|
}, [j(n, null, {
|
|
1556
|
-
default:
|
|
1768
|
+
default: W(() => [j(H(le))]),
|
|
1557
1769
|
_: 1
|
|
1558
1770
|
})]),
|
|
1559
1771
|
k("button", {
|
|
1560
1772
|
class: "app-layout__tabs-action",
|
|
1561
1773
|
type: "button",
|
|
1562
1774
|
title: "刷新当前页签",
|
|
1563
|
-
onClick: t[0] ||= (e) =>
|
|
1775
|
+
onClick: t[0] ||= (e) => x(H(i).activeTab)
|
|
1564
1776
|
}, [j(n, { class: P({ "is-rotating": o.value }) }, {
|
|
1565
|
-
default:
|
|
1777
|
+
default: W(() => [j(H(De))]),
|
|
1566
1778
|
_: 1
|
|
1567
1779
|
}, 8, ["class"])])
|
|
1568
|
-
]), j(
|
|
1780
|
+
]), j(yr, {
|
|
1569
1781
|
visible: s.value,
|
|
1570
1782
|
"has-left-tabs": p.value,
|
|
1571
1783
|
"has-multiple-tabs": h.value,
|
|
1572
1784
|
"has-right-tabs": m.value,
|
|
1573
1785
|
"has-last-active": g.value,
|
|
1574
|
-
"is-target-home": l.value?.path === H(
|
|
1786
|
+
"is-target-home": l.value?.path === H(q),
|
|
1575
1787
|
"is-target-active": f.value,
|
|
1576
1788
|
position: c.value,
|
|
1577
1789
|
"target-tab": l.value,
|
|
1578
|
-
onClose:
|
|
1579
|
-
onCloseAll:
|
|
1580
|
-
onCloseLeft:
|
|
1581
|
-
onCloseOthers:
|
|
1582
|
-
onCloseRight:
|
|
1790
|
+
onClose: M,
|
|
1791
|
+
onCloseAll: oe,
|
|
1792
|
+
onCloseLeft: re,
|
|
1793
|
+
onCloseOthers: ne,
|
|
1794
|
+
onCloseRight: I,
|
|
1583
1795
|
onCloseTab: b,
|
|
1584
|
-
onOpenInNewTab:
|
|
1585
|
-
onSwitchPrev:
|
|
1586
|
-
onRefresh:
|
|
1796
|
+
onOpenInNewTab: se,
|
|
1797
|
+
onSwitchPrev: G,
|
|
1798
|
+
onRefresh: x
|
|
1587
1799
|
}, null, 8, [
|
|
1588
1800
|
"visible",
|
|
1589
1801
|
"has-left-tabs",
|
|
@@ -1597,10 +1809,10 @@ var Pn = ["disabled"], Fn = ["disabled"], In = ["disabled"], Ln = ["disabled"],
|
|
|
1597
1809
|
])])) : D("", !0);
|
|
1598
1810
|
};
|
|
1599
1811
|
}
|
|
1600
|
-
}),
|
|
1812
|
+
}), Er = /* @__PURE__ */ M({
|
|
1601
1813
|
__name: "AppLayout",
|
|
1602
1814
|
setup(e) {
|
|
1603
|
-
let t =
|
|
1815
|
+
let t = _(), n = Y(), r = Z(), i = L(0), a = T(() => t.matched.filter((e) => e.meta?.title));
|
|
1604
1816
|
function o() {
|
|
1605
1817
|
i.value += 1;
|
|
1606
1818
|
}
|
|
@@ -1621,32 +1833,34 @@ var Pn = ["disabled"], Fn = ["disabled"], In = ["disabled"], Ln = ["disabled"],
|
|
|
1621
1833
|
}
|
|
1622
1834
|
return (e, t) => {
|
|
1623
1835
|
let n = z("el-container");
|
|
1624
|
-
return
|
|
1625
|
-
default:
|
|
1626
|
-
default:
|
|
1627
|
-
j(
|
|
1628
|
-
j(
|
|
1629
|
-
j(
|
|
1836
|
+
return F(), O(S, null, [j(n, { class: "app-layout" }, {
|
|
1837
|
+
default: W(() => [j(fr), j(n, { direction: "vertical" }, {
|
|
1838
|
+
default: W(() => [
|
|
1839
|
+
j(Qn, { "breadcrumb-items": a.value }, null, 8, ["breadcrumb-items"]),
|
|
1840
|
+
j(Tr, { onRefresh: o }),
|
|
1841
|
+
j(un, { "refresh-key": i.value }, null, 8, ["refresh-key"])
|
|
1630
1842
|
]),
|
|
1631
1843
|
_: 1
|
|
1632
1844
|
})]),
|
|
1633
1845
|
_: 1
|
|
1634
|
-
}), j(
|
|
1846
|
+
}), j(ln)], 64);
|
|
1635
1847
|
};
|
|
1636
1848
|
}
|
|
1637
|
-
})
|
|
1638
|
-
|
|
1849
|
+
});
|
|
1850
|
+
//#endregion
|
|
1851
|
+
//#region src/main/router/base-routes.ts
|
|
1852
|
+
function Dr(e = []) {
|
|
1639
1853
|
return [{
|
|
1640
1854
|
path: "/login",
|
|
1641
1855
|
name: "login",
|
|
1642
|
-
component: () => import("./Login-
|
|
1856
|
+
component: () => import("./Login-BcNNVCnZ.js"),
|
|
1643
1857
|
meta: {
|
|
1644
1858
|
title: "登录",
|
|
1645
1859
|
public: !0
|
|
1646
1860
|
}
|
|
1647
1861
|
}, {
|
|
1648
1862
|
path: "/",
|
|
1649
|
-
component:
|
|
1863
|
+
component: Er,
|
|
1650
1864
|
redirect: "/dashboard",
|
|
1651
1865
|
children: [
|
|
1652
1866
|
{
|
|
@@ -1660,29 +1874,6 @@ function Jn(e = []) {
|
|
|
1660
1874
|
}
|
|
1661
1875
|
},
|
|
1662
1876
|
...e,
|
|
1663
|
-
{
|
|
1664
|
-
path: "micro",
|
|
1665
|
-
name: "micro",
|
|
1666
|
-
redirect: `${qn}/demo/orders`,
|
|
1667
|
-
meta: {
|
|
1668
|
-
title: "微前端",
|
|
1669
|
-
icon: "Connection"
|
|
1670
|
-
},
|
|
1671
|
-
children: [{
|
|
1672
|
-
path: "sub-app/demo/orders",
|
|
1673
|
-
name: "micro-sub-app-demo-orders",
|
|
1674
|
-
component: () => import("./MicroAppView-DqTrIZZa.js"),
|
|
1675
|
-
meta: { title: "订单管理" }
|
|
1676
|
-
}, {
|
|
1677
|
-
path: "sub-app/:pathMatch(.*)*",
|
|
1678
|
-
name: "micro-sub-app-fallback",
|
|
1679
|
-
component: () => import("./MicroAppView-DqTrIZZa.js"),
|
|
1680
|
-
meta: {
|
|
1681
|
-
title: "子应用页面",
|
|
1682
|
-
hidden: !0
|
|
1683
|
-
}
|
|
1684
|
-
}]
|
|
1685
|
-
},
|
|
1686
1877
|
{
|
|
1687
1878
|
path: "config",
|
|
1688
1879
|
name: "config-center",
|
|
@@ -1694,7 +1885,7 @@ function Jn(e = []) {
|
|
|
1694
1885
|
children: [{
|
|
1695
1886
|
path: "apps",
|
|
1696
1887
|
name: "config-apps",
|
|
1697
|
-
component: () => import("./application-config-
|
|
1888
|
+
component: () => import("./application-config-CGx7DctK.js"),
|
|
1698
1889
|
meta: {
|
|
1699
1890
|
title: "应用配置",
|
|
1700
1891
|
icon: "Connection"
|
|
@@ -1702,7 +1893,7 @@ function Jn(e = []) {
|
|
|
1702
1893
|
}, {
|
|
1703
1894
|
path: "system",
|
|
1704
1895
|
name: "config-system",
|
|
1705
|
-
component: () => import("./SystemConfig-
|
|
1896
|
+
component: () => import("./SystemConfig-CjcXN9Ma.js"),
|
|
1706
1897
|
meta: {
|
|
1707
1898
|
title: "系统配置",
|
|
1708
1899
|
icon: "Setting"
|
|
@@ -1724,26 +1915,26 @@ function Jn(e = []) {
|
|
|
1724
1915
|
}
|
|
1725
1916
|
//#endregion
|
|
1726
1917
|
//#region src/main/router/index.ts
|
|
1727
|
-
function
|
|
1728
|
-
let t = Array.isArray(e) ? { businessRoutes: e } : e, n =
|
|
1729
|
-
history: t.history ??
|
|
1730
|
-
routes:
|
|
1918
|
+
function Or(e = []) {
|
|
1919
|
+
let t = Array.isArray(e) ? { businessRoutes: e } : e, n = h({
|
|
1920
|
+
history: t.history ?? g("/"),
|
|
1921
|
+
routes: Dr(t.businessRoutes ?? []),
|
|
1731
1922
|
scrollBehavior: t.scrollBehavior ?? (() => ({ top: 0 }))
|
|
1732
1923
|
});
|
|
1733
|
-
return
|
|
1924
|
+
return $e(n), t.setupRouter?.(n), n;
|
|
1734
1925
|
}
|
|
1735
1926
|
//#endregion
|
|
1736
1927
|
//#region src/main/directives/index.ts
|
|
1737
|
-
var
|
|
1928
|
+
var kr = {
|
|
1738
1929
|
mounted(e, t) {
|
|
1739
|
-
|
|
1930
|
+
Ar(e, t.value);
|
|
1740
1931
|
},
|
|
1741
1932
|
updated(e, t) {
|
|
1742
|
-
|
|
1933
|
+
Ar(e, t.value);
|
|
1743
1934
|
}
|
|
1744
1935
|
};
|
|
1745
|
-
function
|
|
1746
|
-
let n = a(), r =
|
|
1936
|
+
function Ar(e, t) {
|
|
1937
|
+
let n = a(), r = jr(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));
|
|
1747
1938
|
if (!r.length || s) {
|
|
1748
1939
|
e.style.display = "", e.hidden = !1, o && (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
|
|
1749
1940
|
return;
|
|
@@ -1754,30 +1945,30 @@ function Zn(e, t) {
|
|
|
1754
1945
|
}
|
|
1755
1946
|
e.style.display = "none", e.hidden = !0;
|
|
1756
1947
|
}
|
|
1757
|
-
function
|
|
1948
|
+
function jr(e) {
|
|
1758
1949
|
return typeof e == "string" ? e ? [e] : [] : Array.isArray(e) ? e : e.permissions ?? [];
|
|
1759
1950
|
}
|
|
1760
|
-
function
|
|
1761
|
-
e.directive("permission",
|
|
1951
|
+
function Mr(e) {
|
|
1952
|
+
e.directive("permission", kr);
|
|
1762
1953
|
}
|
|
1763
1954
|
//#endregion
|
|
1764
1955
|
//#region src/main/app/create-app.ts
|
|
1765
|
-
async function
|
|
1766
|
-
|
|
1767
|
-
let t =
|
|
1956
|
+
async function Nr(e) {
|
|
1957
|
+
Ge(e.appConfig), Xe();
|
|
1958
|
+
let t = Or({
|
|
1768
1959
|
businessRoutes: e.businessRoutes,
|
|
1769
1960
|
history: e.routerHistory,
|
|
1770
1961
|
scrollBehavior: e.routerScrollBehavior,
|
|
1771
1962
|
setupRouter: e.setupRouter
|
|
1772
|
-
}), n =
|
|
1963
|
+
}), n = te(e.rootComponent), r = se(), i = {
|
|
1773
1964
|
app: n,
|
|
1774
1965
|
router: t,
|
|
1775
1966
|
pinia: r,
|
|
1776
|
-
http:
|
|
1777
|
-
requestManager:
|
|
1967
|
+
http: qe,
|
|
1968
|
+
requestManager: Ye
|
|
1778
1969
|
};
|
|
1779
|
-
|
|
1780
|
-
let a =
|
|
1970
|
+
Le(), n.use(b, { locale: ze }), n.use(r), n.use(t), Mr(n), Ue(t), await e.setupApp?.(i), await e.beforePlatformInit?.(i);
|
|
1971
|
+
let a = Z(r), o = l(r), s = Y(r), c = Ie({ fullscreen: !0 });
|
|
1781
1972
|
try {
|
|
1782
1973
|
await Promise.all([
|
|
1783
1974
|
a.initializePreferences(),
|
|
@@ -1795,4 +1986,249 @@ async function er(e) {
|
|
|
1795
1986
|
return await e.afterMount?.(d), n;
|
|
1796
1987
|
}
|
|
1797
1988
|
//#endregion
|
|
1798
|
-
|
|
1989
|
+
//#region src/main/micro-apps/status.ts
|
|
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 };
|