You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.0e4109fe.js 6.9KB

5 maanden geleden
1
  1. var F=(o,d,c)=>new Promise((s,r)=>{var x=f=>{try{p(c.next(f))}catch(h){r(h)}},u=f=>{try{p(c.throw(f))}catch(h){r(h)}},p=f=>f.done?s(f.value):Promise.resolve(f.value).then(x,u);p((c=c.apply(o,d)).next())});import{d as O,_ as q,u as A,f as n,g as l,n as v,w as e,b as m,t as R,e as a,p as L,c as k,F as I,q as M,s as K,k as D,v as b,x as V,y as j,r as w,z,A as ne,o as Y,B as G,h as E,C as ae,D as oe,T as se,G as le,K as ce,H as re,I as ie,J as ue,L as de}from"./index.32194486.js";const _e="/assets/logo-title.e15057ed.png";const me={class:"sub-menu-title"},pe=O({name:"sidebarItem"}),fe=Object.assign(pe,{props:{index:String,title:String,item:Object},setup(o){const d=o,c=A(),s=r=>{c.push({name:r.index})};return(r,x)=>{const u=n("svg-icon"),p=n("el-icon"),f=n("el-menu-item"),h=n("sidebar-item",!0),C=n("el-sub-menu");return!(o.item.children&&o.item.children.length)&&!o.item.meta.hidden?(l(),v(f,{key:0,index:d.index,onClick:s},{title:e(()=>[m("span",me,R(o.title),1)]),default:e(()=>[o.item.meta.icon?(l(),v(p,{key:0},{default:e(()=>[a(u,{name:o.item.meta.icon,"svg-class":"menuIcon"},null,8,["name"])]),_:1})):L("",!0)]),_:1},8,["index"])):(l(),k(I,{key:1},[o.item.meta.hidden?L("",!0):(l(),v(C,{key:0,index:d.index},{title:e(()=>[o.item.meta.icon?(l(),v(p,{key:0},{default:e(()=>[a(u,{name:o.item.meta.icon,"svg-class":"menuIcon"},null,8,["name"])]),_:1})):L("",!0),m("span",null,R(o.title),1)]),default:e(()=>[(l(!0),k(I,null,M(o.item.children,_=>(l(),v(h,{key:_.name,index:_.name,title:_.meta.title,item:_},null,8,["index","title","item"]))),128))]),_:1},8,["index"]))],64))}}}),ve=q(fe,[["__scopeId","data-v-5f99aee2"]]);const he=O({name:"sidebar"}),xe=Object.assign(he,{props:{isCollapse:{type:Boolean,default:!1},sidebarMenu:{type:Array,default:()=>[]}},setup(o){const d=o,c=K(()=>{const s=D(),{meta:r,name:x}=s;return r.activeMenu?r.activeMenu:x});return(s,r)=>{const x=n("el-menu");return l(),v(x,{"default-active":b(c),collapse:d.isCollapse,class:"el-menu-vertical-demo","unique-opened":""},{default:e(()=>[(l(!0),k(I,null,M(d.sidebarMenu,u=>(l(),v(ve,{key:u.name,index:u.name,title:u.meta.title,item:u},null,8,["index","title","item"]))),128))]),_:1},8,["default-active","collapse"])}}}),ge=q(xe,[["__scopeId","data-v-9c2e6248"]]);const ye={class:"px-15 relative"},be=O({name:"routeTags"}),ke=Object.assign(be,{setup(o){const d=D(),c=A(),{tagsList:s}=V(j.menuStore),r=t=>{c.push({name:t.name,query:t.query})},x=(t,i)=>{s.value.splice(t,1),s.value.length===0&&c.push({name:"home"}),s.value.length>0&&d.name===i&&c.push({name:s.value[s.value.length-1].name})},u=w(),p=w(),f=(t,i)=>{p.value=i+1,u.value.style.left=`${t.pageX}px`,u.value.style.top=`${t.pageY}px`},h=t=>{switch(t){case"curr":s.value.splice(p.value-1,1),s.value.length===0&&c.push({name:"home"});break;case"all":c.push({name:"home"}),s.value.splice(0,s.value.length);break}},C=w(),_=w();return z(d,t=>{const i={name:t.name,path:t.path,query:t.query,meta:t.meta};s.value.every($=>$.name!==i.name)&&i.name!=="home"&&s.value.push(i)},{immediate:!0,deep:!0}),z(s.value,()=>{ne(()=>{_.value.setScrollLeft(C.value.offsetWidth)})}),Y(()=>{document.addEventListener("click",()=>{p.value=void 0})}),(t,i)=>{const $=n("el-tag"),T=n("el-scrollbar");return l(),k("div",ye,[a(T,{ref_key:"scrollbar",ref:_},{default:e(()=>[m("ul",{ref_key:"tagsRef",ref:C,class:"flex -px-4 py-6"},[(l(!0),k(I,null,M(b(s),(g,B)=>(l(),k("li",{key:g.name,class:"px-4 flex-shrink-0"},[a($,{closable:"",effect:b(d).name===g.name?"dark":"plain",type:b(d).name===g.name?"":"info",class:"cursor-pointer select-none",onClick:G(S=>r(g),["stop"]),onClose:S=>x(B,g.name),onContextmenu:G(S=>f(S,B),["prevent"])},{default:e(()=>[E(R(g.meta.title),1)]),_:2},1032,["effect","type","onClick","onClose","onContextmenu"])]))),128))],512)]),_:1},512),ae(m("div",{ref_key:"contextmenuRef",ref:u,class:"shadow px-10 bg-white rounded fixed z-10 text-14 contextmenu"},[m("ul",null,[m("li",{class:"cursor-pointer py-5 hover:text-primary",onClick:i[0]||(i[0]=g=>h("curr"))},"\u5173\u95ED\u5F53\u524D"),m("li",{class:"cursor-pointer py-5 hover:text-primary",onClick:i[1]||(i[1]=g=>h("all"))},"\u5173\u95ED\u6240\u6709")])],512),[[oe,p.value]])])}}}),we=q(ke,[["__scopeId","data-v-216390dc"]]);const Ce=o=>(ue("data-v-67c39cbd"),o=o(),de(),o),Ie={class:"flex justify-between items-center"},$e=Ce(()=>m("img",{src:_e,class:"logo-title",alt:""},null,-1)),Se={class:"right flex items-center"},Re={class:"flex items-center text-303133"},Te=E("\u9000\u51FA\u767B\u5F55"),Be={class:"collapse"},Le={class:"px-20 py-10 relative z-10"},je=O({name:"layout"}),Oe=Object.assign(je,{setup(o){const d=A(),c=D(),s=j.userStore.userBaseInfo,r=w(!1),x=w(c.path),{menuArr:u,tagsList:p}=V(j.menuStore),f=K(()=>{const _=p.value.filter(t=>!t.meta.noCache).map(t=>t.name);return _.push("OrderList"),_}),h=w([]),C=_=>F(this,null,function*(){_==="logout"&&(j.userStore.registerRouteFresh=!0,yield ie(),yield d.push({name:"login"}),localStorage.clear())});return z(c,_=>{h.value=c.matched.filter((t,i)=>i!==0)},{immediate:!0,deep:!0}),Y(()=>{document.addEventListener("click",()=>{})}),(_,t)=>{const i=n("el-avatar"),$=n("arrow-down"),T=n("el-icon"),g=n("el-dropdown-item"),B=n("el-dropdown-menu"),S=n("el-dropdown"),H=n("el-header"),J=n("el-scrollbar"),U=n("expand"),W=n("fold"),X=n("el-aside"),P=n("el-breadcrumb-item"),Q=n("el-breadcrumb"),Z=n("router-view"),ee=n("el-main"),N=n("el-container");return l(),v(N,{class:"h-screen overflow-hidden layout"},{default:e(()=>[a(H,{class:"header"},{default:e(()=>[m("div",Ie,[$e,m("div",Se,[a(S,{trigger:"click",onCommand:C},{dropdown:e(()=>[a(B,null,{default:e(()=>[a(g,{command:"logout"},{default:e(()=>[Te]),_:1})]),_:1})]),default:e(()=>{var y;return[m("a",Re,[a(i,{size:34,icon:"User",class:"mr-8"}),m("span",null,R((y=b(s))==null?void 0:y.realName),1),a(T,{class:"el-icon--right"},{default:e(()=>[a($)]),_:1})])]}),_:1})])])]),_:1}),a(N,{class:"overflow-hidden"},{default:e(()=>[a(X,{class:"aside",width:r.value?"48px":"172px"},{default:e(()=>[a(J,{class:"scrollY"},{default:e(()=>[a(ge,{"sidebar-menu":b(u),"is-collapse":r.value,active:x.value},null,8,["sidebar-menu","is-collapse","active"])]),_:1}),m("div",Be,[a(T,{color:"rgba(0, 0, 0, 0.45)"},{default:e(()=>[r.value?(l(),v(U,{key:0,onClick:t[0]||(t[0]=y=>r.value=!r.value)})):(l(),v(W,{key:1,onClick:t[1]||(t[1]=y=>r.value=!r.value)}))]),_:1})])]),_:1},8,["width"]),a(N,{class:"is-vertical relative layout-content"},{default:e(()=>[b(c).name!=="home"?(l(),k(I,{key:0},[m("div",Le,[a(Q,null,{default:e(()=>[a(se,{name:"breadcrumb"},{default:e(()=>[(l(!0),k(I,null,M(h.value,y=>(l(),v(P,{key:y.name},{default:e(()=>[E(R(y.meta.title),1)]),_:2},1024))),128))]),_:1})]),_:1})]),a(we)],64)):L("",!0),a(ee,{class:"main"},{default:e(()=>[a(Z,null,{default:e(({Component:y,route:te})=>[a(le,{name:"fade-transform",mode:"out-in"},{default:e(()=>[(l(),v(ce,{include:b(f)},[(l(),v(re(y),{key:te.name}))],1032,["include"]))]),_:2},1024)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}}}),Ne=q(Oe,[["__scopeId","data-v-67c39cbd"]]);export{Ne as default};