1f545fb489
测试验证发现3个问题并修复: 1. TASK-007 社保联动:Organization.socialInsCutoffDay 字段缺失, createDraft 未自动推导社保/公积金截止月。 - 新增 Organization.socialInsCutoffDay 字段(默认15日) - createDraft 中根据离职日期与截止日比较,自动推导截止月 - cutoffDay 日前离职 → 截止月=离职月-1,日后 → 截止月=离职月 2. TASK-002 补偿金合计:createTerminationDraftSchema 缺少 compensationBreakdown 和 checklistOverrides 字段,导致 zod parse 时被过滤。已补充字段声明。 3. TASK-028 去掉用工办理:Breadcrumb 中 /work-process 标签仍为 "用工办理",已改为"批量流程"。 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
64 lines
2.6 KiB
TypeScript
64 lines
2.6 KiB
TypeScript
/**
|
|
* 面包屑导航组件
|
|
* 根据当前路由自动生成分组 > 页面 的层级面包屑
|
|
*/
|
|
|
|
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: '总览' },
|
|
'/calendar': { group: '工作台', label: '工作日历' },
|
|
'/roster': { group: '员工管理', label: '花名册' },
|
|
'/work-process': { group: '员工管理', label: '批量流程' },
|
|
'/attendance': { group: '员工管理', label: '考勤确认' },
|
|
'/leave-approval': { group: '员工管理', label: '休假审批' },
|
|
'/termination': { group: '员工管理', label: '解聘补偿' },
|
|
'/special-status': { group: '员工管理', label: '特殊状态' },
|
|
'/training-records': { group: '员工管理', label: '培训记录' },
|
|
'/performance-records': { group: '员工管理', label: '绩效考核' },
|
|
'/disciplinary-records': { 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>
|
|
)
|
|
}
|