feat: 系统优化Phase2 - 面包屑导航/侧边栏间距/制度公示阅读签收/模板变量中文化/通知类型补全

- 面包屑导航组件,集成至TopNav header
- 侧边栏菜单分组间距增大,分组间分隔线
- 制度公示员工阅读签收:PolicyReadRecord模型、portal路由、管理端阅读统计
- 修复Policies.tsx民主程序推进bug(字段名/API路径/参数)
- 用工文本模板变量名英文转中文显示
- 通知类型TYPE_LABELS补全(RISK_ALERT/SOCIAL_INS/OVERTIME_ALERT/PAYSLIP_READY)
- 通知示例数据补充
- h2标题统一为text-sm font-medium
- 新增run.md
This commit is contained in:
selfrelease
2026-07-26 20:32:38 +08:00
parent 9cb0d1f63b
commit d79e3baa34
71 changed files with 18561 additions and 3230 deletions
@@ -0,0 +1,56 @@
/**
* 面包屑导航组件
* 根据当前路由自动生成分组 > 页面 的层级面包屑
*/
import { Link, useLocation } from 'react-router-dom'
import { ChevronRight, Home } from 'lucide-react'
interface BreadcrumbItem {
group: string
label: string
}
const ROUTE_MAP: Record<string, BreadcrumbItem> = {
'/': { group: '工作台', label: '总览' },
'/roster': { group: '员工管理', label: '花名册' },
'/attendance': { group: '员工管理', label: '考勤确认' },
'/termination': { group: '员工管理', label: '解聘补偿' },
'/money': { group: '薪税社保', label: '薪税管理' },
'/social': { group: '薪税社保', label: '社保公积金' },
'/evidence': { group: '合规风控', label: '证据链' },
'/policies': { group: '合规风控', label: '规章制度' },
'/tools/health-check': { group: '合规风控', label: '用工体检' },
'/tools/medical-period': { group: '合规风控', label: '医疗期计算' },
'/tools/annual-value': { group: '合规风控', label: '年度价值' },
'/ai-assistant': { group: 'AI 辅助', label: 'AI 顾问' },
'/templates': { group: 'AI 辅助', label: '文本模板' },
'/notifications': { group: '系统', label: '通知管理' },
'/audit': { group: '系统', label: '操作日志' },
'/settings': { group: '系统', label: '设置' },
}
export default function Breadcrumb() {
const location = useLocation()
const path = location.pathname
const item = ROUTE_MAP[path]
if (!item) return null
return (
<nav className="flex items-center gap-1 text-xs text-gray-400" aria-label="面包屑导航">
<Link to="/" className="flex items-center gap-1 hover:text-gray-600 transition-colors">
<Home className="w-3 h-3" />
<span></span>
</Link>
{item.group !== '工作台' && (
<>
<ChevronRight className="w-3 h-3 text-gray-300" />
<span className="text-gray-400">{item.group}</span>
</>
)}
<ChevronRight className="w-3 h-3 text-gray-300" />
<span className="text-gray-700 font-medium">{item.label}</span>
</nav>
)
}