import{d as B,V as N,W as $,a5 as V,a3 as z,X as L,dJ as E,Y as H,s as I,a6 as J,_ as R,c as n,e as o,f as t,g as h,h as r,i as l,A as a,t as i,F as f,j as W,H as j,k as P,m as g}from"./index.0308b213.js";const D=B({setup(){const{router:e,route:S}=N(),{user:O,logout:C}=$(),{logout:b}=V(),{logout:F}=z(),{config:w}=L(),{updateSidebar:v}=E(),{menus:m}=H(),k=I(()=>S.path);let p=JSON.parse(sessionStorage.getItem("shangpu_pinia-store-admin-user")||"{}");p.store&&(p=p.store);let d=JSON.parse(sessionStorage.getItem("shangpu_pinia-agent-admin-user")||"{}");d.agent&&(d=d.agent);const{OpPlatform:c}=J(),y=s=>{switch(s){case"logout":console.log("logout"),c.value==="agent"?b().then(()=>{e.push("/agent/login")}):c.value==="store"?F().then(()=>{e.push("/store/login")}):C().then(()=>{e.push("/admin/login")});break;case"forget_password":console.log("forget_password"),c.value==="agent"?e.push("/password/agent"):c.value==="store"?e.push("/password/store"):e.push("/password/admin");break}},u=s=>{let _=s.path;console.log(_,"path"),e.push(_),s.children&&s.children.length>0&&v(s.children)};return(()=>{const s=m.find(_=>k.value.startsWith(_.path));s&&s.children&&s.children.length>0&&v(s.children)})(),{user:O,agent:d,store:p,OpPlatform:c,config:w,menus:m,currentPath:k,handleCommand:y,handleNavClick:u}}});const T={class:"layout-header"},X={class:"left"},Y=["src"],q=["src"],G=["src"],K={key:3,class:"line-1"},M={key:4,class:"line-1"},Q={class:"nav"},U=["onClick"],Z={class:"admin-info flex flex-center m-l-40"},x={class:"m-l-10"},ee={class:"flex flex-center",style:{color:"#FFFFFF"}},oe=g("\u4FEE\u6539\u5BC6\u7801"),se=g("\u9000\u51FA\u767B\u5F55");function te(e,S,O,C,b,F){const w=n("router-link"),v=n("el-scrollbar"),m=n("el-avatar"),k=n("arrow-down"),p=n("el-icon"),d=n("el-dropdown-item"),c=n("el-dropdown-menu"),y=n("el-dropdown");return o(),t("div",T,[h("div",X,[r(w,{to:"",class:"logo flex col-center"},{default:l(()=>[e.OpPlatform=="shangpu"?(o(),t("img",{key:0,class:"logo-img",src:e.config.web_logo},null,8,Y)):a("",!0),e.OpPlatform=="store"?(o(),t("img",{key:1,class:"logo-img",src:e.store.store_logo},null,8,q)):a("",!0),e.OpPlatform=="saas"?(o(),t("img",{key:2,class:"logo-img",src:e.config.web_logo},null,8,G)):a("",!0),e.OpPlatform!="store"?(o(),t("div",K,i(e.config.web_name),1)):a("",!0),e.OpPlatform=="store"?(o(),t("div",M,i(e.store.store_title),1)):a("",!0)]),_:1}),r(v,{class:"nav-scrollbar"},{default:l(()=>[h("div",Q,[(o(!0),t(f,null,W(e.menus,(u,A)=>{var s;return o(),t("div",{key:`nav-parent-item-${A}`,class:j(["nav-item",{select:e.currentPath&&e.currentPath.startsWith(u.path)}]),onClick:_=>e.handleNavClick(u)},i(((s=u==null?void 0:u.meta)==null?void 0:s.title)||""),11,U)}),128))])]),_:1})]),h("div",Z,[e.OpPlatform==="shangpu"?(o(),P(m,{key:0,size:40,src:e.user.avatar},null,8,["src"])):a("",!0),e.OpPlatform==="store"?(o(),P(m,{key:1,size:40,src:e.store.avatar},null,8,["src"])):a("",!0),e.OpPlatform==="saas"?(o(),P(m,{key:2,size:40,src:e.user.avatar},null,8,["src"])):a("",!0),h("div",x,[r(y,{placement:"bottom",onCommand:e.handleCommand},{dropdown:l(()=>[r(c,null,{default:l(()=>[r(d,{command:"forget_password"},{default:l(()=>[oe]),_:1}),r(d,{command:"logout"},{default:l(()=>[se]),_:1})]),_:1})]),default:l(()=>[h("div",ee,[e.OpPlatform==="shangpu"?(o(),t(f,{key:0},[g(i(e.user.name),1)],64)):a("",!0),e.OpPlatform==="agent"?(o(),t(f,{key:1},[g(i(e.agent.title)+" - "+i(e.agent.nickname),1)],64)):a("",!0),e.OpPlatform==="store"?(o(),t(f,{key:2},[g(i(e.store.title),1)],64)):a("",!0),e.OpPlatform==="saas"?(o(),t(f,{key:3},[g(i(e.user.name),1)],64)):a("",!0),r(p,{class:"el-icon--right"},{default:l(()=>[r(k)]),_:1})])]),_:1},8,["onCommand"])])])])}const ne=R(D,[["render",te],["__scopeId","data-v-3adcc4a5"]]);export{ne as default};
