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.

2 lines
7.0KB

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