@campus-admin/core 2.0.7 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/i18n.d.ts +22 -0
- package/dist/index.js +988 -697
- package/dist/layout/MenuSearch.vue.d.ts +10 -0
- package/dist/layout/menu-search.d.ts +13 -0
- package/dist/pages/auth/CaptchaField.vue.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -2,79 +2,80 @@ import './style.css'
|
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/theme-chalk/dark/css-vars.css";
|
|
4
4
|
import "@campus-admin/theme/nova.css";
|
|
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,
|
|
6
|
-
import { createPinia as
|
|
7
|
-
import { installUi as
|
|
8
|
-
import { LOCALES as
|
|
9
|
-
import { createI18n as
|
|
10
|
-
import { RouterLink as
|
|
11
|
-
import { applyTheme as ie, deriveCssVars as ae, isHexColor as oe,
|
|
12
|
-
import { ElLoading as
|
|
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, useId as O, useModel as k, vShow as A, watch as j, watchEffect as M, withCtx as N, withDirectives as P, withModifiers as F } from "vue";
|
|
6
|
+
import { createPinia as I, defineStore as L } from "pinia";
|
|
7
|
+
import { installUi as R, translateKey as z } from "@campus-admin/ui";
|
|
8
|
+
import { LOCALES as ee, frameworkMessages as te } from "@campus-admin/locale";
|
|
9
|
+
import { createI18n as B, useI18n as V } from "vue-i18n";
|
|
10
|
+
import { RouterLink as ne, createRouter as re, createWebHashHistory as H, createWebHistory as U, useRoute as W, useRouter as G } from "vue-router";
|
|
11
|
+
import { applyTheme as ie, deriveCssVars as ae, isHexColor as oe, parseColor as se, resolveMode as ce, resolveTheme as le, toHex as ue } from "@campus-admin/theme";
|
|
12
|
+
import { ElLoading as de, ElMessage as fe, ElMessageBox as pe, ElNotification as me } 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
|
+
import { pinyin as he } from "pinyin-pro";
|
|
17
18
|
export * from "@campus-admin/ui";
|
|
18
19
|
// packages/core/src/storage.ts
|
|
19
|
-
var
|
|
20
|
-
function
|
|
20
|
+
var ge = "ca:";
|
|
21
|
+
function _e(e, t = "local") {
|
|
21
22
|
try {
|
|
22
|
-
return (t === "local" ? localStorage : sessionStorage).getItem(
|
|
23
|
+
return (t === "local" ? localStorage : sessionStorage).getItem(ge + e);
|
|
23
24
|
} catch {
|
|
24
25
|
return null;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function K(e, t, n = "local") {
|
|
28
29
|
try {
|
|
29
30
|
let r = n === "local" ? localStorage : sessionStorage;
|
|
30
|
-
t === null ? r.removeItem(
|
|
31
|
+
t === null ? r.removeItem(ge + e) : r.setItem(ge + e, t);
|
|
31
32
|
} catch {}
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
let n =
|
|
34
|
+
function ve(e, t = "local") {
|
|
35
|
+
let n = _e(e, t);
|
|
35
36
|
if (n) try {
|
|
36
37
|
return JSON.parse(n);
|
|
37
38
|
} catch {
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
42
|
+
function ye(e, t, n = "local") {
|
|
43
|
+
K(e, JSON.stringify(t), n);
|
|
43
44
|
}
|
|
44
45
|
// packages/core/src/i18n.ts
|
|
45
|
-
var
|
|
46
|
-
function
|
|
46
|
+
var be = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
47
|
+
function xe(e, t) {
|
|
47
48
|
let n = { ...e };
|
|
48
49
|
for (let [e, r] of Object.entries(t)) {
|
|
49
50
|
let t = n[e];
|
|
50
|
-
n[e] =
|
|
51
|
+
n[e] = be(t) && be(r) ? xe(t, r) : r;
|
|
51
52
|
}
|
|
52
53
|
return n;
|
|
53
54
|
}
|
|
54
|
-
var
|
|
55
|
-
function
|
|
55
|
+
var Se = "locale";
|
|
56
|
+
function Ce(e) {
|
|
56
57
|
return e === "zh-CN" || e === "en-US";
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
let t =
|
|
59
|
+
function we(e) {
|
|
60
|
+
let t = _e(Se), n = Ce(t) ? t : e.defaultLocale ?? "zh-CN", r = Object.fromEntries(["zh-CN", "en-US"].map((t) => [t, xe(te[t], e.messages?.[t] ?? {})])), i = B({
|
|
60
61
|
legacy: !1,
|
|
61
62
|
locale: n,
|
|
62
63
|
fallbackLocale: "zh-CN",
|
|
63
64
|
messages: r
|
|
64
65
|
});
|
|
65
|
-
return typeof document < "u" &&
|
|
66
|
+
return typeof document < "u" && j(() => i.global.locale.value, (e) => {
|
|
66
67
|
document.documentElement.lang = e;
|
|
67
|
-
}, { immediate: !0 }),
|
|
68
|
+
}, { immediate: !0 }), Te = i, i;
|
|
68
69
|
}
|
|
69
|
-
var
|
|
70
|
-
function
|
|
71
|
-
return
|
|
70
|
+
var Te;
|
|
71
|
+
function Ee(e, t) {
|
|
72
|
+
return Te ? Te.global.t(e, t ?? {}) : e;
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
74
|
+
function De(e) {
|
|
75
|
+
K(Se, e);
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
-
let { t: e, te: t, locale: n } =
|
|
77
|
+
function q() {
|
|
78
|
+
let { t: e, te: t, locale: n } = V();
|
|
78
79
|
return {
|
|
79
80
|
t: e,
|
|
80
81
|
te: t,
|
|
@@ -83,38 +84,38 @@ function K() {
|
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
// packages/core/src/CampusRoot.vue
|
|
86
|
-
var
|
|
87
|
+
var Oe = /* @__PURE__ */ d({
|
|
87
88
|
__name: "CampusRoot",
|
|
88
89
|
setup(e) {
|
|
89
|
-
let { locale: t } =
|
|
90
|
+
let { locale: t } = q();
|
|
90
91
|
return (e, n) => {
|
|
91
92
|
let r = w("router-view"), a = w("ca-config-provider");
|
|
92
93
|
return y(), i(a, { locale: D(t) }, {
|
|
93
|
-
default:
|
|
94
|
+
default: N(() => [u(r)]),
|
|
94
95
|
_: 1
|
|
95
96
|
}, 8, ["locale"]);
|
|
96
97
|
};
|
|
97
98
|
}
|
|
98
99
|
});
|
|
99
100
|
// packages/core/src/types.ts
|
|
100
|
-
function
|
|
101
|
+
function ke(e) {
|
|
101
102
|
return "children" in e;
|
|
102
103
|
}
|
|
103
104
|
// packages/core/src/context.ts
|
|
104
|
-
var
|
|
105
|
-
function
|
|
106
|
-
|
|
105
|
+
var Ae;
|
|
106
|
+
function je(e) {
|
|
107
|
+
Ae = e;
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
-
if (!
|
|
110
|
-
return
|
|
109
|
+
function J() {
|
|
110
|
+
if (!Ae) throw Error("[campus] 请先调用 createCampusApp()");
|
|
111
|
+
return Ae;
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
-
for (let t of
|
|
113
|
+
function Me(e) {
|
|
114
|
+
for (let t of J().menus) {
|
|
114
115
|
if (t.key === e && t.path) return { titles: [t.title] };
|
|
115
116
|
for (let n of t.children) {
|
|
116
117
|
if (n.key === e && n.path) return { titles: [t.title, n.title] };
|
|
117
|
-
if (
|
|
118
|
+
if (ke(n)) {
|
|
118
119
|
let r = n.children.find((t) => t.key === e);
|
|
119
120
|
if (r) return { titles: [
|
|
120
121
|
t.title,
|
|
@@ -125,15 +126,15 @@ function ke(e) {
|
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
|
-
var
|
|
129
|
+
var Ne = [
|
|
129
130
|
"none",
|
|
130
131
|
"panel",
|
|
131
132
|
"all"
|
|
132
133
|
];
|
|
133
|
-
function
|
|
134
|
+
function Pe(e) {
|
|
134
135
|
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
135
136
|
function o(e, s, c, l = 1) {
|
|
136
|
-
let u = l === 1 ? i : l === 2 &&
|
|
137
|
+
let u = l === 1 ? i : l === 2 && ke(e) ? a : void 0;
|
|
137
138
|
if (u?.has(e.key)) throw Error(`[campus] 菜单${l === 1 ? "一级场景键" : "组键"}重复:${e.key}`);
|
|
138
139
|
u?.add(e.key);
|
|
139
140
|
let d = e.path !== void 0;
|
|
@@ -147,9 +148,9 @@ function je(e) {
|
|
|
147
148
|
let { children: i, ...a } = e, o = {
|
|
148
149
|
...a,
|
|
149
150
|
appKey: s,
|
|
150
|
-
groupKey: l === 2 &&
|
|
151
|
+
groupKey: l === 2 && ke(e) ? e.key : c
|
|
151
152
|
};
|
|
152
|
-
o.sideCollapse != null && !
|
|
153
|
+
o.sideCollapse != null && !Ne.includes(o.sideCollapse) && (console.warn(`[campus] 菜单页面 sideCollapse 只能是 none / panel / all,已忽略:${e.key}`), delete o.sideCollapse), o.openMode != null && ![
|
|
153
154
|
"normal",
|
|
154
155
|
"collapsePanel",
|
|
155
156
|
"collapseAll",
|
|
@@ -166,7 +167,7 @@ function je(e) {
|
|
|
166
167
|
for (let t of e) o(t, t.key);
|
|
167
168
|
return t;
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
+
function Fe(e) {
|
|
170
171
|
let t = {
|
|
171
172
|
home: "/",
|
|
172
173
|
login: "/login",
|
|
@@ -186,8 +187,8 @@ function Me(e) {
|
|
|
186
187
|
])).size !== 5) throw Error("[campus] 系统页面路径不能重复");
|
|
187
188
|
return t;
|
|
188
189
|
}
|
|
189
|
-
function
|
|
190
|
-
let n = e.homeEntry === !1 ? void 0 :
|
|
190
|
+
function Ie(e, t) {
|
|
191
|
+
let n = e.homeEntry === !1 ? void 0 : Pe(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
192
|
function a(e) {
|
|
192
193
|
let t = "children" in e ? e.children.map((e) => a(e)).filter((e) => e !== void 0) : [], n = i(e);
|
|
193
194
|
if (!n && !t.length) return;
|
|
@@ -200,7 +201,7 @@ function Ne(e, t) {
|
|
|
200
201
|
accountStandalone: r
|
|
201
202
|
};
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
+
function Y(e) {
|
|
204
205
|
return {
|
|
205
206
|
login: "login",
|
|
206
207
|
register: "register",
|
|
@@ -211,51 +212,51 @@ function J(e) {
|
|
|
211
212
|
};
|
|
212
213
|
}
|
|
213
214
|
// packages/core/src/stores/theme.ts
|
|
214
|
-
var
|
|
215
|
-
function
|
|
216
|
-
return
|
|
215
|
+
var Le = "theme-mode", Re = "box-style", ze = "user-primary";
|
|
216
|
+
function Be() {
|
|
217
|
+
return _e(Re) === "border" ? "border" : "shadow";
|
|
217
218
|
}
|
|
218
|
-
function
|
|
219
|
-
let e =
|
|
219
|
+
function Ve() {
|
|
220
|
+
let e = _e(ze);
|
|
220
221
|
return oe(e) ? e : void 0;
|
|
221
222
|
}
|
|
222
|
-
function
|
|
223
|
-
let e =
|
|
223
|
+
function He() {
|
|
224
|
+
let e = _e(Le);
|
|
224
225
|
return e === "light" || e === "dark" || e === "auto" ? e : "auto";
|
|
225
226
|
}
|
|
226
|
-
var
|
|
227
|
-
let e = x({}), t = x(
|
|
227
|
+
var Ue = L("campus-theme", () => {
|
|
228
|
+
let e = x({}), t = x(He()), r = x(Be()), i = x(Ve()), a = typeof matchMedia == "function" ? matchMedia("(prefers-color-scheme: dark)") : void 0, o = x(a?.matches ?? !1);
|
|
228
229
|
a?.addEventListener("change", (e) => o.value = e.matches);
|
|
229
|
-
let s = n(() =>
|
|
230
|
+
let s = n(() => le(e.value)), c = n(() => e.value.tenantDefault?.locks?.includes("primary") ?? !1), l = n(() => {
|
|
230
231
|
let e = s.value.theme, t = i.value;
|
|
231
232
|
return !t || c.value ? e : {
|
|
232
233
|
...e,
|
|
233
234
|
primary: t,
|
|
234
235
|
headerBg: e.headerBg === e.primary ? t : e.headerBg
|
|
235
236
|
};
|
|
236
|
-
}), u = n(() => s.value.issues), d = n(() =>
|
|
237
|
-
|
|
237
|
+
}), u = n(() => s.value.issues), d = n(() => ce(t.value, o.value)), f = n(() => ae(l.value, d.value));
|
|
238
|
+
M(() => ie(f.value, d.value, l.value.style)), M(() => {
|
|
238
239
|
document.documentElement.dataset.caBox = r.value;
|
|
239
240
|
});
|
|
240
241
|
function p(e) {
|
|
241
|
-
(e === void 0 || oe(e)) && (i.value = e,
|
|
242
|
+
(e === void 0 || oe(e)) && (i.value = e, K(ze, e ?? null));
|
|
242
243
|
}
|
|
243
244
|
function h(e) {
|
|
244
|
-
r.value = e,
|
|
245
|
+
r.value = e, K(Re, e);
|
|
245
246
|
}
|
|
246
247
|
function g() {
|
|
247
|
-
return `theme-layers:${
|
|
248
|
+
return `theme-layers:${J().theme?.cacheKey ?? location.host}`;
|
|
248
249
|
}
|
|
249
250
|
function _(e) {
|
|
250
|
-
t.value = e,
|
|
251
|
+
t.value = e, K(Le, e);
|
|
251
252
|
}
|
|
252
253
|
function v(e, t) {
|
|
253
|
-
let n = document, r =
|
|
254
|
+
let n = document, r = ce(e, o.value) !== d.value, i = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
254
255
|
if (!t || !r || i || !n.startViewTransition) {
|
|
255
256
|
_(e);
|
|
256
257
|
return;
|
|
257
258
|
}
|
|
258
|
-
let a = Math.hypot(Math.max(t.x, innerWidth - t.x), Math.max(t.y, innerHeight - t.y)), s =
|
|
259
|
+
let a = Math.hypot(Math.max(t.x, innerWidth - t.x), Math.max(t.y, innerHeight - t.y)), s = ce(e, o.value) === "dark", c = document.documentElement;
|
|
259
260
|
c.dataset.caThemeTransition = s ? "to-dark" : "to-light";
|
|
260
261
|
let l = !1, u = () => {
|
|
261
262
|
l || (l = !0, _(e));
|
|
@@ -274,12 +275,12 @@ var Be = I("campus-theme", () => {
|
|
|
274
275
|
}).catch(() => {});
|
|
275
276
|
}
|
|
276
277
|
function y(t, n = !0) {
|
|
277
|
-
e.value = t, n &&
|
|
278
|
+
e.value = t, n && ye(g(), t);
|
|
278
279
|
}
|
|
279
280
|
async function b() {
|
|
280
|
-
let t =
|
|
281
|
+
let t = ve(g());
|
|
281
282
|
t && (e.value = t);
|
|
282
|
-
let n =
|
|
283
|
+
let n = J().theme?.load;
|
|
283
284
|
if (n) {
|
|
284
285
|
try {
|
|
285
286
|
y(await n());
|
|
@@ -307,16 +308,16 @@ var Be = I("campus-theme", () => {
|
|
|
307
308
|
};
|
|
308
309
|
});
|
|
309
310
|
// packages/core/src/copyright.ts
|
|
310
|
-
function
|
|
311
|
+
function We(e, t = (/* @__PURE__ */ new Date()).getFullYear()) {
|
|
311
312
|
return e.replaceAll("{year}", String(t));
|
|
312
313
|
}
|
|
313
314
|
// packages/core/src/pages/auth/options.ts
|
|
314
|
-
var
|
|
315
|
-
function
|
|
316
|
-
return
|
|
315
|
+
var Ge = /^1[3-9]\d{9}$/;
|
|
316
|
+
function X() {
|
|
317
|
+
return J().login ?? {};
|
|
317
318
|
}
|
|
318
|
-
function
|
|
319
|
-
let e =
|
|
319
|
+
function Ke() {
|
|
320
|
+
let e = J().auth;
|
|
320
321
|
return {
|
|
321
322
|
captcha: typeof e.captcha == "function",
|
|
322
323
|
register: typeof e.register == "function" && typeof e.sendSmsCode == "function",
|
|
@@ -324,37 +325,37 @@ function Ue() {
|
|
|
324
325
|
forgot: typeof e.resetPassword == "function" && typeof e.sendSmsCode == "function"
|
|
325
326
|
};
|
|
326
327
|
}
|
|
327
|
-
function
|
|
328
|
-
return typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e :
|
|
328
|
+
function qe(e) {
|
|
329
|
+
return typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : Fe(J()).home;
|
|
329
330
|
}
|
|
330
331
|
// packages/core/src/pages/auth/AuthShell.vue?vue&type=script&setup=true&lang.ts
|
|
331
|
-
var
|
|
332
|
+
var Je = {
|
|
332
333
|
key: 0,
|
|
333
334
|
class: "ca-auth__title"
|
|
334
|
-
},
|
|
335
|
+
}, Ye = ["src"], Xe = { class: "ca-auth__qrcode" }, Ze = ["src", "alt"], Qe = {
|
|
335
336
|
key: 0,
|
|
336
337
|
class: "ca-auth__caption"
|
|
337
|
-
},
|
|
338
|
+
}, $e = { class: "ca-auth__site" }, et = {
|
|
338
339
|
key: 0,
|
|
339
340
|
class: "ca-auth__caption"
|
|
340
|
-
},
|
|
341
|
+
}, tt = { class: "ca-auth__main" }, nt = { class: "ca-auth__brand" }, rt = ["src"], it = {
|
|
341
342
|
class: "ca-auth__tabs",
|
|
342
343
|
role: "tablist"
|
|
343
|
-
},
|
|
344
|
+
}, at = [
|
|
344
345
|
"aria-selected",
|
|
345
346
|
"tabindex",
|
|
346
347
|
"onClick",
|
|
347
348
|
"onKeydown"
|
|
348
|
-
],
|
|
349
|
+
], ot = {
|
|
349
350
|
class: "ca-auth__body",
|
|
350
351
|
role: "tabpanel"
|
|
351
|
-
},
|
|
352
|
+
}, st = {
|
|
352
353
|
key: 0,
|
|
353
354
|
class: "ca-auth__footer"
|
|
354
|
-
},
|
|
355
|
+
}, ct = {
|
|
355
356
|
key: 0,
|
|
356
357
|
class: "ca-auth__version"
|
|
357
|
-
},
|
|
358
|
+
}, lt = /*@__PURE__*/ d({
|
|
358
359
|
__name: "AuthShell",
|
|
359
360
|
props: {
|
|
360
361
|
tabs: {},
|
|
@@ -363,13 +364,13 @@ var Ge = {
|
|
|
363
364
|
},
|
|
364
365
|
emits: ["update:active"],
|
|
365
366
|
setup(t, { emit: r }) {
|
|
366
|
-
let c = t, u = r, { t: d, label: f } =
|
|
367
|
+
let c = t, u = r, { t: d, label: f } = q(), p = J().brand, m = X(), _ = Ue(), 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(() => {
|
|
367
368
|
let e = m.panel?.caption ?? p.subtitle;
|
|
368
369
|
return e ? f(e) : "";
|
|
369
370
|
}), 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(() => {
|
|
370
371
|
let e = m.card, t = {}, n = A(e?.width), r = A(e?.minHeight), i = A(e?.panelWidth), a = A(e?.radius);
|
|
371
372
|
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;
|
|
372
|
-
}),
|
|
373
|
+
}), M = n(() => m.background ?? "var(--ca-login-bg)"), P = n(() => m.footer ? m.footer.map((e) => We(f(e))) : p.copyright ? We(f(p.copyright)).split("\n").filter(Boolean) : []);
|
|
373
374
|
function F(e, t) {
|
|
374
375
|
if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") return;
|
|
375
376
|
let n = (t + (e.key === "ArrowRight" ? 1 : -1) + c.tabs.length) % c.tabs.length, r = c.tabs[n];
|
|
@@ -377,7 +378,7 @@ var Ge = {
|
|
|
377
378
|
}
|
|
378
379
|
return (n, r) => (y(), o("div", { class: h(["ca-auth", { "ca-auth--preview": t.preview }]) }, [s("div", {
|
|
379
380
|
class: "ca-auth__stage",
|
|
380
|
-
style: g({ background:
|
|
381
|
+
style: g({ background: M.value })
|
|
381
382
|
}, [s("div", {
|
|
382
383
|
class: "ca-auth__card",
|
|
383
384
|
style: g(j.value)
|
|
@@ -385,24 +386,24 @@ var Ge = {
|
|
|
385
386
|
class: "ca-auth__panel",
|
|
386
387
|
style: g(k.value ? { background: k.value } : void 0)
|
|
387
388
|
}, [
|
|
388
|
-
O.value && w.value ? (y(), o("h2",
|
|
389
|
+
O.value && w.value ? (y(), o("h2", Je, E(O.value), 1)) : a("v-if", !0),
|
|
389
390
|
x.value ? (y(), o("img", {
|
|
390
391
|
key: 1,
|
|
391
392
|
src: x.value,
|
|
392
393
|
alt: "",
|
|
393
394
|
class: "ca-auth__logo"
|
|
394
|
-
}, null, 8,
|
|
395
|
-
w.value ? (y(), o(e, { key: 2 }, [s("div",
|
|
395
|
+
}, null, 8, Ye)) : a("v-if", !0),
|
|
396
|
+
w.value ? (y(), o(e, { key: 2 }, [s("div", Xe, [s("img", {
|
|
396
397
|
src: w.value,
|
|
397
398
|
alt: D(d)("campus.auth.qrcodeAlt")
|
|
398
|
-
}, null, 8,
|
|
399
|
-
], 4), s("section",
|
|
400
|
-
s("div",
|
|
399
|
+
}, null, 8, Ze)]), T.value ? (y(), o("p", Qe, E(T.value), 1)) : a("v-if", !0)], 64)) : (y(), o(e, { key: 3 }, [s("h2", $e, E(O.value || v.value), 1), T.value ? (y(), o("p", et, E(T.value), 1)) : a("v-if", !0)], 64))
|
|
400
|
+
], 4), s("section", tt, [
|
|
401
|
+
s("div", nt, [b.value ? (y(), o("img", {
|
|
401
402
|
key: 0,
|
|
402
403
|
src: b.value,
|
|
403
404
|
alt: ""
|
|
404
|
-
}, null, 8,
|
|
405
|
-
s("div",
|
|
405
|
+
}, null, 8, rt)) : a("v-if", !0), s("span", null, E(v.value), 1)]),
|
|
406
|
+
s("div", it, [(y(!0), o(e, null, S(t.tabs, (n, r) => (y(), o(e, { key: n.key }, [n.to && !t.preview ? (y(), i(D(ne), {
|
|
406
407
|
key: 0,
|
|
407
408
|
to: n.to,
|
|
408
409
|
role: "tab",
|
|
@@ -410,7 +411,7 @@ var Ge = {
|
|
|
410
411
|
class: "ca-auth__tab",
|
|
411
412
|
onKeydown: (e) => F(e, r)
|
|
412
413
|
}, {
|
|
413
|
-
default:
|
|
414
|
+
default: N(() => [l(E(n.label), 1)]),
|
|
414
415
|
_: 2
|
|
415
416
|
}, 1032, ["to", "onKeydown"])) : (y(), o("button", {
|
|
416
417
|
key: 1,
|
|
@@ -421,17 +422,17 @@ var Ge = {
|
|
|
421
422
|
tabindex: n.key === t.active ? 0 : -1,
|
|
422
423
|
onClick: (e) => n.to ? void 0 : u("update:active", n.key),
|
|
423
424
|
onKeydown: (e) => F(e, r)
|
|
424
|
-
}, E(n.label), 43,
|
|
425
|
-
s("div",
|
|
426
|
-
P.value.length ? (y(), o("div",
|
|
427
|
-
])], 4), D(m).version ? (y(), o("span",
|
|
425
|
+
}, E(n.label), 43, at))], 64))), 128))]),
|
|
426
|
+
s("div", ot, [C(n.$slots, "default", {}, void 0, !0)]),
|
|
427
|
+
P.value.length ? (y(), o("div", st, [(y(!0), o(e, null, S(P.value, (e) => (y(), o("p", { key: e }, E(e), 1))), 128))])) : a("v-if", !0)
|
|
428
|
+
])], 4), D(m).version ? (y(), o("span", ct, E(D(m).version), 1)) : a("v-if", !0)], 4)], 2));
|
|
428
429
|
}
|
|
429
|
-
}),
|
|
430
|
+
}), Z = (e, t) => {
|
|
430
431
|
let n = e.__vccOpts || e;
|
|
431
432
|
for (let [e, r] of t) n[e] = r;
|
|
432
433
|
return n;
|
|
433
|
-
},
|
|
434
|
-
let e = x(!1), t = x("desktop"), r = x(!1), i = x(!1), a = x(
|
|
434
|
+
}, ut = /*#__PURE__*/ Z(lt, [["__scopeId", "data-v-3545cdf2"]]), dt = "side-collapsed", ft = L("campus-layout", () => {
|
|
435
|
+
let e = x(!1), t = x("desktop"), r = x(!1), i = x(!1), a = x(_e(dt) === "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
436
|
function p(e, t = !1) {
|
|
436
437
|
f = e, e && !t && (o.value = u.value[e] ?? !1);
|
|
437
438
|
}
|
|
@@ -442,7 +443,7 @@ var Ge = {
|
|
|
442
443
|
e in d.value || m(e, !0);
|
|
443
444
|
}
|
|
444
445
|
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" &&
|
|
446
|
+
e.path && n !== e.path ? (await r(e.path), m(e.key, !0), t.value === "phone" ? V() : t.value === "pad" && re()) : m(e.key, !(d.value[e.key] ?? !1));
|
|
446
447
|
}
|
|
447
448
|
async function _(e, n, r, a) {
|
|
448
449
|
if (e.path) {
|
|
@@ -451,11 +452,11 @@ var Ge = {
|
|
|
451
452
|
let n = e.openMode == null ? e.sideCollapse === "panel" || e.sideCollapse === "all" : e.openMode !== "normal";
|
|
452
453
|
a && e.children.length && t.value === "desktop" && !n && (o.value = !1, u.value[e.key] = !1);
|
|
453
454
|
} 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" &&
|
|
455
|
+
e.path !== n && e.children.length && t.value === "pad" && re(), e.children.length && t.value === "phone" && V(), e.children.length || H();
|
|
455
456
|
} else t.value === "pad" ? i.value = !(a && i.value) : t.value === "desktop" && s.value && v();
|
|
456
457
|
}
|
|
457
458
|
function v() {
|
|
458
|
-
o.value === null ? (a.value = !a.value,
|
|
459
|
+
o.value === null ? (a.value = !a.value, K(dt, a.value ? "1" : "0")) : (o.value = !o.value, f && (u.value[f] = o.value));
|
|
459
460
|
}
|
|
460
461
|
function y() {
|
|
461
462
|
c.value = !1, o.value = null;
|
|
@@ -529,14 +530,14 @@ var Ge = {
|
|
|
529
530
|
function ne() {
|
|
530
531
|
i.value = !1;
|
|
531
532
|
}
|
|
532
|
-
function
|
|
533
|
+
function re() {
|
|
533
534
|
i.value = !0;
|
|
534
535
|
}
|
|
535
|
-
function
|
|
536
|
+
function H() {
|
|
536
537
|
r.value = !1, i.value = !1;
|
|
537
538
|
}
|
|
538
539
|
function U() {
|
|
539
|
-
F("normal"), e.value = !1, b("none"),
|
|
540
|
+
F("normal"), e.value = !1, b("none"), H(), u.value = {}, d.value = {}, f = void 0;
|
|
540
541
|
}
|
|
541
542
|
return {
|
|
542
543
|
enterParentPage: p,
|
|
@@ -571,33 +572,33 @@ var Ge = {
|
|
|
571
572
|
closeMobileMenu: B,
|
|
572
573
|
openMobileMenu: V,
|
|
573
574
|
closePadPanel: ne,
|
|
574
|
-
openPadPanel:
|
|
575
|
-
closeOverlays:
|
|
575
|
+
openPadPanel: re,
|
|
576
|
+
closeOverlays: H
|
|
576
577
|
};
|
|
577
578
|
});
|
|
578
579
|
// packages/core/src/tabs-policy.ts
|
|
579
|
-
function
|
|
580
|
+
function pt(e, t, n = Date.now()) {
|
|
580
581
|
return {
|
|
581
582
|
...e,
|
|
582
583
|
[t]: Math.max(n, ...Object.values(e).map((e) => e + 1))
|
|
583
584
|
};
|
|
584
585
|
}
|
|
585
|
-
function
|
|
586
|
+
function mt(e, t, n, r, i) {
|
|
586
587
|
let a = e.filter((e) => !r.includes(e));
|
|
587
588
|
if (!(a.length <= i)) return a.filter((e) => e !== n).reduce((e, n) => e === void 0 || (t[n] ?? 0) < (t[e] ?? 0) ? n : e, void 0);
|
|
588
589
|
}
|
|
589
590
|
// packages/core/src/stores/tabs.ts
|
|
590
|
-
var
|
|
591
|
-
let e =
|
|
591
|
+
var ht = "tabs", gt = L("campus-tabs", () => {
|
|
592
|
+
let e = Pe(J().menus), t = new Set(e.map((e) => e.key)), r = e.filter((e) => e.affix).map((e) => e.key), i = ve(ht, "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 = J().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))));
|
|
592
593
|
for (let [e, t] of d.value.entries()) Number.isFinite(p.value[t]) || (p.value[t] = e + 1);
|
|
593
594
|
for (;;) {
|
|
594
|
-
let e =
|
|
595
|
+
let e = mt(d.value, p.value, "", s.value, l);
|
|
595
596
|
if (!e) break;
|
|
596
597
|
d.value.splice(d.value.indexOf(e), 1), delete p.value[e];
|
|
597
598
|
}
|
|
598
599
|
let h = x({}), g = x(null), _ = n(() => d.value.filter((e) => e !== g.value));
|
|
599
600
|
function v() {
|
|
600
|
-
p.value = Object.fromEntries(d.value.map((e) => [e, p.value[e] ?? 0])),
|
|
601
|
+
p.value = Object.fromEntries(d.value.map((e) => [e, p.value[e] ?? 0])), ye(ht, {
|
|
601
602
|
visited: d.value,
|
|
602
603
|
active: p.value,
|
|
603
604
|
affix: o.value
|
|
@@ -605,8 +606,8 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
605
606
|
}
|
|
606
607
|
function y(e) {
|
|
607
608
|
if (!t.has(e)) return;
|
|
608
|
-
d.value.includes(e) || d.value.push(e), p.value =
|
|
609
|
-
let n =
|
|
609
|
+
d.value.includes(e) || d.value.push(e), p.value = pt(p.value, e);
|
|
610
|
+
let n = mt(d.value, p.value, e, s.value, l);
|
|
610
611
|
n && d.value.splice(d.value.indexOf(n), 1), v();
|
|
611
612
|
}
|
|
612
613
|
function b(e) {
|
|
@@ -654,8 +655,8 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
654
655
|
refresh: E,
|
|
655
656
|
setAffix: D
|
|
656
657
|
};
|
|
657
|
-
}),
|
|
658
|
-
let e =
|
|
658
|
+
}), _t = "session", Q = L("campus-session", () => {
|
|
659
|
+
let e = ve(_t, "session"), t = x(e?.token ?? ""), r = x(e?.user), i = n(() => !!(t.value && r.value));
|
|
659
660
|
function a(e) {
|
|
660
661
|
if (!e) return !0;
|
|
661
662
|
let t = r.value?.permissions;
|
|
@@ -665,28 +666,28 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
665
666
|
r.value && (r.value = {
|
|
666
667
|
...r.value,
|
|
667
668
|
permissions: e
|
|
668
|
-
},
|
|
669
|
+
}, ye(_t, {
|
|
669
670
|
token: t.value,
|
|
670
671
|
user: r.value
|
|
671
672
|
}, "session"));
|
|
672
673
|
}
|
|
673
674
|
async function s(e) {
|
|
674
|
-
c(await
|
|
675
|
+
c(await J().auth.login(e));
|
|
675
676
|
}
|
|
676
677
|
function c(e) {
|
|
677
|
-
t.value = e.token, r.value = e.user,
|
|
678
|
+
t.value = e.token, r.value = e.user, ye(_t, e, "session");
|
|
678
679
|
}
|
|
679
680
|
async function l() {
|
|
680
681
|
try {
|
|
681
|
-
await
|
|
682
|
+
await J().auth.logout?.();
|
|
682
683
|
} catch (e) {
|
|
683
684
|
console.warn("[campus] 退出时通知服务端失败,已清除本地登录态:", e);
|
|
684
685
|
} finally {
|
|
685
|
-
t.value = "", r.value = void 0,
|
|
686
|
+
t.value = "", r.value = void 0, K(_t, null, "session"), gt().reset(), ft().reset();
|
|
686
687
|
}
|
|
687
688
|
}
|
|
688
689
|
function u() {
|
|
689
|
-
t.value = "", r.value = void 0,
|
|
690
|
+
t.value = "", r.value = void 0, K(_t, null, "session"), gt().reset(), ft().reset();
|
|
690
691
|
}
|
|
691
692
|
return {
|
|
692
693
|
token: t,
|
|
@@ -699,7 +700,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
699
700
|
logout: l,
|
|
700
701
|
expire: u
|
|
701
702
|
};
|
|
702
|
-
}),
|
|
703
|
+
}), vt = {
|
|
703
704
|
class: "ca-auth-icon",
|
|
704
705
|
viewBox: "0 0 24 24",
|
|
705
706
|
width: "16",
|
|
@@ -710,7 +711,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
710
711
|
"stroke-linecap": "round",
|
|
711
712
|
"stroke-linejoin": "round",
|
|
712
713
|
"aria-hidden": "true"
|
|
713
|
-
},
|
|
714
|
+
}, yt = ["d"], $ = /* @__PURE__ */ d({
|
|
714
715
|
__name: "AuthIcon",
|
|
715
716
|
props: { name: {} },
|
|
716
717
|
setup(e) {
|
|
@@ -721,15 +722,19 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
721
722
|
shield: "M12 3l7 3v5c0 4.5-3 8-7 10-4-2-7-5.500-7-10V6l7-3Zm-3 9 2.500 2.500L15 10",
|
|
722
723
|
message: "M4 5h16v11H9l-4 3.500V16H4z"
|
|
723
724
|
};
|
|
724
|
-
return (n, r) => (y(), o("svg",
|
|
725
|
+
return (n, r) => (y(), o("svg", vt, [s("path", { d: t[e.name] }, null, 8, yt)]));
|
|
725
726
|
}
|
|
726
|
-
}),
|
|
727
|
+
}), bt = { class: "ca-auth-row" }, xt = [
|
|
727
728
|
"title",
|
|
728
729
|
"aria-label",
|
|
729
730
|
"disabled"
|
|
730
|
-
],
|
|
731
|
+
], St = ["src"], Ct = { key: 1 }, wt = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
731
732
|
__name: "CaptchaField",
|
|
732
|
-
props: /*@__PURE__*/ p({
|
|
733
|
+
props: /*@__PURE__*/ p({
|
|
734
|
+
scene: {},
|
|
735
|
+
inputId: {},
|
|
736
|
+
inputErrorId: {}
|
|
737
|
+
}, {
|
|
733
738
|
code: { default: "" },
|
|
734
739
|
codeModifiers: {},
|
|
735
740
|
captchaKey: { default: "" },
|
|
@@ -737,11 +742,11 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
737
742
|
}),
|
|
738
743
|
emits: ["update:code", "update:captchaKey"],
|
|
739
744
|
setup(e, { expose: t }) {
|
|
740
|
-
let n = e, r =
|
|
741
|
-
async function
|
|
745
|
+
let n = e, r = k(e, "code"), i = k(e, "captchaKey"), { t: c, label: l } = q(), d = X().fields?.captcha, f = x(""), p = x(!1), m = x(!1);
|
|
746
|
+
async function g() {
|
|
742
747
|
m.value = !0;
|
|
743
748
|
try {
|
|
744
|
-
let e = await
|
|
749
|
+
let e = await J().auth.captcha(n.scene);
|
|
745
750
|
i.value = e.key, f.value = e.image, p.value = !1;
|
|
746
751
|
} catch {
|
|
747
752
|
f.value = "", p.value = !0;
|
|
@@ -749,22 +754,30 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
749
754
|
r.value = "", m.value = !1;
|
|
750
755
|
}
|
|
751
756
|
}
|
|
752
|
-
return v(
|
|
753
|
-
let
|
|
754
|
-
return y(), o("div",
|
|
757
|
+
return v(g), t({ refresh: g }), (t, n) => {
|
|
758
|
+
let i = w("ca-input");
|
|
759
|
+
return y(), o("div", bt, [u(i, {
|
|
755
760
|
modelValue: r.value,
|
|
756
|
-
"onUpdate:modelValue":
|
|
757
|
-
|
|
758
|
-
"
|
|
761
|
+
"onUpdate:modelValue": n[0] ||= (e) => r.value = e,
|
|
762
|
+
id: e.inputId,
|
|
763
|
+
class: h({ "ca-auth-captcha__input": e.inputId }),
|
|
764
|
+
placeholder: D(d)?.placeholder ? D(l)(D(d).placeholder) : e.inputId ? void 0 : D(c)("campus.auth.captchaPlaceholder"),
|
|
765
|
+
"aria-label": e.inputId ? void 0 : D(c)("campus.auth.captcha"),
|
|
766
|
+
"aria-invalid": e.inputErrorId ? "true" : void 0,
|
|
767
|
+
"aria-describedby": e.inputErrorId,
|
|
759
768
|
autocomplete: "off",
|
|
760
769
|
maxlength: D(d)?.maxlength ?? 8
|
|
761
770
|
}, {
|
|
762
|
-
prefix:
|
|
771
|
+
prefix: N(() => [u($, { name: "shield" })]),
|
|
763
772
|
_: 1
|
|
764
773
|
}, 8, [
|
|
765
774
|
"modelValue",
|
|
775
|
+
"id",
|
|
776
|
+
"class",
|
|
766
777
|
"placeholder",
|
|
767
778
|
"aria-label",
|
|
779
|
+
"aria-invalid",
|
|
780
|
+
"aria-describedby",
|
|
768
781
|
"maxlength"
|
|
769
782
|
]), s("button", {
|
|
770
783
|
type: "button",
|
|
@@ -772,26 +785,26 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
772
785
|
title: D(c)("campus.auth.captchaRefresh"),
|
|
773
786
|
"aria-label": D(c)("campus.auth.captchaRefresh"),
|
|
774
787
|
disabled: m.value,
|
|
775
|
-
onClick:
|
|
788
|
+
onClick: g
|
|
776
789
|
}, [f.value ? (y(), o("img", {
|
|
777
790
|
key: 0,
|
|
778
791
|
src: f.value,
|
|
779
792
|
alt: ""
|
|
780
|
-
}, null, 8,
|
|
793
|
+
}, null, 8, St)) : p.value ? (y(), o("span", Ct, E(D(c)("campus.auth.captchaFailed")), 1)) : a("v-if", !0)], 8, xt)]);
|
|
781
794
|
};
|
|
782
795
|
}
|
|
783
|
-
}),
|
|
796
|
+
}), [["__scopeId", "data-v-bd481e4d"]]), Tt = {
|
|
784
797
|
key: 1,
|
|
785
798
|
class: "ca-auth-links"
|
|
786
|
-
},
|
|
799
|
+
}, Et = { class: "ca-auth-help" }, Dt = /* @__PURE__ */ d({
|
|
787
800
|
__name: "LoginForm",
|
|
788
801
|
props: { preview: { type: Boolean } },
|
|
789
802
|
setup(t) {
|
|
790
|
-
let r = t, c =
|
|
803
|
+
let r = t, c = W(), d = G(), f = Q(), { t: p, label: m } = q(), h = Ke(), g = X(), _ = g.fields ?? {}, v = b({
|
|
791
804
|
username: "",
|
|
792
805
|
password: "",
|
|
793
806
|
captcha: ""
|
|
794
|
-
}), C = x(""), T = x(), O = x(), k = x(!1), A = x(""), j = x("error"),
|
|
807
|
+
}), C = x(""), T = x(), O = x(), k = x(!1), A = x(""), j = x("error"), M = n(() => ({
|
|
795
808
|
username: [{
|
|
796
809
|
required: !0,
|
|
797
810
|
message: p("campus.login.required", { label: p("campus.login.username") }),
|
|
@@ -807,7 +820,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
807
820
|
message: p("campus.auth.captchaRequired"),
|
|
808
821
|
trigger: "blur"
|
|
809
822
|
}] : []
|
|
810
|
-
})),
|
|
823
|
+
})), P = n(() => (g.helps ?? [
|
|
811
824
|
1,
|
|
812
825
|
2,
|
|
813
826
|
3,
|
|
@@ -833,7 +846,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
833
846
|
key: C.value,
|
|
834
847
|
code: v.captcha
|
|
835
848
|
} : void 0
|
|
836
|
-
}), await d.replace(
|
|
849
|
+
}), await d.replace(qe(c.query.redirect));
|
|
837
850
|
} catch (e) {
|
|
838
851
|
A.value = e instanceof Error && e.message ? e.message : p("campus.login.failed"), T.value?.refresh();
|
|
839
852
|
} finally {
|
|
@@ -860,14 +873,14 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
860
873
|
ref_key: "formRef",
|
|
861
874
|
ref: O,
|
|
862
875
|
model: v,
|
|
863
|
-
rules:
|
|
876
|
+
rules: M.value,
|
|
864
877
|
size: "large",
|
|
865
878
|
class: "ca-auth-form",
|
|
866
|
-
onSubmit:
|
|
879
|
+
onSubmit: F(L, ["prevent"])
|
|
867
880
|
}, {
|
|
868
|
-
default:
|
|
881
|
+
default: N(() => [
|
|
869
882
|
u(d, { prop: "username" }, {
|
|
870
|
-
default:
|
|
883
|
+
default: N(() => [u(c, {
|
|
871
884
|
modelValue: v.username,
|
|
872
885
|
"onUpdate:modelValue": n[0] ||= (e) => v.username = e,
|
|
873
886
|
placeholder: D(_).username?.placeholder ? D(m)(D(_).username.placeholder) : D(p)("campus.auth.accountPlaceholder"),
|
|
@@ -877,7 +890,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
877
890
|
"aria-label": D(p)("campus.login.username"),
|
|
878
891
|
autocomplete: "username"
|
|
879
892
|
}, {
|
|
880
|
-
prefix:
|
|
893
|
+
prefix: N(() => [u($, { name: "user" })]),
|
|
881
894
|
_: 1
|
|
882
895
|
}, 8, [
|
|
883
896
|
"modelValue",
|
|
@@ -889,7 +902,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
889
902
|
_: 1
|
|
890
903
|
}),
|
|
891
904
|
u(d, { prop: "password" }, {
|
|
892
|
-
default:
|
|
905
|
+
default: N(() => [u(c, {
|
|
893
906
|
modelValue: v.password,
|
|
894
907
|
"onUpdate:modelValue": n[1] ||= (e) => v.password = e,
|
|
895
908
|
type: "password",
|
|
@@ -899,7 +912,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
899
912
|
"aria-label": D(p)("campus.login.password"),
|
|
900
913
|
autocomplete: "current-password"
|
|
901
914
|
}, {
|
|
902
|
-
prefix:
|
|
915
|
+
prefix: N(() => [u($, { name: "lock" })]),
|
|
903
916
|
_: 1
|
|
904
917
|
}, 8, [
|
|
905
918
|
"modelValue",
|
|
@@ -913,7 +926,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
913
926
|
key: 0,
|
|
914
927
|
prop: "captcha"
|
|
915
928
|
}, {
|
|
916
|
-
default:
|
|
929
|
+
default: N(() => [u(wt, {
|
|
917
930
|
ref_key: "captchaRef",
|
|
918
931
|
ref: T,
|
|
919
932
|
code: v.captcha,
|
|
@@ -931,33 +944,33 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
931
944
|
loading: k.value,
|
|
932
945
|
class: "ca-auth-submit"
|
|
933
946
|
}, {
|
|
934
|
-
default:
|
|
947
|
+
default: N(() => [l(E(D(p)("campus.login.submit")), 1)]),
|
|
935
948
|
_: 1
|
|
936
949
|
}, 8, ["loading"])
|
|
937
950
|
]),
|
|
938
951
|
_: 1
|
|
939
952
|
}, 8, ["model", "rules"]),
|
|
940
|
-
z.value ? (y(), o("div",
|
|
953
|
+
z.value ? (y(), o("div", Tt, [D(h).forgot ? (y(), i(D(ne), {
|
|
941
954
|
key: 0,
|
|
942
|
-
to: { name: D(
|
|
955
|
+
to: { name: D(Y)(D(J)()).forgot },
|
|
943
956
|
onClick: R
|
|
944
957
|
}, {
|
|
945
|
-
default:
|
|
958
|
+
default: N(() => [l(E(D(p)("campus.auth.forgotLink")), 1)]),
|
|
946
959
|
_: 1
|
|
947
|
-
}, 8, ["to"])) : a("v-if", !0), D(h).register ? (y(), i(D(
|
|
960
|
+
}, 8, ["to"])) : a("v-if", !0), D(h).register ? (y(), i(D(ne), {
|
|
948
961
|
key: 1,
|
|
949
|
-
to: { name: D(
|
|
962
|
+
to: { name: D(Y)(D(J)()).register },
|
|
950
963
|
onClick: R
|
|
951
964
|
}, {
|
|
952
|
-
default:
|
|
965
|
+
default: N(() => [l(E(D(p)("campus.auth.registerLink")), 1)]),
|
|
953
966
|
_: 1
|
|
954
967
|
}, 8, ["to"])) : a("v-if", !0)])) : a("v-if", !0),
|
|
955
|
-
s("div",
|
|
968
|
+
s("div", Et, [s("h3", null, E(D(p)("campus.auth.helpTitle")), 1), s("ol", null, [(y(!0), o(e, null, S(P.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(ne), {
|
|
956
969
|
key: 1,
|
|
957
|
-
to: { name: D(
|
|
970
|
+
to: { name: D(Y)(D(J)()).forgot },
|
|
958
971
|
onClick: R
|
|
959
972
|
}, {
|
|
960
|
-
default:
|
|
973
|
+
default: N(() => [l(E(D(p)("campus.auth.findPassword")), 1)]),
|
|
961
974
|
_: 1
|
|
962
975
|
}, 8, ["to"])) : (y(), o(e, { key: 2 }, [l(E(D(p)("campus.auth.findPassword")), 1)], 64)) : (y(), o(e, { key: 0 }, [l(E(t), 1)], 64))], 64))), 128))]))), 128))])])
|
|
963
976
|
], 64);
|
|
@@ -965,7 +978,7 @@ var dt = "tabs", ft = I("campus-tabs", () => {
|
|
|
965
978
|
}
|
|
966
979
|
});
|
|
967
980
|
// packages/core/src/pages/auth/wechat-host.ts
|
|
968
|
-
function
|
|
981
|
+
function Ot(e, t) {
|
|
969
982
|
let n, r = !1, i = () => {
|
|
970
983
|
if (!r) {
|
|
971
984
|
r = !0;
|
|
@@ -992,75 +1005,75 @@ function wt(e, t) {
|
|
|
992
1005
|
};
|
|
993
1006
|
}
|
|
994
1007
|
// packages/core/src/pages/auth/WechatPane.vue?vue&type=script&setup=true&lang.ts
|
|
995
|
-
var
|
|
1008
|
+
var kt = {
|
|
996
1009
|
key: 0,
|
|
997
1010
|
class: "ca-auth-wechat"
|
|
998
|
-
},
|
|
1011
|
+
}, At = {
|
|
999
1012
|
key: 0,
|
|
1000
1013
|
class: "ca-auth-wechat__failed",
|
|
1001
1014
|
role: "alert"
|
|
1002
|
-
},
|
|
1015
|
+
}, jt = {
|
|
1003
1016
|
key: 1,
|
|
1004
1017
|
class: "ca-auth-wechat"
|
|
1005
|
-
},
|
|
1018
|
+
}, Mt = { class: "ca-auth-wechat__code" }, Nt = ["src", "alt"], Pt = ["aria-label"], Ft = { class: "ca-auth-wechat__hint" }, It = {
|
|
1006
1019
|
key: 0,
|
|
1007
1020
|
class: "ca-auth-wechat__note"
|
|
1008
|
-
},
|
|
1021
|
+
}, Lt = /* @__PURE__ */ d({
|
|
1009
1022
|
__name: "WechatPane",
|
|
1010
1023
|
props: { preview: { type: Boolean } },
|
|
1011
1024
|
setup(e) {
|
|
1012
|
-
let t = e, { t: r } =
|
|
1025
|
+
let t = e, { t: r } = q(), i = n(() => X().panel?.qrcode), d = !t.preview && Ke().wechat, f = x(), p = x(!1), h;
|
|
1013
1026
|
function g() {
|
|
1014
1027
|
h?.release(), h = void 0;
|
|
1015
1028
|
}
|
|
1016
1029
|
async function b() {
|
|
1017
|
-
g(), p.value = !1, await m(), f.value && (h =
|
|
1030
|
+
g(), p.value = !1, await m(), f.value && (h = Ot(J().auth.wechat.mount, f.value), p.value = !h.ok);
|
|
1018
1031
|
}
|
|
1019
1032
|
return v(() => {
|
|
1020
1033
|
d && b();
|
|
1021
1034
|
}), _(g), (e, t) => {
|
|
1022
1035
|
let n = w("ca-button");
|
|
1023
|
-
return D(d) ? (y(), o("div",
|
|
1036
|
+
return D(d) ? (y(), o("div", kt, [P(s("div", {
|
|
1024
1037
|
ref_key: "host",
|
|
1025
1038
|
ref: f,
|
|
1026
1039
|
class: "ca-auth-wechat__host"
|
|
1027
|
-
}, null, 512), [[
|
|
1028
|
-
default:
|
|
1040
|
+
}, null, 512), [[A, !p.value]]), p.value ? (y(), o("div", At, [s("p", null, E(D(r)("campus.auth.wechatMountFailed")), 1), u(n, { onClick: b }, {
|
|
1041
|
+
default: N(() => [l(E(D(r)("campus.auth.wechatRetry")), 1)]),
|
|
1029
1042
|
_: 1
|
|
1030
|
-
})])) : a("v-if", !0)])) : (y(), o("div",
|
|
1031
|
-
s("div",
|
|
1043
|
+
})])) : a("v-if", !0)])) : (y(), o("div", jt, [
|
|
1044
|
+
s("div", Mt, [i.value ? (y(), o("img", {
|
|
1032
1045
|
key: 0,
|
|
1033
1046
|
src: i.value,
|
|
1034
1047
|
alt: D(r)("campus.auth.qrcodeAlt")
|
|
1035
|
-
}, null, 8,
|
|
1048
|
+
}, null, 8, Nt)) : (y(), o("svg", {
|
|
1036
1049
|
key: 1,
|
|
1037
1050
|
viewBox: "0 0 100 100",
|
|
1038
1051
|
role: "img",
|
|
1039
1052
|
"aria-label": D(r)("campus.auth.qrcodeAlt")
|
|
1040
|
-
}, [...t[0] ||= [c("<rect x=\"8\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"66\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"8\" y=\"66\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"16\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"74\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"16\" y=\"74\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><path d=\"M44 10h8v10h-8zM44 28h16v8H44zM10 44h10v8H10zM28 44h16v10H28zM52 46h10v10H52zM70 44h22v8H70zM44 62h8v14h-8zM58 66h14v8H58zM78 62h14v14H78zM56 82h14v10H56z\" fill=\"currentColor\"></path>", 7)]], 8,
|
|
1041
|
-
s("p",
|
|
1042
|
-
i.value ? a("v-if", !0) : (y(), o("p",
|
|
1053
|
+
}, [...t[0] ||= [c("<rect x=\"8\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"66\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"8\" y=\"66\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"16\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"74\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"16\" y=\"74\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><path d=\"M44 10h8v10h-8zM44 28h16v8H44zM10 44h10v8H10zM28 44h16v10H28zM52 46h10v10H52zM70 44h22v8H70zM44 62h8v14h-8zM58 66h14v8H58zM78 62h14v14H78zM56 82h14v10H56z\" fill=\"currentColor\"></path>", 7)]], 8, Pt))]),
|
|
1054
|
+
s("p", Ft, E(D(r)("campus.auth.wechatHint")), 1),
|
|
1055
|
+
i.value ? a("v-if", !0) : (y(), o("p", It, E(D(r)("campus.auth.wechatNote")), 1))
|
|
1043
1056
|
]));
|
|
1044
1057
|
};
|
|
1045
1058
|
}
|
|
1046
|
-
}),
|
|
1059
|
+
}), Rt = /* @__PURE__ */ d({
|
|
1047
1060
|
__name: "LoginSplit",
|
|
1048
1061
|
props: { preview: { type: Boolean } },
|
|
1049
1062
|
setup(e) {
|
|
1050
|
-
let { t } =
|
|
1063
|
+
let { t } = q(), r = X().tabs?.length ? X().tabs : ["account", "wechat"], a = x(r[0]), o = n(() => r.map((e) => ({
|
|
1051
1064
|
key: e,
|
|
1052
1065
|
label: t(e === "account" ? "campus.auth.tabAccount" : "campus.auth.tabWechat")
|
|
1053
1066
|
})));
|
|
1054
|
-
return (t, n) => (y(), i(
|
|
1067
|
+
return (t, n) => (y(), i(ut, {
|
|
1055
1068
|
active: a.value,
|
|
1056
1069
|
"onUpdate:active": n[0] ||= (e) => a.value = e,
|
|
1057
1070
|
tabs: o.value,
|
|
1058
1071
|
preview: e.preview
|
|
1059
1072
|
}, {
|
|
1060
|
-
default:
|
|
1073
|
+
default: N(() => [a.value === "account" ? (y(), i(Dt, {
|
|
1061
1074
|
key: 0,
|
|
1062
1075
|
preview: e.preview
|
|
1063
|
-
}, null, 8, ["preview"])) : (y(), i(
|
|
1076
|
+
}, null, 8, ["preview"])) : (y(), i(Lt, { key: 1 }))]),
|
|
1064
1077
|
_: 1
|
|
1065
1078
|
}, 8, [
|
|
1066
1079
|
"active",
|
|
@@ -1070,78 +1083,78 @@ var Tt = {
|
|
|
1070
1083
|
}
|
|
1071
1084
|
});
|
|
1072
1085
|
// packages/core/src/security.ts
|
|
1073
|
-
function
|
|
1086
|
+
function zt(e) {
|
|
1074
1087
|
return e.environment ? e.environment : "production";
|
|
1075
1088
|
}
|
|
1076
|
-
function
|
|
1077
|
-
if (
|
|
1089
|
+
function Bt(e) {
|
|
1090
|
+
if (zt(e) === "production" && typeof e.auth.captcha != "function") throw Error("[campus] 生产环境必须在 auth 中提供 captcha()(图形验证码);测试环境可设置 environment: 'test' 跳过");
|
|
1078
1091
|
}
|
|
1079
|
-
function
|
|
1092
|
+
function Vt(e, t) {
|
|
1080
1093
|
return t === "test" || e.length >= 8 && /[A-Za-z]/.test(e) && /\d/.test(e);
|
|
1081
1094
|
}
|
|
1082
1095
|
// packages/core/src/services/feedback.ts
|
|
1083
|
-
var
|
|
1084
|
-
function
|
|
1085
|
-
|
|
1096
|
+
var Ht = (e) => e;
|
|
1097
|
+
function Ut(e) {
|
|
1098
|
+
Ht = e;
|
|
1086
1099
|
}
|
|
1087
|
-
async function
|
|
1088
|
-
await
|
|
1100
|
+
async function Wt(e, t = {}) {
|
|
1101
|
+
await pe.alert(e, t.title ?? Ht("campus.common.tip"), {
|
|
1089
1102
|
type: t.type ?? "info",
|
|
1090
|
-
confirmButtonText: t.confirmText ??
|
|
1103
|
+
confirmButtonText: t.confirmText ?? Ht("campus.common.ok")
|
|
1091
1104
|
});
|
|
1092
1105
|
}
|
|
1093
|
-
async function
|
|
1106
|
+
async function Gt(e, t = {}) {
|
|
1094
1107
|
try {
|
|
1095
|
-
return await
|
|
1108
|
+
return await pe.confirm(e, t.title ?? Ht("campus.common.tip"), {
|
|
1096
1109
|
type: t.type ?? "warning",
|
|
1097
|
-
confirmButtonText: t.confirmText ??
|
|
1098
|
-
cancelButtonText: t.cancelText ??
|
|
1110
|
+
confirmButtonText: t.confirmText ?? Ht("campus.common.confirm"),
|
|
1111
|
+
cancelButtonText: t.cancelText ?? Ht("campus.common.cancel")
|
|
1099
1112
|
}), !0;
|
|
1100
1113
|
} catch (e) {
|
|
1101
1114
|
if (e === "cancel" || e === "close") return !1;
|
|
1102
1115
|
throw e;
|
|
1103
1116
|
}
|
|
1104
1117
|
}
|
|
1105
|
-
var
|
|
1106
|
-
info: (e) => void
|
|
1118
|
+
var Kt = {
|
|
1119
|
+
info: (e) => void fe({
|
|
1107
1120
|
message: e,
|
|
1108
1121
|
type: "info"
|
|
1109
1122
|
}),
|
|
1110
|
-
success: (e) => void
|
|
1123
|
+
success: (e) => void fe({
|
|
1111
1124
|
message: e,
|
|
1112
1125
|
type: "success"
|
|
1113
1126
|
}),
|
|
1114
|
-
warning: (e) => void
|
|
1127
|
+
warning: (e) => void fe({
|
|
1115
1128
|
message: e,
|
|
1116
1129
|
type: "warning"
|
|
1117
1130
|
}),
|
|
1118
|
-
error: (e) => void
|
|
1131
|
+
error: (e) => void fe({
|
|
1119
1132
|
message: e,
|
|
1120
1133
|
type: "error"
|
|
1121
1134
|
})
|
|
1122
|
-
},
|
|
1123
|
-
function
|
|
1124
|
-
let r =
|
|
1135
|
+
}, qt = de.service;
|
|
1136
|
+
function Jt(e, t, n = {}) {
|
|
1137
|
+
let r = me({
|
|
1125
1138
|
...n,
|
|
1126
|
-
title: n.title ??
|
|
1139
|
+
title: n.title ?? Ht(`campus.notify.${e}`),
|
|
1127
1140
|
message: t,
|
|
1128
1141
|
type: e
|
|
1129
1142
|
});
|
|
1130
|
-
return m(() =>
|
|
1143
|
+
return m(() => me.updateOffsets(n.position)), r;
|
|
1131
1144
|
}
|
|
1132
1145
|
// packages/core/src/services/ca.ts
|
|
1133
|
-
var
|
|
1134
|
-
alert:
|
|
1135
|
-
confirm:
|
|
1136
|
-
toast:
|
|
1137
|
-
loading:
|
|
1146
|
+
var Yt = {
|
|
1147
|
+
alert: Wt,
|
|
1148
|
+
confirm: Gt,
|
|
1149
|
+
toast: Kt,
|
|
1150
|
+
loading: qt,
|
|
1138
1151
|
notify: {
|
|
1139
|
-
success: (e, t) =>
|
|
1140
|
-
info: (e, t) =>
|
|
1141
|
-
warning: (e, t) =>
|
|
1142
|
-
error: (e, t) =>
|
|
1152
|
+
success: (e, t) => Jt("success", e, t),
|
|
1153
|
+
info: (e, t) => Jt("info", e, t),
|
|
1154
|
+
warning: (e, t) => Jt("warning", e, t),
|
|
1155
|
+
error: (e, t) => Jt("error", e, t)
|
|
1143
1156
|
}
|
|
1144
|
-
},
|
|
1157
|
+
}, Xt = { class: "ca-auth-row" }, Zt = ["disabled"], Qt = 60, $t = /* @__PURE__ */ d({
|
|
1145
1158
|
__name: "SmsField",
|
|
1146
1159
|
props: /*@__PURE__*/ p({ send: { type: Function } }, {
|
|
1147
1160
|
modelValue: { default: "" },
|
|
@@ -1149,7 +1162,7 @@ var Gt = {
|
|
|
1149
1162
|
}),
|
|
1150
1163
|
emits: ["update:modelValue"],
|
|
1151
1164
|
setup(e) {
|
|
1152
|
-
let t = e, n =
|
|
1165
|
+
let t = e, n = k(e, "modelValue"), { t: r } = q(), i = x(0), a = x(!1), c;
|
|
1153
1166
|
function l() {
|
|
1154
1167
|
c && clearInterval(c), c = void 0;
|
|
1155
1168
|
}
|
|
@@ -1163,14 +1176,14 @@ var Gt = {
|
|
|
1163
1176
|
} finally {
|
|
1164
1177
|
a.value = !1;
|
|
1165
1178
|
}
|
|
1166
|
-
i.value =
|
|
1179
|
+
i.value = Qt, l(), c = setInterval(() => {
|
|
1167
1180
|
--i.value, i.value <= 0 && l();
|
|
1168
1181
|
}, 1e3);
|
|
1169
1182
|
}
|
|
1170
1183
|
}
|
|
1171
1184
|
return _(l), (e, t) => {
|
|
1172
1185
|
let c = w("ca-input");
|
|
1173
|
-
return y(), o("div",
|
|
1186
|
+
return y(), o("div", Xt, [u(c, {
|
|
1174
1187
|
modelValue: n.value,
|
|
1175
1188
|
"onUpdate:modelValue": t[0] ||= (e) => n.value = e,
|
|
1176
1189
|
placeholder: D(r)("campus.auth.smsPlaceholder"),
|
|
@@ -1178,7 +1191,7 @@ var Gt = {
|
|
|
1178
1191
|
autocomplete: "one-time-code",
|
|
1179
1192
|
maxlength: "8"
|
|
1180
1193
|
}, {
|
|
1181
|
-
prefix:
|
|
1194
|
+
prefix: N(() => [u($, { name: "message" })]),
|
|
1182
1195
|
_: 1
|
|
1183
1196
|
}, 8, [
|
|
1184
1197
|
"modelValue",
|
|
@@ -1189,30 +1202,30 @@ var Gt = {
|
|
|
1189
1202
|
class: "ca-auth-sms",
|
|
1190
1203
|
disabled: i.value > 0 || a.value,
|
|
1191
1204
|
onClick: d
|
|
1192
|
-
}, E(i.value > 0 ? D(r)("campus.auth.resend", { n: i.value }) : D(r)("campus.auth.getCode")), 9,
|
|
1205
|
+
}, E(i.value > 0 ? D(r)("campus.auth.resend", { n: i.value }) : D(r)("campus.auth.getCode")), 9, Zt)]);
|
|
1193
1206
|
};
|
|
1194
1207
|
}
|
|
1195
|
-
}),
|
|
1208
|
+
}), en = {
|
|
1196
1209
|
key: 0,
|
|
1197
1210
|
class: "ca-auth-hint"
|
|
1198
|
-
},
|
|
1211
|
+
}, tn = { class: "ca-auth-agreements" }, nn = ["href"], rn = /* @__PURE__ */ d({
|
|
1199
1212
|
__name: "RegisterForm",
|
|
1200
1213
|
props: { preview: { type: Boolean } },
|
|
1201
1214
|
setup(t) {
|
|
1202
|
-
let r = t, c =
|
|
1215
|
+
let r = t, c = G(), { t: d, label: f } = q(), p = Ke(), m = zt(J()), g = X(), _ = g.agreements ?? [], v = b({
|
|
1203
1216
|
phone: "",
|
|
1204
1217
|
captcha: "",
|
|
1205
1218
|
code: "",
|
|
1206
1219
|
password: "",
|
|
1207
1220
|
confirm: "",
|
|
1208
1221
|
agree: !1
|
|
1209
|
-
}), C = x(""), T = x(), O = x(), k = x(!1), A = x(""), j = x("error"),
|
|
1222
|
+
}), C = x(""), T = x(), O = x(), k = x(!1), A = x(""), j = x("error"), M = n(() => ({
|
|
1210
1223
|
phone: [{
|
|
1211
1224
|
required: !0,
|
|
1212
1225
|
message: d("campus.auth.phonePlaceholder"),
|
|
1213
1226
|
trigger: "blur"
|
|
1214
1227
|
}, {
|
|
1215
|
-
pattern:
|
|
1228
|
+
pattern: Ge,
|
|
1216
1229
|
message: d("campus.auth.phoneInvalid"),
|
|
1217
1230
|
trigger: "blur"
|
|
1218
1231
|
}],
|
|
@@ -1231,7 +1244,7 @@ var Gt = {
|
|
|
1231
1244
|
message: d("campus.auth.registerPasswordPlaceholder"),
|
|
1232
1245
|
trigger: "blur"
|
|
1233
1246
|
}, {
|
|
1234
|
-
validator: (e, t, n) => n(
|
|
1247
|
+
validator: (e, t, n) => n(Vt(t, m) ? void 0 : Error(d("campus.auth.passwordPolicy"))),
|
|
1235
1248
|
trigger: "blur"
|
|
1236
1249
|
}],
|
|
1237
1250
|
confirm: [{
|
|
@@ -1246,7 +1259,7 @@ var Gt = {
|
|
|
1246
1259
|
validator: (e, t, n) => n(t ? void 0 : Error(d("campus.auth.agreeRequired"))),
|
|
1247
1260
|
trigger: "change"
|
|
1248
1261
|
}] : []
|
|
1249
|
-
})),
|
|
1262
|
+
})), P = n(() => !!(v.phone && v.code && v.password && v.confirm) && (!p.captcha || !!v.captcha) && (!_.length || v.agree));
|
|
1250
1263
|
function I(e, t) {
|
|
1251
1264
|
j.value = "error", A.value = e instanceof Error && e.message ? e.message : t;
|
|
1252
1265
|
}
|
|
@@ -1259,20 +1272,20 @@ var Gt = {
|
|
|
1259
1272
|
}
|
|
1260
1273
|
if (A.value = "", r.preview) j.value = "info", A.value = d("campus.auth.previewNote");
|
|
1261
1274
|
else try {
|
|
1262
|
-
await
|
|
1275
|
+
await J().auth.sendSmsCode({
|
|
1263
1276
|
phone: v.phone,
|
|
1264
1277
|
scene: "register",
|
|
1265
1278
|
captcha: p.captcha ? {
|
|
1266
1279
|
key: C.value,
|
|
1267
1280
|
code: v.captcha
|
|
1268
1281
|
} : void 0
|
|
1269
|
-
}),
|
|
1282
|
+
}), Yt.toast.success(d("campus.auth.smsSent"));
|
|
1270
1283
|
} catch (e) {
|
|
1271
1284
|
throw I(e, d("campus.login.failed")), T.value?.refresh(), e;
|
|
1272
1285
|
}
|
|
1273
1286
|
}
|
|
1274
1287
|
async function R() {
|
|
1275
|
-
if (
|
|
1288
|
+
if (P.value) {
|
|
1276
1289
|
try {
|
|
1277
1290
|
await O.value?.validate();
|
|
1278
1291
|
} catch {
|
|
@@ -1282,7 +1295,7 @@ var Gt = {
|
|
|
1282
1295
|
else {
|
|
1283
1296
|
k.value = !0, A.value = "";
|
|
1284
1297
|
try {
|
|
1285
|
-
await
|
|
1298
|
+
await J().auth.register({
|
|
1286
1299
|
phone: v.phone,
|
|
1287
1300
|
code: v.code,
|
|
1288
1301
|
password: v.password,
|
|
@@ -1290,7 +1303,7 @@ var Gt = {
|
|
|
1290
1303
|
key: C.value,
|
|
1291
1304
|
code: v.captcha
|
|
1292
1305
|
} : void 0
|
|
1293
|
-
}),
|
|
1306
|
+
}), Yt.toast.success(d("campus.auth.registerOk")), await c.replace({ name: Y(J()).login });
|
|
1294
1307
|
} catch (e) {
|
|
1295
1308
|
I(e, d("campus.login.failed")), T.value?.refresh();
|
|
1296
1309
|
} finally {
|
|
@@ -1312,14 +1325,14 @@ var Gt = {
|
|
|
1312
1325
|
ref_key: "formRef",
|
|
1313
1326
|
ref: O,
|
|
1314
1327
|
model: v,
|
|
1315
|
-
rules:
|
|
1328
|
+
rules: M.value,
|
|
1316
1329
|
size: "large",
|
|
1317
1330
|
class: "ca-auth-form",
|
|
1318
|
-
onSubmit:
|
|
1331
|
+
onSubmit: F(R, ["prevent"])
|
|
1319
1332
|
}, {
|
|
1320
|
-
default:
|
|
1333
|
+
default: N(() => [
|
|
1321
1334
|
u(m, { prop: "phone" }, {
|
|
1322
|
-
default:
|
|
1335
|
+
default: N(() => [u(c, {
|
|
1323
1336
|
modelValue: v.phone,
|
|
1324
1337
|
"onUpdate:modelValue": n[0] ||= (e) => v.phone = e,
|
|
1325
1338
|
placeholder: D(d)("campus.auth.phonePlaceholder"),
|
|
@@ -1327,7 +1340,7 @@ var Gt = {
|
|
|
1327
1340
|
autocomplete: "tel",
|
|
1328
1341
|
maxlength: "11"
|
|
1329
1342
|
}, {
|
|
1330
|
-
prefix:
|
|
1343
|
+
prefix: N(() => [u($, { name: "phone" })]),
|
|
1331
1344
|
_: 1
|
|
1332
1345
|
}, 8, [
|
|
1333
1346
|
"modelValue",
|
|
@@ -1340,7 +1353,7 @@ var Gt = {
|
|
|
1340
1353
|
key: 0,
|
|
1341
1354
|
prop: "captcha"
|
|
1342
1355
|
}, {
|
|
1343
|
-
default:
|
|
1356
|
+
default: N(() => [u(wt, {
|
|
1344
1357
|
ref_key: "captchaRef",
|
|
1345
1358
|
ref: T,
|
|
1346
1359
|
code: v.captcha,
|
|
@@ -1352,15 +1365,15 @@ var Gt = {
|
|
|
1352
1365
|
_: 1
|
|
1353
1366
|
})) : a("v-if", !0),
|
|
1354
1367
|
u(m, { prop: "code" }, {
|
|
1355
|
-
default:
|
|
1368
|
+
default: N(() => [u($t, {
|
|
1356
1369
|
modelValue: v.code,
|
|
1357
1370
|
"onUpdate:modelValue": n[3] ||= (e) => v.code = e,
|
|
1358
1371
|
send: L
|
|
1359
|
-
}, null, 8, ["modelValue"]), D(g).smsHint ? (y(), o("p",
|
|
1372
|
+
}, null, 8, ["modelValue"]), D(g).smsHint ? (y(), o("p", en, E(D(f)(D(g).smsHint)), 1)) : a("v-if", !0)]),
|
|
1360
1373
|
_: 1
|
|
1361
1374
|
}),
|
|
1362
1375
|
u(m, { prop: "password" }, {
|
|
1363
|
-
default:
|
|
1376
|
+
default: N(() => [u(c, {
|
|
1364
1377
|
modelValue: v.password,
|
|
1365
1378
|
"onUpdate:modelValue": n[4] ||= (e) => v.password = e,
|
|
1366
1379
|
type: "password",
|
|
@@ -1369,7 +1382,7 @@ var Gt = {
|
|
|
1369
1382
|
"aria-label": D(d)("campus.auth.registerPassword"),
|
|
1370
1383
|
autocomplete: "new-password"
|
|
1371
1384
|
}, {
|
|
1372
|
-
prefix:
|
|
1385
|
+
prefix: N(() => [u($, { name: "lock" })]),
|
|
1373
1386
|
_: 1
|
|
1374
1387
|
}, 8, [
|
|
1375
1388
|
"modelValue",
|
|
@@ -1379,7 +1392,7 @@ var Gt = {
|
|
|
1379
1392
|
_: 1
|
|
1380
1393
|
}),
|
|
1381
1394
|
u(m, { prop: "confirm" }, {
|
|
1382
|
-
default:
|
|
1395
|
+
default: N(() => [u(c, {
|
|
1383
1396
|
modelValue: v.confirm,
|
|
1384
1397
|
"onUpdate:modelValue": n[5] ||= (e) => v.confirm = e,
|
|
1385
1398
|
type: "password",
|
|
@@ -1388,7 +1401,7 @@ var Gt = {
|
|
|
1388
1401
|
"aria-label": D(d)("campus.auth.confirmPlaceholder"),
|
|
1389
1402
|
autocomplete: "new-password"
|
|
1390
1403
|
}, {
|
|
1391
|
-
prefix:
|
|
1404
|
+
prefix: N(() => [u($, { name: "lock" })]),
|
|
1392
1405
|
_: 1
|
|
1393
1406
|
}, 8, [
|
|
1394
1407
|
"modelValue",
|
|
@@ -1401,18 +1414,18 @@ var Gt = {
|
|
|
1401
1414
|
key: 1,
|
|
1402
1415
|
prop: "agree"
|
|
1403
1416
|
}, {
|
|
1404
|
-
default:
|
|
1417
|
+
default: N(() => [u(b, {
|
|
1405
1418
|
modelValue: v.agree,
|
|
1406
1419
|
"onUpdate:modelValue": n[6] ||= (e) => v.agree = e
|
|
1407
1420
|
}, {
|
|
1408
|
-
default:
|
|
1421
|
+
default: N(() => [l(E(D(d)("campus.auth.agreePrefix")), 1)]),
|
|
1409
1422
|
_: 1
|
|
1410
|
-
}, 8, ["modelValue"]), s("span",
|
|
1423
|
+
}, 8, ["modelValue"]), s("span", tn, [(y(!0), o(e, null, S(D(_), (e) => (y(), o("a", {
|
|
1411
1424
|
key: e.href,
|
|
1412
1425
|
href: e.href,
|
|
1413
1426
|
target: "_blank",
|
|
1414
1427
|
rel: "noopener noreferrer"
|
|
1415
|
-
}, E(D(f)(e.text)), 9,
|
|
1428
|
+
}, E(D(f)(e.text)), 9, nn))), 128))])]),
|
|
1416
1429
|
_: 1
|
|
1417
1430
|
})) : a("v-if", !0),
|
|
1418
1431
|
u(x, {
|
|
@@ -1420,10 +1433,10 @@ var Gt = {
|
|
|
1420
1433
|
"native-type": "submit",
|
|
1421
1434
|
size: "large",
|
|
1422
1435
|
loading: k.value,
|
|
1423
|
-
disabled: !
|
|
1424
|
-
class: h(["ca-auth-submit", { "ca-auth-submit--off": !
|
|
1436
|
+
disabled: !P.value,
|
|
1437
|
+
class: h(["ca-auth-submit", { "ca-auth-submit--off": !P.value }])
|
|
1425
1438
|
}, {
|
|
1426
|
-
default:
|
|
1439
|
+
default: N(() => [l(E(D(d)("campus.common.ok")), 1)]),
|
|
1427
1440
|
_: 1
|
|
1428
1441
|
}, 8, [
|
|
1429
1442
|
"loading",
|
|
@@ -1435,42 +1448,42 @@ var Gt = {
|
|
|
1435
1448
|
}, 8, ["model", "rules"])], 64);
|
|
1436
1449
|
};
|
|
1437
1450
|
}
|
|
1438
|
-
}),
|
|
1451
|
+
}), an = {
|
|
1439
1452
|
key: 1,
|
|
1440
1453
|
class: "ca-auth-off",
|
|
1441
1454
|
role: "status"
|
|
1442
|
-
},
|
|
1455
|
+
}, on = /* @__PURE__ */ d({
|
|
1443
1456
|
__name: "RegisterPage",
|
|
1444
1457
|
props: { preview: { type: Boolean } },
|
|
1445
1458
|
setup(e) {
|
|
1446
|
-
let { t } =
|
|
1459
|
+
let { t } = q(), r = Ke().register, a = n(() => [{
|
|
1447
1460
|
key: "register",
|
|
1448
1461
|
label: t("campus.auth.tabRegister")
|
|
1449
1462
|
}, {
|
|
1450
1463
|
key: "login",
|
|
1451
1464
|
label: t("campus.auth.backLogin"),
|
|
1452
|
-
to:
|
|
1465
|
+
to: Fe(J()).login
|
|
1453
1466
|
}]);
|
|
1454
|
-
return (n, c) => (y(), i(
|
|
1467
|
+
return (n, c) => (y(), i(ut, {
|
|
1455
1468
|
active: "register",
|
|
1456
1469
|
tabs: a.value,
|
|
1457
1470
|
preview: e.preview
|
|
1458
1471
|
}, {
|
|
1459
|
-
default:
|
|
1472
|
+
default: N(() => [D(r) ? (y(), i(rn, {
|
|
1460
1473
|
key: 0,
|
|
1461
1474
|
preview: e.preview
|
|
1462
|
-
}, null, 8, ["preview"])) : (y(), o("div",
|
|
1475
|
+
}, null, 8, ["preview"])) : (y(), o("div", an, [s("h3", null, E(D(t)("campus.auth.unavailableTitle")), 1), s("p", null, E(D(t)("campus.auth.unavailableDesc")), 1)]))]),
|
|
1463
1476
|
_: 1
|
|
1464
1477
|
}, 8, ["tabs", "preview"]));
|
|
1465
1478
|
}
|
|
1466
|
-
}),
|
|
1479
|
+
}), sn = {
|
|
1467
1480
|
key: 0,
|
|
1468
1481
|
class: "ca-auth-hint"
|
|
1469
|
-
},
|
|
1482
|
+
}, cn = /* @__PURE__ */ d({
|
|
1470
1483
|
__name: "ForgotForm",
|
|
1471
1484
|
props: { preview: { type: Boolean } },
|
|
1472
1485
|
setup(t) {
|
|
1473
|
-
let r = t, s =
|
|
1486
|
+
let r = t, s = G(), { t: c, label: d } = q(), f = Ke(), p = zt(J()), m = X(), g = b({
|
|
1474
1487
|
account: "",
|
|
1475
1488
|
captcha: "",
|
|
1476
1489
|
code: "",
|
|
@@ -1497,7 +1510,7 @@ var Gt = {
|
|
|
1497
1510
|
message: c("campus.auth.newPasswordPlaceholder"),
|
|
1498
1511
|
trigger: "blur"
|
|
1499
1512
|
}, {
|
|
1500
|
-
validator: (e, t, n) => n(
|
|
1513
|
+
validator: (e, t, n) => n(Vt(t, p) ? void 0 : Error(c("campus.auth.passwordPolicy"))),
|
|
1501
1514
|
trigger: "blur"
|
|
1502
1515
|
}],
|
|
1503
1516
|
confirm: [{
|
|
@@ -1512,7 +1525,7 @@ var Gt = {
|
|
|
1512
1525
|
function j(e, t) {
|
|
1513
1526
|
O.value = "error", T.value = e instanceof Error && e.message ? e.message : t;
|
|
1514
1527
|
}
|
|
1515
|
-
async function
|
|
1528
|
+
async function M() {
|
|
1516
1529
|
let e = f.captcha ? ["account", "captcha"] : ["account"];
|
|
1517
1530
|
try {
|
|
1518
1531
|
await S.value?.validateField(e);
|
|
@@ -1521,19 +1534,19 @@ var Gt = {
|
|
|
1521
1534
|
}
|
|
1522
1535
|
if (T.value = "", r.preview) O.value = "info", T.value = c("campus.auth.previewNote");
|
|
1523
1536
|
else try {
|
|
1524
|
-
await
|
|
1525
|
-
...
|
|
1537
|
+
await J().auth.sendSmsCode({
|
|
1538
|
+
...Ge.test(g.account) ? { phone: g.account } : { username: g.account },
|
|
1526
1539
|
scene: "forgot",
|
|
1527
1540
|
captcha: f.captcha ? {
|
|
1528
1541
|
key: _.value,
|
|
1529
1542
|
code: g.captcha
|
|
1530
1543
|
} : void 0
|
|
1531
|
-
}),
|
|
1544
|
+
}), Yt.toast.success(c("campus.auth.smsSent"));
|
|
1532
1545
|
} catch (e) {
|
|
1533
1546
|
throw j(e, c("campus.login.failed")), v.value?.refresh(), e;
|
|
1534
1547
|
}
|
|
1535
1548
|
}
|
|
1536
|
-
async function
|
|
1549
|
+
async function P() {
|
|
1537
1550
|
if (A.value) {
|
|
1538
1551
|
try {
|
|
1539
1552
|
await S.value?.validate();
|
|
@@ -1544,7 +1557,7 @@ var Gt = {
|
|
|
1544
1557
|
else {
|
|
1545
1558
|
C.value = !0, T.value = "";
|
|
1546
1559
|
try {
|
|
1547
|
-
await
|
|
1560
|
+
await J().auth.resetPassword({
|
|
1548
1561
|
account: g.account,
|
|
1549
1562
|
code: g.code,
|
|
1550
1563
|
password: g.password,
|
|
@@ -1552,7 +1565,7 @@ var Gt = {
|
|
|
1552
1565
|
key: _.value,
|
|
1553
1566
|
code: g.captcha
|
|
1554
1567
|
} : void 0
|
|
1555
|
-
}),
|
|
1568
|
+
}), Yt.toast.success(c("campus.auth.resetOk")), await s.replace({ name: Y(J()).login });
|
|
1556
1569
|
} catch (e) {
|
|
1557
1570
|
j(e, c("campus.login.failed")), v.value?.refresh();
|
|
1558
1571
|
} finally {
|
|
@@ -1577,18 +1590,18 @@ var Gt = {
|
|
|
1577
1590
|
rules: k.value,
|
|
1578
1591
|
size: "large",
|
|
1579
1592
|
class: "ca-auth-form",
|
|
1580
|
-
onSubmit: P
|
|
1593
|
+
onSubmit: F(P, ["prevent"])
|
|
1581
1594
|
}, {
|
|
1582
|
-
default:
|
|
1595
|
+
default: N(() => [
|
|
1583
1596
|
u(p, { prop: "account" }, {
|
|
1584
|
-
default:
|
|
1597
|
+
default: N(() => [u(s, {
|
|
1585
1598
|
modelValue: g.account,
|
|
1586
1599
|
"onUpdate:modelValue": n[0] ||= (e) => g.account = e,
|
|
1587
1600
|
placeholder: D(c)("campus.auth.accountPlaceholder"),
|
|
1588
1601
|
"aria-label": D(c)("campus.auth.account"),
|
|
1589
1602
|
autocomplete: "username"
|
|
1590
1603
|
}, {
|
|
1591
|
-
prefix:
|
|
1604
|
+
prefix: N(() => [u($, { name: "user" })]),
|
|
1592
1605
|
_: 1
|
|
1593
1606
|
}, 8, [
|
|
1594
1607
|
"modelValue",
|
|
@@ -1601,7 +1614,7 @@ var Gt = {
|
|
|
1601
1614
|
key: 0,
|
|
1602
1615
|
prop: "captcha"
|
|
1603
1616
|
}, {
|
|
1604
|
-
default:
|
|
1617
|
+
default: N(() => [u(wt, {
|
|
1605
1618
|
ref_key: "captchaRef",
|
|
1606
1619
|
ref: v,
|
|
1607
1620
|
code: g.captcha,
|
|
@@ -1613,15 +1626,15 @@ var Gt = {
|
|
|
1613
1626
|
_: 1
|
|
1614
1627
|
})) : a("v-if", !0),
|
|
1615
1628
|
u(p, { prop: "code" }, {
|
|
1616
|
-
default:
|
|
1629
|
+
default: N(() => [u($t, {
|
|
1617
1630
|
modelValue: g.code,
|
|
1618
1631
|
"onUpdate:modelValue": n[3] ||= (e) => g.code = e,
|
|
1619
|
-
send:
|
|
1620
|
-
}, null, 8, ["modelValue"]), D(m).smsHint ? (y(), o("p",
|
|
1632
|
+
send: M
|
|
1633
|
+
}, null, 8, ["modelValue"]), D(m).smsHint ? (y(), o("p", sn, E(D(d)(D(m).smsHint)), 1)) : a("v-if", !0)]),
|
|
1621
1634
|
_: 1
|
|
1622
1635
|
}),
|
|
1623
1636
|
u(p, { prop: "password" }, {
|
|
1624
|
-
default:
|
|
1637
|
+
default: N(() => [u(s, {
|
|
1625
1638
|
modelValue: g.password,
|
|
1626
1639
|
"onUpdate:modelValue": n[4] ||= (e) => g.password = e,
|
|
1627
1640
|
type: "password",
|
|
@@ -1630,7 +1643,7 @@ var Gt = {
|
|
|
1630
1643
|
"aria-label": D(c)("campus.auth.newPasswordPlaceholder"),
|
|
1631
1644
|
autocomplete: "new-password"
|
|
1632
1645
|
}, {
|
|
1633
|
-
prefix:
|
|
1646
|
+
prefix: N(() => [u($, { name: "lock" })]),
|
|
1634
1647
|
_: 1
|
|
1635
1648
|
}, 8, [
|
|
1636
1649
|
"modelValue",
|
|
@@ -1640,7 +1653,7 @@ var Gt = {
|
|
|
1640
1653
|
_: 1
|
|
1641
1654
|
}),
|
|
1642
1655
|
u(p, { prop: "confirm" }, {
|
|
1643
|
-
default:
|
|
1656
|
+
default: N(() => [u(s, {
|
|
1644
1657
|
modelValue: g.confirm,
|
|
1645
1658
|
"onUpdate:modelValue": n[5] ||= (e) => g.confirm = e,
|
|
1646
1659
|
type: "password",
|
|
@@ -1649,7 +1662,7 @@ var Gt = {
|
|
|
1649
1662
|
"aria-label": D(c)("campus.auth.confirmPlaceholder"),
|
|
1650
1663
|
autocomplete: "new-password"
|
|
1651
1664
|
}, {
|
|
1652
|
-
prefix:
|
|
1665
|
+
prefix: N(() => [u($, { name: "lock" })]),
|
|
1653
1666
|
_: 1
|
|
1654
1667
|
}, 8, [
|
|
1655
1668
|
"modelValue",
|
|
@@ -1666,7 +1679,7 @@ var Gt = {
|
|
|
1666
1679
|
disabled: !A.value,
|
|
1667
1680
|
class: h(["ca-auth-submit", { "ca-auth-submit--off": !A.value }])
|
|
1668
1681
|
}, {
|
|
1669
|
-
default:
|
|
1682
|
+
default: N(() => [l(E(D(c)("campus.common.ok")), 1)]),
|
|
1670
1683
|
_: 1
|
|
1671
1684
|
}, 8, [
|
|
1672
1685
|
"loading",
|
|
@@ -1678,50 +1691,50 @@ var Gt = {
|
|
|
1678
1691
|
}, 8, ["model", "rules"])], 64);
|
|
1679
1692
|
};
|
|
1680
1693
|
}
|
|
1681
|
-
}),
|
|
1694
|
+
}), ln = {
|
|
1682
1695
|
key: 1,
|
|
1683
1696
|
class: "ca-auth-off",
|
|
1684
1697
|
role: "status"
|
|
1685
|
-
},
|
|
1698
|
+
}, un = /* @__PURE__ */ d({
|
|
1686
1699
|
__name: "ForgotPage",
|
|
1687
1700
|
props: { preview: { type: Boolean } },
|
|
1688
1701
|
setup(e) {
|
|
1689
|
-
let { t } =
|
|
1702
|
+
let { t } = q(), r = Ke().forgot, a = n(() => [{
|
|
1690
1703
|
key: "forgot",
|
|
1691
1704
|
label: t("campus.auth.tabForgot")
|
|
1692
1705
|
}, {
|
|
1693
1706
|
key: "login",
|
|
1694
1707
|
label: t("campus.auth.backLogin"),
|
|
1695
|
-
to:
|
|
1708
|
+
to: Fe(J()).login
|
|
1696
1709
|
}]);
|
|
1697
|
-
return (n, c) => (y(), i(
|
|
1710
|
+
return (n, c) => (y(), i(ut, {
|
|
1698
1711
|
active: "forgot",
|
|
1699
1712
|
tabs: a.value,
|
|
1700
1713
|
preview: e.preview
|
|
1701
1714
|
}, {
|
|
1702
|
-
default:
|
|
1715
|
+
default: N(() => [D(r) ? (y(), i(cn, {
|
|
1703
1716
|
key: 0,
|
|
1704
1717
|
preview: e.preview
|
|
1705
|
-
}, null, 8, ["preview"])) : (y(), o("div",
|
|
1718
|
+
}, null, 8, ["preview"])) : (y(), o("div", ln, [s("h3", null, E(D(t)("campus.auth.unavailableTitle")), 1), s("p", null, E(D(t)("campus.auth.unavailableDesc")), 1)]))]),
|
|
1706
1719
|
_: 1
|
|
1707
1720
|
}, 8, ["tabs", "preview"]));
|
|
1708
1721
|
}
|
|
1709
|
-
}),
|
|
1722
|
+
}), dn = /* @__PURE__ */ d({
|
|
1710
1723
|
__name: "AuthPreview",
|
|
1711
1724
|
props: { kind: {} },
|
|
1712
1725
|
setup(e) {
|
|
1713
|
-
return (t, n) => e.kind === "login" ? (y(), i(
|
|
1726
|
+
return (t, n) => e.kind === "login" ? (y(), i(Rt, {
|
|
1714
1727
|
key: 0,
|
|
1715
1728
|
preview: ""
|
|
1716
|
-
})) : e.kind === "register" ? (y(), i(
|
|
1729
|
+
})) : e.kind === "register" ? (y(), i(on, {
|
|
1717
1730
|
key: 1,
|
|
1718
1731
|
preview: ""
|
|
1719
|
-
})) : (y(), i(
|
|
1732
|
+
})) : (y(), i(un, {
|
|
1720
1733
|
key: 2,
|
|
1721
1734
|
preview: ""
|
|
1722
1735
|
}));
|
|
1723
1736
|
}
|
|
1724
|
-
}),
|
|
1737
|
+
}), fn = { class: "ca-user-avatar" }, pn = ["src"], mn = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
1725
1738
|
__name: "UserAvatar",
|
|
1726
1739
|
props: {
|
|
1727
1740
|
name: {},
|
|
@@ -1729,48 +1742,248 @@ var Gt = {
|
|
|
1729
1742
|
},
|
|
1730
1743
|
setup(t) {
|
|
1731
1744
|
let n = t, r = x(!1);
|
|
1732
|
-
return
|
|
1745
|
+
return j(() => n.src, () => {
|
|
1733
1746
|
r.value = !1;
|
|
1734
|
-
}), (n, i) => (y(), o("span",
|
|
1747
|
+
}), (n, i) => (y(), o("span", fn, [t.src && !r.value ? (y(), o("img", {
|
|
1735
1748
|
key: 0,
|
|
1736
1749
|
src: t.src,
|
|
1737
1750
|
alt: "",
|
|
1738
1751
|
draggable: "false",
|
|
1739
1752
|
onError: i[0] ||= (e) => r.value = !0
|
|
1740
|
-
}, null, 40,
|
|
1753
|
+
}, null, 40, pn)) : (y(), o(e, { key: 1 }, [l(E(t.name?.slice(0, 1)), 1)], 64))]));
|
|
1741
1754
|
}
|
|
1742
|
-
}), [["__scopeId", "data-v-b67c1b85"]]),
|
|
1755
|
+
}), [["__scopeId", "data-v-b67c1b85"]]), hn = (e) => e.normalize("NFKC").toLowerCase().trim();
|
|
1756
|
+
function gn(e) {
|
|
1757
|
+
return e.filter((e) => /\p{Script=Han}/u.test(e)).flatMap((e) => {
|
|
1758
|
+
let t = {
|
|
1759
|
+
toneType: "none",
|
|
1760
|
+
type: "array",
|
|
1761
|
+
nonZh: "consecutive",
|
|
1762
|
+
v: !0
|
|
1763
|
+
};
|
|
1764
|
+
return [he(e, t), he(e, {
|
|
1765
|
+
...t,
|
|
1766
|
+
pattern: "first"
|
|
1767
|
+
})].map((e) => e.join("").replace(/[^a-z0-9]/g, ""));
|
|
1768
|
+
}).filter(Boolean);
|
|
1769
|
+
}
|
|
1770
|
+
function _n(e, t, n) {
|
|
1771
|
+
return Pe(J().menus).filter((t) => e(t.permission)).map((e) => {
|
|
1772
|
+
let r = Me(e.key)?.titles.slice(0, -1) ?? [], i = t(e.title), a = r.map(t).join(" / "), o = [i, n(e.title)].map(hn);
|
|
1773
|
+
return {
|
|
1774
|
+
key: e.key,
|
|
1775
|
+
path: e.path,
|
|
1776
|
+
title: i,
|
|
1777
|
+
trail: a,
|
|
1778
|
+
icon: e.icon,
|
|
1779
|
+
titles: o,
|
|
1780
|
+
pinyinTitles: gn(o),
|
|
1781
|
+
terms: hn([
|
|
1782
|
+
a,
|
|
1783
|
+
...r.map(n),
|
|
1784
|
+
...o,
|
|
1785
|
+
e.path
|
|
1786
|
+
].join(" "))
|
|
1787
|
+
};
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
function vn(e, t) {
|
|
1791
|
+
let n = hn(t);
|
|
1792
|
+
if (!n) return e;
|
|
1793
|
+
let r = n.split(/\s+/), i = /^[a-z0-9\s]+$/.test(n) ? r.join("") : "";
|
|
1794
|
+
return e.flatMap((e) => {
|
|
1795
|
+
let t = r.every((t) => e.terms.includes(t)), a = i && e.pinyinTitles.some((e) => e.includes(i));
|
|
1796
|
+
return !t && !a ? [] : [{
|
|
1797
|
+
entry: e,
|
|
1798
|
+
score: e.titles.includes(n) || hn(e.path) === n ? 0 : e.titles.some((e) => e.startsWith(n)) ? 1 : e.titles.some((e) => e.includes(n)) ? 2 : e.pinyinTitles.includes(i) ? 3 : t ? 4 : 5
|
|
1799
|
+
}];
|
|
1800
|
+
}).sort((e, t) => e.score - t.score).map(({ entry: e }) => e);
|
|
1801
|
+
}
|
|
1802
|
+
// packages/core/src/layout/MenuSearch.vue?vue&type=script&setup=true&lang.ts
|
|
1803
|
+
var yn = ["aria-label"], bn = [
|
|
1804
|
+
"id",
|
|
1805
|
+
"aria-selected",
|
|
1806
|
+
"onMousemove",
|
|
1807
|
+
"onClick"
|
|
1808
|
+
], xn = { class: "ca-menu-search__label" }, Sn = { key: 0 }, Cn = {
|
|
1809
|
+
key: 0,
|
|
1810
|
+
class: "ca-menu-search__empty",
|
|
1811
|
+
role: "status"
|
|
1812
|
+
}, wn = { class: "ca-menu-search__keys" }, Tn = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
1813
|
+
__name: "MenuSearch",
|
|
1814
|
+
props: {
|
|
1815
|
+
modelValue: {
|
|
1816
|
+
type: Boolean,
|
|
1817
|
+
required: !0
|
|
1818
|
+
},
|
|
1819
|
+
modelModifiers: {}
|
|
1820
|
+
},
|
|
1821
|
+
emits: ["update:modelValue"],
|
|
1822
|
+
setup(t) {
|
|
1823
|
+
let r = k(t, "modelValue"), { t: c, te: d, label: f, locale: p } = q(), h = Q(), g = G(), _ = x(""), v = x(0), b = O(), C = `${b}-input`, T = `${b}-results`, M = (e) => `${T}-${e}`, I = n(() => {
|
|
1824
|
+
let e = p.value === "zh-CN" ? "en-US" : "zh-CN";
|
|
1825
|
+
return _n((e) => h.can(e), f, (t) => d(t, e) ? c(t, {}, { locale: e }) : t);
|
|
1826
|
+
}), L = n(() => vn(I.value, _.value));
|
|
1827
|
+
j(r, (e) => {
|
|
1828
|
+
e && (_.value = "", v.value = 0);
|
|
1829
|
+
}), j(L, () => {
|
|
1830
|
+
v.value = 0;
|
|
1831
|
+
});
|
|
1832
|
+
async function R() {
|
|
1833
|
+
await m(), await m(), r.value && document.getElementById(C)?.focus();
|
|
1834
|
+
}
|
|
1835
|
+
function z(e) {
|
|
1836
|
+
r.value = !1, g.push({ name: e.key });
|
|
1837
|
+
}
|
|
1838
|
+
async function ee(e) {
|
|
1839
|
+
if (e.isComposing || e.keyCode === 229 || !L.value.length) return;
|
|
1840
|
+
if (e.key === "Enter") {
|
|
1841
|
+
e.preventDefault(), z(L.value[v.value]);
|
|
1842
|
+
return;
|
|
1843
|
+
}
|
|
1844
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
1845
|
+
e.preventDefault();
|
|
1846
|
+
let t = e.key === "ArrowDown" ? 1 : -1;
|
|
1847
|
+
v.value = (v.value + t + L.value.length) % L.value.length, await m(), document.getElementById(M(v.value))?.scrollIntoView({ block: "nearest" });
|
|
1848
|
+
}
|
|
1849
|
+
return (t, n) => {
|
|
1850
|
+
let d = w("ca-icon"), f = w("ca-input"), p = w("ca-dialog");
|
|
1851
|
+
return y(), i(p, {
|
|
1852
|
+
modelValue: r.value,
|
|
1853
|
+
"onUpdate:modelValue": n[2] ||= (e) => r.value = e,
|
|
1854
|
+
title: D(c)("campus.menuSearch.title"),
|
|
1855
|
+
width: "min(560px, calc(100vw - 24px))",
|
|
1856
|
+
top: "min(12vh, 96px)",
|
|
1857
|
+
"append-to-body": "",
|
|
1858
|
+
"destroy-on-close": "",
|
|
1859
|
+
"close-on-press-escape": !1,
|
|
1860
|
+
"header-class": "ca-menu-search__header",
|
|
1861
|
+
"body-class": "ca-menu-search__body",
|
|
1862
|
+
class: "ca-menu-search",
|
|
1863
|
+
onOpenAutoFocus: R
|
|
1864
|
+
}, {
|
|
1865
|
+
default: N(() => [
|
|
1866
|
+
s("div", {
|
|
1867
|
+
class: "ca-menu-search__input",
|
|
1868
|
+
onKeydown: ee
|
|
1869
|
+
}, [u(f, {
|
|
1870
|
+
id: C,
|
|
1871
|
+
modelValue: _.value,
|
|
1872
|
+
"onUpdate:modelValue": n[0] ||= (e) => _.value = e,
|
|
1873
|
+
class: "ca-menu-search__control",
|
|
1874
|
+
placeholder: D(c)("campus.menuSearch.placeholder"),
|
|
1875
|
+
"aria-label": D(c)("campus.menuSearch.title"),
|
|
1876
|
+
"aria-controls": T,
|
|
1877
|
+
"aria-expanded": L.value.length > 0,
|
|
1878
|
+
"aria-activedescendant": L.value.length ? M(v.value) : void 0,
|
|
1879
|
+
"container-role": "combobox",
|
|
1880
|
+
"aria-autocomplete": "list",
|
|
1881
|
+
autocomplete: "off",
|
|
1882
|
+
spellcheck: "false"
|
|
1883
|
+
}, {
|
|
1884
|
+
prefix: N(() => [u(d, {
|
|
1885
|
+
name: "search",
|
|
1886
|
+
size: 18,
|
|
1887
|
+
"aria-hidden": "true"
|
|
1888
|
+
})]),
|
|
1889
|
+
_: 1
|
|
1890
|
+
}, 8, [
|
|
1891
|
+
"modelValue",
|
|
1892
|
+
"placeholder",
|
|
1893
|
+
"aria-label",
|
|
1894
|
+
"aria-expanded",
|
|
1895
|
+
"aria-activedescendant"
|
|
1896
|
+
])], 32),
|
|
1897
|
+
P(s("ul", {
|
|
1898
|
+
id: T,
|
|
1899
|
+
class: "ca-menu-search__results",
|
|
1900
|
+
role: "listbox",
|
|
1901
|
+
"aria-label": D(c)("campus.menuSearch.results")
|
|
1902
|
+
}, [(y(!0), o(e, null, S(L.value, (e, t) => (y(), o("li", {
|
|
1903
|
+
id: M(t),
|
|
1904
|
+
key: e.key,
|
|
1905
|
+
role: "option",
|
|
1906
|
+
"aria-selected": t === v.value,
|
|
1907
|
+
onMousemove: (e) => v.value = t,
|
|
1908
|
+
onMousedown: n[1] ||= F(() => {}, ["prevent"]),
|
|
1909
|
+
onClick: (t) => z(e)
|
|
1910
|
+
}, [
|
|
1911
|
+
u(d, {
|
|
1912
|
+
name: e.icon || "document",
|
|
1913
|
+
size: 18,
|
|
1914
|
+
"aria-hidden": "true"
|
|
1915
|
+
}, null, 8, ["name"]),
|
|
1916
|
+
s("span", xn, [s("strong", null, E(e.title), 1), e.trail ? (y(), o("small", Sn, E(e.trail), 1)) : a("v-if", !0)]),
|
|
1917
|
+
u(d, {
|
|
1918
|
+
name: "right",
|
|
1919
|
+
size: 16,
|
|
1920
|
+
class: "ca-menu-search__arrow",
|
|
1921
|
+
"aria-hidden": "true"
|
|
1922
|
+
})
|
|
1923
|
+
], 40, bn))), 128))], 8, yn), [[A, L.value.length]]),
|
|
1924
|
+
L.value.length ? a("v-if", !0) : (y(), o("p", Cn, E(D(c)("campus.menuSearch.empty")), 1)),
|
|
1925
|
+
s("div", wn, [
|
|
1926
|
+
s("span", null, [
|
|
1927
|
+
n[3] ||= s("kbd", null, "↑", -1),
|
|
1928
|
+
n[4] ||= l(),
|
|
1929
|
+
n[5] ||= s("kbd", null, "↓", -1),
|
|
1930
|
+
l(" " + E(D(c)("campus.menuSearch.navigate")), 1)
|
|
1931
|
+
]),
|
|
1932
|
+
s("span", null, [n[6] ||= s("kbd", null, "↵", -1), l(" " + E(D(c)("campus.menuSearch.open")), 1)]),
|
|
1933
|
+
s("span", null, [n[7] ||= s("kbd", null, "Esc", -1), l(" " + E(D(c)("campus.menuSearch.close")), 1)])
|
|
1934
|
+
])
|
|
1935
|
+
]),
|
|
1936
|
+
_: 1
|
|
1937
|
+
}, 8, ["modelValue", "title"]);
|
|
1938
|
+
};
|
|
1939
|
+
}
|
|
1940
|
+
}), [["__scopeId", "data-v-1f227e14"]]), En = { class: "ca-header" }, Dn = [
|
|
1743
1941
|
"title",
|
|
1744
1942
|
"aria-label",
|
|
1745
1943
|
"aria-expanded"
|
|
1746
|
-
],
|
|
1944
|
+
], On = { class: "ca-header__brand" }, kn = ["src"], An = { class: "ca-header__titles" }, jn = { class: "ca-header__name" }, Mn = {
|
|
1747
1945
|
key: 0,
|
|
1748
1946
|
class: "ca-header__subtitle"
|
|
1749
|
-
},
|
|
1947
|
+
}, Nn = ["aria-label"], Pn = ["onClick"], Fn = { class: "ca-header__tools" }, In = ["aria-label", "aria-haspopup"], Ln = { class: "ca-header__search-text" }, Rn = {
|
|
1948
|
+
class: "ca-header__kbd",
|
|
1949
|
+
"aria-hidden": "true"
|
|
1950
|
+
}, zn = [
|
|
1750
1951
|
"title",
|
|
1751
1952
|
"aria-label",
|
|
1752
1953
|
"aria-pressed"
|
|
1753
|
-
],
|
|
1954
|
+
], Bn = ["title", "aria-label"], Vn = { class: "ca-header__icon-text" }, Hn = ["title", "aria-label"], Un = ["title", "aria-label"], Wn = ["title", "aria-label"], Gn = ["title", "aria-label"], Kn = { class: "ca-settings__intro" }, qn = { class: "ca-settings__group" }, Jn = { class: "ca-settings__title" }, Yn = ["aria-label"], Xn = ["aria-pressed", "onClick"], Zn = {
|
|
1754
1955
|
key: 0,
|
|
1755
1956
|
class: "ca-settings__group"
|
|
1756
|
-
},
|
|
1957
|
+
}, Qn = { class: "ca-settings__color-heading" }, $n = { class: "ca-settings__title" }, er = {
|
|
1958
|
+
class: "ca-settings__color-value",
|
|
1959
|
+
"aria-live": "polite"
|
|
1960
|
+
}, tr = { key: 0 }, nr = ["aria-label"], rr = [
|
|
1757
1961
|
"aria-label",
|
|
1758
|
-
"
|
|
1962
|
+
"title",
|
|
1963
|
+
"aria-pressed",
|
|
1759
1964
|
"onClick"
|
|
1760
|
-
],
|
|
1965
|
+
], ir = { class: "ca-settings__color-actions" }, ar = { class: "ca-settings__custom" }, or = ["value", "aria-label"], sr = ["disabled"], cr = { class: "ca-settings__group" }, lr = { class: "ca-settings__title" }, ur = ["aria-label"], dr = ["aria-pressed", "onClick"], fr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
1761
1966
|
__name: "HeaderBar",
|
|
1762
1967
|
setup(t) {
|
|
1763
|
-
let r =
|
|
1968
|
+
let r = W(), c = G(), d = Q(), f = ft(), p = Ue(), { t: m, label: b, locale: C } = q(), T = J(), O = x(!1), k = typeof navigator < "u" && /Mac|iPhone|iPad/i.test(navigator.platform) ? "⌘ K" : "Ctrl K";
|
|
1969
|
+
function A() {
|
|
1970
|
+
T.headerTools?.search ? T.headerTools.search() : O.value = !0;
|
|
1971
|
+
}
|
|
1972
|
+
function j(e) {
|
|
1973
|
+
e.isComposing || e.defaultPrevented || (e.key === "Escape" && O.value ? (e.preventDefault(), e.stopPropagation(), O.value = !1) : !(e.metaKey || e.ctrlKey) || e.altKey || e.shiftKey || e.key.toLowerCase() !== "k" || e.target instanceof Element && e.target.closest("[aria-modal=\"true\"]") || (e.preventDefault(), e.repeat || A()));
|
|
1974
|
+
}
|
|
1975
|
+
v(() => window.addEventListener("keydown", j, !0)), _(() => window.removeEventListener("keydown", j, !0));
|
|
1976
|
+
let M = x(!1), P = [{
|
|
1764
1977
|
value: "border",
|
|
1765
1978
|
label: "campus.settings.boxBorder"
|
|
1766
1979
|
}, {
|
|
1767
1980
|
value: "shadow",
|
|
1768
1981
|
label: "campus.settings.boxShadow"
|
|
1769
|
-
}],
|
|
1770
|
-
function
|
|
1982
|
+
}], F = n(() => b(p.theme.siteName ?? T.brand.name)), I = n(() => p.theme.logo ?? T.brand.logo), L = n(() => (T.shortcuts ?? []).filter((e) => d.can(e.permission)));
|
|
1983
|
+
function R(e) {
|
|
1771
1984
|
r.path !== e && c.push(e);
|
|
1772
1985
|
}
|
|
1773
|
-
let
|
|
1986
|
+
let z = [
|
|
1774
1987
|
{
|
|
1775
1988
|
value: "light",
|
|
1776
1989
|
icon: "sunny"
|
|
@@ -1783,7 +1996,7 @@ var Gt = {
|
|
|
1783
1996
|
value: "auto",
|
|
1784
1997
|
icon: "monitor"
|
|
1785
1998
|
}
|
|
1786
|
-
],
|
|
1999
|
+
], te = [
|
|
1787
2000
|
"#1677ff",
|
|
1788
2001
|
"#364fc7",
|
|
1789
2002
|
"#6b1d7a",
|
|
@@ -1792,39 +2005,39 @@ var Gt = {
|
|
|
1792
2005
|
"#f59f00",
|
|
1793
2006
|
"#0f9d58",
|
|
1794
2007
|
"#0ca678"
|
|
1795
|
-
],
|
|
1796
|
-
function
|
|
2008
|
+
], B = n(() => ue(se(p.theme.primary))), V = n(() => p.userPrimary && te.find((e) => e === B.value));
|
|
2009
|
+
function ne(e, t) {
|
|
1797
2010
|
let n = t.currentTarget?.getBoundingClientRect();
|
|
1798
2011
|
p.setMode(e, n ? {
|
|
1799
2012
|
x: n.left + n.width / 2,
|
|
1800
2013
|
y: n.top + n.height / 2
|
|
1801
2014
|
} : void 0);
|
|
1802
2015
|
}
|
|
1803
|
-
function
|
|
1804
|
-
C.value = e,
|
|
2016
|
+
function re(e) {
|
|
2017
|
+
C.value = e, De(e);
|
|
1805
2018
|
}
|
|
1806
|
-
async function
|
|
1807
|
-
e === "account" ? T.onAccountClick ? await T.onAccountClick("header") : T.accountPath &&
|
|
2019
|
+
async function H(e) {
|
|
2020
|
+
e === "account" ? T.onAccountClick ? await T.onAccountClick("header") : T.accountPath && R(T.accountPath) : (await d.logout(), await c.replace({ name: Y(J()).login }));
|
|
1808
2021
|
}
|
|
1809
|
-
let
|
|
1810
|
-
function
|
|
1811
|
-
|
|
2022
|
+
let U = x(!1);
|
|
2023
|
+
function ie() {
|
|
2024
|
+
U.value = !!document.fullscreenElement;
|
|
1812
2025
|
}
|
|
1813
|
-
async function
|
|
2026
|
+
async function ae() {
|
|
1814
2027
|
f.pageScreenManual();
|
|
1815
2028
|
try {
|
|
1816
2029
|
document.fullscreenElement ? await document.exitFullscreen() : await document.documentElement.requestFullscreen();
|
|
1817
2030
|
} catch {}
|
|
1818
2031
|
}
|
|
1819
2032
|
v(() => {
|
|
1820
|
-
|
|
1821
|
-
}), _(() => document.removeEventListener("fullscreenchange",
|
|
1822
|
-
function
|
|
2033
|
+
ie(), document.addEventListener("fullscreenchange", ie);
|
|
2034
|
+
}), _(() => document.removeEventListener("fullscreenchange", ie));
|
|
2035
|
+
function oe(e) {
|
|
1823
2036
|
T.headerTools?.[e]?.();
|
|
1824
2037
|
}
|
|
1825
2038
|
return (t, n) => {
|
|
1826
|
-
let c = w("ca-icon"), _ = w("ca-dropdown-item"), v = w("ca-dropdown-menu"), x = w("ca-dropdown"),
|
|
1827
|
-
return y(), o("header",
|
|
2039
|
+
let c = w("ca-icon"), _ = w("ca-dropdown-item"), v = w("ca-dropdown-menu"), x = w("ca-dropdown"), j = w("ca-drawer");
|
|
2040
|
+
return y(), o("header", En, [
|
|
1828
2041
|
a(" 菜单按钮:手机打开抽屉;电脑档两栏都收起时也显示,点击重新显示侧栏 "),
|
|
1829
2042
|
s("button", {
|
|
1830
2043
|
type: "button",
|
|
@@ -1842,13 +2055,13 @@ var Gt = {
|
|
|
1842
2055
|
"stroke-width": "2",
|
|
1843
2056
|
"stroke-linecap": "round",
|
|
1844
2057
|
"aria-hidden": "true"
|
|
1845
|
-
}, [s("path", { d: "M4 6h16M4 12h16M4 18h16" })], -1)]], 10,
|
|
1846
|
-
s("div",
|
|
2058
|
+
}, [s("path", { d: "M4 6h16M4 12h16M4 18h16" })], -1)]], 10, Dn),
|
|
2059
|
+
s("div", On, [I.value ? (y(), o("img", {
|
|
1847
2060
|
key: 0,
|
|
1848
|
-
src:
|
|
2061
|
+
src: I.value,
|
|
1849
2062
|
alt: "",
|
|
1850
2063
|
class: "ca-header__logo"
|
|
1851
|
-
}, null, 8,
|
|
2064
|
+
}, null, 8, kn)) : (y(), o(e, { key: 1 }, [a(" 没有配置 logo 时用框架默认标志(学士帽),颜色跟随头部前景色 "), n[9] ||= s("svg", {
|
|
1852
2065
|
class: "ca-header__logo",
|
|
1853
2066
|
viewBox: "0 0 32 32",
|
|
1854
2067
|
fill: "none",
|
|
@@ -1861,58 +2074,64 @@ var Gt = {
|
|
|
1861
2074
|
s("path", { d: "M16 6 3 12.5 16 19l13-6.5L16 6Z" }),
|
|
1862
2075
|
s("path", { d: "M9 16.5v5.2c0 1.6 3.1 3.3 7 3.3s7-1.7 7-3.3v-5.2" }),
|
|
1863
2076
|
s("path", { d: "M29 12.5V20" })
|
|
1864
|
-
], -1)], 2112)), s("div",
|
|
2077
|
+
], -1)], 2112)), s("div", An, [s("strong", jn, E(F.value), 1), D(T).brand.subtitle ? (y(), o("span", Mn, E(D(b)(D(T).brand.subtitle)), 1)) : a("v-if", !0)])]),
|
|
1865
2078
|
s("nav", {
|
|
1866
2079
|
class: "ca-header__nav",
|
|
1867
2080
|
"aria-label": D(m)("campus.header.shortcuts")
|
|
1868
|
-
}, [(y(!0), o(e, null, S(
|
|
2081
|
+
}, [(y(!0), o(e, null, S(L.value, (e) => (y(), o("button", {
|
|
1869
2082
|
key: e.key,
|
|
1870
2083
|
class: h(["ca-header__nav-item", { "is-active": D(r).path === e.path }]),
|
|
1871
2084
|
type: "button",
|
|
1872
|
-
onClick: (t) =>
|
|
1873
|
-
}, E(D(b)(e.title)), 11,
|
|
1874
|
-
s("div",
|
|
2085
|
+
onClick: (t) => R(e.path)
|
|
2086
|
+
}, E(D(b)(e.title)), 11, Pn))), 128))], 8, Nn),
|
|
2087
|
+
s("div", Fn, [
|
|
1875
2088
|
s("button", {
|
|
1876
2089
|
type: "button",
|
|
1877
2090
|
class: "ca-header__search",
|
|
1878
|
-
|
|
2091
|
+
"aria-label": D(m)("campus.header.search"),
|
|
2092
|
+
"aria-haspopup": D(T).headerTools?.search ? void 0 : "dialog",
|
|
2093
|
+
"aria-keyshortcuts": "Meta+K Control+K",
|
|
2094
|
+
onClick: A
|
|
1879
2095
|
}, [
|
|
1880
|
-
u(c, {
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
2096
|
+
u(c, {
|
|
2097
|
+
name: "search",
|
|
2098
|
+
"aria-hidden": "true"
|
|
2099
|
+
}),
|
|
2100
|
+
s("span", Ln, E(D(m)("campus.header.search")), 1),
|
|
2101
|
+
s("kbd", Rn, E(D(k)), 1)
|
|
2102
|
+
], 8, In),
|
|
1884
2103
|
s("button", {
|
|
1885
2104
|
type: "button",
|
|
1886
2105
|
class: "ca-header__icon ca-header__desktop-tool",
|
|
1887
|
-
title:
|
|
1888
|
-
"aria-label":
|
|
1889
|
-
"aria-pressed":
|
|
1890
|
-
onClick:
|
|
2106
|
+
title: U.value ? D(m)("campus.header.exitFullscreen") : D(m)("campus.header.fullscreen"),
|
|
2107
|
+
"aria-label": U.value ? D(m)("campus.header.exitFullscreen") : D(m)("campus.header.fullscreen"),
|
|
2108
|
+
"aria-pressed": U.value,
|
|
2109
|
+
onClick: ae
|
|
1891
2110
|
}, [u(c, {
|
|
1892
|
-
name:
|
|
2111
|
+
name: U.value ? "exitFullscreen" : "fullscreen",
|
|
1893
2112
|
size: 18
|
|
1894
|
-
}, null, 8, ["name"])], 8,
|
|
2113
|
+
}, null, 8, ["name"])], 8, zn),
|
|
1895
2114
|
u(x, {
|
|
1896
2115
|
trigger: "click",
|
|
1897
|
-
onCommand:
|
|
2116
|
+
onCommand: re
|
|
1898
2117
|
}, {
|
|
1899
|
-
dropdown:
|
|
1900
|
-
default:
|
|
2118
|
+
dropdown: N(() => [u(v, null, {
|
|
2119
|
+
default: N(() => [(y(!0), o(e, null, S(D(ee), (e) => (y(), i(_, {
|
|
1901
2120
|
key: e.code,
|
|
1902
2121
|
command: e.code,
|
|
1903
2122
|
class: h({ "is-current": D(C) === e.code })
|
|
1904
2123
|
}, {
|
|
1905
|
-
default:
|
|
2124
|
+
default: N(() => [l(E(e.code === "zh-CN" ? "简体中文" : "English"), 1)]),
|
|
1906
2125
|
_: 2
|
|
1907
2126
|
}, 1032, ["command", "class"]))), 128))]),
|
|
1908
2127
|
_: 1
|
|
1909
2128
|
})]),
|
|
1910
|
-
default:
|
|
2129
|
+
default: N(() => [s("button", {
|
|
1911
2130
|
type: "button",
|
|
1912
2131
|
class: "ca-header__icon",
|
|
1913
2132
|
title: D(m)("campus.header.language"),
|
|
1914
2133
|
"aria-label": D(m)("campus.header.language")
|
|
1915
|
-
}, [s("span",
|
|
2134
|
+
}, [s("span", Vn, E(D(ee).find((e) => e.code === D(C))?.label), 1)], 8, Bn)]),
|
|
1916
2135
|
_: 1
|
|
1917
2136
|
}),
|
|
1918
2137
|
s("button", {
|
|
@@ -1920,154 +2139,177 @@ var Gt = {
|
|
|
1920
2139
|
class: "ca-header__icon ca-header__desktop-tool",
|
|
1921
2140
|
title: D(m)("campus.header.notifications"),
|
|
1922
2141
|
"aria-label": D(m)("campus.header.notifications"),
|
|
1923
|
-
onClick: n[
|
|
2142
|
+
onClick: n[1] ||= (e) => oe("notifications")
|
|
1924
2143
|
}, [u(c, {
|
|
1925
2144
|
name: "bell",
|
|
1926
2145
|
size: 18
|
|
1927
|
-
}), n[
|
|
2146
|
+
}), n[10] ||= s("i", {
|
|
1928
2147
|
class: "ca-header__dot is-danger",
|
|
1929
2148
|
"aria-hidden": "true"
|
|
1930
|
-
}, null, -1)], 8,
|
|
2149
|
+
}, null, -1)], 8, Hn),
|
|
1931
2150
|
s("button", {
|
|
1932
2151
|
type: "button",
|
|
1933
2152
|
class: "ca-header__icon ca-header__desktop-tool",
|
|
1934
2153
|
title: D(m)("campus.header.assistant"),
|
|
1935
2154
|
"aria-label": D(m)("campus.header.assistant"),
|
|
1936
|
-
onClick: n[
|
|
2155
|
+
onClick: n[2] ||= (e) => oe("assistant")
|
|
1937
2156
|
}, [u(c, {
|
|
1938
2157
|
name: "chat",
|
|
1939
2158
|
size: 18
|
|
1940
|
-
}), n[
|
|
2159
|
+
}), n[11] ||= s("i", {
|
|
1941
2160
|
class: "ca-header__dot is-success",
|
|
1942
2161
|
"aria-hidden": "true"
|
|
1943
|
-
}, null, -1)], 8,
|
|
2162
|
+
}, null, -1)], 8, Un),
|
|
1944
2163
|
s("button", {
|
|
1945
2164
|
type: "button",
|
|
1946
2165
|
class: "ca-header__icon",
|
|
1947
2166
|
title: D(m)("campus.header.settings"),
|
|
1948
2167
|
"aria-label": D(m)("campus.header.settings"),
|
|
1949
|
-
onClick: n[
|
|
2168
|
+
onClick: n[3] ||= (e) => M.value = !0
|
|
1950
2169
|
}, [u(c, {
|
|
1951
2170
|
name: "setting",
|
|
1952
2171
|
size: 18
|
|
1953
|
-
})], 8,
|
|
2172
|
+
})], 8, Wn),
|
|
1954
2173
|
u(x, {
|
|
1955
2174
|
trigger: "click",
|
|
1956
|
-
onCommand:
|
|
2175
|
+
onCommand: H
|
|
1957
2176
|
}, {
|
|
1958
|
-
dropdown:
|
|
1959
|
-
default:
|
|
2177
|
+
dropdown: N(() => [u(v, null, {
|
|
2178
|
+
default: N(() => [D(T).accountEntry?.header !== !1 && (D(T).accountPath || D(T).onAccountClick) ? (y(), i(_, {
|
|
1960
2179
|
key: 0,
|
|
1961
2180
|
command: "account"
|
|
1962
2181
|
}, {
|
|
1963
|
-
default:
|
|
2182
|
+
default: N(() => [l(E(D(m)("campus.header.myAccount")), 1)]),
|
|
1964
2183
|
_: 1
|
|
1965
2184
|
})) : a("v-if", !0), u(_, {
|
|
1966
2185
|
command: "logout",
|
|
1967
2186
|
divided: ""
|
|
1968
2187
|
}, {
|
|
1969
|
-
default:
|
|
2188
|
+
default: N(() => [l(E(D(m)("campus.header.logout")), 1)]),
|
|
1970
2189
|
_: 1
|
|
1971
2190
|
})]),
|
|
1972
2191
|
_: 1
|
|
1973
2192
|
})]),
|
|
1974
|
-
default:
|
|
2193
|
+
default: N(() => [s("button", {
|
|
1975
2194
|
type: "button",
|
|
1976
2195
|
class: "ca-header__user",
|
|
1977
2196
|
title: D(m)("campus.header.account"),
|
|
1978
2197
|
"aria-label": D(d).user?.name
|
|
1979
|
-
}, [u(
|
|
2198
|
+
}, [u(mn, {
|
|
1980
2199
|
class: "ca-header__avatar",
|
|
1981
2200
|
name: D(d).user?.name,
|
|
1982
2201
|
src: D(d).user?.avatar
|
|
1983
2202
|
}, null, 8, ["name", "src"]), u(c, {
|
|
1984
2203
|
name: "arrowDown",
|
|
1985
2204
|
size: 12
|
|
1986
|
-
})], 8,
|
|
2205
|
+
})], 8, Gn)]),
|
|
1987
2206
|
_: 1
|
|
1988
2207
|
})
|
|
1989
2208
|
]),
|
|
1990
|
-
|
|
2209
|
+
D(T).headerTools?.search ? a("v-if", !0) : (y(), i(Tn, {
|
|
2210
|
+
key: 0,
|
|
1991
2211
|
modelValue: O.value,
|
|
1992
|
-
"onUpdate:modelValue": n[
|
|
2212
|
+
"onUpdate:modelValue": n[4] ||= (e) => O.value = e
|
|
2213
|
+
}, null, 8, ["modelValue"])),
|
|
2214
|
+
u(j, {
|
|
2215
|
+
modelValue: M.value,
|
|
2216
|
+
"onUpdate:modelValue": n[7] ||= (e) => M.value = e,
|
|
1993
2217
|
title: D(m)("campus.settings.title"),
|
|
1994
|
-
size: "
|
|
2218
|
+
size: "min(352px, 100vw)",
|
|
1995
2219
|
"append-to-body": "",
|
|
2220
|
+
"header-class": "ca-settings__header",
|
|
2221
|
+
"body-class": "ca-settings__body",
|
|
1996
2222
|
class: "ca-settings"
|
|
1997
2223
|
}, {
|
|
1998
|
-
default:
|
|
1999
|
-
s("
|
|
2224
|
+
default: N(() => [
|
|
2225
|
+
s("p", Kn, E(D(m)("campus.settings.deviceNote")), 1),
|
|
2226
|
+
s("section", qn, [s("h3", Jn, E(D(m)("campus.settings.themeMode")), 1), s("div", {
|
|
2000
2227
|
class: "ca-settings__segment is-three",
|
|
2001
|
-
role: "
|
|
2228
|
+
role: "group",
|
|
2002
2229
|
"aria-label": D(m)("campus.settings.themeMode")
|
|
2003
|
-
}, [(y(), o(e, null, S(
|
|
2230
|
+
}, [(y(), o(e, null, S(z, (e) => s("button", {
|
|
2004
2231
|
key: e.value,
|
|
2005
2232
|
type: "button",
|
|
2006
|
-
|
|
2007
|
-
"aria-checked": D(p).mode === e.value,
|
|
2233
|
+
"aria-pressed": D(p).mode === e.value,
|
|
2008
2234
|
class: h({ "is-active": D(p).mode === e.value }),
|
|
2009
|
-
onClick: (t) =>
|
|
2235
|
+
onClick: (t) => ne(e.value, t)
|
|
2010
2236
|
}, [u(c, {
|
|
2011
2237
|
name: e.icon,
|
|
2012
|
-
size: 16
|
|
2013
|
-
|
|
2014
|
-
D(
|
|
2015
|
-
|
|
2238
|
+
size: 16,
|
|
2239
|
+
"aria-hidden": "true"
|
|
2240
|
+
}, null, 8, ["name"]), l(E(D(m)(`campus.mode.${e.value}`)), 1)], 10, Xn)), 64))], 8, Yn)]),
|
|
2241
|
+
D(p).primaryLocked ? a("v-if", !0) : (y(), o("section", Zn, [
|
|
2242
|
+
s("div", Qn, [s("h3", $n, E(D(m)("campus.settings.themeColor")), 1), s("span", er, [D(p).userPrimary ? a("v-if", !0) : (y(), o("span", tr, E(D(m)("campus.settings.siteDefault")), 1)), s("code", null, E(B.value), 1)])]),
|
|
2016
2243
|
s("div", {
|
|
2017
2244
|
class: "ca-settings__swatches",
|
|
2018
|
-
role: "
|
|
2245
|
+
role: "group",
|
|
2019
2246
|
"aria-label": D(m)("campus.settings.themeColor")
|
|
2020
|
-
}, [(y(), o(e, null, S(
|
|
2247
|
+
}, [(y(), o(e, null, S(te, (e) => s("button", {
|
|
2021
2248
|
key: e,
|
|
2022
2249
|
type: "button",
|
|
2023
|
-
|
|
2024
|
-
class: h(["ca-settings__swatch", { "is-active": D(p).userPrimary?.toLowerCase() === e }]),
|
|
2025
|
-
style: g({ background: e }),
|
|
2250
|
+
class: "ca-settings__swatch",
|
|
2026
2251
|
"aria-label": e,
|
|
2027
|
-
|
|
2252
|
+
title: e,
|
|
2253
|
+
"aria-pressed": V.value === e,
|
|
2028
2254
|
onClick: (t) => D(p).setPrimary(e)
|
|
2029
|
-
},
|
|
2030
|
-
class: "ca-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2255
|
+
}, [s("span", {
|
|
2256
|
+
class: "ca-settings__chip",
|
|
2257
|
+
style: g({ background: e }),
|
|
2258
|
+
"aria-hidden": "true"
|
|
2259
|
+
}, null, 4), V.value === e ? (y(), i(c, {
|
|
2260
|
+
key: 0,
|
|
2261
|
+
name: "check",
|
|
2262
|
+
size: 14,
|
|
2263
|
+
"aria-hidden": "true"
|
|
2264
|
+
})) : a("v-if", !0)], 8, rr)), 64))], 8, nr),
|
|
2265
|
+
s("div", ir, [s("label", ar, [
|
|
2266
|
+
u(c, {
|
|
2267
|
+
name: "brush",
|
|
2268
|
+
size: 16,
|
|
2269
|
+
"aria-hidden": "true"
|
|
2270
|
+
}),
|
|
2271
|
+
l(" " + E(D(m)("campus.settings.themeColorCustom")) + " ", 1),
|
|
2272
|
+
s("input", {
|
|
2273
|
+
type: "color",
|
|
2274
|
+
value: B.value,
|
|
2275
|
+
"aria-label": D(m)("campus.settings.themeColorCustom"),
|
|
2276
|
+
onInput: n[5] ||= (e) => D(p).setPrimary(e.target.value)
|
|
2277
|
+
}, null, 40, or)
|
|
2278
|
+
]), s("button", {
|
|
2039
2279
|
type: "button",
|
|
2040
2280
|
class: "ca-settings__reset",
|
|
2041
2281
|
disabled: !D(p).userPrimary,
|
|
2042
2282
|
onClick: n[6] ||= (e) => D(p).setPrimary(void 0)
|
|
2043
|
-
}, E(D(m)("campus.settings.themeColorReset")), 9,
|
|
2283
|
+
}, E(D(m)("campus.settings.themeColorReset")), 9, sr)])
|
|
2044
2284
|
])),
|
|
2045
|
-
s("section",
|
|
2046
|
-
class: "ca-settings__segment",
|
|
2047
|
-
role: "
|
|
2285
|
+
s("section", cr, [s("h3", lr, E(D(m)("campus.settings.boxStyle")), 1), s("div", {
|
|
2286
|
+
class: "ca-settings__segment ca-settings__boxes",
|
|
2287
|
+
role: "group",
|
|
2048
2288
|
"aria-label": D(m)("campus.settings.boxStyle")
|
|
2049
|
-
}, [(y(), o(e, null, S(
|
|
2289
|
+
}, [(y(), o(e, null, S(P, (e) => s("button", {
|
|
2050
2290
|
key: e.value,
|
|
2051
2291
|
type: "button",
|
|
2052
|
-
|
|
2053
|
-
"aria-checked": D(p).boxStyle === e.value,
|
|
2292
|
+
"aria-pressed": D(p).boxStyle === e.value,
|
|
2054
2293
|
class: h({ "is-active": D(p).boxStyle === e.value }),
|
|
2055
2294
|
onClick: (t) => D(p).setBoxStyle(e.value)
|
|
2056
|
-
},
|
|
2295
|
+
}, [s("span", {
|
|
2296
|
+
class: h(["ca-settings__box-sample", `is-${e.value}`]),
|
|
2297
|
+
"aria-hidden": "true"
|
|
2298
|
+
}, [...n[12] ||= [s("span", null, null, -1)]], 2), l(" " + E(D(m)(e.label)), 1)], 10, dr)), 64))], 8, ur)])
|
|
2057
2299
|
]),
|
|
2058
2300
|
_: 1
|
|
2059
2301
|
}, 8, ["modelValue", "title"])
|
|
2060
2302
|
]);
|
|
2061
2303
|
};
|
|
2062
2304
|
}
|
|
2063
|
-
}), [["__scopeId", "data-v-
|
|
2305
|
+
}), [["__scopeId", "data-v-9af060a7"]]), pr = {
|
|
2064
2306
|
key: 0,
|
|
2065
2307
|
class: "ca-page-header"
|
|
2066
|
-
},
|
|
2308
|
+
}, mr = { class: "ca-page-header__top" }, hr = { class: "ca-page-header__crumb" }, gr = ["title", "aria-label"], _r = { class: "ca-page-header__date" }, vr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
2067
2309
|
__name: "PageHeader",
|
|
2068
2310
|
setup(t) {
|
|
2069
|
-
let r =
|
|
2070
|
-
let e = h.value ?
|
|
2311
|
+
let r = W(), { t: c, label: d, locale: f } = q(), p = gt(), m = new Map(Pe(J().menus).map((e) => [e.key, e])), h = n(() => r.meta.pageKey ? m.get(r.meta.pageKey) : void 0), g = n(() => {
|
|
2312
|
+
let e = h.value ? Me(h.value.key) : void 0;
|
|
2071
2313
|
if (!e) return [];
|
|
2072
2314
|
let t = e.titles.map((e) => d(e));
|
|
2073
2315
|
return h.value?.affix ? t.filter((e, n) => e !== t[n - 1]) : t;
|
|
@@ -2083,15 +2325,15 @@ var Gt = {
|
|
|
2083
2325
|
});
|
|
2084
2326
|
return (t, n) => {
|
|
2085
2327
|
let r = w("ca-icon"), d = w("ca-breadcrumb-item"), f = w("ca-breadcrumb");
|
|
2086
|
-
return h.value ? (y(), o("header",
|
|
2328
|
+
return h.value ? (y(), o("header", pr, [s("div", mr, [s("div", hr, [
|
|
2087
2329
|
u(r, {
|
|
2088
2330
|
name: "location",
|
|
2089
2331
|
class: "ca-page-header__icon"
|
|
2090
2332
|
}),
|
|
2091
2333
|
s("span", null, E(D(c)("campus.breadcrumb.current")), 1),
|
|
2092
2334
|
u(f, { separator: ">" }, {
|
|
2093
|
-
default:
|
|
2094
|
-
default:
|
|
2335
|
+
default: N(() => [(y(!0), o(e, null, S(g.value, (e, t) => (y(), i(d, { key: t }, {
|
|
2336
|
+
default: N(() => [l(E(e), 1)]),
|
|
2095
2337
|
_: 2
|
|
2096
2338
|
}, 1024))), 128))]),
|
|
2097
2339
|
_: 1
|
|
@@ -2103,29 +2345,29 @@ var Gt = {
|
|
|
2103
2345
|
title: D(c)("campus.tabs.refresh"),
|
|
2104
2346
|
"aria-label": D(c)("campus.tabs.refresh"),
|
|
2105
2347
|
onClick: n[0] ||= (e) => h.value && D(p).refresh(h.value.key)
|
|
2106
|
-
}, [u(r, { name: "refresh" })], 8,
|
|
2107
|
-
]), s("time",
|
|
2348
|
+
}, [u(r, { name: "refresh" })], 8, gr)
|
|
2349
|
+
]), s("time", _r, E(C.value), 1)])])) : a("v-if", !0);
|
|
2108
2350
|
};
|
|
2109
2351
|
}
|
|
2110
|
-
}), [["__scopeId", "data-v-e0f9b42f"]]),
|
|
2352
|
+
}), [["__scopeId", "data-v-e0f9b42f"]]), yr = {
|
|
2111
2353
|
key: 0,
|
|
2112
2354
|
class: "ca-page-header__titles"
|
|
2113
|
-
},
|
|
2355
|
+
}, br = { class: "ca-page-header__title" }, xr = ["title"], Sr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
2114
2356
|
__name: "PageTitle",
|
|
2115
2357
|
setup(e) {
|
|
2116
|
-
let t =
|
|
2358
|
+
let t = W(), { label: r } = q(), i = new Map(Pe(J().menus).map((e) => [e.key, e])), c = n(() => t.meta.pageKey ? i.get(t.meta.pageKey) : void 0), l = n(() => c.value?.pageHeader ?? J().pageHeader ?? !0), u = n(() => c.value ? r(c.value.title) : ""), d = n(() => c.value?.description ? r(c.value.description) : "");
|
|
2117
2359
|
return (e, t) => c.value ? (y(), o("header", {
|
|
2118
2360
|
key: 0,
|
|
2119
2361
|
class: h(["ca-page-header__main", { "is-title-hidden": !l.value }])
|
|
2120
2362
|
}, [
|
|
2121
|
-
l.value ? (y(), o("div",
|
|
2122
|
-
s("h2",
|
|
2363
|
+
l.value ? (y(), o("div", yr, [
|
|
2364
|
+
s("h2", br, E(u.value), 1),
|
|
2123
2365
|
a(" 说明和标题同一行,放不下时省略;窗口较矮时直接隐藏,把高度留给内容 "),
|
|
2124
2366
|
d.value ? (y(), o("p", {
|
|
2125
2367
|
key: 0,
|
|
2126
2368
|
class: "ca-page-header__desc",
|
|
2127
2369
|
title: d.value
|
|
2128
|
-
}, E(d.value), 9,
|
|
2370
|
+
}, E(d.value), 9, xr)) : a("v-if", !0)
|
|
2129
2371
|
])) : a("v-if", !0),
|
|
2130
2372
|
a(" 页面通过 <ca-page-actions> 把按钮放到这里 "),
|
|
2131
2373
|
t[0] ||= s("div", {
|
|
@@ -2134,112 +2376,112 @@ var Gt = {
|
|
|
2134
2376
|
}, null, -1)
|
|
2135
2377
|
], 2)) : a("v-if", !0);
|
|
2136
2378
|
}
|
|
2137
|
-
}), [["__scopeId", "data-v-
|
|
2379
|
+
}), [["__scopeId", "data-v-22464957"]]), Cr = ["aria-label"], wr = ["onClick"], Tr = { class: "ca-side__rail-list" }, Er = ["aria-current", "title"], Dr = [
|
|
2138
2380
|
"aria-current",
|
|
2139
2381
|
"aria-expanded",
|
|
2140
2382
|
"title",
|
|
2141
2383
|
"onClick"
|
|
2142
|
-
],
|
|
2384
|
+
], Or = {
|
|
2143
2385
|
key: 0,
|
|
2144
2386
|
class: "ca-side__badge"
|
|
2145
|
-
},
|
|
2387
|
+
}, kr = { class: "ca-side__tools" }, Ar = [
|
|
2146
2388
|
"title",
|
|
2147
2389
|
"aria-label",
|
|
2148
2390
|
"aria-pressed"
|
|
2149
|
-
],
|
|
2391
|
+
], jr = [
|
|
2150
2392
|
"title",
|
|
2151
2393
|
"aria-label",
|
|
2152
2394
|
"aria-expanded"
|
|
2153
|
-
],
|
|
2395
|
+
], Mr = ["title", "aria-label"], Nr = ["inert"], Pr = { class: "ca-side__panel-inner" }, Fr = {
|
|
2154
2396
|
key: 0,
|
|
2155
2397
|
class: "ca-side__title"
|
|
2156
|
-
},
|
|
2398
|
+
}, Ir = { class: "ca-side__group-label" }, Lr = {
|
|
2157
2399
|
key: 1,
|
|
2158
2400
|
class: "ca-side__group-badge"
|
|
2159
|
-
},
|
|
2401
|
+
}, Rr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
2160
2402
|
__name: "SideMenu",
|
|
2161
2403
|
setup(t) {
|
|
2162
|
-
let r =
|
|
2404
|
+
let r = W(), c = G(), d = Q(), f = ft(), { t: p, label: g } = q(), _ = J(), v = n(() => f.sidePanelCollapsed), b = () => f.toggleSidePanel(), C = x(_e("side-text-hidden") === "1");
|
|
2163
2405
|
function T() {
|
|
2164
|
-
C.value = !C.value,
|
|
2406
|
+
C.value = !C.value, K("side-text-hidden", C.value ? "1" : "0");
|
|
2165
2407
|
}
|
|
2166
2408
|
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(
|
|
2409
|
+
e === "account" ? _.onAccountClick ? await _.onAccountClick("side") : _.accountPath && r.path !== _.accountPath && await c.push(_.accountPath) : (await d.logout(), await c.replace({ name: Y(J()).login }));
|
|
2168
2410
|
}
|
|
2169
|
-
let
|
|
2170
|
-
|
|
2411
|
+
let k = n(() => Ie(_, (e) => d.can(e))), M = n(() => k.value.home), F = n(() => k.value.apps), I = k.value.accountStandalone, L = x(), R = n(() => !!M.value && r.path === M.value.path);
|
|
2412
|
+
j(() => [r.path, r.meta.appKey], () => {
|
|
2171
2413
|
L.value = R.value || I && r.path === _.accountPath ? void 0 : r.meta.appKey ?? F.value[0]?.key;
|
|
2172
2414
|
}, { immediate: !0 });
|
|
2173
2415
|
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
|
-
|
|
2416
|
+
j(z, (e) => e?.children.length && (te.value = e), { immediate: !0 });
|
|
2175
2417
|
let B = n(() => z.value?.children.length ? z.value : te.value);
|
|
2176
2418
|
function V(e) {
|
|
2177
2419
|
let t = typeof e.badge == "function" ? e.badge() : e.badge ?? 0;
|
|
2178
2420
|
return t > 0 ? t : 0;
|
|
2179
2421
|
}
|
|
2180
2422
|
function ne(e) {
|
|
2181
|
-
return e.children.reduce((e, t) => e + (
|
|
2423
|
+
return e.children.reduce((e, t) => e + (ke(t) ? V(t) : 0), 0);
|
|
2182
2424
|
}
|
|
2183
|
-
let
|
|
2184
|
-
function
|
|
2185
|
-
|
|
2425
|
+
let re = x(), H = !0;
|
|
2426
|
+
function U(e, t) {
|
|
2427
|
+
H || f.setMenuGroup(e, t);
|
|
2186
2428
|
}
|
|
2187
|
-
let
|
|
2188
|
-
|
|
2429
|
+
let ie = n(() => Object.keys(f.menuGroups).filter((e) => f.menuGroups[e]));
|
|
2430
|
+
j(() => r.meta.groupKey, (e) => {
|
|
2189
2431
|
e && f.ensureMenuGroup(e);
|
|
2190
|
-
}, { immediate: !0 }),
|
|
2432
|
+
}, { immediate: !0 }), j([
|
|
2191
2433
|
() => f.menuGroups,
|
|
2192
2434
|
B,
|
|
2193
2435
|
() => r.path
|
|
2194
2436
|
], async () => {
|
|
2195
|
-
|
|
2196
|
-
for (let e of B.value?.children ?? [])
|
|
2197
|
-
|
|
2437
|
+
H = !0, await m();
|
|
2438
|
+
for (let e of B.value?.children ?? []) ke(e) && e.children.length && (f.menuGroups[e.key] ? re.value?.open(e.key) : re.value?.close(e.key));
|
|
2439
|
+
H = !1;
|
|
2198
2440
|
}, {
|
|
2199
2441
|
deep: !0,
|
|
2200
2442
|
immediate: !0
|
|
2201
2443
|
});
|
|
2202
|
-
async function
|
|
2444
|
+
async function ae(e) {
|
|
2203
2445
|
let t = F.value.find((t) => t.key === e);
|
|
2204
2446
|
if (!t) return;
|
|
2205
2447
|
let n = L.value === e;
|
|
2206
2448
|
L.value = e, await f.clickMenuApp(t, r.path, (e) => c.push(e), n);
|
|
2207
2449
|
}
|
|
2208
|
-
function
|
|
2450
|
+
function oe(e, t) {
|
|
2209
2451
|
let n = e.currentTarget, i = e.type === "keydown";
|
|
2210
2452
|
(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)));
|
|
2211
2453
|
}
|
|
2212
|
-
let
|
|
2213
|
-
function
|
|
2454
|
+
let se = n(() => (_.shortcuts ?? []).filter((e) => d.can(e.permission)));
|
|
2455
|
+
function ce(e) {
|
|
2214
2456
|
f.closeOverlays(), r.path !== e && c.push(e);
|
|
2215
2457
|
}
|
|
2216
2458
|
return (t, n) => {
|
|
2217
|
-
let c = w("ca-icon"), m = w("ca-dropdown-item"), x = w("ca-dropdown-menu"),
|
|
2459
|
+
let c = w("ca-icon"), m = w("ca-dropdown-item"), x = w("ca-dropdown-menu"), k = w("ca-dropdown"), j = w("ca-menu-item"), I = w("ca-sub-menu"), L = w("ca-menu");
|
|
2218
2460
|
return y(), o(e, null, [a(" 两栏都收起(只在电脑档):整个侧栏向左滑出,第二栏同时收起;不可聚焦由 CaLayout 的 inert 负责 "), s("aside", { class: h(["ca-side", {
|
|
2219
2461
|
"is-pad-open": D(f).mode === "pad" && D(f).padPanelOpen,
|
|
2220
2462
|
"is-hidden": D(f).sideHiddenActive,
|
|
2221
2463
|
"is-text-hidden": C.value
|
|
2222
2464
|
}]) }, [
|
|
2223
|
-
|
|
2465
|
+
se.value.length ? (y(), o("nav", {
|
|
2224
2466
|
key: 0,
|
|
2225
2467
|
class: "ca-side__shortcuts",
|
|
2226
2468
|
"aria-label": D(p)("campus.header.shortcuts")
|
|
2227
|
-
}, [(y(!0), o(e, null, S(
|
|
2469
|
+
}, [(y(!0), o(e, null, S(se.value, (e) => (y(), o("button", {
|
|
2228
2470
|
key: e.key,
|
|
2229
2471
|
type: "button",
|
|
2230
2472
|
class: h({ "is-active": D(r).path === e.path }),
|
|
2231
|
-
onClick: (t) =>
|
|
2232
|
-
}, E(D(g)(e.title)), 11,
|
|
2473
|
+
onClick: (t) => ce(e.path)
|
|
2474
|
+
}, E(D(g)(e.title)), 11, wr))), 128))], 8, Cr)) : a("v-if", !0),
|
|
2233
2475
|
s("nav", { class: h(["ca-side__rail", { "is-compact": C.value }]) }, [
|
|
2234
2476
|
a(" 入口列表单独滚动;底部工具按钮固定在外面,窗口再矮也不会被挤出屏幕 "),
|
|
2235
|
-
s("div",
|
|
2477
|
+
s("div", Tr, [M.value ? (y(), o("button", {
|
|
2236
2478
|
key: 0,
|
|
2237
2479
|
type: "button",
|
|
2238
2480
|
class: h(["ca-side__rail-item", { "is-active": R.value }]),
|
|
2239
2481
|
"aria-current": R.value ? "page" : void 0,
|
|
2240
|
-
title:
|
|
2241
|
-
onClick: n[0] ||= (e) =>
|
|
2242
|
-
}, [u(c, { name: "home" }),
|
|
2482
|
+
title: D(p)("campus.side.home"),
|
|
2483
|
+
onClick: n[0] ||= (e) => ce(M.value.path)
|
|
2484
|
+
}, [u(c, { name: "home" }), P(s("span", { class: "ca-side__rail-text" }, E(D(p)("campus.side.home")), 513), [[A, !C.value || D(f).mobileMenuOpen]])], 10, Er)) : a("v-if", !0), (y(!0), o(e, null, S(F.value, (e) => (y(), o("button", {
|
|
2243
2485
|
key: e.key,
|
|
2244
2486
|
type: "button",
|
|
2245
2487
|
class: h(["ca-side__rail-item", {
|
|
@@ -2248,17 +2490,17 @@ var Gt = {
|
|
|
2248
2490
|
}]),
|
|
2249
2491
|
"aria-current": e.path === D(r).path ? "page" : void 0,
|
|
2250
2492
|
"aria-expanded": e.children.length ? e.key === z.value?.key && !ee.value : void 0,
|
|
2251
|
-
title:
|
|
2252
|
-
onClick: (t) =>
|
|
2493
|
+
title: D(g)(e.title),
|
|
2494
|
+
onClick: (t) => ae(e.key)
|
|
2253
2495
|
}, [
|
|
2254
2496
|
u(c, {
|
|
2255
2497
|
name: e.icon,
|
|
2256
2498
|
fallback: "grid"
|
|
2257
2499
|
}, null, 8, ["name"]),
|
|
2258
|
-
|
|
2259
|
-
ne(e) ? (y(), o("span",
|
|
2260
|
-
], 10,
|
|
2261
|
-
s("div",
|
|
2500
|
+
P(s("span", { class: "ca-side__rail-text" }, E(D(g)(e.title)), 513), [[A, !C.value || D(f).mobileMenuOpen]]),
|
|
2501
|
+
ne(e) ? (y(), o("span", Or, E(ne(e)), 1)) : a("v-if", !0)
|
|
2502
|
+
], 10, Dr))), 128))]),
|
|
2503
|
+
s("div", kr, [
|
|
2262
2504
|
s("button", {
|
|
2263
2505
|
type: "button",
|
|
2264
2506
|
class: "ca-side__tool",
|
|
@@ -2269,7 +2511,7 @@ var Gt = {
|
|
|
2269
2511
|
}, [u(c, {
|
|
2270
2512
|
name: C.value ? "view" : "hide",
|
|
2271
2513
|
size: 18
|
|
2272
|
-
}, null, 8, ["name"])], 8,
|
|
2514
|
+
}, null, 8, ["name"])], 8, Ar),
|
|
2273
2515
|
s("button", {
|
|
2274
2516
|
type: "button",
|
|
2275
2517
|
class: "ca-side__tool ca-side__tool--collapse",
|
|
@@ -2280,38 +2522,38 @@ var Gt = {
|
|
|
2280
2522
|
}, [u(c, {
|
|
2281
2523
|
name: v.value ? "expand" : "fold",
|
|
2282
2524
|
size: 18
|
|
2283
|
-
}, null, 8, ["name"])], 8,
|
|
2284
|
-
u(
|
|
2525
|
+
}, null, 8, ["name"])], 8, jr),
|
|
2526
|
+
u(k, {
|
|
2285
2527
|
trigger: "click",
|
|
2286
2528
|
placement: "right-end",
|
|
2287
2529
|
onCommand: O
|
|
2288
2530
|
}, {
|
|
2289
|
-
dropdown:
|
|
2290
|
-
default:
|
|
2531
|
+
dropdown: N(() => [u(x, null, {
|
|
2532
|
+
default: N(() => [D(_).accountEntry?.side !== !1 && (D(_).accountPath || D(_).onAccountClick) ? (y(), i(m, {
|
|
2291
2533
|
key: 0,
|
|
2292
2534
|
command: "account"
|
|
2293
2535
|
}, {
|
|
2294
|
-
default:
|
|
2536
|
+
default: N(() => [l(E(D(p)("campus.header.myAccount")), 1)]),
|
|
2295
2537
|
_: 1
|
|
2296
2538
|
})) : a("v-if", !0), u(m, {
|
|
2297
2539
|
command: "logout",
|
|
2298
2540
|
divided: ""
|
|
2299
2541
|
}, {
|
|
2300
|
-
default:
|
|
2542
|
+
default: N(() => [l(E(D(p)("campus.header.logout")), 1)]),
|
|
2301
2543
|
_: 1
|
|
2302
2544
|
})]),
|
|
2303
2545
|
_: 1
|
|
2304
2546
|
})]),
|
|
2305
|
-
default:
|
|
2547
|
+
default: N(() => [s("button", {
|
|
2306
2548
|
type: "button",
|
|
2307
2549
|
class: "ca-side__tool",
|
|
2308
2550
|
title: D(d).user?.name,
|
|
2309
2551
|
"aria-label": D(d).user?.name
|
|
2310
|
-
}, [u(
|
|
2552
|
+
}, [u(mn, {
|
|
2311
2553
|
class: "ca-side__avatar",
|
|
2312
2554
|
name: D(d).user?.name,
|
|
2313
2555
|
src: D(d).user?.avatar
|
|
2314
|
-
}, null, 8, ["name", "src"])], 8,
|
|
2556
|
+
}, null, 8, ["name", "src"])], 8, Mr)]),
|
|
2315
2557
|
_: 1
|
|
2316
2558
|
})
|
|
2317
2559
|
])
|
|
@@ -2323,22 +2565,22 @@ var Gt = {
|
|
|
2323
2565
|
"is-empty": !z.value?.children.length
|
|
2324
2566
|
}]),
|
|
2325
2567
|
inert: ee.value && !D(f).mobileMenuOpen
|
|
2326
|
-
}, [s("div",
|
|
2327
|
-
B.value ? (y(), o("div",
|
|
2568
|
+
}, [s("div", Pr, [
|
|
2569
|
+
B.value ? (y(), o("div", Fr, E(D(g)(B.value.title)), 1)) : a("v-if", !0),
|
|
2328
2570
|
a(" key 绑定场景:切换场景时重建菜单,展开状态不会串到别的场景 "),
|
|
2329
2571
|
(y(), i(L, {
|
|
2330
2572
|
ref_key: "menuRef",
|
|
2331
|
-
ref:
|
|
2573
|
+
ref: re,
|
|
2332
2574
|
key: B.value?.key,
|
|
2333
2575
|
"default-active": D(r).path,
|
|
2334
|
-
"default-openeds":
|
|
2576
|
+
"default-openeds": ie.value,
|
|
2335
2577
|
router: "",
|
|
2336
2578
|
class: "ca-side__menu",
|
|
2337
2579
|
onSelect: n[1] ||= (e) => D(f).closeOverlays(),
|
|
2338
|
-
onOpen: n[2] ||= (e) =>
|
|
2339
|
-
onClose: n[3] ||= (e) =>
|
|
2580
|
+
onOpen: n[2] ||= (e) => U(e, !0),
|
|
2581
|
+
onClose: n[3] ||= (e) => U(e, !1)
|
|
2340
2582
|
}, {
|
|
2341
|
-
default:
|
|
2583
|
+
default: N(() => [(y(!0), o(e, null, S(B.value?.children ?? [], (t) => (y(), o(e, { key: t.key }, [a(" 二级是菜单组:可展开,下面是三级页面 "), D(ke)(t) && t.children.length ? (y(), i(I, {
|
|
2342
2584
|
key: 0,
|
|
2343
2585
|
index: t.key,
|
|
2344
2586
|
tabindex: "0",
|
|
@@ -2347,24 +2589,24 @@ var Gt = {
|
|
|
2347
2589
|
"is-ancestor": D(r).meta.groupKey === t.key && t.path !== D(r).path
|
|
2348
2590
|
}),
|
|
2349
2591
|
"aria-current": t.path === D(r).path ? "page" : void 0,
|
|
2350
|
-
onClickCapture: (e) =>
|
|
2351
|
-
onKeydownCapture: (e) =>
|
|
2592
|
+
onClickCapture: (e) => oe(e, t),
|
|
2593
|
+
onKeydownCapture: (e) => oe(e, t)
|
|
2352
2594
|
}, {
|
|
2353
|
-
title:
|
|
2595
|
+
title: N(() => [s("span", Ir, [
|
|
2354
2596
|
t.icon ? (y(), i(c, {
|
|
2355
2597
|
key: 0,
|
|
2356
2598
|
name: t.icon
|
|
2357
2599
|
}, null, 8, ["name"])) : a("v-if", !0),
|
|
2358
2600
|
s("span", null, E(D(g)(t.title)), 1),
|
|
2359
|
-
V(t) ? (y(), o("span",
|
|
2601
|
+
V(t) ? (y(), o("span", Lr, E(V(t)), 1)) : a("v-if", !0)
|
|
2360
2602
|
])]),
|
|
2361
|
-
default:
|
|
2603
|
+
default: N(() => [(y(!0), o(e, null, S(t.children, (e) => (y(), i(j, {
|
|
2362
2604
|
class: "ca-side__submenu-item",
|
|
2363
2605
|
key: e.key,
|
|
2364
2606
|
index: e.path,
|
|
2365
2607
|
"aria-current": e.path === D(r).path ? "page" : void 0
|
|
2366
2608
|
}, {
|
|
2367
|
-
default:
|
|
2609
|
+
default: N(() => [e.icon ? (y(), i(c, {
|
|
2368
2610
|
key: 0,
|
|
2369
2611
|
name: e.icon
|
|
2370
2612
|
}, null, 8, ["name"])) : a("v-if", !0), s("span", null, E(D(g)(e.title)), 1)]),
|
|
@@ -2381,7 +2623,7 @@ var Gt = {
|
|
|
2381
2623
|
index: t.path,
|
|
2382
2624
|
"aria-current": t.path === D(r).path ? "page" : void 0
|
|
2383
2625
|
}, {
|
|
2384
|
-
default:
|
|
2626
|
+
default: N(() => [t.icon ? (y(), i(c, {
|
|
2385
2627
|
key: 0,
|
|
2386
2628
|
name: t.icon
|
|
2387
2629
|
}, null, 8, ["name"])) : a("v-if", !0), s("span", null, E(D(g)(t.title)), 1)]),
|
|
@@ -2389,34 +2631,34 @@ var Gt = {
|
|
|
2389
2631
|
}, 1032, ["index", "aria-current"])], 2112))], 64))), 128))]),
|
|
2390
2632
|
_: 1
|
|
2391
2633
|
}, 8, ["default-active", "default-openeds"]))
|
|
2392
|
-
])], 10,
|
|
2634
|
+
])], 10, Nr)
|
|
2393
2635
|
], 2)], 2112);
|
|
2394
2636
|
};
|
|
2395
2637
|
}
|
|
2396
|
-
}), [["__scopeId", "data-v-
|
|
2638
|
+
}), [["__scopeId", "data-v-54cb2f14"]]), zr = {
|
|
2397
2639
|
key: 0,
|
|
2398
2640
|
class: "ca-copyright"
|
|
2399
|
-
},
|
|
2641
|
+
}, Br = ["href"], Vr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
2400
2642
|
__name: "CaCopyright",
|
|
2401
2643
|
setup(t) {
|
|
2402
|
-
let r =
|
|
2403
|
-
return (t, n) => c.value ? (y(), o("footer",
|
|
2644
|
+
let r = J().brand, { label: i } = q(), c = n(() => r.copyright ? We(i(r.copyright)) : ""), l = n(() => r.copyrightLinks ?? []);
|
|
2645
|
+
return (t, n) => c.value ? (y(), o("footer", zr, [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", {
|
|
2404
2646
|
class: "ca-copyright__dot",
|
|
2405
2647
|
"aria-hidden": "true"
|
|
2406
2648
|
}, "·", -1), s("a", {
|
|
2407
2649
|
href: t.href,
|
|
2408
2650
|
target: "_blank",
|
|
2409
2651
|
rel: "noopener noreferrer"
|
|
2410
|
-
}, E(t.text), 9,
|
|
2652
|
+
}, E(t.text), 9, Br)], 64))), 128))])) : a("v-if", !0);
|
|
2411
2653
|
}
|
|
2412
|
-
}), [["__scopeId", "data-v-c51879e8"]]),
|
|
2654
|
+
}), [["__scopeId", "data-v-c51879e8"]]), Hr = { class: "ca-tabs" }, Ur = ["onClick"], Wr = { class: "ca-tabs__more" }, Gr = [
|
|
2413
2655
|
"title",
|
|
2414
2656
|
"aria-label",
|
|
2415
2657
|
"aria-pressed"
|
|
2416
|
-
],
|
|
2658
|
+
], Kr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
2417
2659
|
__name: "TabsBar",
|
|
2418
2660
|
setup(t) {
|
|
2419
|
-
let r =
|
|
2661
|
+
let r = W(), c = G(), d = gt(), f = ft(), { t: p, label: g } = q(), _ = new Map(Pe(J().menus).map((e) => [e.key, e])), b = n(() => d.visited.map((e) => _.get(e)).filter((e) => !!e).map((e) => ({
|
|
2420
2662
|
key: e.key,
|
|
2421
2663
|
path: e.path,
|
|
2422
2664
|
title: g(e.title),
|
|
@@ -2440,27 +2682,27 @@ var Gt = {
|
|
|
2440
2682
|
});
|
|
2441
2683
|
});
|
|
2442
2684
|
}
|
|
2443
|
-
|
|
2444
|
-
function
|
|
2685
|
+
j([C, () => b.value.length], k), v(k);
|
|
2686
|
+
function A(e) {
|
|
2445
2687
|
let t = d.close(e);
|
|
2446
2688
|
if (e !== C.value) return;
|
|
2447
2689
|
let n = t ? _.get(t)?.path : void 0;
|
|
2448
2690
|
c.push(n ?? "/");
|
|
2449
2691
|
}
|
|
2450
|
-
let
|
|
2692
|
+
let M = n(() => {
|
|
2451
2693
|
let e = d.visited.indexOf(C.value ?? "");
|
|
2452
2694
|
return d.visited.some((t, n) => n < e && !d.affixKeys.includes(t));
|
|
2453
|
-
}),
|
|
2695
|
+
}), P = n(() => {
|
|
2454
2696
|
let e = d.visited.indexOf(C.value ?? "");
|
|
2455
2697
|
return e !== -1 && d.visited.some((t, n) => n > e && !d.affixKeys.includes(t));
|
|
2456
2698
|
});
|
|
2457
2699
|
function I(e) {
|
|
2458
2700
|
let t = C.value;
|
|
2459
|
-
e === "closeAll" ? (d.closeAll(), c.push(_.get(d.affixKeys[0] ?? "")?.path ?? "/")) : t && (e === "close" ?
|
|
2701
|
+
e === "closeAll" ? (d.closeAll(), c.push(_.get(d.affixKeys[0] ?? "")?.path ?? "/")) : t && (e === "close" ? A(t) : e === "closeLeft" ? d.closeLeft(t) : e === "closeRight" ? d.closeRight(t) : d.closeOthers(t));
|
|
2460
2702
|
}
|
|
2461
2703
|
return (t, n) => {
|
|
2462
2704
|
let r = w("ca-icon"), d = w("ca-dropdown-item"), m = w("ca-dropdown-menu"), g = w("ca-dropdown");
|
|
2463
|
-
return y(), o("div",
|
|
2705
|
+
return y(), o("div", Hr, [
|
|
2464
2706
|
(y(!0), o(e, null, S(T.value, (t) => (y(), o("div", {
|
|
2465
2707
|
key: t.name,
|
|
2466
2708
|
ref_for: !0,
|
|
@@ -2482,45 +2724,45 @@ var Gt = {
|
|
|
2482
2724
|
key: 1,
|
|
2483
2725
|
name: "close",
|
|
2484
2726
|
class: "ca-tabs__close",
|
|
2485
|
-
onClick:
|
|
2727
|
+
onClick: F((t) => A(e.key), ["stop"])
|
|
2486
2728
|
}, null, 8, ["onClick"])) : a("v-if", !0)
|
|
2487
|
-
], 10,
|
|
2729
|
+
], 10, Ur))), 128))], 2))), 128)),
|
|
2488
2730
|
u(g, {
|
|
2489
2731
|
trigger: "click",
|
|
2490
2732
|
onCommand: I
|
|
2491
2733
|
}, {
|
|
2492
|
-
dropdown:
|
|
2493
|
-
default:
|
|
2734
|
+
dropdown: N(() => [u(m, null, {
|
|
2735
|
+
default: N(() => [
|
|
2494
2736
|
u(d, { command: "close" }, {
|
|
2495
|
-
default:
|
|
2737
|
+
default: N(() => [l(E(D(p)("campus.tabs.close")), 1)]),
|
|
2496
2738
|
_: 1
|
|
2497
2739
|
}),
|
|
2498
|
-
|
|
2740
|
+
M.value ? (y(), i(d, {
|
|
2499
2741
|
key: 0,
|
|
2500
2742
|
command: "closeLeft"
|
|
2501
2743
|
}, {
|
|
2502
|
-
default:
|
|
2744
|
+
default: N(() => [l(E(D(p)("campus.tabs.closeLeft")), 1)]),
|
|
2503
2745
|
_: 1
|
|
2504
2746
|
})) : a("v-if", !0),
|
|
2505
|
-
|
|
2747
|
+
P.value ? (y(), i(d, {
|
|
2506
2748
|
key: 1,
|
|
2507
2749
|
command: "closeRight"
|
|
2508
2750
|
}, {
|
|
2509
|
-
default:
|
|
2751
|
+
default: N(() => [l(E(D(p)("campus.tabs.closeRight")), 1)]),
|
|
2510
2752
|
_: 1
|
|
2511
2753
|
})) : a("v-if", !0),
|
|
2512
2754
|
u(d, { command: "closeOthers" }, {
|
|
2513
|
-
default:
|
|
2755
|
+
default: N(() => [l(E(D(p)("campus.tabs.closeOthers")), 1)]),
|
|
2514
2756
|
_: 1
|
|
2515
2757
|
}),
|
|
2516
2758
|
u(d, { command: "closeAll" }, {
|
|
2517
|
-
default:
|
|
2759
|
+
default: N(() => [l(E(D(p)("campus.tabs.closeAll")), 1)]),
|
|
2518
2760
|
_: 1
|
|
2519
2761
|
})
|
|
2520
2762
|
]),
|
|
2521
2763
|
_: 1
|
|
2522
2764
|
})]),
|
|
2523
|
-
default:
|
|
2765
|
+
default: N(() => [s("span", Wr, [u(r, { name: "arrowDown" })])]),
|
|
2524
2766
|
_: 1
|
|
2525
2767
|
}),
|
|
2526
2768
|
a(" 内容全屏:隐藏头部和侧栏,再点一次恢复 "),
|
|
@@ -2531,25 +2773,25 @@ var Gt = {
|
|
|
2531
2773
|
"aria-label": D(f).contentFullscreen ? D(p)("campus.tabs.exitFullscreen") : D(p)("campus.tabs.fullscreen"),
|
|
2532
2774
|
"aria-pressed": D(f).contentFullscreen,
|
|
2533
2775
|
onClick: n[0] ||= (e) => D(f).toggleContentFullscreen()
|
|
2534
|
-
}, [u(r, { name: D(f).contentFullscreen ? "exitFullscreen" : "fullscreen" }, null, 8, ["name"])], 8,
|
|
2776
|
+
}, [u(r, { name: D(f).contentFullscreen ? "exitFullscreen" : "fullscreen" }, null, 8, ["name"])], 8, Gr)
|
|
2535
2777
|
]);
|
|
2536
2778
|
};
|
|
2537
2779
|
}
|
|
2538
|
-
}), [["__scopeId", "data-v-1d7ba823"]]),
|
|
2780
|
+
}), [["__scopeId", "data-v-1d7ba823"]]), qr = 1200, Jr = "(max-width: 768px)", Yr = `(min-width: 769px) and (max-width: ${qr}px)`, Xr = ["aria-label"], Zr = ["aria-label"], Qr = { class: "ca-main" }, $r = {
|
|
2539
2781
|
key: 0,
|
|
2540
2782
|
class: "ca-screen-prompt",
|
|
2541
2783
|
role: "status"
|
|
2542
|
-
},
|
|
2784
|
+
}, ei = { class: "ca-content" }, ti = { class: "ca-content__page" }, ni = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
2543
2785
|
__name: "CaLayout",
|
|
2544
2786
|
setup(e) {
|
|
2545
|
-
let n =
|
|
2787
|
+
let n = W(), r = gt(), c = ft(), { t: d } = q(), f = window.matchMedia(Jr), p = window.matchMedia(Yr), m = "";
|
|
2546
2788
|
function g() {
|
|
2547
2789
|
let e = f.matches ? "phone" : p.matches ? "pad" : "desktop";
|
|
2548
2790
|
c.setMode(e);
|
|
2549
2791
|
}
|
|
2550
|
-
g(),
|
|
2792
|
+
g(), j(() => c.mode === "phone" && c.mobileMenuOpen, (e) => {
|
|
2551
2793
|
e ? (m = document.body.style.overflow, document.body.style.overflow = "hidden") : document.body.style.overflow = m;
|
|
2552
|
-
}),
|
|
2794
|
+
}), j(() => n.fullPath, () => c.closeOverlays());
|
|
2553
2795
|
function b(e) {
|
|
2554
2796
|
e.key === "Escape" && (c.mobileMenuOpen || c.padPanelOpen ? c.closeOverlays() : c.contentFullscreen && c.toggleContentFullscreen());
|
|
2555
2797
|
}
|
|
@@ -2564,212 +2806,261 @@ var Gt = {
|
|
|
2564
2806
|
}
|
|
2565
2807
|
return (e, n) => {
|
|
2566
2808
|
let f = w("ca-button"), p = w("router-view");
|
|
2567
|
-
return y(), o("div", { class: h(["ca-shell", { "is-fullscreen": D(c).contentFullscreen }]) }, [
|
|
2809
|
+
return y(), o("div", { class: h(["ca-shell", { "is-fullscreen": D(c).contentFullscreen }]) }, [P(u(fr, null, null, 512), [[A, !D(c).contentFullscreen]]), s("div", { class: h(["ca-body", { "is-fullscreen": D(c).contentFullscreen }]) }, [
|
|
2568
2810
|
D(c).mode === "phone" && D(c).mobileMenuOpen ? (y(), o("button", {
|
|
2569
2811
|
key: 0,
|
|
2570
2812
|
type: "button",
|
|
2571
2813
|
class: "ca-mobile-scrim",
|
|
2572
2814
|
"aria-label": D(d)("campus.side.closeMenu"),
|
|
2573
2815
|
onClick: n[0] ||= (e) => D(c).closeMobileMenu()
|
|
2574
|
-
}, null, 8,
|
|
2816
|
+
}, null, 8, Xr)) : a("v-if", !0),
|
|
2575
2817
|
D(c).mode === "pad" && D(c).padPanelOpen ? (y(), o("button", {
|
|
2576
2818
|
key: 1,
|
|
2577
2819
|
type: "button",
|
|
2578
2820
|
class: "ca-pad-scrim",
|
|
2579
2821
|
"aria-label": D(d)("campus.side.closeMenu"),
|
|
2580
2822
|
onClick: n[1] ||= (e) => D(c).closePadPanel()
|
|
2581
|
-
}, null, 8,
|
|
2823
|
+
}, null, 8, Zr)) : a("v-if", !0),
|
|
2582
2824
|
a(" 手机抽屉关闭时、电脑档两栏都收起时,侧栏不在屏幕上,不可聚焦 "),
|
|
2583
|
-
|
|
2825
|
+
P(u(Rr, {
|
|
2584
2826
|
class: h({ "is-mobile-open": D(c).mobileMenuOpen }),
|
|
2585
2827
|
inert: D(c).mode === "phone" && !D(c).mobileMenuOpen || D(c).sideHiddenActive
|
|
2586
|
-
}, null, 8, ["class", "inert"]), [[
|
|
2587
|
-
s("main",
|
|
2588
|
-
u(
|
|
2589
|
-
u(
|
|
2590
|
-
D(c).pageScreenPrompt ? (y(), o("div",
|
|
2828
|
+
}, null, 8, ["class", "inert"]), [[A, !D(c).contentFullscreen]]),
|
|
2829
|
+
s("main", Qr, [
|
|
2830
|
+
u(Kr),
|
|
2831
|
+
u(vr),
|
|
2832
|
+
D(c).pageScreenPrompt ? (y(), o("div", $r, [u(f, {
|
|
2591
2833
|
size: "small",
|
|
2592
2834
|
onClick: n[2] ||= (e) => D(c).retryPageScreen()
|
|
2593
2835
|
}, {
|
|
2594
|
-
default:
|
|
2836
|
+
default: N(() => [l(E(D(d)("campus.tabs.enterScreen")), 1)]),
|
|
2595
2837
|
_: 1
|
|
2596
2838
|
}), u(f, {
|
|
2597
2839
|
size: "small",
|
|
2598
2840
|
"aria-label": D(d)("campus.tabs.dismissScreen"),
|
|
2599
2841
|
onClick: n[3] ||= (e) => D(c).dismissPageScreenPrompt()
|
|
2600
2842
|
}, {
|
|
2601
|
-
default:
|
|
2843
|
+
default: N(() => [l(E(D(d)("campus.tabs.dismissScreen")), 1)]),
|
|
2602
2844
|
_: 1
|
|
2603
2845
|
}, 8, ["aria-label"])])) : a("v-if", !0),
|
|
2604
|
-
s("div",
|
|
2605
|
-
u(
|
|
2846
|
+
s("div", ei, [
|
|
2847
|
+
u(Sr),
|
|
2606
2848
|
a(" 页面区撑满剩余高度,版权在其后:内容少时贴窗口底,内容长时滚到最底才出现 "),
|
|
2607
|
-
s("div",
|
|
2608
|
-
default:
|
|
2849
|
+
s("div", ti, [u(p, null, {
|
|
2850
|
+
default: N(({ Component: e }) => [a(" include 与标签名单同步;缓存容量包含固定标签。 "), (y(), i(t, {
|
|
2609
2851
|
include: D(r).cached,
|
|
2610
2852
|
max: D(r).maxTabs + D(r).affixKeys.length
|
|
2611
2853
|
}, [e ? (y(), i(T(e), { key: x() })) : a("v-if", !0)], 1032, ["include", "max"]))]),
|
|
2612
2854
|
_: 1
|
|
2613
2855
|
})]),
|
|
2614
|
-
u(
|
|
2856
|
+
u(Vr)
|
|
2615
2857
|
])
|
|
2616
2858
|
])
|
|
2617
2859
|
], 2)], 2);
|
|
2618
2860
|
};
|
|
2619
2861
|
}
|
|
2620
|
-
}), [["__scopeId", "data-v-90594751"]]),
|
|
2862
|
+
}), [["__scopeId", "data-v-90594751"]]), ri = { class: "ca-exception" }, ii = { class: "ca-exception__code" }, ai = { class: "ca-exception__text" }, oi = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
2621
2863
|
__name: "ExceptionPage",
|
|
2622
2864
|
props: { kind: {} },
|
|
2623
2865
|
setup(e) {
|
|
2624
|
-
let t = e, r =
|
|
2866
|
+
let t = e, r = G(), i = Fe(J()).home, { t: a } = q(), c = n(() => t.kind === "forbidden" ? "403" : "404"), d = n(() => a(t.kind === "forbidden" ? "campus.error.forbidden" : "campus.error.notFound"));
|
|
2625
2867
|
return (e, t) => {
|
|
2626
2868
|
let n = w("ca-button");
|
|
2627
|
-
return y(), o("div",
|
|
2628
|
-
s("
|
|
2629
|
-
s("p",
|
|
2869
|
+
return y(), o("div", ri, [
|
|
2870
|
+
s("h1", ii, E(c.value), 1),
|
|
2871
|
+
s("p", ai, E(d.value), 1),
|
|
2630
2872
|
u(n, {
|
|
2631
2873
|
type: "primary",
|
|
2632
2874
|
onClick: t[0] ||= (e) => D(r).replace(D(i))
|
|
2633
2875
|
}, {
|
|
2634
|
-
default:
|
|
2876
|
+
default: N(() => [l(E(D(a)("campus.error.backHome")), 1)]),
|
|
2635
2877
|
_: 1
|
|
2636
2878
|
})
|
|
2637
2879
|
]);
|
|
2638
2880
|
};
|
|
2639
2881
|
}
|
|
2640
|
-
}), [["__scopeId", "data-v-
|
|
2882
|
+
}), [["__scopeId", "data-v-c6bc58c6"]]), si = { class: "ca-login" }, ci = { class: "ca-login__main" }, li = { class: "ca-card ca-login__card" }, ui = { class: "ca-login__brand" }, di = ["src"], fi = { class: "ca-login__name" }, pi = {
|
|
2641
2883
|
key: 1,
|
|
2642
2884
|
class: "ca-login__subtitle"
|
|
2643
|
-
},
|
|
2885
|
+
}, mi = ["id"], hi = /*#__PURE__*/ Z(/* @__PURE__ */ d({
|
|
2644
2886
|
__name: "LoginPage",
|
|
2645
|
-
setup(
|
|
2646
|
-
let
|
|
2887
|
+
setup(t) {
|
|
2888
|
+
let r = W(), c = G(), d = Q(), f = Ue(), { t: p, label: h } = q(), g = J().brand, _ = n(() => h(f.theme.siteName ?? g.name)), v = n(() => f.theme.logo ?? g.logo), C = Ke(), T = b({
|
|
2647
2889
|
username: "",
|
|
2648
2890
|
password: "",
|
|
2649
2891
|
captcha: ""
|
|
2650
|
-
}),
|
|
2892
|
+
}), k = x(""), A = x([]), j = x(), M = x(!1), P = x(""), I = O(), L = n(() => [
|
|
2893
|
+
{
|
|
2894
|
+
key: "username",
|
|
2895
|
+
label: p("campus.login.username")
|
|
2896
|
+
},
|
|
2897
|
+
{
|
|
2898
|
+
key: "password",
|
|
2899
|
+
label: p("campus.login.password")
|
|
2900
|
+
},
|
|
2901
|
+
...C.captcha ? [{
|
|
2902
|
+
key: "captcha",
|
|
2903
|
+
label: p("campus.auth.captcha")
|
|
2904
|
+
}] : []
|
|
2905
|
+
].map((e) => {
|
|
2906
|
+
let t = j.value?.getField(e.key), n = `${I}-${e.key}`, r = t?.validateState === "error" ? t.validateMessage : "";
|
|
2907
|
+
return {
|
|
2908
|
+
...e,
|
|
2909
|
+
id: n,
|
|
2910
|
+
error: r,
|
|
2911
|
+
errorId: r ? `${n}-error` : void 0
|
|
2912
|
+
};
|
|
2913
|
+
})), R = n(() => ({
|
|
2651
2914
|
username: [{
|
|
2652
2915
|
required: !0,
|
|
2653
|
-
message:
|
|
2916
|
+
message: p("campus.login.required", { label: p("campus.login.username") }),
|
|
2654
2917
|
trigger: "blur"
|
|
2655
2918
|
}],
|
|
2656
2919
|
password: [{
|
|
2657
2920
|
required: !0,
|
|
2658
|
-
message:
|
|
2921
|
+
message: p("campus.login.required", { label: p("campus.login.password") }),
|
|
2659
2922
|
trigger: "blur"
|
|
2660
2923
|
}],
|
|
2661
|
-
captcha:
|
|
2924
|
+
captcha: C.captcha ? [{
|
|
2662
2925
|
required: !0,
|
|
2663
|
-
message:
|
|
2926
|
+
message: p("campus.auth.captchaRequired"),
|
|
2664
2927
|
trigger: "blur"
|
|
2665
2928
|
}] : []
|
|
2666
2929
|
}));
|
|
2667
|
-
async function
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2930
|
+
async function z() {
|
|
2931
|
+
if (!M.value) {
|
|
2932
|
+
P.value = "";
|
|
2933
|
+
try {
|
|
2934
|
+
await j.value?.validate();
|
|
2935
|
+
} catch {
|
|
2936
|
+
await m();
|
|
2937
|
+
let e = L.value.find((e) => e.error);
|
|
2938
|
+
e && document.getElementById(e.id)?.focus();
|
|
2939
|
+
return;
|
|
2940
|
+
}
|
|
2941
|
+
if (!M.value) {
|
|
2942
|
+
M.value = !0;
|
|
2943
|
+
try {
|
|
2944
|
+
await d.login({
|
|
2945
|
+
username: T.username,
|
|
2946
|
+
password: T.password,
|
|
2947
|
+
captcha: C.captcha ? {
|
|
2948
|
+
key: k.value,
|
|
2949
|
+
code: T.captcha
|
|
2950
|
+
} : void 0
|
|
2951
|
+
}), await c.replace(qe(r.query.redirect));
|
|
2952
|
+
} catch (e) {
|
|
2953
|
+
P.value = e instanceof Error && e.message ? e.message : p("campus.login.failed"), A.value[0]?.refresh();
|
|
2954
|
+
} finally {
|
|
2955
|
+
M.value = !1;
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2687
2958
|
}
|
|
2688
2959
|
}
|
|
2689
|
-
return (
|
|
2690
|
-
let
|
|
2691
|
-
return y(), o("div",
|
|
2692
|
-
s("div",
|
|
2693
|
-
|
|
2960
|
+
return (t, n) => {
|
|
2961
|
+
let r = w("ca-alert"), c = w("ca-input"), d = w("ca-form-item"), f = w("ca-button"), m = w("ca-form");
|
|
2962
|
+
return y(), o("div", si, [s("main", ci, [s("div", li, [
|
|
2963
|
+
s("div", ui, [
|
|
2964
|
+
v.value ? (y(), o("img", {
|
|
2694
2965
|
key: 0,
|
|
2695
|
-
src:
|
|
2966
|
+
src: v.value,
|
|
2696
2967
|
alt: "",
|
|
2697
2968
|
class: "ca-login__logo"
|
|
2698
|
-
}, null, 8,
|
|
2699
|
-
s("h1",
|
|
2700
|
-
D(
|
|
2969
|
+
}, null, 8, di)) : a("v-if", !0),
|
|
2970
|
+
s("h1", fi, E(_.value), 1),
|
|
2971
|
+
D(g).subtitle ? (y(), o("p", pi, E(D(h)(D(g).subtitle)), 1)) : a("v-if", !0)
|
|
2701
2972
|
]),
|
|
2702
|
-
|
|
2973
|
+
P.value ? (y(), i(r, {
|
|
2703
2974
|
key: 0,
|
|
2704
|
-
title:
|
|
2975
|
+
title: P.value,
|
|
2705
2976
|
type: "error",
|
|
2706
2977
|
"show-icon": "",
|
|
2707
2978
|
closable: !1,
|
|
2708
2979
|
class: "ca-login__error"
|
|
2709
2980
|
}, null, 8, ["title"])) : a("v-if", !0),
|
|
2710
|
-
u(
|
|
2981
|
+
u(m, {
|
|
2711
2982
|
ref_key: "formRef",
|
|
2712
|
-
ref:
|
|
2713
|
-
model:
|
|
2714
|
-
rules:
|
|
2983
|
+
ref: j,
|
|
2984
|
+
model: T,
|
|
2985
|
+
rules: R.value,
|
|
2715
2986
|
size: "large",
|
|
2716
|
-
|
|
2717
|
-
|
|
2987
|
+
"label-position": "top",
|
|
2988
|
+
"hide-required-asterisk": "",
|
|
2989
|
+
class: "ca-auth-form ca-login__form",
|
|
2990
|
+
onSubmit: F(z, ["prevent"])
|
|
2718
2991
|
}, {
|
|
2719
|
-
default:
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
}),
|
|
2729
|
-
u(c, { prop: "password" }, {
|
|
2730
|
-
default: M(() => [u(r, {
|
|
2731
|
-
modelValue: v.password,
|
|
2732
|
-
"onUpdate:modelValue": t[1] ||= (e) => v.password = e,
|
|
2733
|
-
type: "password",
|
|
2734
|
-
"show-password": "",
|
|
2735
|
-
placeholder: D(f)("campus.login.password"),
|
|
2736
|
-
autocomplete: "current-password"
|
|
2737
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
2738
|
-
_: 1
|
|
2739
|
-
}),
|
|
2740
|
-
D(_).captcha ? (y(), i(c, {
|
|
2992
|
+
default: N(() => [(y(!0), o(e, null, S(L.value, (e) => (y(), i(d, {
|
|
2993
|
+
key: e.key,
|
|
2994
|
+
prop: e.key,
|
|
2995
|
+
label: e.label,
|
|
2996
|
+
for: e.id,
|
|
2997
|
+
"show-message": !1,
|
|
2998
|
+
class: "ca-login__field"
|
|
2999
|
+
}, {
|
|
3000
|
+
default: N(() => [e.key === "captcha" ? (y(), i(wt, {
|
|
2741
3001
|
key: 0,
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
3002
|
+
ref_for: !0,
|
|
3003
|
+
ref_key: "captchaFields",
|
|
3004
|
+
ref: A,
|
|
3005
|
+
code: T.captcha,
|
|
3006
|
+
"onUpdate:code": n[0] ||= (e) => T.captcha = e,
|
|
3007
|
+
"captcha-key": k.value,
|
|
3008
|
+
"onUpdate:captchaKey": n[1] ||= (e) => k.value = e,
|
|
3009
|
+
scene: "login",
|
|
3010
|
+
"input-id": e.id,
|
|
3011
|
+
"input-error-id": e.errorId
|
|
3012
|
+
}, null, 8, [
|
|
3013
|
+
"code",
|
|
3014
|
+
"captcha-key",
|
|
3015
|
+
"input-id",
|
|
3016
|
+
"input-error-id"
|
|
3017
|
+
])) : (y(), i(c, {
|
|
3018
|
+
key: 1,
|
|
3019
|
+
id: e.id,
|
|
3020
|
+
modelValue: T[e.key],
|
|
3021
|
+
"onUpdate:modelValue": (t) => T[e.key] = t,
|
|
3022
|
+
class: "ca-login__input",
|
|
3023
|
+
type: e.key === "password" ? "password" : "text",
|
|
3024
|
+
"show-password": e.key === "password",
|
|
3025
|
+
autocomplete: e.key === "password" ? "current-password" : "username",
|
|
3026
|
+
"aria-invalid": e.error ? "true" : void 0,
|
|
3027
|
+
"aria-describedby": e.errorId
|
|
3028
|
+
}, null, 8, [
|
|
3029
|
+
"id",
|
|
3030
|
+
"modelValue",
|
|
3031
|
+
"onUpdate:modelValue",
|
|
3032
|
+
"type",
|
|
3033
|
+
"show-password",
|
|
3034
|
+
"autocomplete",
|
|
3035
|
+
"aria-invalid",
|
|
3036
|
+
"aria-describedby"
|
|
3037
|
+
])), e.error ? (y(), o("p", {
|
|
3038
|
+
key: 2,
|
|
3039
|
+
id: e.errorId,
|
|
3040
|
+
class: "ca-login__field-error"
|
|
3041
|
+
}, E(e.error), 9, mi)) : a("v-if", !0)]),
|
|
3042
|
+
_: 2
|
|
3043
|
+
}, 1032, [
|
|
3044
|
+
"prop",
|
|
3045
|
+
"label",
|
|
3046
|
+
"for"
|
|
3047
|
+
]))), 128)), u(f, {
|
|
3048
|
+
type: "primary",
|
|
3049
|
+
"native-type": "submit",
|
|
3050
|
+
loading: M.value,
|
|
3051
|
+
class: "ca-login__submit"
|
|
3052
|
+
}, {
|
|
3053
|
+
default: N(() => [l(E(D(p)("campus.login.submit")), 1)]),
|
|
3054
|
+
_: 1
|
|
3055
|
+
}, 8, ["loading"])]),
|
|
2765
3056
|
_: 1
|
|
2766
3057
|
}, 8, ["model", "rules"])
|
|
2767
|
-
])]), u(
|
|
3058
|
+
])]), u(Vr, { class: "ca-login__copyright" })]);
|
|
2768
3059
|
};
|
|
2769
3060
|
}
|
|
2770
|
-
}), [["__scopeId", "data-v-
|
|
3061
|
+
}), [["__scopeId", "data-v-163d1aec"]]);
|
|
2771
3062
|
// packages/core/src/router.ts
|
|
2772
|
-
function
|
|
3063
|
+
function gi(e) {
|
|
2773
3064
|
return async () => {
|
|
2774
3065
|
let t = await e.component();
|
|
2775
3066
|
return d({
|
|
@@ -2778,17 +3069,17 @@ function qr(e) {
|
|
|
2778
3069
|
});
|
|
2779
3070
|
};
|
|
2780
3071
|
}
|
|
2781
|
-
var
|
|
3072
|
+
var _i = d({
|
|
2782
3073
|
name: "CaForbidden",
|
|
2783
|
-
setup: () => () => f(
|
|
2784
|
-
}),
|
|
3074
|
+
setup: () => () => f(oi, { kind: "forbidden" })
|
|
3075
|
+
}), vi = d({
|
|
2785
3076
|
name: "CaNotFound",
|
|
2786
|
-
setup: () => () => f(
|
|
3077
|
+
setup: () => () => f(oi, { kind: "notFound" })
|
|
2787
3078
|
});
|
|
2788
|
-
function
|
|
2789
|
-
let n =
|
|
3079
|
+
function yi(e, t) {
|
|
3080
|
+
let n = Pe(e.menus);
|
|
2790
3081
|
if (!n.length) throw Error("[campus] 菜单里至少需要一个页面");
|
|
2791
|
-
let r =
|
|
3082
|
+
let r = Fe(e), i = Y(e);
|
|
2792
3083
|
if (new Set(Object.values(i)).size !== 5 || n.some((e) => Object.values(i).includes(e.key))) throw Error("[campus] 系统路由名称重复或与页面键冲突,请配置 routeNames");
|
|
2793
3084
|
for (let e of n) if ([
|
|
2794
3085
|
r.login,
|
|
@@ -2801,24 +3092,24 @@ function Xr(e, t) {
|
|
|
2801
3092
|
{
|
|
2802
3093
|
path: r.login,
|
|
2803
3094
|
name: i.login,
|
|
2804
|
-
component: e.login?.style === "split" ?
|
|
3095
|
+
component: e.login?.style === "split" ? Rt : hi,
|
|
2805
3096
|
meta: { public: !0 }
|
|
2806
3097
|
},
|
|
2807
3098
|
{
|
|
2808
3099
|
path: r.register,
|
|
2809
3100
|
name: i.register,
|
|
2810
|
-
component:
|
|
3101
|
+
component: on,
|
|
2811
3102
|
meta: { public: !0 }
|
|
2812
3103
|
},
|
|
2813
3104
|
{
|
|
2814
3105
|
path: r.forgot,
|
|
2815
3106
|
name: i.forgot,
|
|
2816
|
-
component:
|
|
3107
|
+
component: un,
|
|
2817
3108
|
meta: { public: !0 }
|
|
2818
3109
|
},
|
|
2819
3110
|
{
|
|
2820
3111
|
path: "/",
|
|
2821
|
-
component:
|
|
3112
|
+
component: ni,
|
|
2822
3113
|
redirect: n.some((e) => e.path === "/") ? void 0 : () => {
|
|
2823
3114
|
let e = Q(t);
|
|
2824
3115
|
return r.home === "/" ? n.find((t) => e.can(t.permission))?.path ?? r.forbidden : r.home;
|
|
@@ -2827,7 +3118,7 @@ function Xr(e, t) {
|
|
|
2827
3118
|
...n.map((e) => ({
|
|
2828
3119
|
path: e.path,
|
|
2829
3120
|
name: e.key,
|
|
2830
|
-
component:
|
|
3121
|
+
component: gi(e),
|
|
2831
3122
|
meta: {
|
|
2832
3123
|
pageKey: e.key,
|
|
2833
3124
|
appKey: e.appKey,
|
|
@@ -2840,12 +3131,12 @@ function Xr(e, t) {
|
|
|
2840
3131
|
{
|
|
2841
3132
|
path: r.forbidden,
|
|
2842
3133
|
name: i.forbidden,
|
|
2843
|
-
component:
|
|
3134
|
+
component: _i
|
|
2844
3135
|
},
|
|
2845
3136
|
{
|
|
2846
3137
|
path: r.notFound,
|
|
2847
3138
|
name: i.notFound,
|
|
2848
|
-
component:
|
|
3139
|
+
component: vi
|
|
2849
3140
|
},
|
|
2850
3141
|
...r.notFound === "/:pathMatch(.*)*" ? [] : [{
|
|
2851
3142
|
path: "/:pathMatch(.*)*",
|
|
@@ -2853,10 +3144,10 @@ function Xr(e, t) {
|
|
|
2853
3144
|
}]
|
|
2854
3145
|
]
|
|
2855
3146
|
}
|
|
2856
|
-
], o =
|
|
2857
|
-
history: e.history === "web" ?
|
|
3147
|
+
], o = re({
|
|
3148
|
+
history: e.history === "web" ? U() : H(),
|
|
2858
3149
|
routes: a
|
|
2859
|
-
}), s =
|
|
3150
|
+
}), s = ft(t);
|
|
2860
3151
|
return o.beforeEach((e, n) => {
|
|
2861
3152
|
let a = Q(t);
|
|
2862
3153
|
return e.meta.public ? a.isLoggedIn && e.name === i.login ? { path: r.home } : !0 : a.isLoggedIn ? a.can(e.meta.permission) ? (e.path === n.path && n.matched.length || e.meta.openMode !== "screen" || s.preparePageScreen(), !0) : { name: i.forbidden } : {
|
|
@@ -2867,51 +3158,51 @@ function Xr(e, t) {
|
|
|
2867
3158
|
if (i) s.cancelPageScreen();
|
|
2868
3159
|
else {
|
|
2869
3160
|
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 =
|
|
3161
|
+
let r = Ie(e, (e) => Q(t).can(e)).apps.find((e) => e.key === n.meta.appKey);
|
|
2871
3162
|
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
3163
|
}
|
|
2873
|
-
n.meta.pageKey &&
|
|
3164
|
+
n.meta.pageKey && gt(t).open(n.meta.pageKey);
|
|
2874
3165
|
}
|
|
2875
3166
|
}), o.onError(() => s.cancelPageScreen()), o;
|
|
2876
3167
|
}
|
|
2877
3168
|
// packages/core/src/services/login.ts
|
|
2878
|
-
async function
|
|
2879
|
-
e.signIn(n), await t.replace(
|
|
3169
|
+
async function bi(e, t, n, r) {
|
|
3170
|
+
e.signIn(n), await t.replace(qe(r));
|
|
2880
3171
|
}
|
|
2881
3172
|
// packages/core/src/services/auth.ts
|
|
2882
|
-
var
|
|
2883
|
-
function
|
|
2884
|
-
|
|
3173
|
+
var xi, Si;
|
|
3174
|
+
function Ci(e, t) {
|
|
3175
|
+
xi = e, Si = t;
|
|
2885
3176
|
}
|
|
2886
|
-
async function
|
|
2887
|
-
if (
|
|
2888
|
-
let t = Q(
|
|
3177
|
+
async function wi(e) {
|
|
3178
|
+
if (J(), !xi || !Si) return;
|
|
3179
|
+
let t = Q(Si);
|
|
2889
3180
|
if (!t.isLoggedIn) return;
|
|
2890
|
-
t.expire(),
|
|
2891
|
-
let n =
|
|
2892
|
-
n.name !== "login" && await
|
|
2893
|
-
name: J(
|
|
2894
|
-
query: n.fullPath ===
|
|
3181
|
+
t.expire(), Yt.toast.warning(e || Ee("campus.auth.sessionExpired"));
|
|
3182
|
+
let n = xi.currentRoute.value;
|
|
3183
|
+
n.name !== "login" && await xi.replace({
|
|
3184
|
+
name: Y(J()).login,
|
|
3185
|
+
query: n.fullPath === Fe(J()).home ? void 0 : { redirect: n.fullPath }
|
|
2895
3186
|
});
|
|
2896
3187
|
}
|
|
2897
|
-
async function
|
|
2898
|
-
if (
|
|
2899
|
-
await
|
|
3188
|
+
async function Ti(e, t) {
|
|
3189
|
+
if (J(), !xi || !Si) throw Error("[campus] 应用尚未创建,无法完成登录");
|
|
3190
|
+
await bi(Q(Si), xi, e, t);
|
|
2900
3191
|
}
|
|
2901
3192
|
// packages/core/src/app.ts
|
|
2902
|
-
function
|
|
2903
|
-
|
|
2904
|
-
let t = r(
|
|
3193
|
+
function Ei(e) {
|
|
3194
|
+
Bt(e), je(e);
|
|
3195
|
+
let t = r(Oe), n = I();
|
|
2905
3196
|
t.use(n);
|
|
2906
|
-
let i =
|
|
3197
|
+
let i = we(e);
|
|
2907
3198
|
t.use(i);
|
|
2908
3199
|
let a = (e, t) => i.global.t(e, t ?? {});
|
|
2909
|
-
t.provide(
|
|
2910
|
-
let o =
|
|
2911
|
-
return
|
|
3200
|
+
t.provide(z, a), Ut(a), t.config.globalProperties.$ca = Yt, R(t), t.component("CaAuthPreview", dn);
|
|
3201
|
+
let o = yi(e, n);
|
|
3202
|
+
return Ci(o, n), t.use(o), Ue(n).boot(), t;
|
|
2912
3203
|
}
|
|
2913
3204
|
// packages/core/src/index.ts
|
|
2914
|
-
function
|
|
3205
|
+
function Di(e) {
|
|
2915
3206
|
return e;
|
|
2916
3207
|
}
|
|
2917
|
-
export {
|
|
3208
|
+
export { Yt as ca, Ti as completeLogin, Ei as createCampusApp, Di as defineMenus, wi as handleUnauthorized, zt as resolveEnvironment, Ee as t, q as useCampusT, ft as useLayoutStore, Q as useSessionStore, gt as useTabsStore, Ue as useThemeStore };
|