feat: 参考原型图 ui优化提交 个人端-用户中心 相关的页面
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
Copyright (C) 2025 QuantumNous
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Breadcrumb } from 'antd';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
// 路径末段 → 侧栏菜单名;随角色变化的页面(审批中心/消耗明细等)不登记,由页头标题兜底。
|
||||
const orgPageTitles = {
|
||||
workbench: '工作台',
|
||||
'cloud-brain': '云端大脑',
|
||||
knowledge: '企业知识',
|
||||
'my-capabilities': '我的 AI 能力',
|
||||
'skill-center': '技能中心',
|
||||
'skill-assignments': '分发与锁定',
|
||||
experts: '企业专家工坊',
|
||||
connectors: 'Connector 管理',
|
||||
effectiveness: '效能分析',
|
||||
quality: '调用质量',
|
||||
'agent-audit': 'Agent 任务审计',
|
||||
dashboard: '数据看板',
|
||||
departments: '部门管理',
|
||||
'dept-manage': '部门管理',
|
||||
'project-manage': '我的项目',
|
||||
projects: '项目管理',
|
||||
budgets: '预算中心',
|
||||
tokens: '令牌管理',
|
||||
recharge: '企业充值',
|
||||
audit: '审计日志',
|
||||
'personal-settings': '个人设置',
|
||||
settings: '企业设置',
|
||||
};
|
||||
|
||||
/** 企业端统一面包屑:“企业中心 / 当前页面”,样式与用户中心一致。current 仅在路径未登记时兜底。 */
|
||||
export default function OrgBreadcrumb({ current }) {
|
||||
const { pathname } = useLocation();
|
||||
const { t } = useTranslation();
|
||||
const key = pathname.split('/').filter(Boolean)[1];
|
||||
const mapped = orgPageTitles[key];
|
||||
const title = mapped ? t(mapped) : current;
|
||||
if (!title) return null;
|
||||
return (
|
||||
<Breadcrumb
|
||||
className='ui-dashboard-breadcrumb ui-user-center-breadcrumb'
|
||||
items={[{ title: t('企业中心') }, { title }]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user