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