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