@campus-admin/core 2.0.4 → 2.0.6

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/index.js CHANGED
@@ -17,46 +17,46 @@ import "element-plus/es/components/message-box/style/css";
17
17
  export * from "@campus-admin/ui";
18
18
  // packages/core/src/storage.ts
19
19
  var he = "ca:";
20
- function ge(e, t = "local") {
20
+ function U(e, t = "local") {
21
21
  try {
22
22
  return (t === "local" ? localStorage : sessionStorage).getItem(he + e);
23
23
  } catch {
24
24
  return null;
25
25
  }
26
26
  }
27
- function U(e, t, n = "local") {
27
+ function W(e, t, n = "local") {
28
28
  try {
29
29
  let r = n === "local" ? localStorage : sessionStorage;
30
30
  t === null ? r.removeItem(he + e) : r.setItem(he + e, t);
31
31
  } catch {}
32
32
  }
33
- function _e(e, t = "local") {
34
- let n = ge(e, t);
33
+ function ge(e, t = "local") {
34
+ let n = U(e, t);
35
35
  if (n) try {
36
36
  return JSON.parse(n);
37
37
  } catch {
38
38
  return;
39
39
  }
40
40
  }
41
- function ve(e, t, n = "local") {
42
- U(e, JSON.stringify(t), n);
41
+ function _e(e, t, n = "local") {
42
+ W(e, JSON.stringify(t), n);
43
43
  }
44
44
  // packages/core/src/i18n.ts
45
- var ye = (e) => typeof e == "object" && !!e && !Array.isArray(e);
46
- function be(e, t) {
45
+ var ve = (e) => typeof e == "object" && !!e && !Array.isArray(e);
46
+ function ye(e, t) {
47
47
  let n = { ...e };
48
48
  for (let [e, r] of Object.entries(t)) {
49
49
  let t = n[e];
50
- n[e] = ye(t) && ye(r) ? be(t, r) : r;
50
+ n[e] = ve(t) && ve(r) ? ye(t, r) : r;
51
51
  }
52
52
  return n;
53
53
  }
54
- var xe = "locale";
55
- function Se(e) {
54
+ var be = "locale";
55
+ function xe(e) {
56
56
  return e === "zh-CN" || e === "en-US";
57
57
  }
58
- function Ce(e) {
59
- let t = ge(xe), n = Se(t) ? t : e.defaultLocale ?? "zh-CN", r = Object.fromEntries(["zh-CN", "en-US"].map((t) => [t, be(te[t], e.messages?.[t] ?? {})])), i = ne({
58
+ function Se(e) {
59
+ let t = U(be), n = xe(t) ? t : e.defaultLocale ?? "zh-CN", r = Object.fromEntries(["zh-CN", "en-US"].map((t) => [t, ye(te[t], e.messages?.[t] ?? {})])), i = ne({
60
60
  legacy: !1,
61
61
  locale: n,
62
62
  fallbackLocale: "zh-CN",
@@ -64,16 +64,16 @@ function Ce(e) {
64
64
  });
65
65
  return typeof document < "u" && A(() => i.global.locale.value, (e) => {
66
66
  document.documentElement.lang = e;
67
- }, { immediate: !0 }), we = i, i;
67
+ }, { immediate: !0 }), Ce = i, i;
68
68
  }
69
- var we;
70
- function Te(e, t) {
71
- return we ? we.global.t(e, t ?? {}) : e;
69
+ var Ce;
70
+ function we(e, t) {
71
+ return Ce ? Ce.global.t(e, t ?? {}) : e;
72
72
  }
73
- function Ee(e) {
74
- U(xe, e);
73
+ function Te(e) {
74
+ W(be, e);
75
75
  }
76
- function W() {
76
+ function G() {
77
77
  let { t: e, te: t, locale: n } = z();
78
78
  return {
79
79
  t: e,
@@ -83,10 +83,10 @@ function W() {
83
83
  };
84
84
  }
85
85
  // packages/core/src/CampusRoot.vue
86
- var De = /* @__PURE__ */ d({
86
+ var Ee = /* @__PURE__ */ d({
87
87
  __name: "CampusRoot",
88
88
  setup(e) {
89
- let { locale: t } = W();
89
+ let { locale: t } = G();
90
90
  return (e, n) => {
91
91
  let r = w("router-view"), a = w("ca-config-provider");
92
92
  return y(), i(a, { locale: D(t) }, {
@@ -97,7 +97,7 @@ var De = /* @__PURE__ */ d({
97
97
  }
98
98
  });
99
99
  // packages/core/src/types.ts
100
- function G(e) {
100
+ function De(e) {
101
101
  return "children" in e;
102
102
  }
103
103
  // packages/core/src/context.ts
@@ -110,7 +110,7 @@ function K() {
110
110
  return Oe;
111
111
  }
112
112
  function Ae(e) {
113
- for (let t of K().menus) for (let n of t.children) if (G(n)) {
113
+ for (let t of K().menus) for (let n of t.children) if (De(n)) {
114
114
  let r = n.children.find((t) => t.key === e);
115
115
  if (r) return { titles: [
116
116
  t.title,
@@ -119,13 +119,18 @@ function Ae(e) {
119
119
  ] };
120
120
  } else if (n.key === e) return { titles: [t.title, n.title] };
121
121
  }
122
- function je(e) {
122
+ var je = [
123
+ "none",
124
+ "panel",
125
+ "all"
126
+ ];
127
+ function Me(e) {
123
128
  let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
124
129
  for (let o of e) {
125
130
  if (i.has(o.key)) throw Error(`[campus] 菜单一级场景键重复:${o.key}`);
126
131
  i.add(o.key);
127
132
  for (let e of o.children) {
128
- let i = G(e) ? e : void 0;
133
+ let i = De(e) ? e : void 0;
129
134
  if (i) {
130
135
  if (a.has(i.key)) throw Error(`[campus] 菜单组键重复:${i.key}`);
131
136
  a.add(i.key);
@@ -134,34 +139,83 @@ function je(e) {
134
139
  if (n.has(a.key)) throw Error(`[campus] 菜单页面键重复:${a.key}`);
135
140
  if (r.has(a.path)) throw Error(`[campus] 菜单路径重复:${a.path}`);
136
141
  if (!a.path.startsWith("/")) throw Error(`[campus] 菜单路径必须以 / 开头:${a.path}`);
137
- n.add(a.key), r.add(a.path), t.push({
142
+ n.add(a.key), r.add(a.path);
143
+ let e = {
138
144
  ...a,
139
145
  appKey: o.key,
140
146
  groupKey: i?.key
141
- });
147
+ };
148
+ e.sideCollapse != null && !je.includes(e.sideCollapse) && (console.warn(`[campus] 菜单页面 sideCollapse 只能是 none / panel / all,已忽略:${a.key}`), delete e.sideCollapse), e.openMode != null && ![
149
+ "normal",
150
+ "collapsePanel",
151
+ "collapseAll",
152
+ "content",
153
+ "screen"
154
+ ].includes(e.openMode) && (console.warn(`[campus] 菜单页面 openMode 无效,已忽略:${a.key}`), delete e.openMode), t.push(e);
142
155
  }
143
156
  }
144
157
  }
145
158
  return t;
146
159
  }
147
- function Me(e, t) {
148
- if (e !== void 0 && !t.some((t) => t.path === e)) throw Error(`[campus] 账户页路径不在菜单页面里:${e}`);
160
+ function Ne(e) {
161
+ let t = {
162
+ home: "/",
163
+ login: "/login",
164
+ register: "/register",
165
+ forgot: "/forgot",
166
+ forbidden: "/403",
167
+ notFound: "/:pathMatch(.*)*",
168
+ ...e.paths
169
+ };
170
+ for (let e of Object.values(t)) if (!e.startsWith("/") || e.startsWith("//")) throw Error(`[campus] 系统路径必须为站内绝对路径:${e}`);
171
+ if ((/* @__PURE__ */ new Set([
172
+ t.login,
173
+ t.register,
174
+ t.forgot,
175
+ t.forbidden,
176
+ t.notFound
177
+ ])).size !== 5) throw Error("[campus] 系统页面路径不能重复");
178
+ return t;
179
+ }
180
+ function Pe(e, t) {
181
+ let n = e.homeEntry === !1 ? void 0 : Me(e.menus).find((e) => e.affix && t(e.permission)), r = !e.accountInMenu && !e.onAccountClick, i = (i) => t(i.permission) && i.key !== n?.key && (!r || i.path !== e.accountPath);
182
+ return {
183
+ home: n,
184
+ apps: e.menus.map((e) => ({
185
+ ...e,
186
+ children: e.children.map((e) => De(e) ? {
187
+ ...e,
188
+ children: e.children.filter(i)
189
+ } : e).filter((e) => De(e) ? e.children.length > 0 : i(e))
190
+ })).filter((e) => e.children.length > 0),
191
+ accountStandalone: r
192
+ };
193
+ }
194
+ function q(e) {
195
+ return {
196
+ login: "login",
197
+ register: "register",
198
+ forgot: "forgot",
199
+ forbidden: "forbidden",
200
+ notFound: "not-found",
201
+ ...e.routeNames
202
+ };
149
203
  }
150
204
  // packages/core/src/stores/theme.ts
151
- var Ne = "theme-mode", Pe = "box-style", Fe = "user-primary";
152
- function Ie() {
153
- return ge(Pe) === "border" ? "border" : "shadow";
205
+ var Fe = "theme-mode", Ie = "box-style", Le = "user-primary";
206
+ function Re() {
207
+ return U(Ie) === "border" ? "border" : "shadow";
154
208
  }
155
- function Le() {
156
- let e = ge(Fe);
209
+ function ze() {
210
+ let e = U(Le);
157
211
  return ce(e) ? e : void 0;
158
212
  }
159
- function Re() {
160
- let e = ge(Ne);
213
+ function Be() {
214
+ let e = U(Fe);
161
215
  return e === "light" || e === "dark" || e === "auto" ? e : "auto";
162
216
  }
163
- var ze = I("campus-theme", () => {
164
- let e = x({}), t = x(Re()), r = x(Ie()), i = x(Le()), a = typeof matchMedia == "function" ? matchMedia("(prefers-color-scheme: dark)") : void 0, o = x(a?.matches ?? !1);
217
+ var Ve = I("campus-theme", () => {
218
+ let e = x({}), t = x(Be()), r = x(Re()), i = x(ze()), a = typeof matchMedia == "function" ? matchMedia("(prefers-color-scheme: dark)") : void 0, o = x(a?.matches ?? !1);
165
219
  a?.addEventListener("change", (e) => o.value = e.matches);
166
220
  let s = n(() => ue(e.value)), c = n(() => e.value.tenantDefault?.locks?.includes("primary") ?? !1), l = n(() => {
167
221
  let e = s.value.theme, t = i.value;
@@ -175,16 +229,16 @@ var ze = I("campus-theme", () => {
175
229
  document.documentElement.dataset.caBox = r.value;
176
230
  });
177
231
  function p(e) {
178
- (e === void 0 || ce(e)) && (i.value = e, U(Fe, e ?? null));
232
+ (e === void 0 || ce(e)) && (i.value = e, W(Le, e ?? null));
179
233
  }
180
234
  function h(e) {
181
- r.value = e, U(Pe, e);
235
+ r.value = e, W(Ie, e);
182
236
  }
183
237
  function g() {
184
238
  return `theme-layers:${K().theme?.cacheKey ?? location.host}`;
185
239
  }
186
240
  function _(e) {
187
- t.value = e, U(Ne, e);
241
+ t.value = e, W(Fe, e);
188
242
  }
189
243
  function v(e, t) {
190
244
  let n = document, r = le(e, o.value) !== d.value, i = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
@@ -211,10 +265,10 @@ var ze = I("campus-theme", () => {
211
265
  }).catch(() => {});
212
266
  }
213
267
  function y(t, n = !0) {
214
- e.value = t, n && ve(g(), t);
268
+ e.value = t, n && _e(g(), t);
215
269
  }
216
270
  async function b() {
217
- let t = _e(g());
271
+ let t = ge(g());
218
272
  t && (e.value = t);
219
273
  let n = K().theme?.load;
220
274
  if (n) {
@@ -244,15 +298,15 @@ var ze = I("campus-theme", () => {
244
298
  };
245
299
  });
246
300
  // packages/core/src/copyright.ts
247
- function Be(e, t = (/* @__PURE__ */ new Date()).getFullYear()) {
301
+ function He(e, t = (/* @__PURE__ */ new Date()).getFullYear()) {
248
302
  return e.replaceAll("{year}", String(t));
249
303
  }
250
304
  // packages/core/src/pages/auth/options.ts
251
- var Ve = /^1[3-9]\d{9}$/;
252
- function q() {
305
+ var Ue = /^1[3-9]\d{9}$/;
306
+ function J() {
253
307
  return K().login ?? {};
254
308
  }
255
- function J() {
309
+ function Y() {
256
310
  let e = K().auth;
257
311
  return {
258
312
  captcha: typeof e.captcha == "function",
@@ -261,37 +315,37 @@ function J() {
261
315
  forgot: typeof e.resetPassword == "function" && typeof e.sendSmsCode == "function"
262
316
  };
263
317
  }
264
- function He(e) {
265
- return typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "/";
318
+ function We(e) {
319
+ return typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : Ne(K()).home;
266
320
  }
267
321
  // packages/core/src/pages/auth/AuthShell.vue?vue&type=script&setup=true&lang.ts
268
- var Ue = {
322
+ var Ge = {
269
323
  key: 0,
270
324
  class: "ca-auth__title"
271
- }, We = ["src"], Ge = { class: "ca-auth__qrcode" }, Ke = ["src", "alt"], qe = {
325
+ }, Ke = ["src"], qe = { class: "ca-auth__qrcode" }, Je = ["src", "alt"], Ye = {
272
326
  key: 0,
273
327
  class: "ca-auth__caption"
274
- }, Je = { class: "ca-auth__site" }, Ye = {
328
+ }, Xe = { class: "ca-auth__site" }, Ze = {
275
329
  key: 0,
276
330
  class: "ca-auth__caption"
277
- }, Xe = { class: "ca-auth__main" }, Ze = { class: "ca-auth__brand" }, Qe = ["src"], $e = {
331
+ }, Qe = { class: "ca-auth__main" }, $e = { class: "ca-auth__brand" }, et = ["src"], tt = {
278
332
  class: "ca-auth__tabs",
279
333
  role: "tablist"
280
- }, et = [
334
+ }, nt = [
281
335
  "aria-selected",
282
336
  "tabindex",
283
337
  "onClick",
284
338
  "onKeydown"
285
- ], tt = {
339
+ ], rt = {
286
340
  class: "ca-auth__body",
287
341
  role: "tabpanel"
288
- }, nt = {
342
+ }, it = {
289
343
  key: 0,
290
344
  class: "ca-auth__footer"
291
- }, rt = {
345
+ }, at = {
292
346
  key: 0,
293
347
  class: "ca-auth__version"
294
- }, it = /*@__PURE__*/ d({
348
+ }, ot = /*@__PURE__*/ d({
295
349
  __name: "AuthShell",
296
350
  props: {
297
351
  tabs: {},
@@ -300,13 +354,13 @@ var Ue = {
300
354
  },
301
355
  emits: ["update:active"],
302
356
  setup(t, { emit: r }) {
303
- let c = t, u = r, { t: d, label: f } = W(), p = K().brand, m = q(), _ = ze(), v = n(() => f(_.theme.siteName ?? p.name)), b = n(() => _.theme.logo ?? p.logo), x = n(() => m.panel?.logo ?? b.value), w = n(() => m.panel?.qrcode), T = n(() => {
357
+ let c = t, u = r, { t: d, label: f } = G(), p = K().brand, m = J(), _ = Ve(), v = n(() => f(_.theme.siteName ?? p.name)), b = n(() => _.theme.logo ?? p.logo), x = n(() => m.panel?.logo ?? b.value), w = n(() => m.panel?.qrcode), T = n(() => {
304
358
  let e = m.panel?.caption ?? p.subtitle;
305
359
  return e ? f(e) : "";
306
360
  }), O = n(() => m.panel?.title ? f(m.panel.title) : ""), k = n(() => m.panel?.background), A = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 ? `${e}px` : typeof e == "string" && /^[\d.]+(px|rem|em|%)$/.test(e) ? e : void 0, j = n(() => {
307
361
  let e = m.card, t = {}, n = A(e?.width), r = A(e?.minHeight), i = A(e?.panelWidth), a = A(e?.radius);
308
362
  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;
309
- }), N = n(() => m.background ?? "var(--ca-login-bg)"), P = n(() => m.footer ? m.footer.map((e) => Be(f(e))) : p.copyright ? Be(f(p.copyright)).split("\n").filter(Boolean) : []);
363
+ }), N = n(() => m.background ?? "var(--ca-login-bg)"), P = n(() => m.footer ? m.footer.map((e) => He(f(e))) : p.copyright ? He(f(p.copyright)).split("\n").filter(Boolean) : []);
310
364
  function F(e, t) {
311
365
  if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") return;
312
366
  let n = (t + (e.key === "ArrowRight" ? 1 : -1) + c.tabs.length) % c.tabs.length, r = c.tabs[n];
@@ -322,24 +376,24 @@ var Ue = {
322
376
  class: "ca-auth__panel",
323
377
  style: g(k.value ? { background: k.value } : void 0)
324
378
  }, [
325
- O.value && w.value ? (y(), o("h2", Ue, E(O.value), 1)) : a("v-if", !0),
379
+ O.value && w.value ? (y(), o("h2", Ge, E(O.value), 1)) : a("v-if", !0),
326
380
  x.value ? (y(), o("img", {
327
381
  key: 1,
328
382
  src: x.value,
329
383
  alt: "",
330
384
  class: "ca-auth__logo"
331
- }, null, 8, We)) : a("v-if", !0),
332
- w.value ? (y(), o(e, { key: 2 }, [s("div", Ge, [s("img", {
385
+ }, null, 8, Ke)) : a("v-if", !0),
386
+ w.value ? (y(), o(e, { key: 2 }, [s("div", qe, [s("img", {
333
387
  src: w.value,
334
388
  alt: D(d)("campus.auth.qrcodeAlt")
335
- }, null, 8, Ke)]), T.value ? (y(), o("p", qe, E(T.value), 1)) : a("v-if", !0)], 64)) : (y(), o(e, { key: 3 }, [s("h2", Je, E(O.value || v.value), 1), T.value ? (y(), o("p", Ye, E(T.value), 1)) : a("v-if", !0)], 64))
336
- ], 4), s("section", Xe, [
337
- s("div", Ze, [b.value ? (y(), o("img", {
389
+ }, null, 8, Je)]), T.value ? (y(), o("p", Ye, E(T.value), 1)) : a("v-if", !0)], 64)) : (y(), o(e, { key: 3 }, [s("h2", Xe, E(O.value || v.value), 1), T.value ? (y(), o("p", Ze, E(T.value), 1)) : a("v-if", !0)], 64))
390
+ ], 4), s("section", Qe, [
391
+ s("div", $e, [b.value ? (y(), o("img", {
338
392
  key: 0,
339
393
  src: b.value,
340
394
  alt: ""
341
- }, null, 8, Qe)) : a("v-if", !0), s("span", null, E(v.value), 1)]),
342
- s("div", $e, [(y(!0), o(e, null, S(t.tabs, (n, r) => (y(), o(e, { key: n.key }, [n.to && !t.preview ? (y(), i(D(B), {
395
+ }, null, 8, et)) : a("v-if", !0), s("span", null, E(v.value), 1)]),
396
+ s("div", tt, [(y(!0), o(e, null, S(t.tabs, (n, r) => (y(), o(e, { key: n.key }, [n.to && !t.preview ? (y(), i(D(B), {
343
397
  key: 0,
344
398
  to: n.to,
345
399
  role: "tab",
@@ -358,79 +412,155 @@ var Ue = {
358
412
  tabindex: n.key === t.active ? 0 : -1,
359
413
  onClick: (e) => n.to ? void 0 : u("update:active", n.key),
360
414
  onKeydown: (e) => F(e, r)
361
- }, E(n.label), 43, et))], 64))), 128))]),
362
- s("div", tt, [C(n.$slots, "default", {}, void 0, !0)]),
363
- P.value.length ? (y(), o("div", nt, [(y(!0), o(e, null, S(P.value, (e) => (y(), o("p", { key: e }, E(e), 1))), 128))])) : a("v-if", !0)
364
- ])], 4), D(m).version ? (y(), o("span", rt, E(D(m).version), 1)) : a("v-if", !0)], 4)], 2));
415
+ }, E(n.label), 43, nt))], 64))), 128))]),
416
+ s("div", rt, [C(n.$slots, "default", {}, void 0, !0)]),
417
+ P.value.length ? (y(), o("div", it, [(y(!0), o(e, null, S(P.value, (e) => (y(), o("p", { key: e }, E(e), 1))), 128))])) : a("v-if", !0)
418
+ ])], 4), D(m).version ? (y(), o("span", at, E(D(m).version), 1)) : a("v-if", !0)], 4)], 2));
365
419
  }
366
- }), Y = (e, t) => {
420
+ }), X = (e, t) => {
367
421
  let n = e.__vccOpts || e;
368
422
  for (let [e, r] of t) n[e] = r;
369
423
  return n;
370
- }, at = /*#__PURE__*/ Y(it, [["__scopeId", "data-v-df817220"]]), X = I("campus-layout", () => {
371
- let e = x(!1), t = x("desktop"), n = x(!1), r = x(!1);
372
- function i() {
373
- e.value = !e.value;
424
+ }, st = /*#__PURE__*/ X(ot, [["__scopeId", "data-v-df817220"]]), ct = "side-collapsed", Z = I("campus-layout", () => {
425
+ let e = x(!1), t = x("desktop"), r = x(!1), i = x(!1), a = x(U(ct) === "1"), o = x(null), s = n(() => o.value ?? a.value), c = x(!1), l = n(() => c.value && t.value === "desktop");
426
+ function u() {
427
+ o.value === null ? (a.value = !a.value, W(ct, a.value ? "1" : "0")) : o.value = !o.value;
374
428
  }
375
- function a(e) {
376
- t.value = e, e !== "phone" && (n.value = !1), e !== "pad" && (r.value = !1);
429
+ function d() {
430
+ c.value = !1, o.value = null;
377
431
  }
378
- function o() {
379
- n.value = !1;
432
+ function f(e = "none") {
433
+ o.value = e === "panel" || null, c.value = e === "all";
380
434
  }
381
- function s() {
382
- n.value = !0;
435
+ let p = "normal", m = null, h = !1, g, _ = !1, v = !1, y = !1, b = x(!1);
436
+ function S() {
437
+ m !== null && (e.value = m);
383
438
  }
384
- function c() {
439
+ function C() {
440
+ h && document.fullscreenElement === document.documentElement && (h = !1, document.exitFullscreen().catch(() => {
441
+ h = document.fullscreenElement === document.documentElement;
442
+ }).finally(() => {
443
+ p === "screen" && !document.fullscreenElement && (v = !0, w());
444
+ }));
445
+ }
446
+ function w() {
447
+ _ || (p === "screen" ? y || (v || !document.fullscreenElement ? (e.value = !0, b.value = !0) : (S(), b.value = !1)) : C());
448
+ }
449
+ function T() {
450
+ if (_ = !0, document.fullscreenElement) v = !1;
451
+ else if (!g) {
452
+ v = !1;
453
+ try {
454
+ g = document.documentElement.requestFullscreen().then(() => {
455
+ v = !1, h = document.fullscreenElement === document.documentElement;
456
+ }, () => {
457
+ v = !0;
458
+ }).finally(() => {
459
+ g = void 0, w();
460
+ });
461
+ } catch {
462
+ v = !0;
463
+ }
464
+ }
465
+ }
466
+ function E() {
467
+ _ = !1, p !== "screen" && C();
468
+ }
469
+ function D(t, n) {
470
+ p = t ?? "normal", y = !1, b.value = !1, f(t == null ? n : t === "collapsePanel" ? "panel" : t === "collapseAll" ? "all" : "none");
471
+ let r = p === "content" || p === "screen";
472
+ r && m === null && (m = e.value), r || (S(), m = null), p === "content" && (e.value = !0), p === "screen" && !_ && T(), _ = !1, p === "screen" ? w() : C();
473
+ }
474
+ function O() {
475
+ y = !0, h = !1, b.value = !1;
476
+ }
477
+ function k() {
478
+ h && document.fullscreenElement !== document.documentElement && (h = !1, y = !0, b.value = !1);
479
+ }
480
+ function A() {
481
+ y = !1, T(), _ = !1, g || w();
482
+ }
483
+ function j() {
484
+ b.value = !1;
485
+ }
486
+ function M() {
487
+ y = !0, b.value = !1, e.value = !e.value;
488
+ }
489
+ function N(e) {
490
+ t.value = e, e !== "phone" && (r.value = !1), e !== "pad" && (i.value = !1);
491
+ }
492
+ function P() {
385
493
  r.value = !1;
386
494
  }
387
- function l() {
495
+ function F() {
388
496
  r.value = !0;
389
497
  }
390
- function u() {
391
- n.value = !1, r.value = !1;
498
+ function I() {
499
+ i.value = !1;
392
500
  }
393
- function d() {
394
- e.value = !1, u();
501
+ function L() {
502
+ i.value = !0;
503
+ }
504
+ function R() {
505
+ r.value = !1, i.value = !1;
506
+ }
507
+ function ee() {
508
+ D("normal"), e.value = !1, f("none"), R();
395
509
  }
396
510
  return {
397
- reset: d,
511
+ reset: ee,
512
+ pageScreenPrompt: b,
513
+ preparePageScreen: T,
514
+ cancelPageScreen: E,
515
+ applyPageOpenMode: D,
516
+ pageScreenManual: O,
517
+ syncPageScreen: k,
518
+ retryPageScreen: A,
519
+ dismissPageScreenPrompt: j,
398
520
  contentFullscreen: e,
399
521
  mode: t,
400
- mobileMenuOpen: n,
401
- padPanelOpen: r,
402
- toggleContentFullscreen: i,
403
- setMode: a,
404
- closeMobileMenu: o,
405
- openMobileMenu: s,
406
- closePadPanel: c,
407
- openPadPanel: l,
408
- closeOverlays: u
522
+ mobileMenuOpen: r,
523
+ padPanelOpen: i,
524
+ sidePanelSaved: a,
525
+ sidePanelTemp: o,
526
+ sidePanelCollapsed: s,
527
+ sideHidden: c,
528
+ sideHiddenActive: l,
529
+ toggleSidePanel: u,
530
+ showSide: d,
531
+ applySideCollapse: f,
532
+ toggleContentFullscreen: M,
533
+ setMode: N,
534
+ closeMobileMenu: P,
535
+ openMobileMenu: F,
536
+ closePadPanel: I,
537
+ openPadPanel: L,
538
+ closeOverlays: R
409
539
  };
410
540
  });
411
541
  // packages/core/src/tabs-policy.ts
412
- function ot(e, t, n = Date.now()) {
542
+ function lt(e, t, n = Date.now()) {
413
543
  return {
414
544
  ...e,
415
545
  [t]: Math.max(n, ...Object.values(e).map((e) => e + 1))
416
546
  };
417
547
  }
418
- function st(e, t, n, r, i) {
548
+ function ut(e, t, n, r, i) {
419
549
  let a = e.filter((e) => !r.includes(e));
420
550
  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);
421
551
  }
422
552
  // packages/core/src/stores/tabs.ts
423
- var ct = "tabs", Z = I("campus-tabs", () => {
424
- let e = je(K().menus), t = new Set(e.map((e) => e.key)), r = e.filter((e) => e.affix).map((e) => e.key), i = _e(ct, "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 = K().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))));
553
+ var dt = "tabs", ft = I("campus-tabs", () => {
554
+ let e = Me(K().menus), t = new Set(e.map((e) => e.key)), r = e.filter((e) => e.affix).map((e) => e.key), i = ge(dt, "session"), a = !Array.isArray(i) && Array.isArray(i?.affix) ? i.affix : [], o = x(a.filter((e) => t.has(e) && !r.includes(e))), s = n(() => [...r, ...o.value]), c = K().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))));
425
555
  for (let [e, t] of d.value.entries()) Number.isFinite(p.value[t]) || (p.value[t] = e + 1);
426
556
  for (;;) {
427
- let e = st(d.value, p.value, "", s.value, l);
557
+ let e = ut(d.value, p.value, "", s.value, l);
428
558
  if (!e) break;
429
559
  d.value.splice(d.value.indexOf(e), 1), delete p.value[e];
430
560
  }
431
561
  let h = x({}), g = x(null), _ = n(() => d.value.filter((e) => e !== g.value));
432
562
  function v() {
433
- p.value = Object.fromEntries(d.value.map((e) => [e, p.value[e] ?? 0])), ve(ct, {
563
+ p.value = Object.fromEntries(d.value.map((e) => [e, p.value[e] ?? 0])), _e(dt, {
434
564
  visited: d.value,
435
565
  active: p.value,
436
566
  affix: o.value
@@ -438,8 +568,8 @@ var ct = "tabs", Z = I("campus-tabs", () => {
438
568
  }
439
569
  function y(e) {
440
570
  if (!t.has(e)) return;
441
- d.value.includes(e) || d.value.push(e), p.value = ot(p.value, e);
442
- let n = st(d.value, p.value, e, s.value, l);
571
+ d.value.includes(e) || d.value.push(e), p.value = lt(p.value, e);
572
+ let n = ut(d.value, p.value, e, s.value, l);
443
573
  n && d.value.splice(d.value.indexOf(n), 1), v();
444
574
  }
445
575
  function b(e) {
@@ -487,8 +617,8 @@ var ct = "tabs", Z = I("campus-tabs", () => {
487
617
  refresh: E,
488
618
  setAffix: D
489
619
  };
490
- }), lt = "session", Q = I("campus-session", () => {
491
- let e = _e(lt, "session"), t = x(e?.token ?? ""), r = x(e?.user), i = n(() => !!(t.value && r.value));
620
+ }), pt = "session", Q = I("campus-session", () => {
621
+ let e = ge(pt, "session"), t = x(e?.token ?? ""), r = x(e?.user), i = n(() => !!(t.value && r.value));
492
622
  function a(e) {
493
623
  if (!e) return !0;
494
624
  let t = r.value?.permissions;
@@ -498,7 +628,7 @@ var ct = "tabs", Z = I("campus-tabs", () => {
498
628
  r.value && (r.value = {
499
629
  ...r.value,
500
630
  permissions: e
501
- }, ve(lt, {
631
+ }, _e(pt, {
502
632
  token: t.value,
503
633
  user: r.value
504
634
  }, "session"));
@@ -507,7 +637,7 @@ var ct = "tabs", Z = I("campus-tabs", () => {
507
637
  c(await K().auth.login(e));
508
638
  }
509
639
  function c(e) {
510
- t.value = e.token, r.value = e.user, ve(lt, e, "session");
640
+ t.value = e.token, r.value = e.user, _e(pt, e, "session");
511
641
  }
512
642
  async function l() {
513
643
  try {
@@ -515,11 +645,11 @@ var ct = "tabs", Z = I("campus-tabs", () => {
515
645
  } catch (e) {
516
646
  console.warn("[campus] 退出时通知服务端失败,已清除本地登录态:", e);
517
647
  } finally {
518
- t.value = "", r.value = void 0, U(lt, null, "session"), Z().reset(), X().reset();
648
+ t.value = "", r.value = void 0, W(pt, null, "session"), ft().reset(), Z().reset();
519
649
  }
520
650
  }
521
651
  function u() {
522
- t.value = "", r.value = void 0, U(lt, null, "session"), Z().reset(), X().reset();
652
+ t.value = "", r.value = void 0, W(pt, null, "session"), ft().reset(), Z().reset();
523
653
  }
524
654
  return {
525
655
  token: t,
@@ -532,7 +662,7 @@ var ct = "tabs", Z = I("campus-tabs", () => {
532
662
  logout: l,
533
663
  expire: u
534
664
  };
535
- }), ut = {
665
+ }), mt = {
536
666
  class: "ca-auth-icon",
537
667
  viewBox: "0 0 24 24",
538
668
  width: "16",
@@ -543,7 +673,7 @@ var ct = "tabs", Z = I("campus-tabs", () => {
543
673
  "stroke-linecap": "round",
544
674
  "stroke-linejoin": "round",
545
675
  "aria-hidden": "true"
546
- }, dt = ["d"], $ = /* @__PURE__ */ d({
676
+ }, ht = ["d"], $ = /* @__PURE__ */ d({
547
677
  __name: "AuthIcon",
548
678
  props: { name: {} },
549
679
  setup(e) {
@@ -554,13 +684,13 @@ var ct = "tabs", Z = I("campus-tabs", () => {
554
684
  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",
555
685
  message: "M4 5h16v11H9l-4 3.500V16H4z"
556
686
  };
557
- return (n, r) => (y(), o("svg", ut, [s("path", { d: t[e.name] }, null, 8, dt)]));
687
+ return (n, r) => (y(), o("svg", mt, [s("path", { d: t[e.name] }, null, 8, ht)]));
558
688
  }
559
- }), ft = { class: "ca-auth-row" }, pt = [
689
+ }), gt = { class: "ca-auth-row" }, _t = [
560
690
  "title",
561
691
  "aria-label",
562
692
  "disabled"
563
- ], mt = ["src"], ht = { key: 1 }, gt = /* @__PURE__ */ d({
693
+ ], vt = ["src"], yt = { key: 1 }, bt = /* @__PURE__ */ d({
564
694
  __name: "CaptchaField",
565
695
  props: /*@__PURE__*/ p({ scene: {} }, {
566
696
  code: { default: "" },
@@ -570,7 +700,7 @@ var ct = "tabs", Z = I("campus-tabs", () => {
570
700
  }),
571
701
  emits: ["update:code", "update:captchaKey"],
572
702
  setup(e, { expose: t }) {
573
- let n = e, r = O(e, "code"), i = O(e, "captchaKey"), { t: c, label: l } = W(), d = q().fields?.captcha, f = x(""), p = x(!1), m = x(!1);
703
+ let n = e, r = O(e, "code"), i = O(e, "captchaKey"), { t: c, label: l } = G(), d = J().fields?.captcha, f = x(""), p = x(!1), m = x(!1);
574
704
  async function h() {
575
705
  m.value = !0;
576
706
  try {
@@ -584,7 +714,7 @@ var ct = "tabs", Z = I("campus-tabs", () => {
584
714
  }
585
715
  return v(h), t({ refresh: h }), (e, t) => {
586
716
  let n = w("ca-input");
587
- return y(), o("div", ft, [u(n, {
717
+ return y(), o("div", gt, [u(n, {
588
718
  modelValue: r.value,
589
719
  "onUpdate:modelValue": t[0] ||= (e) => r.value = e,
590
720
  placeholder: D(d)?.placeholder ? D(l)(D(d).placeholder) : D(c)("campus.auth.captchaPlaceholder"),
@@ -610,17 +740,17 @@ var ct = "tabs", Z = I("campus-tabs", () => {
610
740
  key: 0,
611
741
  src: f.value,
612
742
  alt: ""
613
- }, null, 8, mt)) : p.value ? (y(), o("span", ht, E(D(c)("campus.auth.captchaFailed")), 1)) : a("v-if", !0)], 8, pt)]);
743
+ }, null, 8, vt)) : p.value ? (y(), o("span", yt, E(D(c)("campus.auth.captchaFailed")), 1)) : a("v-if", !0)], 8, _t)]);
614
744
  };
615
745
  }
616
- }), _t = {
746
+ }), xt = {
617
747
  key: 1,
618
748
  class: "ca-auth-links"
619
- }, vt = { class: "ca-auth-help" }, yt = /* @__PURE__ */ d({
749
+ }, St = { class: "ca-auth-help" }, Ct = /* @__PURE__ */ d({
620
750
  __name: "LoginForm",
621
751
  props: { preview: { type: Boolean } },
622
752
  setup(t) {
623
- let r = t, c = V(), d = H(), f = Q(), { t: p, label: m } = W(), h = J(), g = q(), _ = g.fields ?? {}, v = b({
753
+ let r = t, c = V(), d = H(), f = Q(), { t: p, label: m } = G(), h = Y(), g = J(), _ = g.fields ?? {}, v = b({
624
754
  username: "",
625
755
  password: "",
626
756
  captcha: ""
@@ -666,7 +796,7 @@ var ct = "tabs", Z = I("campus-tabs", () => {
666
796
  key: C.value,
667
797
  code: v.captcha
668
798
  } : void 0
669
- }), await d.replace(He(c.query.redirect));
799
+ }), await d.replace(We(c.query.redirect));
670
800
  } catch (e) {
671
801
  A.value = e instanceof Error && e.message ? e.message : p("campus.login.failed"), T.value?.refresh();
672
802
  } finally {
@@ -746,7 +876,7 @@ var ct = "tabs", Z = I("campus-tabs", () => {
746
876
  key: 0,
747
877
  prop: "captcha"
748
878
  }, {
749
- default: M(() => [u(gt, {
879
+ default: M(() => [u(bt, {
750
880
  ref_key: "captchaRef",
751
881
  ref: T,
752
882
  code: v.captcha,
@@ -770,35 +900,35 @@ var ct = "tabs", Z = I("campus-tabs", () => {
770
900
  ]),
771
901
  _: 1
772
902
  }, 8, ["model", "rules"]),
773
- ee.value ? (y(), o("div", _t, [D(h).forgot ? (y(), i(D(B), {
903
+ ee.value ? (y(), o("div", xt, [D(h).forgot ? (y(), i(D(B), {
774
904
  key: 0,
775
- to: "/forgot",
905
+ to: { name: D(q)(D(K)()).forgot },
776
906
  onClick: R
777
907
  }, {
778
908
  default: M(() => [l(E(D(p)("campus.auth.forgotLink")), 1)]),
779
909
  _: 1
780
- })) : a("v-if", !0), D(h).register ? (y(), i(D(B), {
910
+ }, 8, ["to"])) : a("v-if", !0), D(h).register ? (y(), i(D(B), {
781
911
  key: 1,
782
- to: "/register",
912
+ to: { name: D(q)(D(K)()).register },
783
913
  onClick: R
784
914
  }, {
785
915
  default: M(() => [l(E(D(p)("campus.auth.registerLink")), 1)]),
786
916
  _: 1
787
- })) : a("v-if", !0)])) : a("v-if", !0),
788
- s("div", vt, [s("h3", null, E(D(p)("campus.auth.helpTitle")), 1), s("ol", null, [(y(!0), o(e, null, S(F.value, (t, n) => (y(), o("li", { key: n }, [(y(!0), o(e, null, S(t, (t, n) => (y(), o(e, { key: n }, [t === null ? D(h).forgot ? (y(), i(D(B), {
917
+ }, 8, ["to"])) : a("v-if", !0)])) : a("v-if", !0),
918
+ s("div", St, [s("h3", null, E(D(p)("campus.auth.helpTitle")), 1), s("ol", null, [(y(!0), o(e, null, S(F.value, (t, n) => (y(), o("li", { key: n }, [(y(!0), o(e, null, S(t, (t, n) => (y(), o(e, { key: n }, [t === null ? D(h).forgot ? (y(), i(D(B), {
789
919
  key: 1,
790
- to: "/forgot",
920
+ to: { name: D(q)(D(K)()).forgot },
791
921
  onClick: R
792
922
  }, {
793
923
  default: M(() => [l(E(D(p)("campus.auth.findPassword")), 1)]),
794
924
  _: 1
795
- })) : (y(), o(e, { key: 2 }, [l(E(D(p)("campus.auth.findPassword")), 1)], 64)) : (y(), o(e, { key: 0 }, [l(E(t), 1)], 64))], 64))), 128))]))), 128))])])
925
+ }, 8, ["to"])) : (y(), o(e, { key: 2 }, [l(E(D(p)("campus.auth.findPassword")), 1)], 64)) : (y(), o(e, { key: 0 }, [l(E(t), 1)], 64))], 64))), 128))]))), 128))])])
796
926
  ], 64);
797
927
  };
798
928
  }
799
929
  });
800
930
  // packages/core/src/pages/auth/wechat-host.ts
801
- function bt(e, t) {
931
+ function wt(e, t) {
802
932
  let n, r = !1, i = () => {
803
933
  if (!r) {
804
934
  r = !0;
@@ -825,75 +955,75 @@ function bt(e, t) {
825
955
  };
826
956
  }
827
957
  // packages/core/src/pages/auth/WechatPane.vue?vue&type=script&setup=true&lang.ts
828
- var xt = {
958
+ var Tt = {
829
959
  key: 0,
830
960
  class: "ca-auth-wechat"
831
- }, St = {
961
+ }, Et = {
832
962
  key: 0,
833
963
  class: "ca-auth-wechat__failed",
834
964
  role: "alert"
835
- }, Ct = {
965
+ }, Dt = {
836
966
  key: 1,
837
967
  class: "ca-auth-wechat"
838
- }, wt = { class: "ca-auth-wechat__code" }, Tt = ["src", "alt"], Et = ["aria-label"], Dt = { class: "ca-auth-wechat__hint" }, Ot = {
968
+ }, Ot = { class: "ca-auth-wechat__code" }, kt = ["src", "alt"], At = ["aria-label"], jt = { class: "ca-auth-wechat__hint" }, Mt = {
839
969
  key: 0,
840
970
  class: "ca-auth-wechat__note"
841
- }, kt = /* @__PURE__ */ d({
971
+ }, Nt = /* @__PURE__ */ d({
842
972
  __name: "WechatPane",
843
973
  props: { preview: { type: Boolean } },
844
974
  setup(e) {
845
- let t = e, { t: r } = W(), i = n(() => q().panel?.qrcode), d = !t.preview && J().wechat, f = x(), p = x(!1), h;
975
+ let t = e, { t: r } = G(), i = n(() => J().panel?.qrcode), d = !t.preview && Y().wechat, f = x(), p = x(!1), h;
846
976
  function g() {
847
977
  h?.release(), h = void 0;
848
978
  }
849
979
  async function b() {
850
- g(), p.value = !1, await m(), f.value && (h = bt(K().auth.wechat.mount, f.value), p.value = !h.ok);
980
+ g(), p.value = !1, await m(), f.value && (h = wt(K().auth.wechat.mount, f.value), p.value = !h.ok);
851
981
  }
852
982
  return v(() => {
853
983
  d && b();
854
984
  }), _(g), (e, t) => {
855
985
  let n = w("ca-button");
856
- return D(d) ? (y(), o("div", xt, [N(s("div", {
986
+ return D(d) ? (y(), o("div", Tt, [N(s("div", {
857
987
  ref_key: "host",
858
988
  ref: f,
859
989
  class: "ca-auth-wechat__host"
860
- }, null, 512), [[k, !p.value]]), p.value ? (y(), o("div", St, [s("p", null, E(D(r)("campus.auth.wechatMountFailed")), 1), u(n, { onClick: b }, {
990
+ }, null, 512), [[k, !p.value]]), p.value ? (y(), o("div", Et, [s("p", null, E(D(r)("campus.auth.wechatMountFailed")), 1), u(n, { onClick: b }, {
861
991
  default: M(() => [l(E(D(r)("campus.auth.wechatRetry")), 1)]),
862
992
  _: 1
863
- })])) : a("v-if", !0)])) : (y(), o("div", Ct, [
864
- s("div", wt, [i.value ? (y(), o("img", {
993
+ })])) : a("v-if", !0)])) : (y(), o("div", Dt, [
994
+ s("div", Ot, [i.value ? (y(), o("img", {
865
995
  key: 0,
866
996
  src: i.value,
867
997
  alt: D(r)("campus.auth.qrcodeAlt")
868
- }, null, 8, Tt)) : (y(), o("svg", {
998
+ }, null, 8, kt)) : (y(), o("svg", {
869
999
  key: 1,
870
1000
  viewBox: "0 0 100 100",
871
1001
  role: "img",
872
1002
  "aria-label": D(r)("campus.auth.qrcodeAlt")
873
- }, [...t[0] ||= [c("<rect x=\"8\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"66\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"8\" y=\"66\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"16\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"74\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"16\" y=\"74\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><path d=\"M44 10h8v10h-8zM44 28h16v8H44zM10 44h10v8H10zM28 44h16v10H28zM52 46h10v10H52zM70 44h22v8H70zM44 62h8v14h-8zM58 66h14v8H58zM78 62h14v14H78zM56 82h14v10H56z\" fill=\"currentColor\"></path>", 7)]], 8, Et))]),
874
- s("p", Dt, E(D(r)("campus.auth.wechatHint")), 1),
875
- i.value ? a("v-if", !0) : (y(), o("p", Ot, E(D(r)("campus.auth.wechatNote")), 1))
1003
+ }, [...t[0] ||= [c("<rect x=\"8\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"66\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"8\" y=\"66\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"16\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"74\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"16\" y=\"74\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><path d=\"M44 10h8v10h-8zM44 28h16v8H44zM10 44h10v8H10zM28 44h16v10H28zM52 46h10v10H52zM70 44h22v8H70zM44 62h8v14h-8zM58 66h14v8H58zM78 62h14v14H78zM56 82h14v10H56z\" fill=\"currentColor\"></path>", 7)]], 8, At))]),
1004
+ s("p", jt, E(D(r)("campus.auth.wechatHint")), 1),
1005
+ i.value ? a("v-if", !0) : (y(), o("p", Mt, E(D(r)("campus.auth.wechatNote")), 1))
876
1006
  ]));
877
1007
  };
878
1008
  }
879
- }), At = /* @__PURE__ */ d({
1009
+ }), Pt = /* @__PURE__ */ d({
880
1010
  __name: "LoginSplit",
881
1011
  props: { preview: { type: Boolean } },
882
1012
  setup(e) {
883
- let { t } = W(), r = q().tabs?.length ? q().tabs : ["account", "wechat"], a = x(r[0]), o = n(() => r.map((e) => ({
1013
+ let { t } = G(), r = J().tabs?.length ? J().tabs : ["account", "wechat"], a = x(r[0]), o = n(() => r.map((e) => ({
884
1014
  key: e,
885
1015
  label: t(e === "account" ? "campus.auth.tabAccount" : "campus.auth.tabWechat")
886
1016
  })));
887
- return (t, n) => (y(), i(at, {
1017
+ return (t, n) => (y(), i(st, {
888
1018
  active: a.value,
889
1019
  "onUpdate:active": n[0] ||= (e) => a.value = e,
890
1020
  tabs: o.value,
891
1021
  preview: e.preview
892
1022
  }, {
893
- default: M(() => [a.value === "account" ? (y(), i(yt, {
1023
+ default: M(() => [a.value === "account" ? (y(), i(Ct, {
894
1024
  key: 0,
895
1025
  preview: e.preview
896
- }, null, 8, ["preview"])) : (y(), i(kt, { key: 1 }))]),
1026
+ }, null, 8, ["preview"])) : (y(), i(Nt, { key: 1 }))]),
897
1027
  _: 1
898
1028
  }, 8, [
899
1029
  "active",
@@ -903,39 +1033,39 @@ var xt = {
903
1033
  }
904
1034
  });
905
1035
  // packages/core/src/security.ts
906
- function jt(e) {
1036
+ function Ft(e) {
907
1037
  return e.environment ? e.environment : "production";
908
1038
  }
909
- function Mt(e) {
910
- if (jt(e) === "production" && typeof e.auth.captcha != "function") throw Error("[campus] 生产环境必须在 auth 中提供 captcha()(图形验证码);测试环境可设置 environment: 'test' 跳过");
1039
+ function It(e) {
1040
+ if (Ft(e) === "production" && typeof e.auth.captcha != "function") throw Error("[campus] 生产环境必须在 auth 中提供 captcha()(图形验证码);测试环境可设置 environment: 'test' 跳过");
911
1041
  }
912
- function Nt(e, t) {
1042
+ function Lt(e, t) {
913
1043
  return t === "test" || e.length >= 8 && /[A-Za-z]/.test(e) && /\d/.test(e);
914
1044
  }
915
1045
  // packages/core/src/services/feedback.ts
916
- var Pt = (e) => e;
917
- function Ft(e) {
918
- Pt = e;
1046
+ var Rt = (e) => e;
1047
+ function zt(e) {
1048
+ Rt = e;
919
1049
  }
920
- async function It(e, t = {}) {
921
- await pe.alert(e, t.title ?? Pt("campus.common.tip"), {
1050
+ async function Bt(e, t = {}) {
1051
+ await pe.alert(e, t.title ?? Rt("campus.common.tip"), {
922
1052
  type: t.type ?? "info",
923
- confirmButtonText: t.confirmText ?? Pt("campus.common.ok")
1053
+ confirmButtonText: t.confirmText ?? Rt("campus.common.ok")
924
1054
  });
925
1055
  }
926
- async function Lt(e, t = {}) {
1056
+ async function Vt(e, t = {}) {
927
1057
  try {
928
- return await pe.confirm(e, t.title ?? Pt("campus.common.tip"), {
1058
+ return await pe.confirm(e, t.title ?? Rt("campus.common.tip"), {
929
1059
  type: t.type ?? "warning",
930
- confirmButtonText: t.confirmText ?? Pt("campus.common.confirm"),
931
- cancelButtonText: t.cancelText ?? Pt("campus.common.cancel")
1060
+ confirmButtonText: t.confirmText ?? Rt("campus.common.confirm"),
1061
+ cancelButtonText: t.cancelText ?? Rt("campus.common.cancel")
932
1062
  }), !0;
933
1063
  } catch (e) {
934
1064
  if (e === "cancel" || e === "close") return !1;
935
1065
  throw e;
936
1066
  }
937
1067
  }
938
- var Rt = {
1068
+ var Ht = {
939
1069
  info: (e) => void fe({
940
1070
  message: e,
941
1071
  type: "info"
@@ -952,29 +1082,29 @@ var Rt = {
952
1082
  message: e,
953
1083
  type: "error"
954
1084
  })
955
- }, zt = de.service;
956
- function Bt(e, t, n = {}) {
1085
+ }, Ut = de.service;
1086
+ function Wt(e, t, n = {}) {
957
1087
  let r = me({
958
1088
  ...n,
959
- title: n.title ?? Pt(`campus.notify.${e}`),
1089
+ title: n.title ?? Rt(`campus.notify.${e}`),
960
1090
  message: t,
961
1091
  type: e
962
1092
  });
963
1093
  return m(() => me.updateOffsets(n.position)), r;
964
1094
  }
965
1095
  // packages/core/src/services/ca.ts
966
- var Vt = {
967
- alert: It,
968
- confirm: Lt,
969
- toast: Rt,
970
- loading: zt,
1096
+ var Gt = {
1097
+ alert: Bt,
1098
+ confirm: Vt,
1099
+ toast: Ht,
1100
+ loading: Ut,
971
1101
  notify: {
972
- success: (e, t) => Bt("success", e, t),
973
- info: (e, t) => Bt("info", e, t),
974
- warning: (e, t) => Bt("warning", e, t),
975
- error: (e, t) => Bt("error", e, t)
1102
+ success: (e, t) => Wt("success", e, t),
1103
+ info: (e, t) => Wt("info", e, t),
1104
+ warning: (e, t) => Wt("warning", e, t),
1105
+ error: (e, t) => Wt("error", e, t)
976
1106
  }
977
- }, Ht = { class: "ca-auth-row" }, Ut = ["disabled"], Wt = 60, Gt = /* @__PURE__ */ d({
1107
+ }, Kt = { class: "ca-auth-row" }, qt = ["disabled"], Jt = 60, Yt = /* @__PURE__ */ d({
978
1108
  __name: "SmsField",
979
1109
  props: /*@__PURE__*/ p({ send: { type: Function } }, {
980
1110
  modelValue: { default: "" },
@@ -982,7 +1112,7 @@ var Vt = {
982
1112
  }),
983
1113
  emits: ["update:modelValue"],
984
1114
  setup(e) {
985
- let t = e, n = O(e, "modelValue"), { t: r } = W(), i = x(0), a = x(!1), c;
1115
+ let t = e, n = O(e, "modelValue"), { t: r } = G(), i = x(0), a = x(!1), c;
986
1116
  function l() {
987
1117
  c && clearInterval(c), c = void 0;
988
1118
  }
@@ -996,14 +1126,14 @@ var Vt = {
996
1126
  } finally {
997
1127
  a.value = !1;
998
1128
  }
999
- i.value = Wt, l(), c = setInterval(() => {
1129
+ i.value = Jt, l(), c = setInterval(() => {
1000
1130
  --i.value, i.value <= 0 && l();
1001
1131
  }, 1e3);
1002
1132
  }
1003
1133
  }
1004
1134
  return _(l), (e, t) => {
1005
1135
  let c = w("ca-input");
1006
- return y(), o("div", Ht, [u(c, {
1136
+ return y(), o("div", Kt, [u(c, {
1007
1137
  modelValue: n.value,
1008
1138
  "onUpdate:modelValue": t[0] ||= (e) => n.value = e,
1009
1139
  placeholder: D(r)("campus.auth.smsPlaceholder"),
@@ -1022,17 +1152,17 @@ var Vt = {
1022
1152
  class: "ca-auth-sms",
1023
1153
  disabled: i.value > 0 || a.value,
1024
1154
  onClick: d
1025
- }, E(i.value > 0 ? D(r)("campus.auth.resend", { n: i.value }) : D(r)("campus.auth.getCode")), 9, Ut)]);
1155
+ }, E(i.value > 0 ? D(r)("campus.auth.resend", { n: i.value }) : D(r)("campus.auth.getCode")), 9, qt)]);
1026
1156
  };
1027
1157
  }
1028
- }), Kt = {
1158
+ }), Xt = {
1029
1159
  key: 0,
1030
1160
  class: "ca-auth-hint"
1031
- }, qt = { class: "ca-auth-agreements" }, Jt = ["href"], Yt = /* @__PURE__ */ d({
1161
+ }, Zt = { class: "ca-auth-agreements" }, Qt = ["href"], $t = /* @__PURE__ */ d({
1032
1162
  __name: "RegisterForm",
1033
1163
  props: { preview: { type: Boolean } },
1034
1164
  setup(t) {
1035
- let r = t, c = H(), { t: d, label: f } = W(), p = J(), m = jt(K()), g = q(), _ = g.agreements ?? [], v = b({
1165
+ let r = t, c = H(), { t: d, label: f } = G(), p = Y(), m = Ft(K()), g = J(), _ = g.agreements ?? [], v = b({
1036
1166
  phone: "",
1037
1167
  captcha: "",
1038
1168
  code: "",
@@ -1045,7 +1175,7 @@ var Vt = {
1045
1175
  message: d("campus.auth.phonePlaceholder"),
1046
1176
  trigger: "blur"
1047
1177
  }, {
1048
- pattern: Ve,
1178
+ pattern: Ue,
1049
1179
  message: d("campus.auth.phoneInvalid"),
1050
1180
  trigger: "blur"
1051
1181
  }],
@@ -1064,7 +1194,7 @@ var Vt = {
1064
1194
  message: d("campus.auth.registerPasswordPlaceholder"),
1065
1195
  trigger: "blur"
1066
1196
  }, {
1067
- validator: (e, t, n) => n(Nt(t, m) ? void 0 : Error(d("campus.auth.passwordPolicy"))),
1197
+ validator: (e, t, n) => n(Lt(t, m) ? void 0 : Error(d("campus.auth.passwordPolicy"))),
1068
1198
  trigger: "blur"
1069
1199
  }],
1070
1200
  confirm: [{
@@ -1099,7 +1229,7 @@ var Vt = {
1099
1229
  key: C.value,
1100
1230
  code: v.captcha
1101
1231
  } : void 0
1102
- }), Vt.toast.success(d("campus.auth.smsSent"));
1232
+ }), Gt.toast.success(d("campus.auth.smsSent"));
1103
1233
  } catch (e) {
1104
1234
  throw I(e, d("campus.login.failed")), T.value?.refresh(), e;
1105
1235
  }
@@ -1123,7 +1253,7 @@ var Vt = {
1123
1253
  key: C.value,
1124
1254
  code: v.captcha
1125
1255
  } : void 0
1126
- }), Vt.toast.success(d("campus.auth.registerOk")), await c.replace("/login");
1256
+ }), Gt.toast.success(d("campus.auth.registerOk")), await c.replace({ name: q(K()).login });
1127
1257
  } catch (e) {
1128
1258
  I(e, d("campus.login.failed")), T.value?.refresh();
1129
1259
  } finally {
@@ -1173,7 +1303,7 @@ var Vt = {
1173
1303
  key: 0,
1174
1304
  prop: "captcha"
1175
1305
  }, {
1176
- default: M(() => [u(gt, {
1306
+ default: M(() => [u(bt, {
1177
1307
  ref_key: "captchaRef",
1178
1308
  ref: T,
1179
1309
  code: v.captcha,
@@ -1185,11 +1315,11 @@ var Vt = {
1185
1315
  _: 1
1186
1316
  })) : a("v-if", !0),
1187
1317
  u(m, { prop: "code" }, {
1188
- default: M(() => [u(Gt, {
1318
+ default: M(() => [u(Yt, {
1189
1319
  modelValue: v.code,
1190
1320
  "onUpdate:modelValue": n[3] ||= (e) => v.code = e,
1191
1321
  send: L
1192
- }, null, 8, ["modelValue"]), D(g).smsHint ? (y(), o("p", Kt, E(D(f)(D(g).smsHint)), 1)) : a("v-if", !0)]),
1322
+ }, null, 8, ["modelValue"]), D(g).smsHint ? (y(), o("p", Xt, E(D(f)(D(g).smsHint)), 1)) : a("v-if", !0)]),
1193
1323
  _: 1
1194
1324
  }),
1195
1325
  u(m, { prop: "password" }, {
@@ -1240,12 +1370,12 @@ var Vt = {
1240
1370
  }, {
1241
1371
  default: M(() => [l(E(D(d)("campus.auth.agreePrefix")), 1)]),
1242
1372
  _: 1
1243
- }, 8, ["modelValue"]), s("span", qt, [(y(!0), o(e, null, S(D(_), (e) => (y(), o("a", {
1373
+ }, 8, ["modelValue"]), s("span", Zt, [(y(!0), o(e, null, S(D(_), (e) => (y(), o("a", {
1244
1374
  key: e.href,
1245
1375
  href: e.href,
1246
1376
  target: "_blank",
1247
1377
  rel: "noopener noreferrer"
1248
- }, E(D(f)(e.text)), 9, Jt))), 128))])]),
1378
+ }, E(D(f)(e.text)), 9, Qt))), 128))])]),
1249
1379
  _: 1
1250
1380
  })) : a("v-if", !0),
1251
1381
  u(x, {
@@ -1268,42 +1398,42 @@ var Vt = {
1268
1398
  }, 8, ["model", "rules"])], 64);
1269
1399
  };
1270
1400
  }
1271
- }), Xt = {
1401
+ }), en = {
1272
1402
  key: 1,
1273
1403
  class: "ca-auth-off",
1274
1404
  role: "status"
1275
- }, Zt = /* @__PURE__ */ d({
1405
+ }, tn = /* @__PURE__ */ d({
1276
1406
  __name: "RegisterPage",
1277
1407
  props: { preview: { type: Boolean } },
1278
1408
  setup(e) {
1279
- let { t } = W(), r = J().register, a = n(() => [{
1409
+ let { t } = G(), r = Y().register, a = n(() => [{
1280
1410
  key: "register",
1281
1411
  label: t("campus.auth.tabRegister")
1282
1412
  }, {
1283
1413
  key: "login",
1284
1414
  label: t("campus.auth.backLogin"),
1285
- to: "/login"
1415
+ to: Ne(K()).login
1286
1416
  }]);
1287
- return (n, c) => (y(), i(at, {
1417
+ return (n, c) => (y(), i(st, {
1288
1418
  active: "register",
1289
1419
  tabs: a.value,
1290
1420
  preview: e.preview
1291
1421
  }, {
1292
- default: M(() => [D(r) ? (y(), i(Yt, {
1422
+ default: M(() => [D(r) ? (y(), i($t, {
1293
1423
  key: 0,
1294
1424
  preview: e.preview
1295
- }, null, 8, ["preview"])) : (y(), o("div", Xt, [s("h3", null, E(D(t)("campus.auth.unavailableTitle")), 1), s("p", null, E(D(t)("campus.auth.unavailableDesc")), 1)]))]),
1425
+ }, null, 8, ["preview"])) : (y(), o("div", en, [s("h3", null, E(D(t)("campus.auth.unavailableTitle")), 1), s("p", null, E(D(t)("campus.auth.unavailableDesc")), 1)]))]),
1296
1426
  _: 1
1297
1427
  }, 8, ["tabs", "preview"]));
1298
1428
  }
1299
- }), Qt = {
1429
+ }), nn = {
1300
1430
  key: 0,
1301
1431
  class: "ca-auth-hint"
1302
- }, $t = /* @__PURE__ */ d({
1432
+ }, rn = /* @__PURE__ */ d({
1303
1433
  __name: "ForgotForm",
1304
1434
  props: { preview: { type: Boolean } },
1305
1435
  setup(t) {
1306
- let r = t, s = H(), { t: c, label: d } = W(), f = J(), p = jt(K()), m = q(), g = b({
1436
+ let r = t, s = H(), { t: c, label: d } = G(), f = Y(), p = Ft(K()), m = J(), g = b({
1307
1437
  account: "",
1308
1438
  captcha: "",
1309
1439
  code: "",
@@ -1330,7 +1460,7 @@ var Vt = {
1330
1460
  message: c("campus.auth.newPasswordPlaceholder"),
1331
1461
  trigger: "blur"
1332
1462
  }, {
1333
- validator: (e, t, n) => n(Nt(t, p) ? void 0 : Error(c("campus.auth.passwordPolicy"))),
1463
+ validator: (e, t, n) => n(Lt(t, p) ? void 0 : Error(c("campus.auth.passwordPolicy"))),
1334
1464
  trigger: "blur"
1335
1465
  }],
1336
1466
  confirm: [{
@@ -1355,13 +1485,13 @@ var Vt = {
1355
1485
  if (T.value = "", r.preview) O.value = "info", T.value = c("campus.auth.previewNote");
1356
1486
  else try {
1357
1487
  await K().auth.sendSmsCode({
1358
- ...Ve.test(g.account) ? { phone: g.account } : { username: g.account },
1488
+ ...Ue.test(g.account) ? { phone: g.account } : { username: g.account },
1359
1489
  scene: "forgot",
1360
1490
  captcha: f.captcha ? {
1361
1491
  key: _.value,
1362
1492
  code: g.captcha
1363
1493
  } : void 0
1364
- }), Vt.toast.success(c("campus.auth.smsSent"));
1494
+ }), Gt.toast.success(c("campus.auth.smsSent"));
1365
1495
  } catch (e) {
1366
1496
  throw j(e, c("campus.login.failed")), v.value?.refresh(), e;
1367
1497
  }
@@ -1385,7 +1515,7 @@ var Vt = {
1385
1515
  key: _.value,
1386
1516
  code: g.captcha
1387
1517
  } : void 0
1388
- }), Vt.toast.success(c("campus.auth.resetOk")), await s.replace("/login");
1518
+ }), Gt.toast.success(c("campus.auth.resetOk")), await s.replace({ name: q(K()).login });
1389
1519
  } catch (e) {
1390
1520
  j(e, c("campus.login.failed")), v.value?.refresh();
1391
1521
  } finally {
@@ -1434,7 +1564,7 @@ var Vt = {
1434
1564
  key: 0,
1435
1565
  prop: "captcha"
1436
1566
  }, {
1437
- default: M(() => [u(gt, {
1567
+ default: M(() => [u(bt, {
1438
1568
  ref_key: "captchaRef",
1439
1569
  ref: v,
1440
1570
  code: g.captcha,
@@ -1446,11 +1576,11 @@ var Vt = {
1446
1576
  _: 1
1447
1577
  })) : a("v-if", !0),
1448
1578
  u(p, { prop: "code" }, {
1449
- default: M(() => [u(Gt, {
1579
+ default: M(() => [u(Yt, {
1450
1580
  modelValue: g.code,
1451
1581
  "onUpdate:modelValue": n[3] ||= (e) => g.code = e,
1452
1582
  send: N
1453
- }, null, 8, ["modelValue"]), D(m).smsHint ? (y(), o("p", Qt, E(D(d)(D(m).smsHint)), 1)) : a("v-if", !0)]),
1583
+ }, null, 8, ["modelValue"]), D(m).smsHint ? (y(), o("p", nn, E(D(d)(D(m).smsHint)), 1)) : a("v-if", !0)]),
1454
1584
  _: 1
1455
1585
  }),
1456
1586
  u(p, { prop: "password" }, {
@@ -1511,50 +1641,50 @@ var Vt = {
1511
1641
  }, 8, ["model", "rules"])], 64);
1512
1642
  };
1513
1643
  }
1514
- }), en = {
1644
+ }), an = {
1515
1645
  key: 1,
1516
1646
  class: "ca-auth-off",
1517
1647
  role: "status"
1518
- }, tn = /* @__PURE__ */ d({
1648
+ }, on = /* @__PURE__ */ d({
1519
1649
  __name: "ForgotPage",
1520
1650
  props: { preview: { type: Boolean } },
1521
1651
  setup(e) {
1522
- let { t } = W(), r = J().forgot, a = n(() => [{
1652
+ let { t } = G(), r = Y().forgot, a = n(() => [{
1523
1653
  key: "forgot",
1524
1654
  label: t("campus.auth.tabForgot")
1525
1655
  }, {
1526
1656
  key: "login",
1527
1657
  label: t("campus.auth.backLogin"),
1528
- to: "/login"
1658
+ to: Ne(K()).login
1529
1659
  }]);
1530
- return (n, c) => (y(), i(at, {
1660
+ return (n, c) => (y(), i(st, {
1531
1661
  active: "forgot",
1532
1662
  tabs: a.value,
1533
1663
  preview: e.preview
1534
1664
  }, {
1535
- default: M(() => [D(r) ? (y(), i($t, {
1665
+ default: M(() => [D(r) ? (y(), i(rn, {
1536
1666
  key: 0,
1537
1667
  preview: e.preview
1538
- }, null, 8, ["preview"])) : (y(), o("div", en, [s("h3", null, E(D(t)("campus.auth.unavailableTitle")), 1), s("p", null, E(D(t)("campus.auth.unavailableDesc")), 1)]))]),
1668
+ }, null, 8, ["preview"])) : (y(), o("div", an, [s("h3", null, E(D(t)("campus.auth.unavailableTitle")), 1), s("p", null, E(D(t)("campus.auth.unavailableDesc")), 1)]))]),
1539
1669
  _: 1
1540
1670
  }, 8, ["tabs", "preview"]));
1541
1671
  }
1542
- }), nn = /* @__PURE__ */ d({
1672
+ }), sn = /* @__PURE__ */ d({
1543
1673
  __name: "AuthPreview",
1544
1674
  props: { kind: {} },
1545
1675
  setup(e) {
1546
- return (t, n) => e.kind === "login" ? (y(), i(At, {
1676
+ return (t, n) => e.kind === "login" ? (y(), i(Pt, {
1547
1677
  key: 0,
1548
1678
  preview: ""
1549
- })) : e.kind === "register" ? (y(), i(Zt, {
1679
+ })) : e.kind === "register" ? (y(), i(tn, {
1550
1680
  key: 1,
1551
1681
  preview: ""
1552
- })) : (y(), i(tn, {
1682
+ })) : (y(), i(on, {
1553
1683
  key: 2,
1554
1684
  preview: ""
1555
1685
  }));
1556
1686
  }
1557
- }), rn = { class: "ca-user-avatar" }, an = ["src"], on = /*#__PURE__*/ Y(/* @__PURE__ */ d({
1687
+ }), cn = { class: "ca-user-avatar" }, ln = ["src"], un = /*#__PURE__*/ X(/* @__PURE__ */ d({
1558
1688
  __name: "UserAvatar",
1559
1689
  props: {
1560
1690
  name: {},
@@ -1564,32 +1694,36 @@ var Vt = {
1564
1694
  let n = t, r = x(!1);
1565
1695
  return A(() => n.src, () => {
1566
1696
  r.value = !1;
1567
- }), (n, i) => (y(), o("span", rn, [t.src && !r.value ? (y(), o("img", {
1697
+ }), (n, i) => (y(), o("span", cn, [t.src && !r.value ? (y(), o("img", {
1568
1698
  key: 0,
1569
1699
  src: t.src,
1570
1700
  alt: "",
1571
1701
  draggable: "false",
1572
1702
  onError: i[0] ||= (e) => r.value = !0
1573
- }, null, 40, an)) : (y(), o(e, { key: 1 }, [l(E(t.name?.slice(0, 1)), 1)], 64))]));
1703
+ }, null, 40, ln)) : (y(), o(e, { key: 1 }, [l(E(t.name?.slice(0, 1)), 1)], 64))]));
1574
1704
  }
1575
- }), [["__scopeId", "data-v-b67c1b85"]]), sn = { class: "ca-header" }, cn = ["aria-label", "aria-expanded"], ln = { class: "ca-header__brand" }, un = ["src"], dn = { class: "ca-header__titles" }, fn = { class: "ca-header__name" }, pn = {
1705
+ }), [["__scopeId", "data-v-b67c1b85"]]), dn = { class: "ca-header" }, fn = [
1706
+ "title",
1707
+ "aria-label",
1708
+ "aria-expanded"
1709
+ ], pn = { class: "ca-header__brand" }, mn = ["src"], hn = { class: "ca-header__titles" }, gn = { class: "ca-header__name" }, _n = {
1576
1710
  key: 0,
1577
1711
  class: "ca-header__subtitle"
1578
- }, mn = ["aria-label"], hn = ["onClick"], gn = { class: "ca-header__tools" }, _n = { class: "ca-header__search-text" }, vn = [
1712
+ }, vn = ["aria-label"], yn = ["onClick"], bn = { class: "ca-header__tools" }, xn = { class: "ca-header__search-text" }, Sn = [
1579
1713
  "title",
1580
1714
  "aria-label",
1581
1715
  "aria-pressed"
1582
- ], yn = ["title", "aria-label"], bn = { class: "ca-header__icon-text" }, xn = ["title", "aria-label"], Sn = ["title", "aria-label"], Cn = ["title", "aria-label"], wn = ["title", "aria-label"], Tn = { class: "ca-settings__group" }, En = { class: "ca-settings__title" }, Dn = ["aria-label"], On = ["aria-checked", "onClick"], kn = {
1716
+ ], Cn = ["title", "aria-label"], wn = { class: "ca-header__icon-text" }, Tn = ["title", "aria-label"], En = ["title", "aria-label"], Dn = ["title", "aria-label"], On = ["title", "aria-label"], kn = { class: "ca-settings__group" }, An = { class: "ca-settings__title" }, jn = ["aria-label"], Mn = ["aria-checked", "onClick"], Nn = {
1583
1717
  key: 0,
1584
1718
  class: "ca-settings__group"
1585
- }, An = { class: "ca-settings__title" }, jn = ["aria-label"], Mn = [
1719
+ }, Pn = { class: "ca-settings__title" }, Fn = ["aria-label"], In = [
1586
1720
  "aria-label",
1587
1721
  "aria-checked",
1588
1722
  "onClick"
1589
- ], Nn = ["title"], Pn = ["value", "aria-label"], Fn = ["disabled"], In = { class: "ca-settings__group" }, Ln = { class: "ca-settings__title" }, Rn = ["aria-label"], zn = ["aria-checked", "onClick"], Bn = /*#__PURE__*/ Y(/* @__PURE__ */ d({
1723
+ ], Ln = ["title"], Rn = ["value", "aria-label"], zn = ["disabled"], Bn = { class: "ca-settings__group" }, Vn = { class: "ca-settings__title" }, Hn = ["aria-label"], Un = ["aria-checked", "onClick"], Wn = /*#__PURE__*/ X(/* @__PURE__ */ d({
1590
1724
  __name: "HeaderBar",
1591
1725
  setup(t) {
1592
- let r = V(), c = H(), d = Q(), f = X(), p = ze(), { t: m, label: b, locale: C } = W(), T = K(), O = x(!1), k = [{
1726
+ let r = V(), c = H(), d = Q(), f = Z(), p = Ve(), { t: m, label: b, locale: C } = G(), T = K(), O = x(!1), k = [{
1593
1727
  value: "border",
1594
1728
  label: "campus.settings.boxBorder"
1595
1729
  }, {
@@ -1630,33 +1764,38 @@ var Vt = {
1630
1764
  } : void 0);
1631
1765
  }
1632
1766
  function te(e) {
1633
- C.value = e, Ee(e);
1767
+ C.value = e, Te(e);
1634
1768
  }
1635
1769
  async function ne(e) {
1636
- e === "account" ? T.accountPath && P(T.accountPath) : (await d.logout(), await c.replace({ name: "login" }));
1770
+ e === "account" ? T.onAccountClick ? await T.onAccountClick("header") : T.accountPath && P(T.accountPath) : (await d.logout(), await c.replace({ name: q(K()).login }));
1637
1771
  }
1638
1772
  let z = x(!1);
1639
1773
  function B() {
1640
1774
  z.value = !!document.fullscreenElement;
1641
1775
  }
1642
1776
  async function re() {
1777
+ f.pageScreenManual();
1643
1778
  try {
1644
1779
  document.fullscreenElement ? await document.exitFullscreen() : await document.documentElement.requestFullscreen();
1645
1780
  } catch {}
1646
1781
  }
1647
- v(() => document.addEventListener("fullscreenchange", B)), _(() => document.removeEventListener("fullscreenchange", B));
1782
+ v(() => {
1783
+ B(), document.addEventListener("fullscreenchange", B);
1784
+ }), _(() => document.removeEventListener("fullscreenchange", B));
1648
1785
  function ie(e) {
1649
1786
  T.headerTools?.[e]?.();
1650
1787
  }
1651
1788
  return (t, n) => {
1652
1789
  let c = w("ca-icon"), _ = w("ca-dropdown-item"), v = w("ca-dropdown-menu"), x = w("ca-dropdown"), B = w("ca-drawer");
1653
- return y(), o("header", sn, [
1790
+ return y(), o("header", dn, [
1791
+ a(" 菜单按钮:手机打开抽屉;电脑档两栏都收起时也显示,点击重新显示侧栏 "),
1654
1792
  s("button", {
1655
1793
  type: "button",
1656
- class: "ca-header__hamburger ca-header__icon",
1794
+ class: h(["ca-header__hamburger ca-header__icon", { "is-side-hidden": D(f).sideHiddenActive }]),
1795
+ title: D(f).sideHiddenActive ? D(m)("campus.side.openMenu") : void 0,
1657
1796
  "aria-label": D(m)("campus.side.openMenu"),
1658
- "aria-expanded": D(f).mobileMenuOpen,
1659
- onClick: n[0] ||= (e) => D(f).openMobileMenu()
1797
+ "aria-expanded": !D(f).sideHiddenActive && D(f).mobileMenuOpen,
1798
+ onClick: n[0] ||= (e) => D(f).sideHiddenActive ? D(f).showSide() : D(f).openMobileMenu()
1660
1799
  }, [...n[8] ||= [s("svg", {
1661
1800
  width: "20",
1662
1801
  height: "20",
@@ -1666,13 +1805,13 @@ var Vt = {
1666
1805
  "stroke-width": "2",
1667
1806
  "stroke-linecap": "round",
1668
1807
  "aria-hidden": "true"
1669
- }, [s("path", { d: "M4 6h16M4 12h16M4 18h16" })], -1)]], 8, cn),
1670
- s("div", ln, [j.value ? (y(), o("img", {
1808
+ }, [s("path", { d: "M4 6h16M4 12h16M4 18h16" })], -1)]], 10, fn),
1809
+ s("div", pn, [j.value ? (y(), o("img", {
1671
1810
  key: 0,
1672
1811
  src: j.value,
1673
1812
  alt: "",
1674
1813
  class: "ca-header__logo"
1675
- }, null, 8, un)) : (y(), o(e, { key: 1 }, [a(" 没有配置 logo 时用框架默认标志(学士帽),颜色跟随头部前景色 "), n[9] ||= s("svg", {
1814
+ }, null, 8, mn)) : (y(), o(e, { key: 1 }, [a(" 没有配置 logo 时用框架默认标志(学士帽),颜色跟随头部前景色 "), n[9] ||= s("svg", {
1676
1815
  class: "ca-header__logo",
1677
1816
  viewBox: "0 0 32 32",
1678
1817
  fill: "none",
@@ -1685,7 +1824,7 @@ var Vt = {
1685
1824
  s("path", { d: "M16 6 3 12.5 16 19l13-6.5L16 6Z" }),
1686
1825
  s("path", { d: "M9 16.5v5.2c0 1.6 3.1 3.3 7 3.3s7-1.7 7-3.3v-5.2" }),
1687
1826
  s("path", { d: "M29 12.5V20" })
1688
- ], -1)], 2112)), s("div", dn, [s("strong", fn, E(A.value), 1), D(T).brand.subtitle ? (y(), o("span", pn, E(D(b)(D(T).brand.subtitle)), 1)) : a("v-if", !0)])]),
1827
+ ], -1)], 2112)), s("div", hn, [s("strong", gn, E(A.value), 1), D(T).brand.subtitle ? (y(), o("span", _n, E(D(b)(D(T).brand.subtitle)), 1)) : a("v-if", !0)])]),
1689
1828
  s("nav", {
1690
1829
  class: "ca-header__nav",
1691
1830
  "aria-label": D(m)("campus.header.shortcuts")
@@ -1694,15 +1833,15 @@ var Vt = {
1694
1833
  class: h(["ca-header__nav-item", { "is-active": D(r).path === e.path }]),
1695
1834
  type: "button",
1696
1835
  onClick: (t) => P(e.path)
1697
- }, E(D(b)(e.title)), 11, hn))), 128))], 8, mn),
1698
- s("div", gn, [
1836
+ }, E(D(b)(e.title)), 11, yn))), 128))], 8, vn),
1837
+ s("div", bn, [
1699
1838
  s("button", {
1700
1839
  type: "button",
1701
1840
  class: "ca-header__search",
1702
1841
  onClick: n[1] ||= (e) => ie("search")
1703
1842
  }, [
1704
1843
  u(c, { name: "search" }),
1705
- s("span", _n, E(D(m)("campus.header.search")), 1),
1844
+ s("span", xn, E(D(m)("campus.header.search")), 1),
1706
1845
  n[10] ||= s("kbd", { class: "ca-header__kbd" }, "⌘ K", -1)
1707
1846
  ]),
1708
1847
  s("button", {
@@ -1715,7 +1854,7 @@ var Vt = {
1715
1854
  }, [u(c, {
1716
1855
  name: z.value ? "exitFullscreen" : "fullscreen",
1717
1856
  size: 18
1718
- }, null, 8, ["name"])], 8, vn),
1857
+ }, null, 8, ["name"])], 8, Sn),
1719
1858
  u(x, {
1720
1859
  trigger: "click",
1721
1860
  onCommand: te
@@ -1736,7 +1875,7 @@ var Vt = {
1736
1875
  class: "ca-header__icon",
1737
1876
  title: D(m)("campus.header.language"),
1738
1877
  "aria-label": D(m)("campus.header.language")
1739
- }, [s("span", bn, E(D(ee).find((e) => e.code === D(C))?.label), 1)], 8, yn)]),
1878
+ }, [s("span", wn, E(D(ee).find((e) => e.code === D(C))?.label), 1)], 8, Cn)]),
1740
1879
  _: 1
1741
1880
  }),
1742
1881
  s("button", {
@@ -1751,7 +1890,7 @@ var Vt = {
1751
1890
  }), n[11] ||= s("i", {
1752
1891
  class: "ca-header__dot is-danger",
1753
1892
  "aria-hidden": "true"
1754
- }, null, -1)], 8, xn),
1893
+ }, null, -1)], 8, Tn),
1755
1894
  s("button", {
1756
1895
  type: "button",
1757
1896
  class: "ca-header__icon ca-header__desktop-tool",
@@ -1764,7 +1903,7 @@ var Vt = {
1764
1903
  }), n[12] ||= s("i", {
1765
1904
  class: "ca-header__dot is-success",
1766
1905
  "aria-hidden": "true"
1767
- }, null, -1)], 8, Sn),
1906
+ }, null, -1)], 8, En),
1768
1907
  s("button", {
1769
1908
  type: "button",
1770
1909
  class: "ca-header__icon",
@@ -1774,13 +1913,13 @@ var Vt = {
1774
1913
  }, [u(c, {
1775
1914
  name: "setting",
1776
1915
  size: 18
1777
- })], 8, Cn),
1916
+ })], 8, Dn),
1778
1917
  u(x, {
1779
1918
  trigger: "click",
1780
1919
  onCommand: ne
1781
1920
  }, {
1782
1921
  dropdown: M(() => [u(v, null, {
1783
- default: M(() => [D(T).accountPath ? (y(), i(_, {
1922
+ default: M(() => [D(T).accountEntry?.header !== !1 && (D(T).accountPath || D(T).onAccountClick) ? (y(), i(_, {
1784
1923
  key: 0,
1785
1924
  command: "account"
1786
1925
  }, {
@@ -1800,14 +1939,14 @@ var Vt = {
1800
1939
  class: "ca-header__user",
1801
1940
  title: D(m)("campus.header.account"),
1802
1941
  "aria-label": D(d).user?.name
1803
- }, [u(on, {
1942
+ }, [u(un, {
1804
1943
  class: "ca-header__avatar",
1805
1944
  name: D(d).user?.name,
1806
1945
  src: D(d).user?.avatar
1807
1946
  }, null, 8, ["name", "src"]), u(c, {
1808
1947
  name: "arrowDown",
1809
1948
  size: 12
1810
- })], 8, wn)]),
1949
+ })], 8, On)]),
1811
1950
  _: 1
1812
1951
  })
1813
1952
  ]),
@@ -1820,7 +1959,7 @@ var Vt = {
1820
1959
  class: "ca-settings"
1821
1960
  }, {
1822
1961
  default: M(() => [
1823
- s("section", Tn, [s("h3", En, [s("span", null, E(D(m)("campus.settings.themeMode")), 1)]), s("div", {
1962
+ s("section", kn, [s("h3", An, [s("span", null, E(D(m)("campus.settings.themeMode")), 1)]), s("div", {
1824
1963
  class: "ca-settings__segment is-three",
1825
1964
  role: "radiogroup",
1826
1965
  "aria-label": D(m)("campus.settings.themeMode")
@@ -1834,9 +1973,9 @@ var Vt = {
1834
1973
  }, [u(c, {
1835
1974
  name: e.icon,
1836
1975
  size: 16
1837
- }, null, 8, ["name"]), l(E(D(m)(`campus.mode.${e.value}`)), 1)], 10, On)), 64))], 8, Dn)]),
1838
- D(p).primaryLocked ? a("v-if", !0) : (y(), o("section", kn, [
1839
- s("h3", An, [s("span", null, E(D(m)("campus.settings.themeColor")), 1)]),
1976
+ }, null, 8, ["name"]), l(E(D(m)(`campus.mode.${e.value}`)), 1)], 10, Mn)), 64))], 8, jn)]),
1977
+ D(p).primaryLocked ? a("v-if", !0) : (y(), o("section", Nn, [
1978
+ s("h3", Pn, [s("span", null, E(D(m)("campus.settings.themeColor")), 1)]),
1840
1979
  s("div", {
1841
1980
  class: "ca-settings__swatches",
1842
1981
  role: "radiogroup",
@@ -1850,7 +1989,7 @@ var Vt = {
1850
1989
  "aria-label": e,
1851
1990
  "aria-checked": D(p).userPrimary?.toLowerCase() === e,
1852
1991
  onClick: (t) => D(p).setPrimary(e)
1853
- }, null, 14, Mn)), 64)), s("label", {
1992
+ }, null, 14, In)), 64)), s("label", {
1854
1993
  class: "ca-settings__swatch is-custom",
1855
1994
  title: D(m)("campus.settings.themeColorCustom")
1856
1995
  }, [s("input", {
@@ -1858,15 +1997,15 @@ var Vt = {
1858
1997
  value: L.value,
1859
1998
  "aria-label": D(m)("campus.settings.themeColorCustom"),
1860
1999
  onInput: n[5] ||= (e) => D(p).setPrimary(e.target.value)
1861
- }, null, 40, Pn)], 8, Nn)], 8, jn),
2000
+ }, null, 40, Rn)], 8, Ln)], 8, Fn),
1862
2001
  s("button", {
1863
2002
  type: "button",
1864
2003
  class: "ca-settings__reset",
1865
2004
  disabled: !D(p).userPrimary,
1866
2005
  onClick: n[6] ||= (e) => D(p).setPrimary(void 0)
1867
- }, E(D(m)("campus.settings.themeColorReset")), 9, Fn)
2006
+ }, E(D(m)("campus.settings.themeColorReset")), 9, zn)
1868
2007
  ])),
1869
- s("section", In, [s("h3", Ln, [s("span", null, E(D(m)("campus.settings.boxStyle")), 1)]), s("div", {
2008
+ s("section", Bn, [s("h3", Vn, [s("span", null, E(D(m)("campus.settings.boxStyle")), 1)]), s("div", {
1870
2009
  class: "ca-settings__segment",
1871
2010
  role: "radiogroup",
1872
2011
  "aria-label": D(m)("campus.settings.boxStyle")
@@ -1877,20 +2016,20 @@ var Vt = {
1877
2016
  "aria-checked": D(p).boxStyle === e.value,
1878
2017
  class: h({ "is-active": D(p).boxStyle === e.value }),
1879
2018
  onClick: (t) => D(p).setBoxStyle(e.value)
1880
- }, E(D(m)(e.label)), 11, zn)), 64))], 8, Rn)])
2019
+ }, E(D(m)(e.label)), 11, Un)), 64))], 8, Hn)])
1881
2020
  ]),
1882
2021
  _: 1
1883
2022
  }, 8, ["modelValue", "title"])
1884
2023
  ]);
1885
2024
  };
1886
2025
  }
1887
- }), [["__scopeId", "data-v-1b60a583"]]), Vn = {
2026
+ }), [["__scopeId", "data-v-d0a9b424"]]), Gn = {
1888
2027
  key: 0,
1889
2028
  class: "ca-page-header"
1890
- }, Hn = { class: "ca-page-header__top" }, Un = { class: "ca-page-header__crumb" }, Wn = ["title", "aria-label"], Gn = { class: "ca-page-header__date" }, Kn = /*#__PURE__*/ Y(/* @__PURE__ */ d({
2029
+ }, Kn = { class: "ca-page-header__top" }, qn = { class: "ca-page-header__crumb" }, Jn = ["title", "aria-label"], Yn = { class: "ca-page-header__date" }, Xn = /*#__PURE__*/ X(/* @__PURE__ */ d({
1891
2030
  __name: "PageHeader",
1892
2031
  setup(t) {
1893
- let r = V(), { t: c, label: d, locale: f } = W(), p = Z(), m = new Map(je(K().menus).map((e) => [e.key, e])), h = n(() => r.meta.pageKey ? m.get(r.meta.pageKey) : void 0), g = n(() => {
2032
+ let r = V(), { t: c, label: d, locale: f } = G(), p = ft(), m = new Map(Me(K().menus).map((e) => [e.key, e])), h = n(() => r.meta.pageKey ? m.get(r.meta.pageKey) : void 0), g = n(() => {
1894
2033
  let e = h.value ? Ae(h.value.key) : void 0;
1895
2034
  if (!e) return [];
1896
2035
  let t = e.titles.map((e) => d(e));
@@ -1907,7 +2046,7 @@ var Vt = {
1907
2046
  });
1908
2047
  return (t, n) => {
1909
2048
  let r = w("ca-icon"), d = w("ca-breadcrumb-item"), f = w("ca-breadcrumb");
1910
- return h.value ? (y(), o("header", Vn, [s("div", Hn, [s("div", Un, [
2049
+ return h.value ? (y(), o("header", Gn, [s("div", Kn, [s("div", qn, [
1911
2050
  u(r, {
1912
2051
  name: "location",
1913
2052
  class: "ca-page-header__icon"
@@ -1927,138 +2066,132 @@ var Vt = {
1927
2066
  title: D(c)("campus.tabs.refresh"),
1928
2067
  "aria-label": D(c)("campus.tabs.refresh"),
1929
2068
  onClick: n[0] ||= (e) => h.value && D(p).refresh(h.value.key)
1930
- }, [u(r, { name: "refresh" })], 8, Wn)
1931
- ]), s("time", Gn, E(C.value), 1)])])) : a("v-if", !0);
2069
+ }, [u(r, { name: "refresh" })], 8, Jn)
2070
+ ]), s("time", Yn, E(C.value), 1)])])) : a("v-if", !0);
1932
2071
  };
1933
2072
  }
1934
- }), [["__scopeId", "data-v-e0f9b42f"]]), qn = {
2073
+ }), [["__scopeId", "data-v-e0f9b42f"]]), Zn = {
1935
2074
  key: 0,
1936
- class: "ca-page-header__main"
1937
- }, Jn = { class: "ca-page-header__titles" }, Yn = { class: "ca-page-header__title" }, Xn = ["title"], Zn = /*#__PURE__*/ Y(/* @__PURE__ */ d({
2075
+ class: "ca-page-header__titles"
2076
+ }, Qn = { class: "ca-page-header__title" }, $n = ["title"], er = /*#__PURE__*/ X(/* @__PURE__ */ d({
1938
2077
  __name: "PageTitle",
1939
2078
  setup(e) {
1940
- let t = V(), { label: r } = W(), i = new Map(je(K().menus).map((e) => [e.key, e])), c = n(() => t.meta.pageKey ? i.get(t.meta.pageKey) : void 0), l = n(() => c.value ? r(c.value.title) : ""), u = n(() => c.value?.description ? r(c.value.description) : "");
1941
- return (e, t) => c.value ? (y(), o("header", qn, [
1942
- s("div", Jn, [
1943
- s("h2", Yn, E(l.value), 1),
2079
+ let t = V(), { label: r } = G(), i = new Map(Me(K().menus).map((e) => [e.key, e])), c = n(() => t.meta.pageKey ? i.get(t.meta.pageKey) : void 0), l = n(() => c.value?.pageHeader ?? K().pageHeader ?? !0), u = n(() => c.value ? r(c.value.title) : ""), d = n(() => c.value?.description ? r(c.value.description) : "");
2080
+ return (e, t) => c.value ? (y(), o("header", {
2081
+ key: 0,
2082
+ class: h(["ca-page-header__main", { "is-title-hidden": !l.value }])
2083
+ }, [
2084
+ l.value ? (y(), o("div", Zn, [
2085
+ s("h2", Qn, E(u.value), 1),
1944
2086
  a(" 说明和标题同一行,放不下时省略;窗口较矮时直接隐藏,把高度留给内容 "),
1945
- u.value ? (y(), o("p", {
2087
+ d.value ? (y(), o("p", {
1946
2088
  key: 0,
1947
2089
  class: "ca-page-header__desc",
1948
- title: u.value
1949
- }, E(u.value), 9, Xn)) : a("v-if", !0)
1950
- ]),
2090
+ title: d.value
2091
+ }, E(d.value), 9, $n)) : a("v-if", !0)
2092
+ ])) : a("v-if", !0),
1951
2093
  a(" 页面通过 <ca-page-actions> 把按钮放到这里 "),
1952
2094
  t[0] ||= s("div", {
1953
2095
  id: "ca-page-actions",
1954
2096
  class: "ca-page-header__actions"
1955
2097
  }, null, -1)
1956
- ])) : a("v-if", !0);
2098
+ ], 2)) : a("v-if", !0);
1957
2099
  }
1958
- }), [["__scopeId", "data-v-e63e651d"]]), Qn = ["aria-label"], $n = ["onClick"], er = { class: "ca-side__rail-list" }, tr = ["aria-current", "title"], nr = [
2100
+ }), [["__scopeId", "data-v-98ee1b64"]]), tr = ["aria-label"], nr = ["onClick"], rr = { class: "ca-side__rail-list" }, ir = ["aria-current", "title"], ar = [
1959
2101
  "aria-current",
1960
2102
  "title",
1961
2103
  "onClick"
1962
- ], rr = {
2104
+ ], or = {
1963
2105
  key: 0,
1964
2106
  class: "ca-side__badge"
1965
- }, ir = { class: "ca-side__tools" }, ar = [
2107
+ }, sr = { class: "ca-side__tools" }, cr = [
1966
2108
  "title",
1967
2109
  "aria-label",
1968
2110
  "aria-pressed"
1969
- ], or = [
2111
+ ], lr = [
1970
2112
  "title",
1971
2113
  "aria-label",
1972
2114
  "aria-expanded"
1973
- ], sr = ["title", "aria-label"], cr = ["inert"], lr = { class: "ca-side__panel-inner" }, ur = {
2115
+ ], ur = ["title", "aria-label"], dr = ["inert"], fr = { class: "ca-side__panel-inner" }, pr = {
1974
2116
  key: 0,
1975
2117
  class: "ca-side__title"
1976
- }, dr = {
2118
+ }, mr = {
1977
2119
  key: 1,
1978
2120
  class: "ca-side__group-badge"
1979
- }, fr = /*#__PURE__*/ Y(/* @__PURE__ */ d({
2121
+ }, hr = /*#__PURE__*/ X(/* @__PURE__ */ d({
1980
2122
  __name: "SideMenu",
1981
2123
  setup(t) {
1982
- let r = V(), c = H(), d = Q(), f = X(), { t: p, label: m } = W(), g = K(), _ = x(ge("side-collapsed") === "1");
1983
- function v() {
1984
- _.value = !_.value, U("side-collapsed", _.value ? "1" : "0");
1985
- }
1986
- let b = x(ge("side-text-hidden") === "1");
2124
+ let r = V(), c = H(), d = Q(), f = Z(), { t: p, label: m } = G(), g = K(), _ = n(() => f.sidePanelCollapsed), v = () => f.toggleSidePanel(), b = x(U("side-text-hidden") === "1");
1987
2125
  function C() {
1988
- b.value = !b.value, U("side-text-hidden", b.value ? "1" : "0");
2126
+ b.value = !b.value, W("side-text-hidden", b.value ? "1" : "0");
1989
2127
  }
1990
2128
  async function T(e) {
1991
- e === "account" ? g.accountPath && r.path !== g.accountPath && await c.push(g.accountPath) : (await d.logout(), await c.replace({ name: "login" }));
2129
+ e === "account" ? g.onAccountClick ? await g.onAccountClick("side") : g.accountPath && r.path !== g.accountPath && await c.push(g.accountPath) : (await d.logout(), await c.replace({ name: q(K()).login }));
1992
2130
  }
1993
- let O = n(() => g.menus.flatMap((e) => e.children.flatMap((e) => G(e) ? e.children : [e])).find((e) => e.affix && d.can(e.permission))), j = (e) => d.can(e.permission) && e.key !== O.value?.key && e.path !== g.accountPath, P = n(() => g.menus.map((e) => ({
1994
- ...e,
1995
- children: e.children.map((e) => G(e) ? {
1996
- ...e,
1997
- children: e.children.filter(j)
1998
- } : e).filter((e) => G(e) ? e.children.length > 0 : j(e))
1999
- })).filter((e) => e.children.length > 0)), F = x(), I = n(() => !!O.value && r.path === O.value.path);
2131
+ let O = n(() => Pe(g, (e) => d.can(e))), j = n(() => O.value.home), P = n(() => O.value.apps), F = O.value.accountStandalone, I = x(), L = n(() => !!j.value && r.path === j.value.path);
2000
2132
  A(() => [r.path, r.meta.appKey], () => {
2001
- F.value = I.value || r.path === g.accountPath ? void 0 : r.meta.appKey ?? P.value[0]?.key;
2133
+ I.value = L.value || F && r.path === g.accountPath ? void 0 : r.meta.appKey ?? P.value[0]?.key;
2002
2134
  }, { immediate: !0 });
2003
- let L = n(() => P.value.find((e) => e.key === F.value)), R = n(() => (f.mode === "pad" ? !f.padPanelOpen : _.value) || !L.value), ee = x();
2004
- A(L, (e) => e && (ee.value = e), { immediate: !0 });
2005
- let te = n(() => L.value ?? ee.value);
2006
- function ne(e) {
2135
+ let R = n(() => P.value.find((e) => e.key === I.value)), ee = n(() => (f.mode === "pad" ? !f.padPanelOpen : _.value || f.sideHiddenActive) || !R.value), te = x();
2136
+ A(R, (e) => e && (te.value = e), { immediate: !0 });
2137
+ let ne = n(() => R.value ?? te.value);
2138
+ function z(e) {
2007
2139
  let t = typeof e.badge == "function" ? e.badge() : e.badge ?? 0;
2008
2140
  return t > 0 ? t : 0;
2009
2141
  }
2010
- function z(e) {
2011
- return e.children.reduce((e, t) => e + (G(t) ? ne(t) : 0), 0);
2142
+ function B(e) {
2143
+ return e.children.reduce((e, t) => e + (De(t) ? z(t) : 0), 0);
2012
2144
  }
2013
- let B = n(() => r.meta.groupKey ? [r.meta.groupKey] : []);
2014
- function re(e) {
2015
- f.mode === "pad" ? f.padPanelOpen && F.value === e ? f.closePadPanel() : (F.value = e, f.openPadPanel()) : (F.value = e, _.value && P.value.some((t) => t.key === e) && v());
2145
+ let re = n(() => r.meta.groupKey ? [r.meta.groupKey] : []);
2146
+ function ie(e) {
2147
+ f.mode === "pad" ? f.padPanelOpen && I.value === e ? f.closePadPanel() : (I.value = e, f.openPadPanel()) : (I.value = e, _.value && P.value.some((t) => t.key === e) && v());
2016
2148
  }
2017
- let ie = n(() => (g.shortcuts ?? []).filter((e) => d.can(e.permission)));
2018
- function ae(e) {
2149
+ let ae = n(() => (g.shortcuts ?? []).filter((e) => d.can(e.permission)));
2150
+ function oe(e) {
2019
2151
  f.closeOverlays(), r.path !== e && c.push(e);
2020
2152
  }
2021
2153
  return (t, n) => {
2022
- let c = w("ca-icon"), x = w("ca-dropdown-item"), A = w("ca-dropdown-menu"), j = w("ca-dropdown"), F = w("ca-menu-item"), ee = w("ca-sub-menu"), V = w("ca-menu");
2023
- return y(), o("aside", { class: h(["ca-side", { "is-pad-open": D(f).mode === "pad" && D(f).padPanelOpen }]) }, [
2024
- ie.value.length ? (y(), o("nav", {
2154
+ let c = w("ca-icon"), x = w("ca-dropdown-item"), O = w("ca-dropdown-menu"), A = w("ca-dropdown"), F = w("ca-menu-item"), I = w("ca-sub-menu"), te = w("ca-menu");
2155
+ return y(), o(e, null, [a(" 两栏都收起(只在电脑档):整个侧栏向左滑出,第二栏同时收起;不可聚焦由 CaLayout 的 inert 负责 "), s("aside", { class: h(["ca-side", {
2156
+ "is-pad-open": D(f).mode === "pad" && D(f).padPanelOpen,
2157
+ "is-hidden": D(f).sideHiddenActive,
2158
+ "is-text-hidden": b.value
2159
+ }]) }, [
2160
+ ae.value.length ? (y(), o("nav", {
2025
2161
  key: 0,
2026
2162
  class: "ca-side__shortcuts",
2027
2163
  "aria-label": D(p)("campus.header.shortcuts")
2028
- }, [(y(!0), o(e, null, S(ie.value, (e) => (y(), o("button", {
2164
+ }, [(y(!0), o(e, null, S(ae.value, (e) => (y(), o("button", {
2029
2165
  key: e.key,
2030
2166
  type: "button",
2031
2167
  class: h({ "is-active": D(r).path === e.path }),
2032
- onClick: (t) => ae(e.path)
2033
- }, E(D(m)(e.title)), 11, $n))), 128))], 8, Qn)) : a("v-if", !0),
2168
+ onClick: (t) => oe(e.path)
2169
+ }, E(D(m)(e.title)), 11, nr))), 128))], 8, tr)) : a("v-if", !0),
2034
2170
  s("nav", { class: h(["ca-side__rail", { "is-compact": b.value }]) }, [
2035
2171
  a(" 入口列表单独滚动;底部工具按钮固定在外面,窗口再矮也不会被挤出屏幕 "),
2036
- s("div", er, [O.value ? (y(), o("button", {
2172
+ s("div", rr, [j.value ? (y(), o("button", {
2037
2173
  key: 0,
2038
2174
  type: "button",
2039
- class: h(["ca-side__rail-item", { "is-active": I.value }]),
2040
- "aria-current": I.value ? "page" : void 0,
2175
+ class: h(["ca-side__rail-item", { "is-active": L.value }]),
2176
+ "aria-current": L.value ? "page" : void 0,
2041
2177
  title: b.value ? D(p)("campus.side.home") : void 0,
2042
- onClick: n[0] ||= (e) => ae(O.value.path)
2043
- }, [u(c, {
2044
- name: "home",
2045
- size: 20
2046
- }), N(s("span", { class: "ca-side__rail-text" }, E(D(p)("campus.side.home")), 513), [[k, !b.value || D(f).mobileMenuOpen]])], 10, tr)) : a("v-if", !0), (y(!0), o(e, null, S(P.value, (e) => (y(), o("button", {
2178
+ onClick: n[0] ||= (e) => oe(j.value.path)
2179
+ }, [u(c, { name: "home" }), N(s("span", { class: "ca-side__rail-text" }, E(D(p)("campus.side.home")), 513), [[k, !b.value || D(f).mobileMenuOpen]])], 10, ir)) : a("v-if", !0), (y(!0), o(e, null, S(P.value, (e) => (y(), o("button", {
2047
2180
  key: e.key,
2048
2181
  type: "button",
2049
- class: h(["ca-side__rail-item", { "is-active": e.key === L.value?.key }]),
2050
- "aria-current": e.key === L.value?.key ? "true" : void 0,
2182
+ class: h(["ca-side__rail-item", { "is-active": e.key === R.value?.key }]),
2183
+ "aria-current": e.key === R.value?.key ? "true" : void 0,
2051
2184
  title: b.value ? D(m)(e.title) : void 0,
2052
- onClick: (t) => re(e.key)
2185
+ onClick: (t) => ie(e.key)
2053
2186
  }, [
2054
2187
  u(c, {
2055
- name: e.icon ?? "grid",
2056
- size: 20
2188
+ name: e.icon,
2189
+ fallback: "grid"
2057
2190
  }, null, 8, ["name"]),
2058
2191
  N(s("span", { class: "ca-side__rail-text" }, E(D(m)(e.title)), 513), [[k, !b.value || D(f).mobileMenuOpen]]),
2059
- z(e) ? (y(), o("span", rr, E(z(e)), 1)) : a("v-if", !0)
2060
- ], 10, nr))), 128))]),
2061
- s("div", ir, [
2192
+ B(e) ? (y(), o("span", or, E(B(e)), 1)) : a("v-if", !0)
2193
+ ], 10, ar))), 128))]),
2194
+ s("div", sr, [
2062
2195
  s("button", {
2063
2196
  type: "button",
2064
2197
  class: "ca-side__tool",
@@ -2069,7 +2202,7 @@ var Vt = {
2069
2202
  }, [u(c, {
2070
2203
  name: b.value ? "view" : "hide",
2071
2204
  size: 18
2072
- }, null, 8, ["name"])], 8, ar),
2205
+ }, null, 8, ["name"])], 8, cr),
2073
2206
  s("button", {
2074
2207
  type: "button",
2075
2208
  class: "ca-side__tool ca-side__tool--collapse",
@@ -2080,14 +2213,14 @@ var Vt = {
2080
2213
  }, [u(c, {
2081
2214
  name: _.value ? "expand" : "fold",
2082
2215
  size: 18
2083
- }, null, 8, ["name"])], 8, or),
2084
- u(j, {
2216
+ }, null, 8, ["name"])], 8, lr),
2217
+ u(A, {
2085
2218
  trigger: "click",
2086
2219
  placement: "right-end",
2087
2220
  onCommand: T
2088
2221
  }, {
2089
- dropdown: M(() => [u(A, null, {
2090
- default: M(() => [D(g).accountPath ? (y(), i(x, {
2222
+ dropdown: M(() => [u(O, null, {
2223
+ default: M(() => [D(g).accountEntry?.side !== !1 && (D(g).accountPath || D(g).onAccountClick) ? (y(), i(x, {
2091
2224
  key: 0,
2092
2225
  command: "account"
2093
2226
  }, {
@@ -2107,31 +2240,31 @@ var Vt = {
2107
2240
  class: "ca-side__tool",
2108
2241
  title: D(d).user?.name,
2109
2242
  "aria-label": D(d).user?.name
2110
- }, [u(on, {
2243
+ }, [u(un, {
2111
2244
  class: "ca-side__avatar",
2112
2245
  name: D(d).user?.name,
2113
2246
  src: D(d).user?.avatar
2114
- }, null, 8, ["name", "src"])], 8, sr)]),
2247
+ }, null, 8, ["name", "src"])], 8, ur)]),
2115
2248
  _: 1
2116
2249
  })
2117
2250
  ])
2118
2251
  ], 2),
2119
2252
  a(" 第二栏:隐藏时宽度渐变到 0(而不是直接消失),首页与其他页之间切换时内容区不会突然跳动 "),
2120
2253
  s("div", {
2121
- class: h(["ca-side__panel", { "is-hidden": R.value }]),
2122
- inert: R.value && !D(f).mobileMenuOpen
2123
- }, [s("div", lr, [
2124
- te.value ? (y(), o("div", ur, E(D(m)(te.value.title)), 1)) : a("v-if", !0),
2254
+ class: h(["ca-side__panel", { "is-hidden": ee.value }]),
2255
+ inert: ee.value && !D(f).mobileMenuOpen
2256
+ }, [s("div", fr, [
2257
+ ne.value ? (y(), o("div", pr, E(D(m)(ne.value.title)), 1)) : a("v-if", !0),
2125
2258
  a(" key 绑定场景:切换场景时重建菜单,展开状态不会串到别的场景 "),
2126
- (y(), i(V, {
2127
- key: te.value?.key,
2259
+ (y(), i(te, {
2260
+ key: ne.value?.key,
2128
2261
  "default-active": D(r).path,
2129
- "default-openeds": B.value,
2262
+ "default-openeds": re.value,
2130
2263
  router: "",
2131
2264
  class: "ca-side__menu",
2132
2265
  onSelect: n[1] ||= (e) => D(f).closeOverlays()
2133
2266
  }, {
2134
- default: M(() => [(y(!0), o(e, null, S(te.value?.children ?? [], (t) => (y(), o(e, { key: t.key }, [a(" 二级是菜单组:可展开,下面是三级页面 "), D(G)(t) ? (y(), i(ee, {
2267
+ default: M(() => [(y(!0), o(e, null, S(ne.value?.children ?? [], (t) => (y(), o(e, { key: t.key }, [a(" 二级是菜单组:可展开,下面是三级页面 "), D(De)(t) ? (y(), i(I, {
2135
2268
  key: 0,
2136
2269
  index: t.key
2137
2270
  }, {
@@ -2141,13 +2274,17 @@ var Vt = {
2141
2274
  name: t.icon
2142
2275
  }, null, 8, ["name"])) : a("v-if", !0),
2143
2276
  s("span", null, E(D(m)(t.title)), 1),
2144
- ne(t) ? (y(), o("span", dr, E(ne(t)), 1)) : a("v-if", !0)
2277
+ z(t) ? (y(), o("span", mr, E(z(t)), 1)) : a("v-if", !0)
2145
2278
  ]),
2146
2279
  default: M(() => [(y(!0), o(e, null, S(t.children, (e) => (y(), i(F, {
2280
+ class: "ca-side__submenu-item",
2147
2281
  key: e.key,
2148
2282
  index: e.path
2149
2283
  }, {
2150
- default: M(() => [s("span", null, E(D(m)(e.title)), 1)]),
2284
+ default: M(() => [e.icon ? (y(), i(c, {
2285
+ key: 0,
2286
+ name: e.icon
2287
+ }, null, 8, ["name"])) : a("v-if", !0), s("span", null, E(D(m)(e.title)), 1)]),
2151
2288
  _: 2
2152
2289
  }, 1032, ["index"]))), 128))]),
2153
2290
  _: 2
@@ -2160,34 +2297,34 @@ var Vt = {
2160
2297
  }, 1032, ["index"])], 2112))], 64))), 128))]),
2161
2298
  _: 1
2162
2299
  }, 8, ["default-active", "default-openeds"]))
2163
- ])], 10, cr)
2164
- ], 2);
2300
+ ])], 10, dr)
2301
+ ], 2)], 2112);
2165
2302
  };
2166
2303
  }
2167
- }), [["__scopeId", "data-v-7e3f4585"]]), pr = {
2304
+ }), [["__scopeId", "data-v-00d0b837"]]), gr = {
2168
2305
  key: 0,
2169
2306
  class: "ca-copyright"
2170
- }, mr = ["href"], hr = /*#__PURE__*/ Y(/* @__PURE__ */ d({
2307
+ }, _r = ["href"], vr = /*#__PURE__*/ X(/* @__PURE__ */ d({
2171
2308
  __name: "CaCopyright",
2172
2309
  setup(t) {
2173
- let r = K().brand, { label: i } = W(), c = n(() => r.copyright ? Be(i(r.copyright)) : ""), l = n(() => r.copyrightLinks ?? []);
2174
- return (t, n) => c.value ? (y(), o("footer", pr, [s("span", null, E(c.value), 1), (y(!0), o(e, null, S(l.value, (t) => (y(), o(e, { key: t.href }, [n[0] ||= s("span", {
2310
+ let r = K().brand, { label: i } = G(), c = n(() => r.copyright ? He(i(r.copyright)) : ""), l = n(() => r.copyrightLinks ?? []);
2311
+ return (t, n) => c.value ? (y(), o("footer", gr, [s("span", null, E(c.value), 1), (y(!0), o(e, null, S(l.value, (t) => (y(), o(e, { key: t.href }, [n[0] ||= s("span", {
2175
2312
  class: "ca-copyright__dot",
2176
2313
  "aria-hidden": "true"
2177
2314
  }, "·", -1), s("a", {
2178
2315
  href: t.href,
2179
2316
  target: "_blank",
2180
2317
  rel: "noopener noreferrer"
2181
- }, E(t.text), 9, mr)], 64))), 128))])) : a("v-if", !0);
2318
+ }, E(t.text), 9, _r)], 64))), 128))])) : a("v-if", !0);
2182
2319
  }
2183
- }), [["__scopeId", "data-v-c51879e8"]]), gr = { class: "ca-tabs" }, _r = ["onClick"], vr = { class: "ca-tabs__more" }, yr = [
2320
+ }), [["__scopeId", "data-v-c51879e8"]]), yr = { class: "ca-tabs" }, br = ["onClick"], xr = { class: "ca-tabs__more" }, Sr = [
2184
2321
  "title",
2185
2322
  "aria-label",
2186
2323
  "aria-pressed"
2187
- ], br = /*#__PURE__*/ Y(/* @__PURE__ */ d({
2324
+ ], Cr = /*#__PURE__*/ X(/* @__PURE__ */ d({
2188
2325
  __name: "TabsBar",
2189
2326
  setup(t) {
2190
- let r = V(), c = H(), d = Z(), f = X(), { t: p, label: g } = W(), _ = new Map(je(K().menus).map((e) => [e.key, e])), b = n(() => d.visited.map((e) => _.get(e)).filter((e) => !!e).map((e) => ({
2327
+ let r = V(), c = H(), d = ft(), f = Z(), { t: p, label: g } = G(), _ = new Map(Me(K().menus).map((e) => [e.key, e])), b = n(() => d.visited.map((e) => _.get(e)).filter((e) => !!e).map((e) => ({
2191
2328
  key: e.key,
2192
2329
  path: e.path,
2193
2330
  title: g(e.title),
@@ -2231,7 +2368,7 @@ var Vt = {
2231
2368
  }
2232
2369
  return (t, n) => {
2233
2370
  let r = w("ca-icon"), d = w("ca-dropdown-item"), m = w("ca-dropdown-menu"), g = w("ca-dropdown");
2234
- return y(), o("div", gr, [
2371
+ return y(), o("div", yr, [
2235
2372
  (y(!0), o(e, null, S(T.value, (t) => (y(), o("div", {
2236
2373
  key: t.name,
2237
2374
  ref_for: !0,
@@ -2255,7 +2392,7 @@ var Vt = {
2255
2392
  class: "ca-tabs__close",
2256
2393
  onClick: P((t) => j(e.key), ["stop"])
2257
2394
  }, null, 8, ["onClick"])) : a("v-if", !0)
2258
- ], 10, _r))), 128))], 2))), 128)),
2395
+ ], 10, br))), 128))], 2))), 128)),
2259
2396
  u(g, {
2260
2397
  trigger: "click",
2261
2398
  onCommand: I
@@ -2291,7 +2428,7 @@ var Vt = {
2291
2428
  ]),
2292
2429
  _: 1
2293
2430
  })]),
2294
- default: M(() => [s("span", vr, [u(r, { name: "arrowDown" })])]),
2431
+ default: M(() => [s("span", xr, [u(r, { name: "arrowDown" })])]),
2295
2432
  _: 1
2296
2433
  }),
2297
2434
  a(" 内容全屏:隐藏头部和侧栏,再点一次恢复 "),
@@ -2302,100 +2439,119 @@ var Vt = {
2302
2439
  "aria-label": D(f).contentFullscreen ? D(p)("campus.tabs.exitFullscreen") : D(p)("campus.tabs.fullscreen"),
2303
2440
  "aria-pressed": D(f).contentFullscreen,
2304
2441
  onClick: n[0] ||= (e) => D(f).toggleContentFullscreen()
2305
- }, [u(r, { name: D(f).contentFullscreen ? "exitFullscreen" : "fullscreen" }, null, 8, ["name"])], 8, yr)
2442
+ }, [u(r, { name: D(f).contentFullscreen ? "exitFullscreen" : "fullscreen" }, null, 8, ["name"])], 8, Sr)
2306
2443
  ]);
2307
2444
  };
2308
2445
  }
2309
- }), [["__scopeId", "data-v-1d7ba823"]]), xr = 1200, Sr = "(max-width: 768px)", Cr = `(min-width: 769px) and (max-width: ${xr}px)`, wr = ["aria-label"], Tr = ["aria-label"], Er = { class: "ca-main" }, Dr = { class: "ca-content" }, Or = { class: "ca-content__page" }, kr = /*#__PURE__*/ Y(/* @__PURE__ */ d({
2446
+ }), [["__scopeId", "data-v-1d7ba823"]]), wr = 1200, Tr = "(max-width: 768px)", Er = `(min-width: 769px) and (max-width: ${wr}px)`, Dr = ["aria-label"], Or = ["aria-label"], kr = { class: "ca-main" }, Ar = {
2447
+ key: 0,
2448
+ class: "ca-screen-prompt",
2449
+ role: "status"
2450
+ }, jr = { class: "ca-content" }, Mr = { class: "ca-content__page" }, Nr = /*#__PURE__*/ X(/* @__PURE__ */ d({
2310
2451
  __name: "CaLayout",
2311
2452
  setup(e) {
2312
- let n = V(), r = Z(), c = X(), { t: l } = W(), d = window.matchMedia(Sr), f = window.matchMedia(Cr), p = "";
2313
- function m() {
2314
- let e = d.matches ? "phone" : f.matches ? "pad" : "desktop";
2453
+ let n = V(), r = ft(), c = Z(), { t: d } = G(), f = window.matchMedia(Tr), p = window.matchMedia(Er), m = "";
2454
+ function g() {
2455
+ let e = f.matches ? "phone" : p.matches ? "pad" : "desktop";
2315
2456
  c.setMode(e);
2316
2457
  }
2317
- m(), A(() => c.mode === "phone" && c.mobileMenuOpen, (e) => {
2318
- e ? (p = document.body.style.overflow, document.body.style.overflow = "hidden") : document.body.style.overflow = p;
2458
+ g(), A(() => c.mode === "phone" && c.mobileMenuOpen, (e) => {
2459
+ e ? (m = document.body.style.overflow, document.body.style.overflow = "hidden") : document.body.style.overflow = m;
2319
2460
  }), A(() => n.fullPath, () => c.closeOverlays());
2320
- function g(e) {
2461
+ function b(e) {
2321
2462
  e.key === "Escape" && (c.mobileMenuOpen || c.padPanelOpen ? c.closeOverlays() : c.contentFullscreen && c.toggleContentFullscreen());
2322
2463
  }
2323
2464
  v(() => {
2324
- m(), d.addEventListener("change", m), f.addEventListener("change", m), window.addEventListener("keydown", g);
2465
+ g(), f.addEventListener("change", g), p.addEventListener("change", g), window.addEventListener("keydown", b), document.addEventListener("fullscreenchange", c.syncPageScreen);
2325
2466
  }), _(() => {
2326
- d.removeEventListener("change", m), f.removeEventListener("change", m), window.removeEventListener("keydown", g), document.body.style.overflow = p;
2467
+ f.removeEventListener("change", g), p.removeEventListener("change", g), window.removeEventListener("keydown", b), document.removeEventListener("fullscreenchange", c.syncPageScreen), c.applyPageOpenMode("normal"), document.body.style.overflow = m;
2327
2468
  });
2328
- function b() {
2469
+ function x() {
2329
2470
  let e = n.meta.pageKey;
2330
2471
  return e ? `${e}:${r.versions[e] ?? 0}` : n.fullPath;
2331
2472
  }
2332
2473
  return (e, n) => {
2333
- let d = w("router-view");
2334
- return y(), o("div", { class: h(["ca-shell", { "is-fullscreen": D(c).contentFullscreen }]) }, [N(u(Bn, null, null, 512), [[k, !D(c).contentFullscreen]]), s("div", { class: h(["ca-body", { "is-fullscreen": D(c).contentFullscreen }]) }, [
2474
+ let f = w("ca-button"), p = w("router-view");
2475
+ return y(), o("div", { class: h(["ca-shell", { "is-fullscreen": D(c).contentFullscreen }]) }, [N(u(Wn, null, null, 512), [[k, !D(c).contentFullscreen]]), s("div", { class: h(["ca-body", { "is-fullscreen": D(c).contentFullscreen }]) }, [
2335
2476
  D(c).mode === "phone" && D(c).mobileMenuOpen ? (y(), o("button", {
2336
2477
  key: 0,
2337
2478
  type: "button",
2338
2479
  class: "ca-mobile-scrim",
2339
- "aria-label": D(l)("campus.side.closeMenu"),
2480
+ "aria-label": D(d)("campus.side.closeMenu"),
2340
2481
  onClick: n[0] ||= (e) => D(c).closeMobileMenu()
2341
- }, null, 8, wr)) : a("v-if", !0),
2482
+ }, null, 8, Dr)) : a("v-if", !0),
2342
2483
  D(c).mode === "pad" && D(c).padPanelOpen ? (y(), o("button", {
2343
2484
  key: 1,
2344
2485
  type: "button",
2345
2486
  class: "ca-pad-scrim",
2346
- "aria-label": D(l)("campus.side.closeMenu"),
2487
+ "aria-label": D(d)("campus.side.closeMenu"),
2347
2488
  onClick: n[1] ||= (e) => D(c).closePadPanel()
2348
- }, null, 8, Tr)) : a("v-if", !0),
2349
- N(u(fr, {
2489
+ }, null, 8, Or)) : a("v-if", !0),
2490
+ a(" 手机抽屉关闭时、电脑档两栏都收起时,侧栏不在屏幕上,不可聚焦 "),
2491
+ N(u(hr, {
2350
2492
  class: h({ "is-mobile-open": D(c).mobileMenuOpen }),
2351
- inert: D(c).mode === "phone" && !D(c).mobileMenuOpen
2493
+ inert: D(c).mode === "phone" && !D(c).mobileMenuOpen || D(c).sideHiddenActive
2352
2494
  }, null, 8, ["class", "inert"]), [[k, !D(c).contentFullscreen]]),
2353
- s("main", Er, [
2354
- u(br),
2355
- u(Kn),
2356
- s("div", Dr, [
2357
- u(Zn),
2495
+ s("main", kr, [
2496
+ u(Cr),
2497
+ u(Xn),
2498
+ D(c).pageScreenPrompt ? (y(), o("div", Ar, [u(f, {
2499
+ size: "small",
2500
+ onClick: n[2] ||= (e) => D(c).retryPageScreen()
2501
+ }, {
2502
+ default: M(() => [l(E(D(d)("campus.tabs.enterScreen")), 1)]),
2503
+ _: 1
2504
+ }), u(f, {
2505
+ size: "small",
2506
+ "aria-label": D(d)("campus.tabs.dismissScreen"),
2507
+ onClick: n[3] ||= (e) => D(c).dismissPageScreenPrompt()
2508
+ }, {
2509
+ default: M(() => [l(E(D(d)("campus.tabs.dismissScreen")), 1)]),
2510
+ _: 1
2511
+ }, 8, ["aria-label"])])) : a("v-if", !0),
2512
+ s("div", jr, [
2513
+ u(er),
2358
2514
  a(" 页面区撑满剩余高度,版权在其后:内容少时贴窗口底,内容长时滚到最底才出现 "),
2359
- s("div", Or, [u(d, null, {
2515
+ s("div", Mr, [u(p, null, {
2360
2516
  default: M(({ Component: e }) => [a(" include 与标签名单同步;缓存容量包含固定标签。 "), (y(), i(t, {
2361
2517
  include: D(r).cached,
2362
2518
  max: D(r).maxTabs + D(r).affixKeys.length
2363
- }, [e ? (y(), i(T(e), { key: b() })) : a("v-if", !0)], 1032, ["include", "max"]))]),
2519
+ }, [e ? (y(), i(T(e), { key: x() })) : a("v-if", !0)], 1032, ["include", "max"]))]),
2364
2520
  _: 1
2365
2521
  })]),
2366
- u(hr)
2522
+ u(vr)
2367
2523
  ])
2368
2524
  ])
2369
2525
  ], 2)], 2);
2370
2526
  };
2371
2527
  }
2372
- }), [["__scopeId", "data-v-3a849ce7"]]), Ar = { class: "ca-exception" }, jr = { class: "ca-exception__code" }, Mr = { class: "ca-exception__text" }, Nr = /*#__PURE__*/ Y(/* @__PURE__ */ d({
2528
+ }), [["__scopeId", "data-v-90594751"]]), Pr = { class: "ca-exception" }, Fr = { class: "ca-exception__code" }, Ir = { class: "ca-exception__text" }, Lr = /*#__PURE__*/ X(/* @__PURE__ */ d({
2373
2529
  __name: "ExceptionPage",
2374
2530
  props: { kind: {} },
2375
2531
  setup(e) {
2376
- let t = e, r = H(), { t: i } = W(), a = n(() => t.kind === "forbidden" ? "403" : "404"), c = n(() => i(t.kind === "forbidden" ? "campus.error.forbidden" : "campus.error.notFound"));
2532
+ let t = e, r = H(), i = Ne(K()).home, { t: a } = G(), c = n(() => t.kind === "forbidden" ? "403" : "404"), d = n(() => a(t.kind === "forbidden" ? "campus.error.forbidden" : "campus.error.notFound"));
2377
2533
  return (e, t) => {
2378
2534
  let n = w("ca-button");
2379
- return y(), o("div", Ar, [
2380
- s("div", jr, E(a.value), 1),
2381
- s("p", Mr, E(c.value), 1),
2535
+ return y(), o("div", Pr, [
2536
+ s("div", Fr, E(c.value), 1),
2537
+ s("p", Ir, E(d.value), 1),
2382
2538
  u(n, {
2383
2539
  type: "primary",
2384
- onClick: t[0] ||= (e) => D(r).replace("/")
2540
+ onClick: t[0] ||= (e) => D(r).replace(D(i))
2385
2541
  }, {
2386
- default: M(() => [l(E(D(i)("campus.error.backHome")), 1)]),
2542
+ default: M(() => [l(E(D(a)("campus.error.backHome")), 1)]),
2387
2543
  _: 1
2388
2544
  })
2389
2545
  ]);
2390
2546
  };
2391
2547
  }
2392
- }), [["__scopeId", "data-v-ffcb23b0"]]), Pr = { class: "ca-login" }, Fr = { class: "ca-login__main" }, Ir = { class: "ca-login__card" }, Lr = { class: "ca-login__brand" }, Rr = ["src"], zr = { class: "ca-login__name" }, Br = {
2548
+ }), [["__scopeId", "data-v-75a54c8a"]]), Rr = { class: "ca-login" }, zr = { class: "ca-login__main" }, Br = { class: "ca-login__card" }, Vr = { class: "ca-login__brand" }, Hr = ["src"], Ur = { class: "ca-login__name" }, Wr = {
2393
2549
  key: 1,
2394
2550
  class: "ca-login__subtitle"
2395
- }, Vr = /*#__PURE__*/ Y(/* @__PURE__ */ d({
2551
+ }, Gr = /*#__PURE__*/ X(/* @__PURE__ */ d({
2396
2552
  __name: "LoginPage",
2397
2553
  setup(e) {
2398
- let t = V(), r = H(), c = Q(), d = ze(), { t: f, label: p } = W(), m = K().brand, h = n(() => p(d.theme.siteName ?? m.name)), g = n(() => d.theme.logo ?? m.logo), _ = J(), v = b({
2554
+ let t = V(), r = H(), c = Q(), d = Ve(), { t: f, label: p } = G(), m = K().brand, h = n(() => p(d.theme.siteName ?? m.name)), g = n(() => d.theme.logo ?? m.logo), _ = Y(), v = b({
2399
2555
  username: "",
2400
2556
  password: "",
2401
2557
  captcha: ""
@@ -2431,7 +2587,7 @@ var Vt = {
2431
2587
  key: S.value,
2432
2588
  code: v.captcha
2433
2589
  } : void 0
2434
- }), await r.replace(He(t.query.redirect));
2590
+ }), await r.replace(We(t.query.redirect));
2435
2591
  } catch (e) {
2436
2592
  k.value = e instanceof Error && e.message ? e.message : f("campus.login.failed"), C.value?.refresh();
2437
2593
  } finally {
@@ -2440,16 +2596,16 @@ var Vt = {
2440
2596
  }
2441
2597
  return (e, t) => {
2442
2598
  let n = w("ca-alert"), r = w("ca-input"), c = w("ca-form-item"), d = w("ca-button"), b = w("ca-form");
2443
- return y(), o("div", Pr, [s("div", Fr, [s("div", Ir, [
2444
- s("div", Lr, [
2599
+ return y(), o("div", Rr, [s("div", zr, [s("div", Br, [
2600
+ s("div", Vr, [
2445
2601
  g.value ? (y(), o("img", {
2446
2602
  key: 0,
2447
2603
  src: g.value,
2448
2604
  alt: "",
2449
2605
  class: "ca-login__logo"
2450
- }, null, 8, Rr)) : a("v-if", !0),
2451
- s("h1", zr, E(h.value), 1),
2452
- D(m).subtitle ? (y(), o("p", Br, E(D(p)(D(m).subtitle)), 1)) : a("v-if", !0)
2606
+ }, null, 8, Hr)) : a("v-if", !0),
2607
+ s("h1", Ur, E(h.value), 1),
2608
+ D(m).subtitle ? (y(), o("p", Wr, E(D(p)(D(m).subtitle)), 1)) : a("v-if", !0)
2453
2609
  ]),
2454
2610
  k.value ? (y(), i(n, {
2455
2611
  key: 0,
@@ -2493,7 +2649,7 @@ var Vt = {
2493
2649
  key: 0,
2494
2650
  prop: "captcha"
2495
2651
  }, {
2496
- default: M(() => [u(gt, {
2652
+ default: M(() => [u(bt, {
2497
2653
  ref_key: "captchaRef",
2498
2654
  ref: C,
2499
2655
  code: v.captcha,
@@ -2516,12 +2672,12 @@ var Vt = {
2516
2672
  ]),
2517
2673
  _: 1
2518
2674
  }, 8, ["model", "rules"])
2519
- ])]), u(hr, { class: "ca-login__copyright" })]);
2675
+ ])]), u(vr, { class: "ca-login__copyright" })]);
2520
2676
  };
2521
2677
  }
2522
2678
  }), [["__scopeId", "data-v-ddf636fd"]]);
2523
2679
  // packages/core/src/router.ts
2524
- function Hr(e) {
2680
+ function Kr(e) {
2525
2681
  return async () => {
2526
2682
  let t = await e.component();
2527
2683
  return d({
@@ -2530,119 +2686,133 @@ function Hr(e) {
2530
2686
  });
2531
2687
  };
2532
2688
  }
2533
- var Ur = d({
2689
+ var qr = d({
2534
2690
  name: "CaForbidden",
2535
- setup: () => () => f(Nr, { kind: "forbidden" })
2536
- }), Wr = d({
2691
+ setup: () => () => f(Lr, { kind: "forbidden" })
2692
+ }), Jr = d({
2537
2693
  name: "CaNotFound",
2538
- setup: () => () => f(Nr, { kind: "notFound" })
2694
+ setup: () => () => f(Lr, { kind: "notFound" })
2539
2695
  });
2540
- function Gr(e, t) {
2541
- let n = je(e.menus);
2696
+ function Yr(e, t) {
2697
+ let n = Me(e.menus);
2542
2698
  if (!n.length) throw Error("[campus] 菜单里至少需要一个页面");
2543
- Me(e.accountPath, n);
2544
- let r = [
2699
+ let r = Ne(e), i = q(e);
2700
+ if (new Set(Object.values(i)).size !== 5 || n.some((e) => Object.values(i).includes(e.key))) throw Error("[campus] 系统路由名称重复或与页面键冲突,请配置 routeNames");
2701
+ for (let e of n) if ([
2702
+ r.login,
2703
+ r.register,
2704
+ r.forgot,
2705
+ r.forbidden,
2706
+ r.notFound
2707
+ ].includes(e.path)) throw Error(`[campus] 菜单路径与系统页面冲突:${e.path}`);
2708
+ let a = [
2545
2709
  {
2546
- path: "/login",
2547
- name: "login",
2548
- component: e.login?.style === "split" ? At : Vr,
2710
+ path: r.login,
2711
+ name: i.login,
2712
+ component: e.login?.style === "split" ? Pt : Gr,
2549
2713
  meta: { public: !0 }
2550
2714
  },
2551
2715
  {
2552
- path: "/register",
2553
- name: "register",
2554
- component: Zt,
2716
+ path: r.register,
2717
+ name: i.register,
2718
+ component: tn,
2555
2719
  meta: { public: !0 }
2556
2720
  },
2557
2721
  {
2558
- path: "/forgot",
2559
- name: "forgot",
2560
- component: tn,
2722
+ path: r.forgot,
2723
+ name: i.forgot,
2724
+ component: on,
2561
2725
  meta: { public: !0 }
2562
2726
  },
2563
2727
  {
2564
2728
  path: "/",
2565
- component: kr,
2729
+ component: Nr,
2566
2730
  redirect: n.some((e) => e.path === "/") ? void 0 : () => {
2567
2731
  let e = Q(t);
2568
- return n.find((t) => e.can(t.permission))?.path ?? "/403";
2732
+ return r.home === "/" ? n.find((t) => e.can(t.permission))?.path ?? r.forbidden : r.home;
2569
2733
  },
2570
2734
  children: [
2571
2735
  ...n.map((e) => ({
2572
2736
  path: e.path,
2573
2737
  name: e.key,
2574
- component: Hr(e),
2738
+ component: Kr(e),
2575
2739
  meta: {
2576
2740
  pageKey: e.key,
2577
2741
  appKey: e.appKey,
2578
2742
  groupKey: e.groupKey,
2579
- permission: e.permission
2743
+ permission: e.permission,
2744
+ sideCollapse: e.sideCollapse,
2745
+ openMode: e.openMode
2580
2746
  }
2581
2747
  })),
2582
2748
  {
2583
- path: "/403",
2584
- name: "forbidden",
2585
- component: Ur
2749
+ path: r.forbidden,
2750
+ name: i.forbidden,
2751
+ component: qr
2586
2752
  },
2587
2753
  {
2754
+ path: r.notFound,
2755
+ name: i.notFound,
2756
+ component: Jr
2757
+ },
2758
+ ...r.notFound === "/:pathMatch(.*)*" ? [] : [{
2588
2759
  path: "/:pathMatch(.*)*",
2589
- name: "not-found",
2590
- component: Wr
2591
- }
2760
+ redirect: { name: i.notFound }
2761
+ }]
2592
2762
  ]
2593
2763
  }
2594
- ], i = re({
2764
+ ], o = re({
2595
2765
  history: e.history === "web" ? ae() : ie(),
2596
- routes: r
2597
- });
2598
- return i.beforeEach((e) => {
2599
- let n = Q(t);
2600
- return e.meta.public ? n.isLoggedIn && e.name === "login" ? { path: "/" } : !0 : n.isLoggedIn ? n.can(e.meta.permission) ? !0 : { name: "forbidden" } : {
2601
- name: "login",
2602
- query: e.fullPath === "/" ? void 0 : { redirect: e.fullPath }
2766
+ routes: a
2767
+ }), s = Z(t);
2768
+ return o.beforeEach((e, n) => {
2769
+ let a = Q(t);
2770
+ 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 } : {
2771
+ name: i.login,
2772
+ query: e.fullPath === r.home ? void 0 : { redirect: e.fullPath }
2603
2773
  };
2604
- }), i.afterEach((e) => {
2605
- e.meta.pageKey && Z(t).open(e.meta.pageKey);
2606
- }), i;
2774
+ }), o.afterEach((e, n, r) => {
2775
+ r ? s.cancelPageScreen() : (e.path === n.path && n.matched.length || s.applyPageOpenMode(e.meta.openMode, e.meta.sideCollapse), e.meta.pageKey && ft(t).open(e.meta.pageKey));
2776
+ }), o.onError(() => s.cancelPageScreen()), o;
2607
2777
  }
2608
2778
  // packages/core/src/services/login.ts
2609
- async function Kr(e, t, n, r) {
2610
- e.signIn(n), await t.replace(He(r));
2779
+ async function Xr(e, t, n, r) {
2780
+ e.signIn(n), await t.replace(We(r));
2611
2781
  }
2612
2782
  // packages/core/src/services/auth.ts
2613
- var qr, Jr;
2614
- function Yr(e, t) {
2615
- qr = e, Jr = t;
2783
+ var Zr, Qr;
2784
+ function $r(e, t) {
2785
+ Zr = e, Qr = t;
2616
2786
  }
2617
- async function Xr(e) {
2618
- if (K(), !qr || !Jr) return;
2619
- let t = Q(Jr);
2787
+ async function ei(e) {
2788
+ if (K(), !Zr || !Qr) return;
2789
+ let t = Q(Qr);
2620
2790
  if (!t.isLoggedIn) return;
2621
- t.expire(), Vt.toast.warning(e || Te("campus.auth.sessionExpired"));
2622
- let n = qr.currentRoute.value;
2623
- n.name !== "login" && await qr.replace({
2624
- name: "login",
2625
- query: n.fullPath === "/" ? void 0 : { redirect: n.fullPath }
2791
+ t.expire(), Gt.toast.warning(e || we("campus.auth.sessionExpired"));
2792
+ let n = Zr.currentRoute.value;
2793
+ n.name !== "login" && await Zr.replace({
2794
+ name: q(K()).login,
2795
+ query: n.fullPath === Ne(K()).home ? void 0 : { redirect: n.fullPath }
2626
2796
  });
2627
2797
  }
2628
- async function Zr(e, t) {
2629
- if (K(), !qr || !Jr) throw Error("[campus] 应用尚未创建,无法完成登录");
2630
- await Kr(Q(Jr), qr, e, t);
2798
+ async function ti(e, t) {
2799
+ if (K(), !Zr || !Qr) throw Error("[campus] 应用尚未创建,无法完成登录");
2800
+ await Xr(Q(Qr), Zr, e, t);
2631
2801
  }
2632
2802
  // packages/core/src/app.ts
2633
- function Qr(e) {
2634
- Mt(e), ke(e);
2635
- let t = r(De), n = F();
2803
+ function ni(e) {
2804
+ It(e), ke(e);
2805
+ let t = r(Ee), n = F();
2636
2806
  t.use(n);
2637
- let i = Ce(e);
2807
+ let i = Se(e);
2638
2808
  t.use(i);
2639
2809
  let a = (e, t) => i.global.t(e, t ?? {});
2640
- t.provide(R, a), Ft(a), t.config.globalProperties.$ca = Vt, L(t), t.component("CaAuthPreview", nn);
2641
- let o = Gr(e, n);
2642
- return Yr(o, n), t.use(o), ze(n).boot(), t;
2810
+ t.provide(R, a), zt(a), t.config.globalProperties.$ca = Gt, L(t), t.component("CaAuthPreview", sn);
2811
+ let o = Yr(e, n);
2812
+ return $r(o, n), t.use(o), Ve(n).boot(), t;
2643
2813
  }
2644
2814
  // packages/core/src/index.ts
2645
- function $r(e) {
2815
+ function ri(e) {
2646
2816
  return e;
2647
2817
  }
2648
- export { Vt as ca, Zr as completeLogin, Qr as createCampusApp, $r as defineMenus, Xr as handleUnauthorized, jt as resolveEnvironment, Te as t, W as useCampusT, X as useLayoutStore, Q as useSessionStore, Z as useTabsStore, ze as useThemeStore };
2818
+ export { Gt as ca, ti as completeLogin, ni as createCampusApp, ri as defineMenus, ei as handleUnauthorized, Ft as resolveEnvironment, we as t, G as useCampusT, Z as useLayoutStore, Q as useSessionStore, ft as useTabsStore, Ve as useThemeStore };