fix(web): 侧栏选中精确匹配、页头标题左对齐、添加按钮移至标题行、工作台补内容区 Card
douyin-release-gate / verify (push) Failing after 3m51s

- ProLayout 默认按路径前缀高亮菜单(/accounts 与 /accounts/import 同时选中),改为受控 selectedKeys(metadata.menuSelectedKey 最长前缀精确匹配,详情页回落父级)
- 页面标题/副标题从 PageContainer extra(右上)移到 title 槽(左上),动作按钮经 PageActions Context 渲染到 extra 与标题同行
- 新增 web/src/components/PageActions.tsx;账号导入/我的账号/监控账号/运行环境/网关/网络出口 六处列表页注册各自按钮并移除卡内独占行(重复副标题的小字提示一并移除)
- 运营工作台根节点包 Card variant=outlined,operations 标签页去掉冗余内层 Card
- dashboard 移除内层 PageContainer,避免与全局页头双标题
This commit is contained in:
2026-09-23 11:21:28 +08:00
parent caf4b0fdcb
commit ebd99f91d2
10 changed files with 146 additions and 101 deletions
+14
View File
@@ -74,3 +74,17 @@ export function pageMetadata(pathname: string): { title: string; subtitle: strin
}
return { title: 'CreatorHub', subtitle: '运营控制台' };
}
export function menuSelectedKey(pathname: string): string {
const leafPaths = menu.flatMap((group) => (group.children ?? []).map((item) => item.path ?? ''));
const segments = pathname.split('/').filter(Boolean);
for (let i = segments.length; i >= 1; i--) {
const candidate = `/${segments.slice(0, i).join('/')}`;
if (leafPaths.includes(candidate)) return candidate;
}
return pathname;
}
// 侧栏选中态:ProLayout 默认按路径前缀高亮(/accounts 是 /accounts/import 的前缀,两项会同时高亮)。
// 这里改为受控 selectedKeys:从完整路径逐段向前回退,仅精确命中菜单叶路径;
// 详情页(如 /accounts/123、/accounts/new)回落到父级菜单项。