@campus-admin/core 2.0.6 → 2.0.7
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/context.d.ts +1 -12
- package/dist/i18n.d.ts +60 -0
- package/dist/index.js +508 -409
- package/dist/stores/layout.d.ts +21 -3
- package/dist/style.css +1 -1
- package/dist/types.d.ts +6 -5
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -5,58 +5,58 @@ import "@campus-admin/theme/nova.css";
|
|
|
5
5
|
import { Fragment as e, KeepAlive as t, computed as n, createApp as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createStaticVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, h as f, mergeModels as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as _, onMounted as v, openBlock as y, reactive as b, ref as x, renderList as S, renderSlot as C, resolveComponent as w, resolveDynamicComponent as T, toDisplayString as E, unref as D, useModel as O, vShow as k, watch as A, watchEffect as j, withCtx as M, withDirectives as N, withModifiers as P } from "vue";
|
|
6
6
|
import { createPinia as F, defineStore as I } from "pinia";
|
|
7
7
|
import { installUi as L, translateKey as R } from "@campus-admin/ui";
|
|
8
|
-
import { LOCALES as
|
|
9
|
-
import { createI18n as
|
|
10
|
-
import { RouterLink as
|
|
11
|
-
import { applyTheme as
|
|
12
|
-
import { ElLoading as
|
|
8
|
+
import { LOCALES as z, frameworkMessages as ee } from "@campus-admin/locale";
|
|
9
|
+
import { createI18n as te, useI18n as B } from "vue-i18n";
|
|
10
|
+
import { RouterLink as V, createRouter as ne, createWebHashHistory as H, createWebHistory as re, useRoute as U, useRouter as W } from "vue-router";
|
|
11
|
+
import { applyTheme as ie, deriveCssVars as ae, isHexColor as oe, resolveMode as se, resolveTheme as ce } from "@campus-admin/theme";
|
|
12
|
+
import { ElLoading as le, ElMessage as ue, ElMessageBox as de, ElNotification as fe } from "element-plus";
|
|
13
13
|
import "element-plus/es/components/loading/style/css";
|
|
14
14
|
import "element-plus/es/components/notification/style/css";
|
|
15
15
|
import "element-plus/es/components/message/style/css";
|
|
16
16
|
import "element-plus/es/components/message-box/style/css";
|
|
17
17
|
export * from "@campus-admin/ui";
|
|
18
18
|
// packages/core/src/storage.ts
|
|
19
|
-
var
|
|
20
|
-
function
|
|
19
|
+
var pe = "ca:";
|
|
20
|
+
function me(e, t = "local") {
|
|
21
21
|
try {
|
|
22
|
-
return (t === "local" ? localStorage : sessionStorage).getItem(
|
|
22
|
+
return (t === "local" ? localStorage : sessionStorage).getItem(pe + e);
|
|
23
23
|
} catch {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function G(e, t, n = "local") {
|
|
28
28
|
try {
|
|
29
29
|
let r = n === "local" ? localStorage : sessionStorage;
|
|
30
|
-
t === null ? r.removeItem(
|
|
30
|
+
t === null ? r.removeItem(pe + e) : r.setItem(pe + e, t);
|
|
31
31
|
} catch {}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
let n =
|
|
33
|
+
function he(e, t = "local") {
|
|
34
|
+
let n = me(e, t);
|
|
35
35
|
if (n) try {
|
|
36
36
|
return JSON.parse(n);
|
|
37
37
|
} catch {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
41
|
+
function ge(e, t, n = "local") {
|
|
42
|
+
G(e, JSON.stringify(t), n);
|
|
43
43
|
}
|
|
44
44
|
// packages/core/src/i18n.ts
|
|
45
|
-
var
|
|
46
|
-
function
|
|
45
|
+
var _e = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
46
|
+
function ve(e, t) {
|
|
47
47
|
let n = { ...e };
|
|
48
48
|
for (let [e, r] of Object.entries(t)) {
|
|
49
49
|
let t = n[e];
|
|
50
|
-
n[e] =
|
|
50
|
+
n[e] = _e(t) && _e(r) ? ve(t, r) : r;
|
|
51
51
|
}
|
|
52
52
|
return n;
|
|
53
53
|
}
|
|
54
|
-
var
|
|
55
|
-
function
|
|
54
|
+
var ye = "locale";
|
|
55
|
+
function be(e) {
|
|
56
56
|
return e === "zh-CN" || e === "en-US";
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
let t =
|
|
58
|
+
function xe(e) {
|
|
59
|
+
let t = me(ye), n = be(t) ? t : e.defaultLocale ?? "zh-CN", r = Object.fromEntries(["zh-CN", "en-US"].map((t) => [t, ve(ee[t], e.messages?.[t] ?? {})])), i = te({
|
|
60
60
|
legacy: !1,
|
|
61
61
|
locale: n,
|
|
62
62
|
fallbackLocale: "zh-CN",
|
|
@@ -64,17 +64,17 @@ function Se(e) {
|
|
|
64
64
|
});
|
|
65
65
|
return typeof document < "u" && A(() => i.global.locale.value, (e) => {
|
|
66
66
|
document.documentElement.lang = e;
|
|
67
|
-
}, { immediate: !0 }),
|
|
67
|
+
}, { immediate: !0 }), Se = i, i;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
function
|
|
71
|
-
return
|
|
69
|
+
var Se;
|
|
70
|
+
function Ce(e, t) {
|
|
71
|
+
return Se ? Se.global.t(e, t ?? {}) : e;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
73
|
+
function we(e) {
|
|
74
|
+
G(ye, e);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
let { t: e, te: t, locale: n } =
|
|
76
|
+
function K() {
|
|
77
|
+
let { t: e, te: t, locale: n } = B();
|
|
78
78
|
return {
|
|
79
79
|
t: e,
|
|
80
80
|
te: t,
|
|
@@ -83,10 +83,10 @@ function G() {
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
// packages/core/src/CampusRoot.vue
|
|
86
|
-
var
|
|
86
|
+
var Te = /* @__PURE__ */ d({
|
|
87
87
|
__name: "CampusRoot",
|
|
88
88
|
setup(e) {
|
|
89
|
-
let { locale: t } =
|
|
89
|
+
let { locale: t } = K();
|
|
90
90
|
return (e, n) => {
|
|
91
91
|
let r = w("router-view"), a = w("ca-config-provider");
|
|
92
92
|
return y(), i(a, { locale: D(t) }, {
|
|
@@ -97,67 +97,76 @@ var Ee = /* @__PURE__ */ d({
|
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
// packages/core/src/types.ts
|
|
100
|
-
function
|
|
100
|
+
function Ee(e) {
|
|
101
101
|
return "children" in e;
|
|
102
102
|
}
|
|
103
103
|
// packages/core/src/context.ts
|
|
104
|
-
var
|
|
105
|
-
function
|
|
106
|
-
|
|
104
|
+
var De;
|
|
105
|
+
function Oe(e) {
|
|
106
|
+
De = e;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
if (!
|
|
110
|
-
return
|
|
108
|
+
function q() {
|
|
109
|
+
if (!De) throw Error("[campus] 请先调用 createCampusApp()");
|
|
110
|
+
return De;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
for (let t of
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
t.title,
|
|
117
|
-
n
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
function ke(e) {
|
|
113
|
+
for (let t of q().menus) {
|
|
114
|
+
if (t.key === e && t.path) return { titles: [t.title] };
|
|
115
|
+
for (let n of t.children) {
|
|
116
|
+
if (n.key === e && n.path) return { titles: [t.title, n.title] };
|
|
117
|
+
if (Ee(n)) {
|
|
118
|
+
let r = n.children.find((t) => t.key === e);
|
|
119
|
+
if (r) return { titles: [
|
|
120
|
+
t.title,
|
|
121
|
+
n.title,
|
|
122
|
+
r.title
|
|
123
|
+
] };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
121
127
|
}
|
|
122
|
-
var
|
|
128
|
+
var Ae = [
|
|
123
129
|
"none",
|
|
124
130
|
"panel",
|
|
125
131
|
"all"
|
|
126
132
|
];
|
|
127
|
-
function
|
|
133
|
+
function je(e) {
|
|
128
134
|
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
135
|
+
function o(e, s, c, l = 1) {
|
|
136
|
+
let u = l === 1 ? i : l === 2 && Ee(e) ? a : void 0;
|
|
137
|
+
if (u?.has(e.key)) throw Error(`[campus] 菜单${l === 1 ? "一级场景键" : "组键"}重复:${e.key}`);
|
|
138
|
+
u?.add(e.key);
|
|
139
|
+
let d = e.path !== void 0;
|
|
140
|
+
if (d !== (e.component !== void 0)) throw Error(`[campus] 菜单 path 与 component 必须同时出现:${e.key}`);
|
|
141
|
+
if (d) {
|
|
142
|
+
if (n.has(e.key)) throw Error(`[campus] 菜单页面键重复:${e.key}`);
|
|
143
|
+
if (n.add(e.key), typeof e.path != "string" || !e.path.startsWith("/")) throw Error(`[campus] 菜单路径必须以 / 开头:${e.path}`);
|
|
144
|
+
if (typeof e.component != "function") throw Error(`[campus] 菜单 component 必须是懒加载函数:${e.key}`);
|
|
145
|
+
if (r.has(e.path)) throw Error(`[campus] 菜单路径重复:${e.path}`);
|
|
146
|
+
r.add(e.path);
|
|
147
|
+
let { children: i, ...a } = e, o = {
|
|
148
|
+
...a,
|
|
149
|
+
appKey: s,
|
|
150
|
+
groupKey: l === 2 && Ee(e) ? e.key : c
|
|
151
|
+
};
|
|
152
|
+
o.sideCollapse != null && !Ae.includes(o.sideCollapse) && (console.warn(`[campus] 菜单页面 sideCollapse 只能是 none / panel / all,已忽略:${e.key}`), delete o.sideCollapse), o.openMode != null && ![
|
|
153
|
+
"normal",
|
|
154
|
+
"collapsePanel",
|
|
155
|
+
"collapseAll",
|
|
156
|
+
"content",
|
|
157
|
+
"screen"
|
|
158
|
+
].includes(o.openMode) && (console.warn(`[campus] 菜单页面 openMode 无效,已忽略:${e.key}`), delete o.openMode), t.push(o);
|
|
159
|
+
}
|
|
160
|
+
if (l === 3 && ("children" in e || !d)) throw Error(`[campus] 三级菜单必须是页面且不能有子菜单:${e.key}`);
|
|
161
|
+
if ("children" in e) {
|
|
162
|
+
if (!Array.isArray(e.children)) throw Error(`[campus] 菜单 children 必须是数组:${e.key}`);
|
|
163
|
+
for (let t of e.children) o(t, s, l === 2 ? e.key : void 0, l + 1);
|
|
156
164
|
}
|
|
157
165
|
}
|
|
166
|
+
for (let t of e) o(t, t.key);
|
|
158
167
|
return t;
|
|
159
168
|
}
|
|
160
|
-
function
|
|
169
|
+
function Me(e) {
|
|
161
170
|
let t = {
|
|
162
171
|
home: "/",
|
|
163
172
|
login: "/login",
|
|
@@ -177,21 +186,21 @@ function Ne(e) {
|
|
|
177
186
|
])).size !== 5) throw Error("[campus] 系统页面路径不能重复");
|
|
178
187
|
return t;
|
|
179
188
|
}
|
|
180
|
-
function
|
|
181
|
-
let n = e.homeEntry === !1 ? void 0 :
|
|
189
|
+
function Ne(e, t) {
|
|
190
|
+
let n = e.homeEntry === !1 ? void 0 : je(e.menus).find((e) => e.affix && t(e.permission)), r = !e.accountInMenu && !e.onAccountClick, i = (i) => !!i.path && t(i.permission) && i.key !== n?.key && (!r || i.path !== e.accountPath);
|
|
191
|
+
function a(e) {
|
|
192
|
+
let t = "children" in e ? e.children.map((e) => a(e)).filter((e) => e !== void 0) : [], n = i(e);
|
|
193
|
+
if (!n && !t.length) return;
|
|
194
|
+
let r = { ...e };
|
|
195
|
+
return "children" in r && (r.children = t), n || (delete r.path, delete r.component, delete r.permission, delete r.affix), r;
|
|
196
|
+
}
|
|
182
197
|
return {
|
|
183
198
|
home: n,
|
|
184
|
-
apps: e.menus.map((e) => (
|
|
185
|
-
...e,
|
|
186
|
-
children: e.children.map((e) => De(e) ? {
|
|
187
|
-
...e,
|
|
188
|
-
children: e.children.filter(i)
|
|
189
|
-
} : e).filter((e) => De(e) ? e.children.length > 0 : i(e))
|
|
190
|
-
})).filter((e) => e.children.length > 0),
|
|
199
|
+
apps: e.menus.map((e) => a(e)).filter((e) => e !== void 0),
|
|
191
200
|
accountStandalone: r
|
|
192
201
|
};
|
|
193
202
|
}
|
|
194
|
-
function
|
|
203
|
+
function J(e) {
|
|
195
204
|
return {
|
|
196
205
|
login: "login",
|
|
197
206
|
register: "register",
|
|
@@ -202,51 +211,51 @@ function q(e) {
|
|
|
202
211
|
};
|
|
203
212
|
}
|
|
204
213
|
// packages/core/src/stores/theme.ts
|
|
205
|
-
var
|
|
214
|
+
var Pe = "theme-mode", Fe = "box-style", Ie = "user-primary";
|
|
215
|
+
function Le() {
|
|
216
|
+
return me(Fe) === "border" ? "border" : "shadow";
|
|
217
|
+
}
|
|
206
218
|
function Re() {
|
|
207
|
-
|
|
219
|
+
let e = me(Ie);
|
|
220
|
+
return oe(e) ? e : void 0;
|
|
208
221
|
}
|
|
209
222
|
function ze() {
|
|
210
|
-
let e =
|
|
211
|
-
return ce(e) ? e : void 0;
|
|
212
|
-
}
|
|
213
|
-
function Be() {
|
|
214
|
-
let e = U(Fe);
|
|
223
|
+
let e = me(Pe);
|
|
215
224
|
return e === "light" || e === "dark" || e === "auto" ? e : "auto";
|
|
216
225
|
}
|
|
217
|
-
var
|
|
218
|
-
let e = x({}), t = x(
|
|
226
|
+
var Be = I("campus-theme", () => {
|
|
227
|
+
let e = x({}), t = x(ze()), r = x(Le()), i = x(Re()), a = typeof matchMedia == "function" ? matchMedia("(prefers-color-scheme: dark)") : void 0, o = x(a?.matches ?? !1);
|
|
219
228
|
a?.addEventListener("change", (e) => o.value = e.matches);
|
|
220
|
-
let s = n(() =>
|
|
229
|
+
let s = n(() => ce(e.value)), c = n(() => e.value.tenantDefault?.locks?.includes("primary") ?? !1), l = n(() => {
|
|
221
230
|
let e = s.value.theme, t = i.value;
|
|
222
231
|
return !t || c.value ? e : {
|
|
223
232
|
...e,
|
|
224
233
|
primary: t,
|
|
225
234
|
headerBg: e.headerBg === e.primary ? t : e.headerBg
|
|
226
235
|
};
|
|
227
|
-
}), u = n(() => s.value.issues), d = n(() =>
|
|
228
|
-
j(() =>
|
|
236
|
+
}), u = n(() => s.value.issues), d = n(() => se(t.value, o.value)), f = n(() => ae(l.value, d.value));
|
|
237
|
+
j(() => ie(f.value, d.value, l.value.style)), j(() => {
|
|
229
238
|
document.documentElement.dataset.caBox = r.value;
|
|
230
239
|
});
|
|
231
240
|
function p(e) {
|
|
232
|
-
(e === void 0 ||
|
|
241
|
+
(e === void 0 || oe(e)) && (i.value = e, G(Ie, e ?? null));
|
|
233
242
|
}
|
|
234
243
|
function h(e) {
|
|
235
|
-
r.value = e,
|
|
244
|
+
r.value = e, G(Fe, e);
|
|
236
245
|
}
|
|
237
246
|
function g() {
|
|
238
|
-
return `theme-layers:${
|
|
247
|
+
return `theme-layers:${q().theme?.cacheKey ?? location.host}`;
|
|
239
248
|
}
|
|
240
249
|
function _(e) {
|
|
241
|
-
t.value = e,
|
|
250
|
+
t.value = e, G(Pe, e);
|
|
242
251
|
}
|
|
243
252
|
function v(e, t) {
|
|
244
|
-
let n = document, r =
|
|
253
|
+
let n = document, r = se(e, o.value) !== d.value, i = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
245
254
|
if (!t || !r || i || !n.startViewTransition) {
|
|
246
255
|
_(e);
|
|
247
256
|
return;
|
|
248
257
|
}
|
|
249
|
-
let a = Math.hypot(Math.max(t.x, innerWidth - t.x), Math.max(t.y, innerHeight - t.y)), s =
|
|
258
|
+
let a = Math.hypot(Math.max(t.x, innerWidth - t.x), Math.max(t.y, innerHeight - t.y)), s = se(e, o.value) === "dark", c = document.documentElement;
|
|
250
259
|
c.dataset.caThemeTransition = s ? "to-dark" : "to-light";
|
|
251
260
|
let l = !1, u = () => {
|
|
252
261
|
l || (l = !0, _(e));
|
|
@@ -265,12 +274,12 @@ var Ve = I("campus-theme", () => {
|
|
|
265
274
|
}).catch(() => {});
|
|
266
275
|
}
|
|
267
276
|
function y(t, n = !0) {
|
|
268
|
-
e.value = t, n &&
|
|
277
|
+
e.value = t, n && ge(g(), t);
|
|
269
278
|
}
|
|
270
279
|
async function b() {
|
|
271
|
-
let t =
|
|
280
|
+
let t = he(g());
|
|
272
281
|
t && (e.value = t);
|
|
273
|
-
let n =
|
|
282
|
+
let n = q().theme?.load;
|
|
274
283
|
if (n) {
|
|
275
284
|
try {
|
|
276
285
|
y(await n());
|
|
@@ -298,16 +307,16 @@ var Ve = I("campus-theme", () => {
|
|
|
298
307
|
};
|
|
299
308
|
});
|
|
300
309
|
// packages/core/src/copyright.ts
|
|
301
|
-
function
|
|
310
|
+
function Ve(e, t = (/* @__PURE__ */ new Date()).getFullYear()) {
|
|
302
311
|
return e.replaceAll("{year}", String(t));
|
|
303
312
|
}
|
|
304
313
|
// packages/core/src/pages/auth/options.ts
|
|
305
|
-
var
|
|
306
|
-
function J() {
|
|
307
|
-
return K().login ?? {};
|
|
308
|
-
}
|
|
314
|
+
var He = /^1[3-9]\d{9}$/;
|
|
309
315
|
function Y() {
|
|
310
|
-
|
|
316
|
+
return q().login ?? {};
|
|
317
|
+
}
|
|
318
|
+
function Ue() {
|
|
319
|
+
let e = q().auth;
|
|
311
320
|
return {
|
|
312
321
|
captcha: typeof e.captcha == "function",
|
|
313
322
|
register: typeof e.register == "function" && typeof e.sendSmsCode == "function",
|
|
@@ -316,7 +325,7 @@ function Y() {
|
|
|
316
325
|
};
|
|
317
326
|
}
|
|
318
327
|
function We(e) {
|
|
319
|
-
return typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e :
|
|
328
|
+
return typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : Me(q()).home;
|
|
320
329
|
}
|
|
321
330
|
// packages/core/src/pages/auth/AuthShell.vue?vue&type=script&setup=true&lang.ts
|
|
322
331
|
var Ge = {
|
|
@@ -354,13 +363,13 @@ var Ge = {
|
|
|
354
363
|
},
|
|
355
364
|
emits: ["update:active"],
|
|
356
365
|
setup(t, { emit: r }) {
|
|
357
|
-
let c = t, u = r, { t: d, label: f } =
|
|
366
|
+
let c = t, u = r, { t: d, label: f } = K(), p = q().brand, m = Y(), _ = Be(), v = n(() => f(_.theme.siteName ?? p.name)), b = n(() => _.theme.logo ?? p.logo), x = n(() => m.panel?.logo ?? b.value), w = n(() => m.panel?.qrcode), T = n(() => {
|
|
358
367
|
let e = m.panel?.caption ?? p.subtitle;
|
|
359
368
|
return e ? f(e) : "";
|
|
360
369
|
}), O = n(() => m.panel?.title ? f(m.panel.title) : ""), k = n(() => m.panel?.background), A = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 ? `${e}px` : typeof e == "string" && /^[\d.]+(px|rem|em|%)$/.test(e) ? e : void 0, j = n(() => {
|
|
361
370
|
let e = m.card, t = {}, n = A(e?.width), r = A(e?.minHeight), i = A(e?.panelWidth), a = A(e?.radius);
|
|
362
371
|
return n && (t["--ca-auth-card-width"] = n), r && (t["--ca-auth-card-min-height"] = r), i && (t["--ca-auth-panel-width"] = i), a && (t["--ca-auth-card-radius"] = a), t;
|
|
363
|
-
}), N = n(() => m.background ?? "var(--ca-login-bg)"), P = n(() => m.footer ? m.footer.map((e) =>
|
|
372
|
+
}), N = n(() => m.background ?? "var(--ca-login-bg)"), P = n(() => m.footer ? m.footer.map((e) => Ve(f(e))) : p.copyright ? Ve(f(p.copyright)).split("\n").filter(Boolean) : []);
|
|
364
373
|
function F(e, t) {
|
|
365
374
|
if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") return;
|
|
366
375
|
let n = (t + (e.key === "ArrowRight" ? 1 : -1) + c.tabs.length) % c.tabs.length, r = c.tabs[n];
|
|
@@ -393,7 +402,7 @@ var Ge = {
|
|
|
393
402
|
src: b.value,
|
|
394
403
|
alt: ""
|
|
395
404
|
}, null, 8, et)) : a("v-if", !0), s("span", null, E(v.value), 1)]),
|
|
396
|
-
s("div", tt, [(y(!0), o(e, null, S(t.tabs, (n, r) => (y(), o(e, { key: n.key }, [n.to && !t.preview ? (y(), i(D(
|
|
405
|
+
s("div", tt, [(y(!0), o(e, null, S(t.tabs, (n, r) => (y(), o(e, { key: n.key }, [n.to && !t.preview ? (y(), i(D(V), {
|
|
397
406
|
key: 0,
|
|
398
407
|
to: n.to,
|
|
399
408
|
role: "tab",
|
|
@@ -422,101 +431,129 @@ var Ge = {
|
|
|
422
431
|
for (let [e, r] of t) n[e] = r;
|
|
423
432
|
return n;
|
|
424
433
|
}, st = /*#__PURE__*/ X(ot, [["__scopeId", "data-v-df817220"]]), ct = "side-collapsed", Z = I("campus-layout", () => {
|
|
425
|
-
let e = x(!1), t = x("desktop"), r = x(!1), i = x(!1), a = x(
|
|
426
|
-
function
|
|
427
|
-
|
|
434
|
+
let e = x(!1), t = x("desktop"), r = x(!1), i = x(!1), a = x(me(ct) === "1"), o = x(null), s = n(() => o.value ?? a.value), c = x(!1), l = n(() => c.value && t.value === "desktop"), u = x({}), d = x({}), f;
|
|
435
|
+
function p(e, t = !1) {
|
|
436
|
+
f = e, e && !t && (o.value = u.value[e] ?? !1);
|
|
437
|
+
}
|
|
438
|
+
function m(e, t) {
|
|
439
|
+
d.value[e] = t;
|
|
440
|
+
}
|
|
441
|
+
function h(e) {
|
|
442
|
+
e in d.value || m(e, !0);
|
|
443
|
+
}
|
|
444
|
+
async function g(e, n, r) {
|
|
445
|
+
e.path && n !== e.path ? (await r(e.path), m(e.key, !0), t.value === "phone" ? V() : t.value === "pad" && H()) : m(e.key, !(d.value[e.key] ?? !1));
|
|
446
|
+
}
|
|
447
|
+
async function _(e, n, r, a) {
|
|
448
|
+
if (e.path) {
|
|
449
|
+
if (e.path !== n) {
|
|
450
|
+
await r(e.path);
|
|
451
|
+
let n = e.openMode == null ? e.sideCollapse === "panel" || e.sideCollapse === "all" : e.openMode !== "normal";
|
|
452
|
+
a && e.children.length && t.value === "desktop" && !n && (o.value = !1, u.value[e.key] = !1);
|
|
453
|
+
} else e.children.length && (t.value === "desktop" ? v() : t.value === "pad" && (i.value = !i.value));
|
|
454
|
+
e.path !== n && e.children.length && t.value === "pad" && H(), e.children.length && t.value === "phone" && V(), e.children.length || re();
|
|
455
|
+
} else t.value === "pad" ? i.value = !(a && i.value) : t.value === "desktop" && s.value && v();
|
|
456
|
+
}
|
|
457
|
+
function v() {
|
|
458
|
+
o.value === null ? (a.value = !a.value, G(ct, a.value ? "1" : "0")) : (o.value = !o.value, f && (u.value[f] = o.value));
|
|
428
459
|
}
|
|
429
|
-
function
|
|
460
|
+
function y() {
|
|
430
461
|
c.value = !1, o.value = null;
|
|
431
462
|
}
|
|
432
|
-
function
|
|
463
|
+
function b(e = "none") {
|
|
433
464
|
o.value = e === "panel" || null, c.value = e === "all";
|
|
434
465
|
}
|
|
435
|
-
let
|
|
436
|
-
function
|
|
437
|
-
|
|
466
|
+
let S = "normal", C = null, w = !1, T, E = !1, D = !1, O = !1, k = x(!1);
|
|
467
|
+
function A() {
|
|
468
|
+
C !== null && (e.value = C);
|
|
438
469
|
}
|
|
439
|
-
function
|
|
440
|
-
|
|
441
|
-
|
|
470
|
+
function j() {
|
|
471
|
+
w && document.fullscreenElement === document.documentElement && (w = !1, document.exitFullscreen().catch(() => {
|
|
472
|
+
w = document.fullscreenElement === document.documentElement;
|
|
442
473
|
}).finally(() => {
|
|
443
|
-
|
|
474
|
+
S === "screen" && !document.fullscreenElement && (D = !0, M());
|
|
444
475
|
}));
|
|
445
476
|
}
|
|
446
|
-
function
|
|
447
|
-
|
|
477
|
+
function M() {
|
|
478
|
+
E || (S === "screen" ? O || (D || !document.fullscreenElement ? (e.value = !0, k.value = !0) : (A(), k.value = !1)) : j());
|
|
448
479
|
}
|
|
449
|
-
function
|
|
450
|
-
if (
|
|
451
|
-
else if (!
|
|
452
|
-
|
|
480
|
+
function N() {
|
|
481
|
+
if (E = !0, document.fullscreenElement) D = !1;
|
|
482
|
+
else if (!T) {
|
|
483
|
+
D = !1;
|
|
453
484
|
try {
|
|
454
|
-
|
|
455
|
-
|
|
485
|
+
T = document.documentElement.requestFullscreen().then(() => {
|
|
486
|
+
D = !1, w = document.fullscreenElement === document.documentElement;
|
|
456
487
|
}, () => {
|
|
457
|
-
|
|
488
|
+
D = !0;
|
|
458
489
|
}).finally(() => {
|
|
459
|
-
|
|
490
|
+
T = void 0, M();
|
|
460
491
|
});
|
|
461
492
|
} catch {
|
|
462
|
-
|
|
493
|
+
D = !0;
|
|
463
494
|
}
|
|
464
495
|
}
|
|
465
496
|
}
|
|
466
|
-
function
|
|
467
|
-
|
|
497
|
+
function P() {
|
|
498
|
+
E = !1, S !== "screen" && j();
|
|
468
499
|
}
|
|
469
|
-
function
|
|
470
|
-
|
|
471
|
-
let r =
|
|
472
|
-
r &&
|
|
500
|
+
function F(t, n) {
|
|
501
|
+
S = t ?? "normal", O = !1, k.value = !1, b(t == null ? n : t === "collapsePanel" ? "panel" : t === "collapseAll" ? "all" : "none");
|
|
502
|
+
let r = S === "content" || S === "screen";
|
|
503
|
+
r && C === null && (C = e.value), r || (A(), C = null), S === "content" && (e.value = !0), S === "screen" && !E && N(), E = !1, S === "screen" ? M() : j();
|
|
473
504
|
}
|
|
474
|
-
function
|
|
475
|
-
|
|
505
|
+
function I() {
|
|
506
|
+
O = !0, w = !1, k.value = !1;
|
|
476
507
|
}
|
|
477
|
-
function
|
|
478
|
-
|
|
508
|
+
function L() {
|
|
509
|
+
w && document.fullscreenElement !== document.documentElement && (w = !1, O = !0, k.value = !1);
|
|
479
510
|
}
|
|
480
|
-
function
|
|
481
|
-
|
|
511
|
+
function R() {
|
|
512
|
+
O = !1, N(), E = !1, T || M();
|
|
482
513
|
}
|
|
483
|
-
function
|
|
484
|
-
|
|
514
|
+
function z() {
|
|
515
|
+
k.value = !1;
|
|
485
516
|
}
|
|
486
|
-
function
|
|
487
|
-
|
|
517
|
+
function ee() {
|
|
518
|
+
O = !0, k.value = !1, e.value = !e.value;
|
|
488
519
|
}
|
|
489
|
-
function
|
|
520
|
+
function te(e) {
|
|
490
521
|
t.value = e, e !== "phone" && (r.value = !1), e !== "pad" && (i.value = !1);
|
|
491
522
|
}
|
|
492
|
-
function
|
|
523
|
+
function B() {
|
|
493
524
|
r.value = !1;
|
|
494
525
|
}
|
|
495
|
-
function
|
|
526
|
+
function V() {
|
|
496
527
|
r.value = !0;
|
|
497
528
|
}
|
|
498
|
-
function
|
|
529
|
+
function ne() {
|
|
499
530
|
i.value = !1;
|
|
500
531
|
}
|
|
501
|
-
function
|
|
532
|
+
function H() {
|
|
502
533
|
i.value = !0;
|
|
503
534
|
}
|
|
504
|
-
function
|
|
535
|
+
function re() {
|
|
505
536
|
r.value = !1, i.value = !1;
|
|
506
537
|
}
|
|
507
|
-
function
|
|
508
|
-
|
|
538
|
+
function U() {
|
|
539
|
+
F("normal"), e.value = !1, b("none"), re(), u.value = {}, d.value = {}, f = void 0;
|
|
509
540
|
}
|
|
510
541
|
return {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
542
|
+
enterParentPage: p,
|
|
543
|
+
menuGroups: d,
|
|
544
|
+
ensureMenuGroup: h,
|
|
545
|
+
setMenuGroup: m,
|
|
546
|
+
clickMenuApp: _,
|
|
547
|
+
clickMenuGroup: g,
|
|
548
|
+
reset: U,
|
|
549
|
+
pageScreenPrompt: k,
|
|
550
|
+
preparePageScreen: N,
|
|
551
|
+
cancelPageScreen: P,
|
|
552
|
+
applyPageOpenMode: F,
|
|
553
|
+
pageScreenManual: I,
|
|
554
|
+
syncPageScreen: L,
|
|
555
|
+
retryPageScreen: R,
|
|
556
|
+
dismissPageScreenPrompt: z,
|
|
520
557
|
contentFullscreen: e,
|
|
521
558
|
mode: t,
|
|
522
559
|
mobileMenuOpen: r,
|
|
@@ -526,16 +563,16 @@ var Ge = {
|
|
|
526
563
|
sidePanelCollapsed: s,
|
|
527
564
|
sideHidden: c,
|
|
528
565
|
sideHiddenActive: l,
|
|
529
|
-
toggleSidePanel:
|
|
530
|
-
showSide:
|
|
531
|
-
applySideCollapse:
|
|
532
|
-
toggleContentFullscreen:
|
|
533
|
-
setMode:
|
|
534
|
-
closeMobileMenu:
|
|
535
|
-
openMobileMenu:
|
|
536
|
-
closePadPanel:
|
|
537
|
-
openPadPanel:
|
|
538
|
-
closeOverlays:
|
|
566
|
+
toggleSidePanel: v,
|
|
567
|
+
showSide: y,
|
|
568
|
+
applySideCollapse: b,
|
|
569
|
+
toggleContentFullscreen: ee,
|
|
570
|
+
setMode: te,
|
|
571
|
+
closeMobileMenu: B,
|
|
572
|
+
openMobileMenu: V,
|
|
573
|
+
closePadPanel: ne,
|
|
574
|
+
openPadPanel: H,
|
|
575
|
+
closeOverlays: re
|
|
539
576
|
};
|
|
540
577
|
});
|
|
541
578
|
// packages/core/src/tabs-policy.ts
|
|
@@ -551,7 +588,7 @@ function ut(e, t, n, r, i) {
|
|
|
551
588
|
}
|
|
552
589
|
// packages/core/src/stores/tabs.ts
|
|
553
590
|
var dt = "tabs", ft = I("campus-tabs", () => {
|
|
554
|
-
let e =
|
|
591
|
+
let e = je(q().menus), t = new Set(e.map((e) => e.key)), r = e.filter((e) => e.affix).map((e) => e.key), i = he(dt, "session"), a = !Array.isArray(i) && Array.isArray(i?.affix) ? i.affix : [], o = x(a.filter((e) => t.has(e) && !r.includes(e))), s = n(() => [...r, ...o.value]), c = q().maxTabs, l = typeof c == "number" && Number.isFinite(c) ? Math.max(1, Math.floor(c)) : 20, u = (Array.isArray(i) ? i : Array.isArray(i?.visited) ? i.visited : []).filter((e) => typeof e == "string" && t.has(e)), d = x([.../* @__PURE__ */ new Set([...s.value, ...u])]), f = !Array.isArray(i) && i?.active && typeof i.active == "object" ? i.active : {}, p = x(Object.fromEntries(Object.entries(f).filter(([e, n]) => t.has(e) && typeof n == "number" && Number.isFinite(n))));
|
|
555
592
|
for (let [e, t] of d.value.entries()) Number.isFinite(p.value[t]) || (p.value[t] = e + 1);
|
|
556
593
|
for (;;) {
|
|
557
594
|
let e = ut(d.value, p.value, "", s.value, l);
|
|
@@ -560,7 +597,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
560
597
|
}
|
|
561
598
|
let h = x({}), g = x(null), _ = n(() => d.value.filter((e) => e !== g.value));
|
|
562
599
|
function v() {
|
|
563
|
-
p.value = Object.fromEntries(d.value.map((e) => [e, p.value[e] ?? 0])),
|
|
600
|
+
p.value = Object.fromEntries(d.value.map((e) => [e, p.value[e] ?? 0])), ge(dt, {
|
|
564
601
|
visited: d.value,
|
|
565
602
|
active: p.value,
|
|
566
603
|
affix: o.value
|
|
@@ -618,7 +655,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
618
655
|
setAffix: D
|
|
619
656
|
};
|
|
620
657
|
}), pt = "session", Q = I("campus-session", () => {
|
|
621
|
-
let e =
|
|
658
|
+
let e = he(pt, "session"), t = x(e?.token ?? ""), r = x(e?.user), i = n(() => !!(t.value && r.value));
|
|
622
659
|
function a(e) {
|
|
623
660
|
if (!e) return !0;
|
|
624
661
|
let t = r.value?.permissions;
|
|
@@ -628,28 +665,28 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
628
665
|
r.value && (r.value = {
|
|
629
666
|
...r.value,
|
|
630
667
|
permissions: e
|
|
631
|
-
},
|
|
668
|
+
}, ge(pt, {
|
|
632
669
|
token: t.value,
|
|
633
670
|
user: r.value
|
|
634
671
|
}, "session"));
|
|
635
672
|
}
|
|
636
673
|
async function s(e) {
|
|
637
|
-
c(await
|
|
674
|
+
c(await q().auth.login(e));
|
|
638
675
|
}
|
|
639
676
|
function c(e) {
|
|
640
|
-
t.value = e.token, r.value = e.user,
|
|
677
|
+
t.value = e.token, r.value = e.user, ge(pt, e, "session");
|
|
641
678
|
}
|
|
642
679
|
async function l() {
|
|
643
680
|
try {
|
|
644
|
-
await
|
|
681
|
+
await q().auth.logout?.();
|
|
645
682
|
} catch (e) {
|
|
646
683
|
console.warn("[campus] 退出时通知服务端失败,已清除本地登录态:", e);
|
|
647
684
|
} finally {
|
|
648
|
-
t.value = "", r.value = void 0,
|
|
685
|
+
t.value = "", r.value = void 0, G(pt, null, "session"), ft().reset(), Z().reset();
|
|
649
686
|
}
|
|
650
687
|
}
|
|
651
688
|
function u() {
|
|
652
|
-
t.value = "", r.value = void 0,
|
|
689
|
+
t.value = "", r.value = void 0, G(pt, null, "session"), ft().reset(), Z().reset();
|
|
653
690
|
}
|
|
654
691
|
return {
|
|
655
692
|
token: t,
|
|
@@ -700,11 +737,11 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
700
737
|
}),
|
|
701
738
|
emits: ["update:code", "update:captchaKey"],
|
|
702
739
|
setup(e, { expose: t }) {
|
|
703
|
-
let n = e, r = O(e, "code"), i = O(e, "captchaKey"), { t: c, label: l } =
|
|
740
|
+
let n = e, r = O(e, "code"), i = O(e, "captchaKey"), { t: c, label: l } = K(), d = Y().fields?.captcha, f = x(""), p = x(!1), m = x(!1);
|
|
704
741
|
async function h() {
|
|
705
742
|
m.value = !0;
|
|
706
743
|
try {
|
|
707
|
-
let e = await
|
|
744
|
+
let e = await q().auth.captcha(n.scene);
|
|
708
745
|
i.value = e.key, f.value = e.image, p.value = !1;
|
|
709
746
|
} catch {
|
|
710
747
|
f.value = "", p.value = !0;
|
|
@@ -750,7 +787,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
750
787
|
__name: "LoginForm",
|
|
751
788
|
props: { preview: { type: Boolean } },
|
|
752
789
|
setup(t) {
|
|
753
|
-
let r = t, c =
|
|
790
|
+
let r = t, c = U(), d = W(), f = Q(), { t: p, label: m } = K(), h = Ue(), g = Y(), _ = g.fields ?? {}, v = b({
|
|
754
791
|
username: "",
|
|
755
792
|
password: "",
|
|
756
793
|
captcha: ""
|
|
@@ -807,7 +844,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
807
844
|
function R(e) {
|
|
808
845
|
r.preview && e.preventDefault();
|
|
809
846
|
}
|
|
810
|
-
let
|
|
847
|
+
let z = n(() => h.forgot || h.register);
|
|
811
848
|
return (t, n) => {
|
|
812
849
|
let r = w("ca-alert"), c = w("ca-input"), d = w("ca-form-item"), f = w("ca-button"), g = w("ca-form");
|
|
813
850
|
return y(), o(e, null, [
|
|
@@ -900,24 +937,24 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
900
937
|
]),
|
|
901
938
|
_: 1
|
|
902
939
|
}, 8, ["model", "rules"]),
|
|
903
|
-
|
|
940
|
+
z.value ? (y(), o("div", xt, [D(h).forgot ? (y(), i(D(V), {
|
|
904
941
|
key: 0,
|
|
905
|
-
to: { name: D(
|
|
942
|
+
to: { name: D(J)(D(q)()).forgot },
|
|
906
943
|
onClick: R
|
|
907
944
|
}, {
|
|
908
945
|
default: M(() => [l(E(D(p)("campus.auth.forgotLink")), 1)]),
|
|
909
946
|
_: 1
|
|
910
|
-
}, 8, ["to"])) : a("v-if", !0), D(h).register ? (y(), i(D(
|
|
947
|
+
}, 8, ["to"])) : a("v-if", !0), D(h).register ? (y(), i(D(V), {
|
|
911
948
|
key: 1,
|
|
912
|
-
to: { name: D(
|
|
949
|
+
to: { name: D(J)(D(q)()).register },
|
|
913
950
|
onClick: R
|
|
914
951
|
}, {
|
|
915
952
|
default: M(() => [l(E(D(p)("campus.auth.registerLink")), 1)]),
|
|
916
953
|
_: 1
|
|
917
954
|
}, 8, ["to"])) : a("v-if", !0)])) : a("v-if", !0),
|
|
918
|
-
s("div", St, [s("h3", null, E(D(p)("campus.auth.helpTitle")), 1), s("ol", null, [(y(!0), o(e, null, S(F.value, (t, n) => (y(), o("li", { key: n }, [(y(!0), o(e, null, S(t, (t, n) => (y(), o(e, { key: n }, [t === null ? D(h).forgot ? (y(), i(D(
|
|
955
|
+
s("div", St, [s("h3", null, E(D(p)("campus.auth.helpTitle")), 1), s("ol", null, [(y(!0), o(e, null, S(F.value, (t, n) => (y(), o("li", { key: n }, [(y(!0), o(e, null, S(t, (t, n) => (y(), o(e, { key: n }, [t === null ? D(h).forgot ? (y(), i(D(V), {
|
|
919
956
|
key: 1,
|
|
920
|
-
to: { name: D(
|
|
957
|
+
to: { name: D(J)(D(q)()).forgot },
|
|
921
958
|
onClick: R
|
|
922
959
|
}, {
|
|
923
960
|
default: M(() => [l(E(D(p)("campus.auth.findPassword")), 1)]),
|
|
@@ -972,12 +1009,12 @@ var Tt = {
|
|
|
972
1009
|
__name: "WechatPane",
|
|
973
1010
|
props: { preview: { type: Boolean } },
|
|
974
1011
|
setup(e) {
|
|
975
|
-
let t = e, { t: r } =
|
|
1012
|
+
let t = e, { t: r } = K(), i = n(() => Y().panel?.qrcode), d = !t.preview && Ue().wechat, f = x(), p = x(!1), h;
|
|
976
1013
|
function g() {
|
|
977
1014
|
h?.release(), h = void 0;
|
|
978
1015
|
}
|
|
979
1016
|
async function b() {
|
|
980
|
-
g(), p.value = !1, await m(), f.value && (h = wt(
|
|
1017
|
+
g(), p.value = !1, await m(), f.value && (h = wt(q().auth.wechat.mount, f.value), p.value = !h.ok);
|
|
981
1018
|
}
|
|
982
1019
|
return v(() => {
|
|
983
1020
|
d && b();
|
|
@@ -1010,7 +1047,7 @@ var Tt = {
|
|
|
1010
1047
|
__name: "LoginSplit",
|
|
1011
1048
|
props: { preview: { type: Boolean } },
|
|
1012
1049
|
setup(e) {
|
|
1013
|
-
let { t } =
|
|
1050
|
+
let { t } = K(), r = Y().tabs?.length ? Y().tabs : ["account", "wechat"], a = x(r[0]), o = n(() => r.map((e) => ({
|
|
1014
1051
|
key: e,
|
|
1015
1052
|
label: t(e === "account" ? "campus.auth.tabAccount" : "campus.auth.tabWechat")
|
|
1016
1053
|
})));
|
|
@@ -1048,14 +1085,14 @@ function zt(e) {
|
|
|
1048
1085
|
Rt = e;
|
|
1049
1086
|
}
|
|
1050
1087
|
async function Bt(e, t = {}) {
|
|
1051
|
-
await
|
|
1088
|
+
await de.alert(e, t.title ?? Rt("campus.common.tip"), {
|
|
1052
1089
|
type: t.type ?? "info",
|
|
1053
1090
|
confirmButtonText: t.confirmText ?? Rt("campus.common.ok")
|
|
1054
1091
|
});
|
|
1055
1092
|
}
|
|
1056
1093
|
async function Vt(e, t = {}) {
|
|
1057
1094
|
try {
|
|
1058
|
-
return await
|
|
1095
|
+
return await de.confirm(e, t.title ?? Rt("campus.common.tip"), {
|
|
1059
1096
|
type: t.type ?? "warning",
|
|
1060
1097
|
confirmButtonText: t.confirmText ?? Rt("campus.common.confirm"),
|
|
1061
1098
|
cancelButtonText: t.cancelText ?? Rt("campus.common.cancel")
|
|
@@ -1066,31 +1103,31 @@ async function Vt(e, t = {}) {
|
|
|
1066
1103
|
}
|
|
1067
1104
|
}
|
|
1068
1105
|
var Ht = {
|
|
1069
|
-
info: (e) => void
|
|
1106
|
+
info: (e) => void ue({
|
|
1070
1107
|
message: e,
|
|
1071
1108
|
type: "info"
|
|
1072
1109
|
}),
|
|
1073
|
-
success: (e) => void
|
|
1110
|
+
success: (e) => void ue({
|
|
1074
1111
|
message: e,
|
|
1075
1112
|
type: "success"
|
|
1076
1113
|
}),
|
|
1077
|
-
warning: (e) => void
|
|
1114
|
+
warning: (e) => void ue({
|
|
1078
1115
|
message: e,
|
|
1079
1116
|
type: "warning"
|
|
1080
1117
|
}),
|
|
1081
|
-
error: (e) => void
|
|
1118
|
+
error: (e) => void ue({
|
|
1082
1119
|
message: e,
|
|
1083
1120
|
type: "error"
|
|
1084
1121
|
})
|
|
1085
|
-
}, Ut =
|
|
1122
|
+
}, Ut = le.service;
|
|
1086
1123
|
function Wt(e, t, n = {}) {
|
|
1087
|
-
let r =
|
|
1124
|
+
let r = fe({
|
|
1088
1125
|
...n,
|
|
1089
1126
|
title: n.title ?? Rt(`campus.notify.${e}`),
|
|
1090
1127
|
message: t,
|
|
1091
1128
|
type: e
|
|
1092
1129
|
});
|
|
1093
|
-
return m(() =>
|
|
1130
|
+
return m(() => fe.updateOffsets(n.position)), r;
|
|
1094
1131
|
}
|
|
1095
1132
|
// packages/core/src/services/ca.ts
|
|
1096
1133
|
var Gt = {
|
|
@@ -1112,7 +1149,7 @@ var Gt = {
|
|
|
1112
1149
|
}),
|
|
1113
1150
|
emits: ["update:modelValue"],
|
|
1114
1151
|
setup(e) {
|
|
1115
|
-
let t = e, n = O(e, "modelValue"), { t: r } =
|
|
1152
|
+
let t = e, n = O(e, "modelValue"), { t: r } = K(), i = x(0), a = x(!1), c;
|
|
1116
1153
|
function l() {
|
|
1117
1154
|
c && clearInterval(c), c = void 0;
|
|
1118
1155
|
}
|
|
@@ -1162,7 +1199,7 @@ var Gt = {
|
|
|
1162
1199
|
__name: "RegisterForm",
|
|
1163
1200
|
props: { preview: { type: Boolean } },
|
|
1164
1201
|
setup(t) {
|
|
1165
|
-
let r = t, c =
|
|
1202
|
+
let r = t, c = W(), { t: d, label: f } = K(), p = Ue(), m = Ft(q()), g = Y(), _ = g.agreements ?? [], v = b({
|
|
1166
1203
|
phone: "",
|
|
1167
1204
|
captcha: "",
|
|
1168
1205
|
code: "",
|
|
@@ -1175,7 +1212,7 @@ var Gt = {
|
|
|
1175
1212
|
message: d("campus.auth.phonePlaceholder"),
|
|
1176
1213
|
trigger: "blur"
|
|
1177
1214
|
}, {
|
|
1178
|
-
pattern:
|
|
1215
|
+
pattern: He,
|
|
1179
1216
|
message: d("campus.auth.phoneInvalid"),
|
|
1180
1217
|
trigger: "blur"
|
|
1181
1218
|
}],
|
|
@@ -1222,7 +1259,7 @@ var Gt = {
|
|
|
1222
1259
|
}
|
|
1223
1260
|
if (A.value = "", r.preview) j.value = "info", A.value = d("campus.auth.previewNote");
|
|
1224
1261
|
else try {
|
|
1225
|
-
await
|
|
1262
|
+
await q().auth.sendSmsCode({
|
|
1226
1263
|
phone: v.phone,
|
|
1227
1264
|
scene: "register",
|
|
1228
1265
|
captcha: p.captcha ? {
|
|
@@ -1245,7 +1282,7 @@ var Gt = {
|
|
|
1245
1282
|
else {
|
|
1246
1283
|
k.value = !0, A.value = "";
|
|
1247
1284
|
try {
|
|
1248
|
-
await
|
|
1285
|
+
await q().auth.register({
|
|
1249
1286
|
phone: v.phone,
|
|
1250
1287
|
code: v.code,
|
|
1251
1288
|
password: v.password,
|
|
@@ -1253,7 +1290,7 @@ var Gt = {
|
|
|
1253
1290
|
key: C.value,
|
|
1254
1291
|
code: v.captcha
|
|
1255
1292
|
} : void 0
|
|
1256
|
-
}), Gt.toast.success(d("campus.auth.registerOk")), await c.replace({ name: q(
|
|
1293
|
+
}), Gt.toast.success(d("campus.auth.registerOk")), await c.replace({ name: J(q()).login });
|
|
1257
1294
|
} catch (e) {
|
|
1258
1295
|
I(e, d("campus.login.failed")), T.value?.refresh();
|
|
1259
1296
|
} finally {
|
|
@@ -1406,13 +1443,13 @@ var Gt = {
|
|
|
1406
1443
|
__name: "RegisterPage",
|
|
1407
1444
|
props: { preview: { type: Boolean } },
|
|
1408
1445
|
setup(e) {
|
|
1409
|
-
let { t } =
|
|
1446
|
+
let { t } = K(), r = Ue().register, a = n(() => [{
|
|
1410
1447
|
key: "register",
|
|
1411
1448
|
label: t("campus.auth.tabRegister")
|
|
1412
1449
|
}, {
|
|
1413
1450
|
key: "login",
|
|
1414
1451
|
label: t("campus.auth.backLogin"),
|
|
1415
|
-
to:
|
|
1452
|
+
to: Me(q()).login
|
|
1416
1453
|
}]);
|
|
1417
1454
|
return (n, c) => (y(), i(st, {
|
|
1418
1455
|
active: "register",
|
|
@@ -1433,7 +1470,7 @@ var Gt = {
|
|
|
1433
1470
|
__name: "ForgotForm",
|
|
1434
1471
|
props: { preview: { type: Boolean } },
|
|
1435
1472
|
setup(t) {
|
|
1436
|
-
let r = t, s =
|
|
1473
|
+
let r = t, s = W(), { t: c, label: d } = K(), f = Ue(), p = Ft(q()), m = Y(), g = b({
|
|
1437
1474
|
account: "",
|
|
1438
1475
|
captcha: "",
|
|
1439
1476
|
code: "",
|
|
@@ -1484,8 +1521,8 @@ var Gt = {
|
|
|
1484
1521
|
}
|
|
1485
1522
|
if (T.value = "", r.preview) O.value = "info", T.value = c("campus.auth.previewNote");
|
|
1486
1523
|
else try {
|
|
1487
|
-
await
|
|
1488
|
-
...
|
|
1524
|
+
await q().auth.sendSmsCode({
|
|
1525
|
+
...He.test(g.account) ? { phone: g.account } : { username: g.account },
|
|
1489
1526
|
scene: "forgot",
|
|
1490
1527
|
captcha: f.captcha ? {
|
|
1491
1528
|
key: _.value,
|
|
@@ -1507,7 +1544,7 @@ var Gt = {
|
|
|
1507
1544
|
else {
|
|
1508
1545
|
C.value = !0, T.value = "";
|
|
1509
1546
|
try {
|
|
1510
|
-
await
|
|
1547
|
+
await q().auth.resetPassword({
|
|
1511
1548
|
account: g.account,
|
|
1512
1549
|
code: g.code,
|
|
1513
1550
|
password: g.password,
|
|
@@ -1515,7 +1552,7 @@ var Gt = {
|
|
|
1515
1552
|
key: _.value,
|
|
1516
1553
|
code: g.captcha
|
|
1517
1554
|
} : void 0
|
|
1518
|
-
}), Gt.toast.success(c("campus.auth.resetOk")), await s.replace({ name: q(
|
|
1555
|
+
}), Gt.toast.success(c("campus.auth.resetOk")), await s.replace({ name: J(q()).login });
|
|
1519
1556
|
} catch (e) {
|
|
1520
1557
|
j(e, c("campus.login.failed")), v.value?.refresh();
|
|
1521
1558
|
} finally {
|
|
@@ -1649,13 +1686,13 @@ var Gt = {
|
|
|
1649
1686
|
__name: "ForgotPage",
|
|
1650
1687
|
props: { preview: { type: Boolean } },
|
|
1651
1688
|
setup(e) {
|
|
1652
|
-
let { t } =
|
|
1689
|
+
let { t } = K(), r = Ue().forgot, a = n(() => [{
|
|
1653
1690
|
key: "forgot",
|
|
1654
1691
|
label: t("campus.auth.tabForgot")
|
|
1655
1692
|
}, {
|
|
1656
1693
|
key: "login",
|
|
1657
1694
|
label: t("campus.auth.backLogin"),
|
|
1658
|
-
to:
|
|
1695
|
+
to: Me(q()).login
|
|
1659
1696
|
}]);
|
|
1660
1697
|
return (n, c) => (y(), i(st, {
|
|
1661
1698
|
active: "forgot",
|
|
@@ -1723,7 +1760,7 @@ var Gt = {
|
|
|
1723
1760
|
], Ln = ["title"], Rn = ["value", "aria-label"], zn = ["disabled"], Bn = { class: "ca-settings__group" }, Vn = { class: "ca-settings__title" }, Hn = ["aria-label"], Un = ["aria-checked", "onClick"], Wn = /*#__PURE__*/ X(/* @__PURE__ */ d({
|
|
1724
1761
|
__name: "HeaderBar",
|
|
1725
1762
|
setup(t) {
|
|
1726
|
-
let r =
|
|
1763
|
+
let r = U(), c = W(), d = Q(), f = Z(), p = Be(), { t: m, label: b, locale: C } = K(), T = q(), O = x(!1), k = [{
|
|
1727
1764
|
value: "border",
|
|
1728
1765
|
label: "campus.settings.boxBorder"
|
|
1729
1766
|
}, {
|
|
@@ -1763,30 +1800,30 @@ var Gt = {
|
|
|
1763
1800
|
y: n.top + n.height / 2
|
|
1764
1801
|
} : void 0);
|
|
1765
1802
|
}
|
|
1766
|
-
function
|
|
1767
|
-
C.value = e,
|
|
1803
|
+
function ee(e) {
|
|
1804
|
+
C.value = e, we(e);
|
|
1768
1805
|
}
|
|
1769
|
-
async function
|
|
1770
|
-
e === "account" ? T.onAccountClick ? await T.onAccountClick("header") : T.accountPath && P(T.accountPath) : (await d.logout(), await c.replace({ name: q(
|
|
1806
|
+
async function te(e) {
|
|
1807
|
+
e === "account" ? T.onAccountClick ? await T.onAccountClick("header") : T.accountPath && P(T.accountPath) : (await d.logout(), await c.replace({ name: J(q()).login }));
|
|
1771
1808
|
}
|
|
1772
|
-
let
|
|
1773
|
-
function
|
|
1774
|
-
|
|
1809
|
+
let B = x(!1);
|
|
1810
|
+
function V() {
|
|
1811
|
+
B.value = !!document.fullscreenElement;
|
|
1775
1812
|
}
|
|
1776
|
-
async function
|
|
1813
|
+
async function ne() {
|
|
1777
1814
|
f.pageScreenManual();
|
|
1778
1815
|
try {
|
|
1779
1816
|
document.fullscreenElement ? await document.exitFullscreen() : await document.documentElement.requestFullscreen();
|
|
1780
1817
|
} catch {}
|
|
1781
1818
|
}
|
|
1782
1819
|
v(() => {
|
|
1783
|
-
|
|
1784
|
-
}), _(() => document.removeEventListener("fullscreenchange",
|
|
1785
|
-
function
|
|
1820
|
+
V(), document.addEventListener("fullscreenchange", V);
|
|
1821
|
+
}), _(() => document.removeEventListener("fullscreenchange", V));
|
|
1822
|
+
function H(e) {
|
|
1786
1823
|
T.headerTools?.[e]?.();
|
|
1787
1824
|
}
|
|
1788
1825
|
return (t, n) => {
|
|
1789
|
-
let c = w("ca-icon"), _ = w("ca-dropdown-item"), v = w("ca-dropdown-menu"), x = w("ca-dropdown"),
|
|
1826
|
+
let c = w("ca-icon"), _ = w("ca-dropdown-item"), v = w("ca-dropdown-menu"), x = w("ca-dropdown"), V = w("ca-drawer");
|
|
1790
1827
|
return y(), o("header", dn, [
|
|
1791
1828
|
a(" 菜单按钮:手机打开抽屉;电脑档两栏都收起时也显示,点击重新显示侧栏 "),
|
|
1792
1829
|
s("button", {
|
|
@@ -1838,7 +1875,7 @@ var Gt = {
|
|
|
1838
1875
|
s("button", {
|
|
1839
1876
|
type: "button",
|
|
1840
1877
|
class: "ca-header__search",
|
|
1841
|
-
onClick: n[1] ||= (e) =>
|
|
1878
|
+
onClick: n[1] ||= (e) => H("search")
|
|
1842
1879
|
}, [
|
|
1843
1880
|
u(c, { name: "search" }),
|
|
1844
1881
|
s("span", xn, E(D(m)("campus.header.search")), 1),
|
|
@@ -1847,20 +1884,20 @@ var Gt = {
|
|
|
1847
1884
|
s("button", {
|
|
1848
1885
|
type: "button",
|
|
1849
1886
|
class: "ca-header__icon ca-header__desktop-tool",
|
|
1850
|
-
title:
|
|
1851
|
-
"aria-label":
|
|
1852
|
-
"aria-pressed":
|
|
1853
|
-
onClick:
|
|
1887
|
+
title: B.value ? D(m)("campus.header.exitFullscreen") : D(m)("campus.header.fullscreen"),
|
|
1888
|
+
"aria-label": B.value ? D(m)("campus.header.exitFullscreen") : D(m)("campus.header.fullscreen"),
|
|
1889
|
+
"aria-pressed": B.value,
|
|
1890
|
+
onClick: ne
|
|
1854
1891
|
}, [u(c, {
|
|
1855
|
-
name:
|
|
1892
|
+
name: B.value ? "exitFullscreen" : "fullscreen",
|
|
1856
1893
|
size: 18
|
|
1857
1894
|
}, null, 8, ["name"])], 8, Sn),
|
|
1858
1895
|
u(x, {
|
|
1859
1896
|
trigger: "click",
|
|
1860
|
-
onCommand:
|
|
1897
|
+
onCommand: ee
|
|
1861
1898
|
}, {
|
|
1862
1899
|
dropdown: M(() => [u(v, null, {
|
|
1863
|
-
default: M(() => [(y(!0), o(e, null, S(D(
|
|
1900
|
+
default: M(() => [(y(!0), o(e, null, S(D(z), (e) => (y(), i(_, {
|
|
1864
1901
|
key: e.code,
|
|
1865
1902
|
command: e.code,
|
|
1866
1903
|
class: h({ "is-current": D(C) === e.code })
|
|
@@ -1875,7 +1912,7 @@ var Gt = {
|
|
|
1875
1912
|
class: "ca-header__icon",
|
|
1876
1913
|
title: D(m)("campus.header.language"),
|
|
1877
1914
|
"aria-label": D(m)("campus.header.language")
|
|
1878
|
-
}, [s("span", wn, E(D(
|
|
1915
|
+
}, [s("span", wn, E(D(z).find((e) => e.code === D(C))?.label), 1)], 8, Cn)]),
|
|
1879
1916
|
_: 1
|
|
1880
1917
|
}),
|
|
1881
1918
|
s("button", {
|
|
@@ -1883,7 +1920,7 @@ var Gt = {
|
|
|
1883
1920
|
class: "ca-header__icon ca-header__desktop-tool",
|
|
1884
1921
|
title: D(m)("campus.header.notifications"),
|
|
1885
1922
|
"aria-label": D(m)("campus.header.notifications"),
|
|
1886
|
-
onClick: n[2] ||= (e) =>
|
|
1923
|
+
onClick: n[2] ||= (e) => H("notifications")
|
|
1887
1924
|
}, [u(c, {
|
|
1888
1925
|
name: "bell",
|
|
1889
1926
|
size: 18
|
|
@@ -1896,7 +1933,7 @@ var Gt = {
|
|
|
1896
1933
|
class: "ca-header__icon ca-header__desktop-tool",
|
|
1897
1934
|
title: D(m)("campus.header.assistant"),
|
|
1898
1935
|
"aria-label": D(m)("campus.header.assistant"),
|
|
1899
|
-
onClick: n[3] ||= (e) =>
|
|
1936
|
+
onClick: n[3] ||= (e) => H("assistant")
|
|
1900
1937
|
}, [u(c, {
|
|
1901
1938
|
name: "chat",
|
|
1902
1939
|
size: 18
|
|
@@ -1916,7 +1953,7 @@ var Gt = {
|
|
|
1916
1953
|
})], 8, Dn),
|
|
1917
1954
|
u(x, {
|
|
1918
1955
|
trigger: "click",
|
|
1919
|
-
onCommand:
|
|
1956
|
+
onCommand: te
|
|
1920
1957
|
}, {
|
|
1921
1958
|
dropdown: M(() => [u(v, null, {
|
|
1922
1959
|
default: M(() => [D(T).accountEntry?.header !== !1 && (D(T).accountPath || D(T).onAccountClick) ? (y(), i(_, {
|
|
@@ -1950,7 +1987,7 @@ var Gt = {
|
|
|
1950
1987
|
_: 1
|
|
1951
1988
|
})
|
|
1952
1989
|
]),
|
|
1953
|
-
u(
|
|
1990
|
+
u(V, {
|
|
1954
1991
|
modelValue: O.value,
|
|
1955
1992
|
"onUpdate:modelValue": n[7] ||= (e) => O.value = e,
|
|
1956
1993
|
title: D(m)("campus.settings.title"),
|
|
@@ -2029,8 +2066,8 @@ var Gt = {
|
|
|
2029
2066
|
}, Kn = { class: "ca-page-header__top" }, qn = { class: "ca-page-header__crumb" }, Jn = ["title", "aria-label"], Yn = { class: "ca-page-header__date" }, Xn = /*#__PURE__*/ X(/* @__PURE__ */ d({
|
|
2030
2067
|
__name: "PageHeader",
|
|
2031
2068
|
setup(t) {
|
|
2032
|
-
let r =
|
|
2033
|
-
let e = h.value ?
|
|
2069
|
+
let r = U(), { t: c, label: d, locale: f } = K(), p = ft(), m = new Map(je(q().menus).map((e) => [e.key, e])), h = n(() => r.meta.pageKey ? m.get(r.meta.pageKey) : void 0), g = n(() => {
|
|
2070
|
+
let e = h.value ? ke(h.value.key) : void 0;
|
|
2034
2071
|
if (!e) return [];
|
|
2035
2072
|
let t = e.titles.map((e) => d(e));
|
|
2036
2073
|
return h.value?.affix ? t.filter((e, n) => e !== t[n - 1]) : t;
|
|
@@ -2076,7 +2113,7 @@ var Gt = {
|
|
|
2076
2113
|
}, Qn = { class: "ca-page-header__title" }, $n = ["title"], er = /*#__PURE__*/ X(/* @__PURE__ */ d({
|
|
2077
2114
|
__name: "PageTitle",
|
|
2078
2115
|
setup(e) {
|
|
2079
|
-
let t =
|
|
2116
|
+
let t = U(), { label: r } = K(), i = new Map(je(q().menus).map((e) => [e.key, e])), c = n(() => t.meta.pageKey ? i.get(t.meta.pageKey) : void 0), l = n(() => c.value?.pageHeader ?? q().pageHeader ?? !0), u = n(() => c.value ? r(c.value.title) : ""), d = n(() => c.value?.description ? r(c.value.description) : "");
|
|
2080
2117
|
return (e, t) => c.value ? (y(), o("header", {
|
|
2081
2118
|
key: 0,
|
|
2082
2119
|
class: h(["ca-page-header__main", { "is-title-hidden": !l.value }])
|
|
@@ -2099,6 +2136,7 @@ var Gt = {
|
|
|
2099
2136
|
}
|
|
2100
2137
|
}), [["__scopeId", "data-v-98ee1b64"]]), tr = ["aria-label"], nr = ["onClick"], rr = { class: "ca-side__rail-list" }, ir = ["aria-current", "title"], ar = [
|
|
2101
2138
|
"aria-current",
|
|
2139
|
+
"aria-expanded",
|
|
2102
2140
|
"title",
|
|
2103
2141
|
"onClick"
|
|
2104
2142
|
], or = {
|
|
@@ -2115,118 +2153,147 @@ var Gt = {
|
|
|
2115
2153
|
], ur = ["title", "aria-label"], dr = ["inert"], fr = { class: "ca-side__panel-inner" }, pr = {
|
|
2116
2154
|
key: 0,
|
|
2117
2155
|
class: "ca-side__title"
|
|
2118
|
-
}, mr = {
|
|
2156
|
+
}, mr = { class: "ca-side__group-label" }, hr = {
|
|
2119
2157
|
key: 1,
|
|
2120
2158
|
class: "ca-side__group-badge"
|
|
2121
|
-
},
|
|
2159
|
+
}, gr = /*#__PURE__*/ X(/* @__PURE__ */ d({
|
|
2122
2160
|
__name: "SideMenu",
|
|
2123
2161
|
setup(t) {
|
|
2124
|
-
let r =
|
|
2125
|
-
function
|
|
2126
|
-
|
|
2162
|
+
let r = U(), c = W(), d = Q(), f = Z(), { t: p, label: g } = K(), _ = q(), v = n(() => f.sidePanelCollapsed), b = () => f.toggleSidePanel(), C = x(me("side-text-hidden") === "1");
|
|
2163
|
+
function T() {
|
|
2164
|
+
C.value = !C.value, G("side-text-hidden", C.value ? "1" : "0");
|
|
2127
2165
|
}
|
|
2128
|
-
async function
|
|
2129
|
-
e === "account" ?
|
|
2166
|
+
async function O(e) {
|
|
2167
|
+
e === "account" ? _.onAccountClick ? await _.onAccountClick("side") : _.accountPath && r.path !== _.accountPath && await c.push(_.accountPath) : (await d.logout(), await c.replace({ name: J(q()).login }));
|
|
2130
2168
|
}
|
|
2131
|
-
let
|
|
2169
|
+
let j = n(() => Ne(_, (e) => d.can(e))), P = n(() => j.value.home), F = n(() => j.value.apps), I = j.value.accountStandalone, L = x(), R = n(() => !!P.value && r.path === P.value.path);
|
|
2132
2170
|
A(() => [r.path, r.meta.appKey], () => {
|
|
2133
|
-
|
|
2171
|
+
L.value = R.value || I && r.path === _.accountPath ? void 0 : r.meta.appKey ?? F.value[0]?.key;
|
|
2134
2172
|
}, { immediate: !0 });
|
|
2135
|
-
let
|
|
2136
|
-
A(
|
|
2137
|
-
let
|
|
2138
|
-
function
|
|
2173
|
+
let z = n(() => F.value.find((e) => e.key === L.value)), ee = n(() => (f.mode === "phone" ? !f.mobileMenuOpen : f.mode === "pad" ? !f.padPanelOpen : v.value || f.sideHiddenActive) || !z.value?.children.length), te = x();
|
|
2174
|
+
A(z, (e) => e?.children.length && (te.value = e), { immediate: !0 });
|
|
2175
|
+
let B = n(() => z.value?.children.length ? z.value : te.value);
|
|
2176
|
+
function V(e) {
|
|
2139
2177
|
let t = typeof e.badge == "function" ? e.badge() : e.badge ?? 0;
|
|
2140
2178
|
return t > 0 ? t : 0;
|
|
2141
2179
|
}
|
|
2142
|
-
function
|
|
2143
|
-
return e.children.reduce((e, t) => e + (
|
|
2180
|
+
function ne(e) {
|
|
2181
|
+
return e.children.reduce((e, t) => e + (Ee(t) ? V(t) : 0), 0);
|
|
2182
|
+
}
|
|
2183
|
+
let H = x(), re = !0;
|
|
2184
|
+
function ie(e, t) {
|
|
2185
|
+
re || f.setMenuGroup(e, t);
|
|
2186
|
+
}
|
|
2187
|
+
let ae = n(() => Object.keys(f.menuGroups).filter((e) => f.menuGroups[e]));
|
|
2188
|
+
A(() => r.meta.groupKey, (e) => {
|
|
2189
|
+
e && f.ensureMenuGroup(e);
|
|
2190
|
+
}, { immediate: !0 }), A([
|
|
2191
|
+
() => f.menuGroups,
|
|
2192
|
+
B,
|
|
2193
|
+
() => r.path
|
|
2194
|
+
], async () => {
|
|
2195
|
+
re = !0, await m();
|
|
2196
|
+
for (let e of B.value?.children ?? []) Ee(e) && e.children.length && (f.menuGroups[e.key] ? H.value?.open(e.key) : H.value?.close(e.key));
|
|
2197
|
+
re = !1;
|
|
2198
|
+
}, {
|
|
2199
|
+
deep: !0,
|
|
2200
|
+
immediate: !0
|
|
2201
|
+
});
|
|
2202
|
+
async function oe(e) {
|
|
2203
|
+
let t = F.value.find((t) => t.key === e);
|
|
2204
|
+
if (!t) return;
|
|
2205
|
+
let n = L.value === e;
|
|
2206
|
+
L.value = e, await f.clickMenuApp(t, r.path, (e) => c.push(e), n);
|
|
2144
2207
|
}
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2208
|
+
function se(e, t) {
|
|
2209
|
+
let n = e.currentTarget, i = e.type === "keydown";
|
|
2210
|
+
(n.firstElementChild?.contains(e.target) || i && e.target === n) && (!i || ["Enter", " "].includes(e.key)) && (e.preventDefault(), e.stopPropagation(), f.clickMenuGroup(t, r.path, (e) => c.push(e)));
|
|
2148
2211
|
}
|
|
2149
|
-
let
|
|
2150
|
-
function
|
|
2212
|
+
let ce = n(() => (_.shortcuts ?? []).filter((e) => d.can(e.permission)));
|
|
2213
|
+
function le(e) {
|
|
2151
2214
|
f.closeOverlays(), r.path !== e && c.push(e);
|
|
2152
2215
|
}
|
|
2153
2216
|
return (t, n) => {
|
|
2154
|
-
let c = w("ca-icon"),
|
|
2217
|
+
let c = w("ca-icon"), m = w("ca-dropdown-item"), x = w("ca-dropdown-menu"), A = w("ca-dropdown"), j = w("ca-menu-item"), I = w("ca-sub-menu"), L = w("ca-menu");
|
|
2155
2218
|
return y(), o(e, null, [a(" 两栏都收起(只在电脑档):整个侧栏向左滑出,第二栏同时收起;不可聚焦由 CaLayout 的 inert 负责 "), s("aside", { class: h(["ca-side", {
|
|
2156
2219
|
"is-pad-open": D(f).mode === "pad" && D(f).padPanelOpen,
|
|
2157
2220
|
"is-hidden": D(f).sideHiddenActive,
|
|
2158
|
-
"is-text-hidden":
|
|
2221
|
+
"is-text-hidden": C.value
|
|
2159
2222
|
}]) }, [
|
|
2160
|
-
|
|
2223
|
+
ce.value.length ? (y(), o("nav", {
|
|
2161
2224
|
key: 0,
|
|
2162
2225
|
class: "ca-side__shortcuts",
|
|
2163
2226
|
"aria-label": D(p)("campus.header.shortcuts")
|
|
2164
|
-
}, [(y(!0), o(e, null, S(
|
|
2227
|
+
}, [(y(!0), o(e, null, S(ce.value, (e) => (y(), o("button", {
|
|
2165
2228
|
key: e.key,
|
|
2166
2229
|
type: "button",
|
|
2167
2230
|
class: h({ "is-active": D(r).path === e.path }),
|
|
2168
|
-
onClick: (t) =>
|
|
2169
|
-
}, E(D(
|
|
2170
|
-
s("nav", { class: h(["ca-side__rail", { "is-compact":
|
|
2231
|
+
onClick: (t) => le(e.path)
|
|
2232
|
+
}, E(D(g)(e.title)), 11, nr))), 128))], 8, tr)) : a("v-if", !0),
|
|
2233
|
+
s("nav", { class: h(["ca-side__rail", { "is-compact": C.value }]) }, [
|
|
2171
2234
|
a(" 入口列表单独滚动;底部工具按钮固定在外面,窗口再矮也不会被挤出屏幕 "),
|
|
2172
|
-
s("div", rr, [
|
|
2235
|
+
s("div", rr, [P.value ? (y(), o("button", {
|
|
2173
2236
|
key: 0,
|
|
2174
2237
|
type: "button",
|
|
2175
|
-
class: h(["ca-side__rail-item", { "is-active":
|
|
2176
|
-
"aria-current":
|
|
2177
|
-
title:
|
|
2178
|
-
onClick: n[0] ||= (e) =>
|
|
2179
|
-
}, [u(c, { name: "home" }), N(s("span", { class: "ca-side__rail-text" }, E(D(p)("campus.side.home")), 513), [[k, !
|
|
2238
|
+
class: h(["ca-side__rail-item", { "is-active": R.value }]),
|
|
2239
|
+
"aria-current": R.value ? "page" : void 0,
|
|
2240
|
+
title: C.value ? D(p)("campus.side.home") : void 0,
|
|
2241
|
+
onClick: n[0] ||= (e) => le(P.value.path)
|
|
2242
|
+
}, [u(c, { name: "home" }), N(s("span", { class: "ca-side__rail-text" }, E(D(p)("campus.side.home")), 513), [[k, !C.value || D(f).mobileMenuOpen]])], 10, ir)) : a("v-if", !0), (y(!0), o(e, null, S(F.value, (e) => (y(), o("button", {
|
|
2180
2243
|
key: e.key,
|
|
2181
2244
|
type: "button",
|
|
2182
|
-
class: h(["ca-side__rail-item", {
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2245
|
+
class: h(["ca-side__rail-item", {
|
|
2246
|
+
"is-active": e.path === D(r).path,
|
|
2247
|
+
"is-ancestor": e.key === z.value?.key && e.path !== D(r).path
|
|
2248
|
+
}]),
|
|
2249
|
+
"aria-current": e.path === D(r).path ? "page" : void 0,
|
|
2250
|
+
"aria-expanded": e.children.length ? e.key === z.value?.key && !ee.value : void 0,
|
|
2251
|
+
title: C.value ? D(g)(e.title) : void 0,
|
|
2252
|
+
onClick: (t) => oe(e.key)
|
|
2186
2253
|
}, [
|
|
2187
2254
|
u(c, {
|
|
2188
2255
|
name: e.icon,
|
|
2189
2256
|
fallback: "grid"
|
|
2190
2257
|
}, null, 8, ["name"]),
|
|
2191
|
-
N(s("span", { class: "ca-side__rail-text" }, E(D(
|
|
2192
|
-
|
|
2258
|
+
N(s("span", { class: "ca-side__rail-text" }, E(D(g)(e.title)), 513), [[k, !C.value || D(f).mobileMenuOpen]]),
|
|
2259
|
+
ne(e) ? (y(), o("span", or, E(ne(e)), 1)) : a("v-if", !0)
|
|
2193
2260
|
], 10, ar))), 128))]),
|
|
2194
2261
|
s("div", sr, [
|
|
2195
2262
|
s("button", {
|
|
2196
2263
|
type: "button",
|
|
2197
2264
|
class: "ca-side__tool",
|
|
2198
|
-
title:
|
|
2199
|
-
"aria-label":
|
|
2200
|
-
"aria-pressed":
|
|
2201
|
-
onClick:
|
|
2265
|
+
title: C.value ? D(p)("campus.side.showText") : D(p)("campus.side.hideText"),
|
|
2266
|
+
"aria-label": C.value ? D(p)("campus.side.showText") : D(p)("campus.side.hideText"),
|
|
2267
|
+
"aria-pressed": C.value,
|
|
2268
|
+
onClick: T
|
|
2202
2269
|
}, [u(c, {
|
|
2203
|
-
name:
|
|
2270
|
+
name: C.value ? "view" : "hide",
|
|
2204
2271
|
size: 18
|
|
2205
2272
|
}, null, 8, ["name"])], 8, cr),
|
|
2206
2273
|
s("button", {
|
|
2207
2274
|
type: "button",
|
|
2208
2275
|
class: "ca-side__tool ca-side__tool--collapse",
|
|
2209
|
-
title:
|
|
2210
|
-
"aria-label":
|
|
2211
|
-
"aria-expanded": !
|
|
2212
|
-
onClick:
|
|
2276
|
+
title: v.value ? D(p)("campus.side.expand") : D(p)("campus.side.collapse"),
|
|
2277
|
+
"aria-label": v.value ? D(p)("campus.side.expand") : D(p)("campus.side.collapse"),
|
|
2278
|
+
"aria-expanded": !v.value,
|
|
2279
|
+
onClick: b
|
|
2213
2280
|
}, [u(c, {
|
|
2214
|
-
name:
|
|
2281
|
+
name: v.value ? "expand" : "fold",
|
|
2215
2282
|
size: 18
|
|
2216
2283
|
}, null, 8, ["name"])], 8, lr),
|
|
2217
2284
|
u(A, {
|
|
2218
2285
|
trigger: "click",
|
|
2219
2286
|
placement: "right-end",
|
|
2220
|
-
onCommand:
|
|
2287
|
+
onCommand: O
|
|
2221
2288
|
}, {
|
|
2222
|
-
dropdown: M(() => [u(
|
|
2223
|
-
default: M(() => [D(
|
|
2289
|
+
dropdown: M(() => [u(x, null, {
|
|
2290
|
+
default: M(() => [D(_).accountEntry?.side !== !1 && (D(_).accountPath || D(_).onAccountClick) ? (y(), i(m, {
|
|
2224
2291
|
key: 0,
|
|
2225
2292
|
command: "account"
|
|
2226
2293
|
}, {
|
|
2227
2294
|
default: M(() => [l(E(D(p)("campus.header.myAccount")), 1)]),
|
|
2228
2295
|
_: 1
|
|
2229
|
-
})) : a("v-if", !0), u(
|
|
2296
|
+
})) : a("v-if", !0), u(m, {
|
|
2230
2297
|
command: "logout",
|
|
2231
2298
|
divided: ""
|
|
2232
2299
|
}, {
|
|
@@ -2251,80 +2318,105 @@ var Gt = {
|
|
|
2251
2318
|
], 2),
|
|
2252
2319
|
a(" 第二栏:隐藏时宽度渐变到 0(而不是直接消失),首页与其他页之间切换时内容区不会突然跳动 "),
|
|
2253
2320
|
s("div", {
|
|
2254
|
-
class: h(["ca-side__panel", {
|
|
2321
|
+
class: h(["ca-side__panel", {
|
|
2322
|
+
"is-hidden": ee.value,
|
|
2323
|
+
"is-empty": !z.value?.children.length
|
|
2324
|
+
}]),
|
|
2255
2325
|
inert: ee.value && !D(f).mobileMenuOpen
|
|
2256
2326
|
}, [s("div", fr, [
|
|
2257
|
-
|
|
2327
|
+
B.value ? (y(), o("div", pr, E(D(g)(B.value.title)), 1)) : a("v-if", !0),
|
|
2258
2328
|
a(" key 绑定场景:切换场景时重建菜单,展开状态不会串到别的场景 "),
|
|
2259
|
-
(y(), i(
|
|
2260
|
-
|
|
2329
|
+
(y(), i(L, {
|
|
2330
|
+
ref_key: "menuRef",
|
|
2331
|
+
ref: H,
|
|
2332
|
+
key: B.value?.key,
|
|
2261
2333
|
"default-active": D(r).path,
|
|
2262
|
-
"default-openeds":
|
|
2334
|
+
"default-openeds": ae.value,
|
|
2263
2335
|
router: "",
|
|
2264
2336
|
class: "ca-side__menu",
|
|
2265
|
-
onSelect: n[1] ||= (e) => D(f).closeOverlays()
|
|
2337
|
+
onSelect: n[1] ||= (e) => D(f).closeOverlays(),
|
|
2338
|
+
onOpen: n[2] ||= (e) => ie(e, !0),
|
|
2339
|
+
onClose: n[3] ||= (e) => ie(e, !1)
|
|
2266
2340
|
}, {
|
|
2267
|
-
default: M(() => [(y(!0), o(e, null, S(
|
|
2341
|
+
default: M(() => [(y(!0), o(e, null, S(B.value?.children ?? [], (t) => (y(), o(e, { key: t.key }, [a(" 二级是菜单组:可展开,下面是三级页面 "), D(Ee)(t) && t.children.length ? (y(), i(I, {
|
|
2268
2342
|
key: 0,
|
|
2269
|
-
index: t.key
|
|
2343
|
+
index: t.key,
|
|
2344
|
+
tabindex: "0",
|
|
2345
|
+
class: h({
|
|
2346
|
+
"is-current-page": t.path === D(r).path,
|
|
2347
|
+
"is-ancestor": D(r).meta.groupKey === t.key && t.path !== D(r).path
|
|
2348
|
+
}),
|
|
2349
|
+
"aria-current": t.path === D(r).path ? "page" : void 0,
|
|
2350
|
+
onClickCapture: (e) => se(e, t),
|
|
2351
|
+
onKeydownCapture: (e) => se(e, t)
|
|
2270
2352
|
}, {
|
|
2271
|
-
title: M(() => [
|
|
2353
|
+
title: M(() => [s("span", mr, [
|
|
2272
2354
|
t.icon ? (y(), i(c, {
|
|
2273
2355
|
key: 0,
|
|
2274
2356
|
name: t.icon
|
|
2275
2357
|
}, null, 8, ["name"])) : a("v-if", !0),
|
|
2276
|
-
s("span", null, E(D(
|
|
2277
|
-
|
|
2278
|
-
]),
|
|
2279
|
-
default: M(() => [(y(!0), o(e, null, S(t.children, (e) => (y(), i(
|
|
2358
|
+
s("span", null, E(D(g)(t.title)), 1),
|
|
2359
|
+
V(t) ? (y(), o("span", hr, E(V(t)), 1)) : a("v-if", !0)
|
|
2360
|
+
])]),
|
|
2361
|
+
default: M(() => [(y(!0), o(e, null, S(t.children, (e) => (y(), i(j, {
|
|
2280
2362
|
class: "ca-side__submenu-item",
|
|
2281
2363
|
key: e.key,
|
|
2282
|
-
index: e.path
|
|
2364
|
+
index: e.path,
|
|
2365
|
+
"aria-current": e.path === D(r).path ? "page" : void 0
|
|
2283
2366
|
}, {
|
|
2284
2367
|
default: M(() => [e.icon ? (y(), i(c, {
|
|
2285
2368
|
key: 0,
|
|
2286
2369
|
name: e.icon
|
|
2287
|
-
}, null, 8, ["name"])) : a("v-if", !0), s("span", null, E(D(
|
|
2370
|
+
}, null, 8, ["name"])) : a("v-if", !0), s("span", null, E(D(g)(e.title)), 1)]),
|
|
2288
2371
|
_: 2
|
|
2289
|
-
}, 1032, ["index"]))), 128))]),
|
|
2372
|
+
}, 1032, ["index", "aria-current"]))), 128))]),
|
|
2290
2373
|
_: 2
|
|
2291
|
-
}, 1032, [
|
|
2374
|
+
}, 1032, [
|
|
2375
|
+
"index",
|
|
2376
|
+
"class",
|
|
2377
|
+
"aria-current",
|
|
2378
|
+
"onClickCapture",
|
|
2379
|
+
"onKeydownCapture"
|
|
2380
|
+
])) : (y(), o(e, { key: 1 }, [a(" 二级直接是页面 "), u(j, {
|
|
2381
|
+
index: t.path,
|
|
2382
|
+
"aria-current": t.path === D(r).path ? "page" : void 0
|
|
2383
|
+
}, {
|
|
2292
2384
|
default: M(() => [t.icon ? (y(), i(c, {
|
|
2293
2385
|
key: 0,
|
|
2294
2386
|
name: t.icon
|
|
2295
|
-
}, null, 8, ["name"])) : a("v-if", !0), s("span", null, E(D(
|
|
2387
|
+
}, null, 8, ["name"])) : a("v-if", !0), s("span", null, E(D(g)(t.title)), 1)]),
|
|
2296
2388
|
_: 2
|
|
2297
|
-
}, 1032, ["index"])], 2112))], 64))), 128))]),
|
|
2389
|
+
}, 1032, ["index", "aria-current"])], 2112))], 64))), 128))]),
|
|
2298
2390
|
_: 1
|
|
2299
2391
|
}, 8, ["default-active", "default-openeds"]))
|
|
2300
2392
|
])], 10, dr)
|
|
2301
2393
|
], 2)], 2112);
|
|
2302
2394
|
};
|
|
2303
2395
|
}
|
|
2304
|
-
}), [["__scopeId", "data-v-
|
|
2396
|
+
}), [["__scopeId", "data-v-efa0bb9f"]]), _r = {
|
|
2305
2397
|
key: 0,
|
|
2306
2398
|
class: "ca-copyright"
|
|
2307
|
-
},
|
|
2399
|
+
}, vr = ["href"], yr = /*#__PURE__*/ X(/* @__PURE__ */ d({
|
|
2308
2400
|
__name: "CaCopyright",
|
|
2309
2401
|
setup(t) {
|
|
2310
|
-
let r =
|
|
2311
|
-
return (t, n) => c.value ? (y(), o("footer",
|
|
2402
|
+
let r = q().brand, { label: i } = K(), c = n(() => r.copyright ? Ve(i(r.copyright)) : ""), l = n(() => r.copyrightLinks ?? []);
|
|
2403
|
+
return (t, n) => c.value ? (y(), o("footer", _r, [s("span", null, E(c.value), 1), (y(!0), o(e, null, S(l.value, (t) => (y(), o(e, { key: t.href }, [n[0] ||= s("span", {
|
|
2312
2404
|
class: "ca-copyright__dot",
|
|
2313
2405
|
"aria-hidden": "true"
|
|
2314
2406
|
}, "·", -1), s("a", {
|
|
2315
2407
|
href: t.href,
|
|
2316
2408
|
target: "_blank",
|
|
2317
2409
|
rel: "noopener noreferrer"
|
|
2318
|
-
}, E(t.text), 9,
|
|
2410
|
+
}, E(t.text), 9, vr)], 64))), 128))])) : a("v-if", !0);
|
|
2319
2411
|
}
|
|
2320
|
-
}), [["__scopeId", "data-v-c51879e8"]]),
|
|
2412
|
+
}), [["__scopeId", "data-v-c51879e8"]]), br = { class: "ca-tabs" }, xr = ["onClick"], Sr = { class: "ca-tabs__more" }, Cr = [
|
|
2321
2413
|
"title",
|
|
2322
2414
|
"aria-label",
|
|
2323
2415
|
"aria-pressed"
|
|
2324
|
-
],
|
|
2416
|
+
], wr = /*#__PURE__*/ X(/* @__PURE__ */ d({
|
|
2325
2417
|
__name: "TabsBar",
|
|
2326
2418
|
setup(t) {
|
|
2327
|
-
let r =
|
|
2419
|
+
let r = U(), c = W(), d = ft(), f = Z(), { t: p, label: g } = K(), _ = new Map(je(q().menus).map((e) => [e.key, e])), b = n(() => d.visited.map((e) => _.get(e)).filter((e) => !!e).map((e) => ({
|
|
2328
2420
|
key: e.key,
|
|
2329
2421
|
path: e.path,
|
|
2330
2422
|
title: g(e.title),
|
|
@@ -2368,7 +2460,7 @@ var Gt = {
|
|
|
2368
2460
|
}
|
|
2369
2461
|
return (t, n) => {
|
|
2370
2462
|
let r = w("ca-icon"), d = w("ca-dropdown-item"), m = w("ca-dropdown-menu"), g = w("ca-dropdown");
|
|
2371
|
-
return y(), o("div",
|
|
2463
|
+
return y(), o("div", br, [
|
|
2372
2464
|
(y(!0), o(e, null, S(T.value, (t) => (y(), o("div", {
|
|
2373
2465
|
key: t.name,
|
|
2374
2466
|
ref_for: !0,
|
|
@@ -2392,7 +2484,7 @@ var Gt = {
|
|
|
2392
2484
|
class: "ca-tabs__close",
|
|
2393
2485
|
onClick: P((t) => j(e.key), ["stop"])
|
|
2394
2486
|
}, null, 8, ["onClick"])) : a("v-if", !0)
|
|
2395
|
-
], 10,
|
|
2487
|
+
], 10, xr))), 128))], 2))), 128)),
|
|
2396
2488
|
u(g, {
|
|
2397
2489
|
trigger: "click",
|
|
2398
2490
|
onCommand: I
|
|
@@ -2428,7 +2520,7 @@ var Gt = {
|
|
|
2428
2520
|
]),
|
|
2429
2521
|
_: 1
|
|
2430
2522
|
})]),
|
|
2431
|
-
default: M(() => [s("span",
|
|
2523
|
+
default: M(() => [s("span", Sr, [u(r, { name: "arrowDown" })])]),
|
|
2432
2524
|
_: 1
|
|
2433
2525
|
}),
|
|
2434
2526
|
a(" 内容全屏:隐藏头部和侧栏,再点一次恢复 "),
|
|
@@ -2439,18 +2531,18 @@ var Gt = {
|
|
|
2439
2531
|
"aria-label": D(f).contentFullscreen ? D(p)("campus.tabs.exitFullscreen") : D(p)("campus.tabs.fullscreen"),
|
|
2440
2532
|
"aria-pressed": D(f).contentFullscreen,
|
|
2441
2533
|
onClick: n[0] ||= (e) => D(f).toggleContentFullscreen()
|
|
2442
|
-
}, [u(r, { name: D(f).contentFullscreen ? "exitFullscreen" : "fullscreen" }, null, 8, ["name"])], 8,
|
|
2534
|
+
}, [u(r, { name: D(f).contentFullscreen ? "exitFullscreen" : "fullscreen" }, null, 8, ["name"])], 8, Cr)
|
|
2443
2535
|
]);
|
|
2444
2536
|
};
|
|
2445
2537
|
}
|
|
2446
|
-
}), [["__scopeId", "data-v-1d7ba823"]]),
|
|
2538
|
+
}), [["__scopeId", "data-v-1d7ba823"]]), Tr = 1200, Er = "(max-width: 768px)", Dr = `(min-width: 769px) and (max-width: ${Tr}px)`, Or = ["aria-label"], kr = ["aria-label"], Ar = { class: "ca-main" }, jr = {
|
|
2447
2539
|
key: 0,
|
|
2448
2540
|
class: "ca-screen-prompt",
|
|
2449
2541
|
role: "status"
|
|
2450
|
-
},
|
|
2542
|
+
}, Mr = { class: "ca-content" }, Nr = { class: "ca-content__page" }, Pr = /*#__PURE__*/ X(/* @__PURE__ */ d({
|
|
2451
2543
|
__name: "CaLayout",
|
|
2452
2544
|
setup(e) {
|
|
2453
|
-
let n =
|
|
2545
|
+
let n = U(), r = ft(), c = Z(), { t: d } = K(), f = window.matchMedia(Er), p = window.matchMedia(Dr), m = "";
|
|
2454
2546
|
function g() {
|
|
2455
2547
|
let e = f.matches ? "phone" : p.matches ? "pad" : "desktop";
|
|
2456
2548
|
c.setMode(e);
|
|
@@ -2479,23 +2571,23 @@ var Gt = {
|
|
|
2479
2571
|
class: "ca-mobile-scrim",
|
|
2480
2572
|
"aria-label": D(d)("campus.side.closeMenu"),
|
|
2481
2573
|
onClick: n[0] ||= (e) => D(c).closeMobileMenu()
|
|
2482
|
-
}, null, 8,
|
|
2574
|
+
}, null, 8, Or)) : a("v-if", !0),
|
|
2483
2575
|
D(c).mode === "pad" && D(c).padPanelOpen ? (y(), o("button", {
|
|
2484
2576
|
key: 1,
|
|
2485
2577
|
type: "button",
|
|
2486
2578
|
class: "ca-pad-scrim",
|
|
2487
2579
|
"aria-label": D(d)("campus.side.closeMenu"),
|
|
2488
2580
|
onClick: n[1] ||= (e) => D(c).closePadPanel()
|
|
2489
|
-
}, null, 8,
|
|
2581
|
+
}, null, 8, kr)) : a("v-if", !0),
|
|
2490
2582
|
a(" 手机抽屉关闭时、电脑档两栏都收起时,侧栏不在屏幕上,不可聚焦 "),
|
|
2491
|
-
N(u(
|
|
2583
|
+
N(u(gr, {
|
|
2492
2584
|
class: h({ "is-mobile-open": D(c).mobileMenuOpen }),
|
|
2493
2585
|
inert: D(c).mode === "phone" && !D(c).mobileMenuOpen || D(c).sideHiddenActive
|
|
2494
2586
|
}, null, 8, ["class", "inert"]), [[k, !D(c).contentFullscreen]]),
|
|
2495
|
-
s("main",
|
|
2496
|
-
u(
|
|
2587
|
+
s("main", Ar, [
|
|
2588
|
+
u(wr),
|
|
2497
2589
|
u(Xn),
|
|
2498
|
-
D(c).pageScreenPrompt ? (y(), o("div",
|
|
2590
|
+
D(c).pageScreenPrompt ? (y(), o("div", jr, [u(f, {
|
|
2499
2591
|
size: "small",
|
|
2500
2592
|
onClick: n[2] ||= (e) => D(c).retryPageScreen()
|
|
2501
2593
|
}, {
|
|
@@ -2509,32 +2601,32 @@ var Gt = {
|
|
|
2509
2601
|
default: M(() => [l(E(D(d)("campus.tabs.dismissScreen")), 1)]),
|
|
2510
2602
|
_: 1
|
|
2511
2603
|
}, 8, ["aria-label"])])) : a("v-if", !0),
|
|
2512
|
-
s("div",
|
|
2604
|
+
s("div", Mr, [
|
|
2513
2605
|
u(er),
|
|
2514
2606
|
a(" 页面区撑满剩余高度,版权在其后:内容少时贴窗口底,内容长时滚到最底才出现 "),
|
|
2515
|
-
s("div",
|
|
2607
|
+
s("div", Nr, [u(p, null, {
|
|
2516
2608
|
default: M(({ Component: e }) => [a(" include 与标签名单同步;缓存容量包含固定标签。 "), (y(), i(t, {
|
|
2517
2609
|
include: D(r).cached,
|
|
2518
2610
|
max: D(r).maxTabs + D(r).affixKeys.length
|
|
2519
2611
|
}, [e ? (y(), i(T(e), { key: x() })) : a("v-if", !0)], 1032, ["include", "max"]))]),
|
|
2520
2612
|
_: 1
|
|
2521
2613
|
})]),
|
|
2522
|
-
u(
|
|
2614
|
+
u(yr)
|
|
2523
2615
|
])
|
|
2524
2616
|
])
|
|
2525
2617
|
], 2)], 2);
|
|
2526
2618
|
};
|
|
2527
2619
|
}
|
|
2528
|
-
}), [["__scopeId", "data-v-90594751"]]),
|
|
2620
|
+
}), [["__scopeId", "data-v-90594751"]]), Fr = { class: "ca-exception" }, Ir = { class: "ca-exception__code" }, Lr = { class: "ca-exception__text" }, Rr = /*#__PURE__*/ X(/* @__PURE__ */ d({
|
|
2529
2621
|
__name: "ExceptionPage",
|
|
2530
2622
|
props: { kind: {} },
|
|
2531
2623
|
setup(e) {
|
|
2532
|
-
let t = e, r =
|
|
2624
|
+
let t = e, r = W(), i = Me(q()).home, { t: a } = K(), c = n(() => t.kind === "forbidden" ? "403" : "404"), d = n(() => a(t.kind === "forbidden" ? "campus.error.forbidden" : "campus.error.notFound"));
|
|
2533
2625
|
return (e, t) => {
|
|
2534
2626
|
let n = w("ca-button");
|
|
2535
|
-
return y(), o("div",
|
|
2536
|
-
s("div",
|
|
2537
|
-
s("p",
|
|
2627
|
+
return y(), o("div", Fr, [
|
|
2628
|
+
s("div", Ir, E(c.value), 1),
|
|
2629
|
+
s("p", Lr, E(d.value), 1),
|
|
2538
2630
|
u(n, {
|
|
2539
2631
|
type: "primary",
|
|
2540
2632
|
onClick: t[0] ||= (e) => D(r).replace(D(i))
|
|
@@ -2545,13 +2637,13 @@ var Gt = {
|
|
|
2545
2637
|
]);
|
|
2546
2638
|
};
|
|
2547
2639
|
}
|
|
2548
|
-
}), [["__scopeId", "data-v-75a54c8a"]]),
|
|
2640
|
+
}), [["__scopeId", "data-v-75a54c8a"]]), zr = { class: "ca-login" }, Br = { class: "ca-login__main" }, Vr = { class: "ca-login__card" }, Hr = { class: "ca-login__brand" }, Ur = ["src"], Wr = { class: "ca-login__name" }, Gr = {
|
|
2549
2641
|
key: 1,
|
|
2550
2642
|
class: "ca-login__subtitle"
|
|
2551
|
-
},
|
|
2643
|
+
}, Kr = /*#__PURE__*/ X(/* @__PURE__ */ d({
|
|
2552
2644
|
__name: "LoginPage",
|
|
2553
2645
|
setup(e) {
|
|
2554
|
-
let t =
|
|
2646
|
+
let t = U(), r = W(), c = Q(), d = Be(), { t: f, label: p } = K(), m = q().brand, h = n(() => p(d.theme.siteName ?? m.name)), g = n(() => d.theme.logo ?? m.logo), _ = Ue(), v = b({
|
|
2555
2647
|
username: "",
|
|
2556
2648
|
password: "",
|
|
2557
2649
|
captcha: ""
|
|
@@ -2596,16 +2688,16 @@ var Gt = {
|
|
|
2596
2688
|
}
|
|
2597
2689
|
return (e, t) => {
|
|
2598
2690
|
let n = w("ca-alert"), r = w("ca-input"), c = w("ca-form-item"), d = w("ca-button"), b = w("ca-form");
|
|
2599
|
-
return y(), o("div",
|
|
2600
|
-
s("div",
|
|
2691
|
+
return y(), o("div", zr, [s("div", Br, [s("div", Vr, [
|
|
2692
|
+
s("div", Hr, [
|
|
2601
2693
|
g.value ? (y(), o("img", {
|
|
2602
2694
|
key: 0,
|
|
2603
2695
|
src: g.value,
|
|
2604
2696
|
alt: "",
|
|
2605
2697
|
class: "ca-login__logo"
|
|
2606
|
-
}, null, 8,
|
|
2607
|
-
s("h1",
|
|
2608
|
-
D(m).subtitle ? (y(), o("p",
|
|
2698
|
+
}, null, 8, Ur)) : a("v-if", !0),
|
|
2699
|
+
s("h1", Wr, E(h.value), 1),
|
|
2700
|
+
D(m).subtitle ? (y(), o("p", Gr, E(D(p)(D(m).subtitle)), 1)) : a("v-if", !0)
|
|
2609
2701
|
]),
|
|
2610
2702
|
k.value ? (y(), i(n, {
|
|
2611
2703
|
key: 0,
|
|
@@ -2672,12 +2764,12 @@ var Gt = {
|
|
|
2672
2764
|
]),
|
|
2673
2765
|
_: 1
|
|
2674
2766
|
}, 8, ["model", "rules"])
|
|
2675
|
-
])]), u(
|
|
2767
|
+
])]), u(yr, { class: "ca-login__copyright" })]);
|
|
2676
2768
|
};
|
|
2677
2769
|
}
|
|
2678
2770
|
}), [["__scopeId", "data-v-ddf636fd"]]);
|
|
2679
2771
|
// packages/core/src/router.ts
|
|
2680
|
-
function
|
|
2772
|
+
function qr(e) {
|
|
2681
2773
|
return async () => {
|
|
2682
2774
|
let t = await e.component();
|
|
2683
2775
|
return d({
|
|
@@ -2686,17 +2778,17 @@ function Kr(e) {
|
|
|
2686
2778
|
});
|
|
2687
2779
|
};
|
|
2688
2780
|
}
|
|
2689
|
-
var
|
|
2781
|
+
var Jr = d({
|
|
2690
2782
|
name: "CaForbidden",
|
|
2691
|
-
setup: () => () => f(
|
|
2692
|
-
}),
|
|
2783
|
+
setup: () => () => f(Rr, { kind: "forbidden" })
|
|
2784
|
+
}), Yr = d({
|
|
2693
2785
|
name: "CaNotFound",
|
|
2694
|
-
setup: () => () => f(
|
|
2786
|
+
setup: () => () => f(Rr, { kind: "notFound" })
|
|
2695
2787
|
});
|
|
2696
|
-
function
|
|
2697
|
-
let n =
|
|
2788
|
+
function Xr(e, t) {
|
|
2789
|
+
let n = je(e.menus);
|
|
2698
2790
|
if (!n.length) throw Error("[campus] 菜单里至少需要一个页面");
|
|
2699
|
-
let r =
|
|
2791
|
+
let r = Me(e), i = J(e);
|
|
2700
2792
|
if (new Set(Object.values(i)).size !== 5 || n.some((e) => Object.values(i).includes(e.key))) throw Error("[campus] 系统路由名称重复或与页面键冲突,请配置 routeNames");
|
|
2701
2793
|
for (let e of n) if ([
|
|
2702
2794
|
r.login,
|
|
@@ -2709,7 +2801,7 @@ function Yr(e, t) {
|
|
|
2709
2801
|
{
|
|
2710
2802
|
path: r.login,
|
|
2711
2803
|
name: i.login,
|
|
2712
|
-
component: e.login?.style === "split" ? Pt :
|
|
2804
|
+
component: e.login?.style === "split" ? Pt : Kr,
|
|
2713
2805
|
meta: { public: !0 }
|
|
2714
2806
|
},
|
|
2715
2807
|
{
|
|
@@ -2726,7 +2818,7 @@ function Yr(e, t) {
|
|
|
2726
2818
|
},
|
|
2727
2819
|
{
|
|
2728
2820
|
path: "/",
|
|
2729
|
-
component:
|
|
2821
|
+
component: Pr,
|
|
2730
2822
|
redirect: n.some((e) => e.path === "/") ? void 0 : () => {
|
|
2731
2823
|
let e = Q(t);
|
|
2732
2824
|
return r.home === "/" ? n.find((t) => e.can(t.permission))?.path ?? r.forbidden : r.home;
|
|
@@ -2735,7 +2827,7 @@ function Yr(e, t) {
|
|
|
2735
2827
|
...n.map((e) => ({
|
|
2736
2828
|
path: e.path,
|
|
2737
2829
|
name: e.key,
|
|
2738
|
-
component:
|
|
2830
|
+
component: qr(e),
|
|
2739
2831
|
meta: {
|
|
2740
2832
|
pageKey: e.key,
|
|
2741
2833
|
appKey: e.appKey,
|
|
@@ -2748,12 +2840,12 @@ function Yr(e, t) {
|
|
|
2748
2840
|
{
|
|
2749
2841
|
path: r.forbidden,
|
|
2750
2842
|
name: i.forbidden,
|
|
2751
|
-
component:
|
|
2843
|
+
component: Jr
|
|
2752
2844
|
},
|
|
2753
2845
|
{
|
|
2754
2846
|
path: r.notFound,
|
|
2755
2847
|
name: i.notFound,
|
|
2756
|
-
component:
|
|
2848
|
+
component: Yr
|
|
2757
2849
|
},
|
|
2758
2850
|
...r.notFound === "/:pathMatch(.*)*" ? [] : [{
|
|
2759
2851
|
path: "/:pathMatch(.*)*",
|
|
@@ -2761,8 +2853,8 @@ function Yr(e, t) {
|
|
|
2761
2853
|
}]
|
|
2762
2854
|
]
|
|
2763
2855
|
}
|
|
2764
|
-
], o =
|
|
2765
|
-
history: e.history === "web" ?
|
|
2856
|
+
], o = ne({
|
|
2857
|
+
history: e.history === "web" ? re() : H(),
|
|
2766
2858
|
routes: a
|
|
2767
2859
|
}), s = Z(t);
|
|
2768
2860
|
return o.beforeEach((e, n) => {
|
|
@@ -2771,48 +2863,55 @@ function Yr(e, t) {
|
|
|
2771
2863
|
name: i.login,
|
|
2772
2864
|
query: e.fullPath === r.home ? void 0 : { redirect: e.fullPath }
|
|
2773
2865
|
};
|
|
2774
|
-
}), o.afterEach((
|
|
2775
|
-
|
|
2866
|
+
}), o.afterEach((n, r, i) => {
|
|
2867
|
+
if (i) s.cancelPageScreen();
|
|
2868
|
+
else {
|
|
2869
|
+
if (n.path === r.path && r.matched.length || s.applyPageOpenMode(n.meta.openMode, n.meta.sideCollapse), n.path !== r.path || !r.matched.length) {
|
|
2870
|
+
let r = Ne(e, (e) => Q(t).can(e)).apps.find((e) => e.key === n.meta.appKey);
|
|
2871
|
+
s.enterParentPage(r?.path === n.path && r.children.length ? r.key : void 0, n.meta.openMode == null ? n.meta.sideCollapse === "panel" || n.meta.sideCollapse === "all" : n.meta.openMode !== "normal"), n.meta.groupKey && s.ensureMenuGroup(n.meta.groupKey);
|
|
2872
|
+
}
|
|
2873
|
+
n.meta.pageKey && ft(t).open(n.meta.pageKey);
|
|
2874
|
+
}
|
|
2776
2875
|
}), o.onError(() => s.cancelPageScreen()), o;
|
|
2777
2876
|
}
|
|
2778
2877
|
// packages/core/src/services/login.ts
|
|
2779
|
-
async function
|
|
2878
|
+
async function Zr(e, t, n, r) {
|
|
2780
2879
|
e.signIn(n), await t.replace(We(r));
|
|
2781
2880
|
}
|
|
2782
2881
|
// packages/core/src/services/auth.ts
|
|
2783
|
-
var
|
|
2784
|
-
function
|
|
2785
|
-
|
|
2882
|
+
var Qr, $r;
|
|
2883
|
+
function ei(e, t) {
|
|
2884
|
+
Qr = e, $r = t;
|
|
2786
2885
|
}
|
|
2787
|
-
async function
|
|
2788
|
-
if (
|
|
2789
|
-
let t = Q(
|
|
2886
|
+
async function ti(e) {
|
|
2887
|
+
if (q(), !Qr || !$r) return;
|
|
2888
|
+
let t = Q($r);
|
|
2790
2889
|
if (!t.isLoggedIn) return;
|
|
2791
|
-
t.expire(), Gt.toast.warning(e ||
|
|
2792
|
-
let n =
|
|
2793
|
-
n.name !== "login" && await
|
|
2794
|
-
name: q(
|
|
2795
|
-
query: n.fullPath ===
|
|
2890
|
+
t.expire(), Gt.toast.warning(e || Ce("campus.auth.sessionExpired"));
|
|
2891
|
+
let n = Qr.currentRoute.value;
|
|
2892
|
+
n.name !== "login" && await Qr.replace({
|
|
2893
|
+
name: J(q()).login,
|
|
2894
|
+
query: n.fullPath === Me(q()).home ? void 0 : { redirect: n.fullPath }
|
|
2796
2895
|
});
|
|
2797
2896
|
}
|
|
2798
|
-
async function
|
|
2799
|
-
if (
|
|
2800
|
-
await
|
|
2897
|
+
async function ni(e, t) {
|
|
2898
|
+
if (q(), !Qr || !$r) throw Error("[campus] 应用尚未创建,无法完成登录");
|
|
2899
|
+
await Zr(Q($r), Qr, e, t);
|
|
2801
2900
|
}
|
|
2802
2901
|
// packages/core/src/app.ts
|
|
2803
|
-
function
|
|
2804
|
-
It(e),
|
|
2805
|
-
let t = r(
|
|
2902
|
+
function ri(e) {
|
|
2903
|
+
It(e), Oe(e);
|
|
2904
|
+
let t = r(Te), n = F();
|
|
2806
2905
|
t.use(n);
|
|
2807
|
-
let i =
|
|
2906
|
+
let i = xe(e);
|
|
2808
2907
|
t.use(i);
|
|
2809
2908
|
let a = (e, t) => i.global.t(e, t ?? {});
|
|
2810
2909
|
t.provide(R, a), zt(a), t.config.globalProperties.$ca = Gt, L(t), t.component("CaAuthPreview", sn);
|
|
2811
|
-
let o =
|
|
2812
|
-
return
|
|
2910
|
+
let o = Xr(e, n);
|
|
2911
|
+
return ei(o, n), t.use(o), Be(n).boot(), t;
|
|
2813
2912
|
}
|
|
2814
2913
|
// packages/core/src/index.ts
|
|
2815
|
-
function
|
|
2914
|
+
function ii(e) {
|
|
2816
2915
|
return e;
|
|
2817
2916
|
}
|
|
2818
|
-
export { Gt as ca,
|
|
2917
|
+
export { Gt as ca, ni as completeLogin, ri as createCampusApp, ii as defineMenus, ti as handleUnauthorized, Ft as resolveEnvironment, Ce as t, K as useCampusT, Z as useLayoutStore, Q as useSessionStore, ft as useTabsStore, Be as useThemeStore };
|