docs: annotate remaining routes layouts and view boundaries

This commit is contained in:
cieanyau committed 2026-11-06 00:34:17 +08:00
1 parent 408f8e5c98
commit ab22d406c0
56 files changed
+403

No files matched your search

+13
View File
@@ -1,4 +1,7 @@
<script>
/**
* 会员中心主布局:组合静态导航与服务端导航权限、面包屑、消息邮箱、账户菜单及移动侧栏。后端导航具有权威性时,不自行补回被关闭入口。
*/
import "~/assets/styles/ConsoleLegalFooter.DAYWmXIB.css";
import "~/assets/styles/BackendNavigation.CEj4LnzI.css";
import "~/assets/styles/BackendNavEntry.Bx6IPica.css";
@@ -308,6 +311,7 @@ var Ce = {
.filter((e) => e.items.length),
),
Je = computed(() => backend_menu_a(j, qe.value, P.value));
// 规范化后端菜单并记录其覆盖路径,为静态菜单合成和当前导航判断提供同一数据。
function Ye(e, t) {
((e = backend_menu_l(e)), (P.value = e), (F.value = t));
let n = [],
@@ -332,17 +336,21 @@ var Ce = {
},
);
let I = ref({});
// 根据当前路由判断父菜单初始展开,实例详情归入服务器菜单。
function L(e) {
return O.path === `/servers/server` && e.label === `服务器`
? !0
: (e.children?.some((t) => R(t.to, e.children)) ?? !1);
}
// 菜单匹配交给公共路径/查询匹配工具,避免仅前缀判断导致高亮错误。
function R(e, t = []) {
return backend_menu_c(e, O, t);
}
// 用户显式切换父菜单展开状态,覆盖当前路由推导的初始值。
function Xe(e) {
I.value[e.label] = !z(e);
}
// 先读取用户手动展开选择,未选择时再使用路由推导值。
function z(e) {
return I.value[e.label] ?? L(e);
}
@@ -388,9 +396,11 @@ var Ce = {
]),
{ count: V, recent: H, refresh: U } = useMailbox_t(),
W = ref(!1);
// 打开消息面板时刷新公共邮箱数据,不用旧未读计数代替最新消息。
async function Qe(e) {
((W.value = !0), await U());
}
// 选中最近消息后关闭浮层,并通过消息页查询 ID 打开详情。
function $e(e) {
((W.value = !1),
D.push({
@@ -400,6 +410,7 @@ var Ce = {
},
}));
}
// 进入完整消息列表时关闭当前消息浮层。
function et() {
((W.value = !1), D.push(`/messages`));
}
@@ -435,6 +446,7 @@ var Ce = {
await nextTick(),
J.value && q.value?.focus());
}));
// 移动侧栏打开时处理 Escape 和 Tab 焦点循环,防止键盘焦点移到被遮住的页面。
function tt(e) {
if (!J.value || !G.value) return;
if (e.key === `Escape`) {
@@ -537,6 +549,7 @@ var Ce = {
useHead(() => ({
title: `${$.value.at(-1) || `会员中心`} - ${A.siteName.value}`,
})),
// 导航、面包屑和账户/消息浮层来自同一布局状态;移动侧栏需保留焦点约束与滚动锁清理。
(e, r) => {
let a = BackendNavEntry,
s = Icon,