import{c as p,a as s,t as o,F as C,i as B,b as h,w as r,j as i,r as m,u as L,o as l,k as v,n as S,T as x,l as D}from"./index-B7ewtAvV.js";import{u as F}from"./user-SeCnlQfV.js";const N={class:"layout-container"},T={class:"sidebar"},V={class:"sidebar-header"},j={class:"user-info"},z={class:"avatar"},A={class:"user-detail"},E={class:"name"},I={class:"role"},R={class:"sidebar-nav"},U={class:"icon"},$={class:"main-content"},J={__name:"Layout",setup(q){const b=L(),c=F(),n=i(()=>c.user),f=i(()=>{var a;return{admin:"管理员",sales:"销售",rd:"研发"}[(a=n.value)==null?void 0:a.role]||""}),k=i(()=>{var a;const t=(a=n.value)==null?void 0:a.role;return t==="admin"?[{path:"/dashboard",label:"统计看板",icon:"📊"},{path:"/clients",label:"客户/项目管理",icon:"🏢"},{path:"/users",label:"账号管理",icon:"👥"},{path:"/workdays",label:"工作日设置",icon:"📅"},{path:"/data-manage",label:"数据管理",icon:"🗄️"}]:t==="rd"?[{path:"/timesheet",label:"工时填报",icon:"⏰"},{path:"/timesheet-details",label:"填报详情",icon:"📅"},{path:"/rd-stats",label:"个人统计",icon:"📊"}]:[]});function g(){c.logout(),b.push("/login")}return(t,a)=>{var u,d,_;const y=m("router-link"),w=m("router-view");return l(),p("div",N,[s("aside",T,[s("div",V,[a[0]||(a[0]=s("h2",null,"⚡ 工时管理",-1)),s("div",j,[s("div",z,o((d=(u=n.value)==null?void 0:u.realname)==null?void 0:d.charAt(0)),1),s("div",A,[s("div",E,o((_=n.value)==null?void 0:_.realname),1),s("div",I,o(f.value),1)])])]),s("nav",R,[(l(!0),p(C,null,B(k.value,e=>(l(),v(y,{key:e.path,to:e.path,class:S(["nav-item",{active:t.$route.path===e.path}])},{default:r(()=>[s("span",U,o(e.icon),1),s("span",null,o(e.label),1)]),_:2},1032,["to","class"]))),128))]),s("div",{class:"sidebar-footer"},[s("button",{class:"logout-btn",onClick:g},[...a[1]||(a[1]=[s("span",{class:"icon"},"🚪",-1),s("span",null,"退出登录",-1)])])])]),s("main",$,[h(w,null,{default:r(({Component:e})=>[h(x,{name:"fade",mode:"out-in"},{default:r(()=>[(l(),v(D(e)))]),_:2},1024)]),_:1})])])}}};export{J as default};
