/** * 员工端统一布局 — 顶部 Header(Logo + 员工名 + 退出)+ 底部固定 TabBar 导航 * 所有已登录员工端页面共享此布局 */ import { Link, useLocation, useNavigate } from 'react-router-dom' import { DollarSign, FileText, ScrollText, LogOut, CalendarCheck } from 'lucide-react' import Logo from '../../components/ui/Logo' const tabItems = [ { path: '/portal/payslip', label: '工资条', icon: DollarSign }, { path: '/portal/contract', label: '我的合同', icon: FileText }, { path: '/portal/attendance', label: '我的考勤', icon: CalendarCheck }, { path: '/portal/policies', label: '规章制度', icon: ScrollText }, ] export default function PortalLayout({ children }: { children: React.ReactNode }) { const location = useLocation() const navigate = useNavigate() const employee = (() => { try { return JSON.parse(localStorage.getItem('portalEmployee') || '{}') } catch { return {} } })() const handleLogout = () => { localStorage.removeItem('portalToken') localStorage.removeItem('portalEmployee') navigate('/portal/login') } return (