test_lgq/niucloud/public/admin/assets/index-cc076538.js
2024-01-24 17:36:08 +08:00

2 lines
16 KiB
JavaScript

import{d as P,r as V,cL as F,cU as he,cV as xe,q as I,h as r,c as y,e as s,w as o,a as n,t as $,u as e,N as h,bE as Q,aM as ve,cE as ge,ap as O,cW as le,cX as ee,_ as G,K as J,n as te,cR as we,i as q,af as ye,aJ as be,aT as ke,aU as $e,aV as Se,W as Ee,X as Ve,Y as Ce,E as re,aa as ce,p as De,g as Ie,f as K,U,cS as Re,cM as de,v as Te,I as b,G as A,F as D,B as E,y as oe,cp as se,A as M,cY as Ue,cZ as Me,an as Pe,ao as je,Q as X,O as Y,R as H,c_ as Be,V as ie,ai as Le,c$ as ue,ae as ne,s as pe,d0 as We,cG as _e,d1 as qe,Z as me,cT as Fe,cN as Ne,a_ as Ae,J as ze,a1 as He}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css */import{_ as N}from"./index.vue_vue_type_script_setup_true_lang-9285296e.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css */import{s as Oe}from"./personal-f9857d63.js";/* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css */import{_ as Ge}from"./icon-addon-339e16d0.js";/* empty css */const Je={class:"flex"},Ke={class:"setting-item flex items-center justify-between mb-[10px]"},Xe={class:"title text-base text-tx-secondary"},Ye={class:""},Ze={class:"setting-item flex items-center justify-between mb-[10px]"},Qe={class:"title text-base text-tx-secondary"},et={class:""},tt=P({__name:"layout-setting",setup(u){const x=V(!1),f=F(),p=he(),v=xe(p),t=I({get(){return f.dark},set(a){f.setTheme("dark",a),v(a),ee(f.theme,f.dark?"dark":"light")}}),k=I({get(){return f.theme},set(a){f.setTheme("theme",a),ee(f.theme,f.dark?"dark":"light")}});return(a,l)=>{const g=N,w=ve,c=ge,d=O,i=le;return r(),y("div",Je,[s(g,{name:"element-Setting",onClick:l[0]||(l[0]=_=>x.value=!0)}),s(i,{modelValue:x.value,"onUpdate:modelValue":l[3]||(l[3]=_=>x.value=_),title:e(h)("layout.layoutSetting"),size:"300px"},{default:o(()=>[s(d,null,{default:o(()=>[n("div",Ke,[n("div",Xe,$(e(h)("layout.darkMode")),1),n("div",Ye,[s(w,{modelValue:e(t),"onUpdate:modelValue":l[1]||(l[1]=_=>Q(t)?t.value=_:null),"active-value":!0,"inactive-value":!1},null,8,["modelValue"])])]),n("div",Ze,[n("div",Qe,$(e(h)("layout.themeColor")),1),n("div",et,[s(c,{modelValue:e(k),"onUpdate:modelValue":l[2]||(l[2]=_=>Q(k)?k.value=_:null)},null,8,["modelValue"])])])]),_:1})]),_:1},8,["modelValue","title"])])}}});const ot=G(tt,[["__scopeId","data-v-ddd4e4e2"]]),z=u=>(De("data-v-b07cf2e9"),u=u(),Ie(),u),st={class:"userinfo flex h-full items-center"},nt={class:"user-name pl-[8px]"},at=z(()=>n("div",{class:"flex items-center leading-[1] py-[5px]"},[n("span",{class:"iconfont iconqiehuan ml-[4px] !text-[14px] mr-[10px]"}),n("span",{class:"text-[14px]"},"切换站点")],-1)),lt=z(()=>n("div",{class:"flex items-center leading-[1] py-[5px]"},[n("span",{class:"iconfont iconshezhi1 ml-[4px] !text-[14px] mr-[10px]"}),n("span",{class:"text-[14px]"},"账号设置")],-1)),rt=z(()=>n("div",{class:"flex items-center leading-[1] py-[5px]"},[n("span",{class:"iconfont iconxiugai ml-[4px] !text-[14px] mr-[10px]"}),n("span",{class:"text-[14px]"},"修改密码")],-1)),ct=z(()=>n("div",{class:"flex items-center leading-[1] py-[2px]"},[n("span",{class:"iconfont icontuichudenglu !text-[21px] mr-[8px]"}),n("span",{class:"text-[14px]"},"退出登录")],-1)),dt={class:"form-tip"},it={class:"dialog-footer"},ut=P({__name:"user-info",setup(u){const x=J(),f=K(),p=w=>{switch(w){case"logout":x.logout();break}},v=w=>{f.push(w)},t=V(!1),k=V(),a=te({original_password:"",password:"",password_copy:""}),l=te({original_password:[{required:!0,message:h("originalPasswordPlaceholder"),trigger:"blur"}],password:[{required:!0,message:h("passwordPlaceholder"),trigger:"blur"}],password_copy:[{required:!0,message:h("passwordPlaceholder"),trigger:"blur"}]}),g=w=>{w&&w.validate(c=>{if(c){let d="";if(a.password&&!a.original_password&&(d=h("originalPasswordHint")),a.password&&a.original_password&&!a.password_copy&&(d=h("newPasswordHint")),a.password&&a.original_password&&a.password_copy&&a.password!=a.password_copy&&(d=h("doubleCipherHint")),d){ye({type:"error",message:d});return}Oe(a).then(i=>{t.value=!1})}else return!1})};return(w,c)=>{const d=be,i=N,_=ke,R=$e,L=Se,T=Ee,C=Ve,j=Ce,B=re,W=ce;return r(),y("div",null,[s(L,{onCommand:p,tabindex:1},{dropdown:o(()=>[s(R,null,{default:o(()=>[s(_,{onClick:c[0]||(c[0]=m=>v("/home/index"))},{default:o(()=>[at]),_:1}),s(_,{onClick:c[1]||(c[1]=m=>v("/user/center"))},{default:o(()=>[lt]),_:1}),s(_,{onClick:c[2]||(c[2]=m=>t.value=!0)},{default:o(()=>[rt]),_:1}),s(_,{command:"logout"},{default:o(()=>[ct]),_:1})]),_:1})]),default:o(()=>[n("div",st,[s(d,{size:25,icon:e(we)},null,8,["icon"]),n("div",nt,$(e(x).userInfo.username),1),s(i,{name:"element-ArrowDown",class:"ml-[5px]"})])]),_:1}),s(W,{modelValue:t.value,"onUpdate:modelValue":c[8]||(c[8]=m=>t.value=m),width:"450px",title:"修改密码","before-close":w.handleClose},{footer:o(()=>[n("span",it,[s(B,{onClick:c[6]||(c[6]=m=>t.value=!1)},{default:o(()=>[q($(e(h)("cancel")),1)]),_:1}),s(B,{type:"primary",onClick:c[7]||(c[7]=m=>g(k.value))},{default:o(()=>[q($(e(h)("save")),1)]),_:1})])]),default:o(()=>[n("div",null,[s(j,{model:a,"label-width":"90px",ref_key:"formRef",ref:k,rules:l,class:"page-form"},{default:o(()=>[s(C,{label:e(h)("originalPassword"),prop:"original_password"},{default:o(()=>[s(T,{modelValue:a.original_password,"onUpdate:modelValue":c[3]||(c[3]=m=>a.original_password=m),type:"password",placeholder:e(h)("originalPasswordPlaceholder"),clearable:"",class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(C,{label:e(h)("newPassword"),prop:"password"},{default:o(()=>[s(T,{modelValue:a.password,"onUpdate:modelValue":c[4]||(c[4]=m=>a.password=m),type:"password",placeholder:e(h)("passwordPlaceholder"),clearable:"",class:"input-width"},null,8,["modelValue","placeholder"]),n("div",dt,$(e(h)("passwordTip")),1)]),_:1},8,["label"]),s(C,{label:e(h)("passwordCopy"),prop:"password_copy"},{default:o(()=>[s(T,{modelValue:a.password_copy,"onUpdate:modelValue":c[5]||(c[5]=m=>a.password_copy=m),type:"password",placeholder:e(h)("passwordPlaceholder"),clearable:"",class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","rules"])])]),_:1},8,["modelValue","before-close"])])}}});const pt=G(ut,[["__scopeId","data-v-b07cf2e9"]]),_t={class:"left-panel h-full flex items-center"},mt={class:"flex items-center h-full pl-[10px] hidden-xs-only"},ft={class:"right-panel h-full flex items-center justify-end"},ht=["title"],xt={class:"navbar-item flex items-center h-full cursor-pointer"},vt={class:"navbar-item flex items-center h-full cursor-pointer"},gt={class:"dialog-footer"},wt=P({__name:"index",setup(u){const x=U.get("app_type");Re();const f=F(),p=de(),v=Y(),t=V(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth),k=I(()=>f.dark),a=V(!1),l=V(""),g=V("");U.get("comparisonTokenStorage")&&(l.value=U.get("comparisonTokenStorage")),U.get("comparisonSiteIdStorage")&&(g.value=U.get("comparisonSiteIdStorage")),document.addEventListener("visibilitychange",i=>{document.visibilityState==="visible"&&(g.value!=U.get("siteId")||l.value!=U.get("token"))&&(a.value=!0)});const w=()=>{a.value=!1,location.reload()};Te(()=>{window.onresize=()=>(()=>{t.value=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth})()});const c=()=>{p.routeRefreshTag&&p.refreshRouterView()},d=I(()=>{const i=v.matched.filter(_=>_.meta.title);return i[0]&&i[0].path=="/"&&i.splice(0,1),i});return(i,_)=>{const R=N,L=Ue,T=Me,C=Pe,j=je,B=re,W=ce,m=X;return r(),b(m,{class:M(["h-full px-[10px]",{"layout-header border-b border-color":!e(k)}])},{default:o(()=>[s(j,{class:"w-100 h-full w-full"},{default:o(()=>[s(C,{span:12},{default:o(()=>[n("div",_t,[n("div",{class:"navbar-item flex items-center h-full cursor-pointer",onClick:c},[s(R,{name:"element-Refresh"})]),n("div",mt,[s(T,{separator:"/"},{default:o(()=>[(r(!0),y(D,null,A(e(d),(S,Z)=>(r(),b(L,{key:Z},{default:o(()=>[q($(S.meta.title),1)]),_:2},1024))),128))]),_:1})])])]),_:1}),s(C,{span:12},{default:o(()=>[n("div",ft,[e(x)=="site"?(r(),y("i",{key:0,class:"iconfont iconlingdang-xianxing cursor-pointer px-[8px]",title:e(h)("newInfo")},null,8,ht)):E("",!0),n("div",xt,[s(ot)]),n("div",vt,[s(pt)])])]),_:1})]),_:1}),oe(n("input",{type:"hidden","onUpdate:modelValue":_[0]||(_[0]=S=>l.value=S)},null,512),[[se,l.value]]),oe(n("input",{type:"hidden","onUpdate:modelValue":_[1]||(_[1]=S=>g.value=S)},null,512),[[se,g.value]]),s(W,{modelValue:a.value,"onUpdate:modelValue":_[2]||(_[2]=S=>a.value=S),title:e(h)("layout.detectionLoginTip"),width:"30%","close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1},{footer:o(()=>[n("span",gt,[s(B,{onClick:w},{default:o(()=>[q($(e(h)("layout.detectionLoginOperation")),1)]),_:1})])]),default:o(()=>[n("span",null,$(e(h)("layout.detectionLoginContent")),1)]),_:1},8,["modelValue","title"])]),_:1},8,["class"])}}});const yt=G(wt,[["__scopeId","data-v-fc4501f4"]]);const bt={key:0,class:"w-[16px] h-[16px] relative flex items-center"},kt={class:M(["ml-[10px]"])},$t={class:"w-[16px] h-[16px] relative flex justify-center"},St={class:"w-[16px] h-[16px] relative flex justify-center"},Et={key:2,class:"!border-0 !border-t-[1px] border-solid mx-[25px] bg-[#f7f7f7] my-[5px]"},fe=P({__name:"menu-item",props:{routes:{type:Object,required:!0}},setup(u){const x=u,f=K(),v=J().siteInfo,t=I(()=>x.routes.meta),k=I(()=>{const a={};return v==null||v.apps.forEach(l=>{a[l.key]=l}),v==null||v.site_addons.forEach(l=>{a[l.key]=l}),a});return(a,l)=>{const g=N,w=Be,c=ie,d=Le,i=ue;return e(t).show?(r(),y(D,{key:0},[u.routes.children?(r(),b(w,{key:0,index:String(u.routes.name)},{title:o(()=>[e(t).icon?(r(),y("div",bt,[e(t).icon?(r(),b(g,{key:0,name:e(t).icon,class:"absolute !w-auto"},null,8,["name"])):E("",!0)])):E("",!0),n("span",kt,$(e(t).title),1)]),default:o(()=>[(r(!0),y(D,null,A(u.routes.children,(_,R)=>(r(),b(fe,{routes:_,key:R},null,8,["routes"]))),128))]),_:1},8,["index"])):(r(),y(D,{key:1},[e(t).addon&&e(t).parent_route&&e(t).parent_route.addon==""?(r(),b(i,{key:0,index:String(u.routes.name),onClick:l[0]||(l[0]=_=>e(f).push({name:u.routes.name}))},{title:o(()=>[s(d,{placement:"right",effect:"light"},{content:o(()=>[q(" 该功能仅限"+$(e(k)[e(t).addon].title)+"使用 ",1)]),default:o(()=>[n("span",{class:M([{"text-[15px]":u.routes.meta.class==1},{"text-[14px]":u.routes.meta.class!=1},{"ml-[10px]":u.routes.meta.class==2,"ml-[15px]":u.routes.meta.class==3}])},$(e(t).title),3)]),_:1})]),default:o(()=>[n("div",$t,[s(c,{class:"w-[16px] h-[16px] rounded-[50%] overflow-hidden",src:e(H)(e(k)[e(t).addon].icon),fit:"fill"},null,8,["src"])])]),_:1},8,["index"])):(r(),b(i,{key:1,index:String(u.routes.name),onClick:l[1]||(l[1]=_=>e(f).push({name:u.routes.name}))},{title:o(()=>[n("span",{class:M([{"text-[15px]":u.routes.meta.class==1},{"text-[14px]":u.routes.meta.class!=1},{"ml-[10px]":u.routes.meta.class==2,"ml-[15px]":u.routes.meta.class==3}])},$(e(t).title),3)]),default:o(()=>[n("div",St,[e(t).icon?(r(),b(g,{key:0,name:e(t).icon,class:"absolute top-[50%] -translate-y-[50%]"},null,8,["name"])):E("",!0)])]),_:1},8,["index"]))],64)),u.routes.is_border?(r(),y("div",Et)):E("",!0)],64)):E("",!0)}}});const Vt={class:"w-[124px] px-[8px] bg-[#282c34] h-screen one-menu"},Ct={key:0,class:"logo flex items-center m-auto h-[64px]"},Dt=["src"],It={key:1,class:"max-h-[40px] max-w-[40px] rounded-full",src:Ge,alt:""},Rt={key:1,class:"logo flex items-center justify-center h-[64px]"},Tt=n("i",{class:"text-3xl iconfont iconyunkongjian"},null,-1),Ut=[Tt],Mt={key:0,class:"w-[16px] h-[16px] relative flex justify-center"},Pt={class:"relative"},jt={class:M(["ml-[10px]"])},Bt=n("div",{class:"h-[48px]"},null,-1),Lt={class:"w-[140px] h-[64px] flex items-center justify-center text-[16px] border-0 border-b-[1px] border-solid border-[#eee]"},Wt=n("div",{class:"h-[48px]"},null,-1),ae=P({__name:"side",setup(u){const x=F(),f=J(),p=Y(),v=K(),t=f.siteInfo,k=f.routers,a=f.addonIndexRoute,l=V([]),g=V([]),w={};if(k.forEach(d=>{d.meta.addon==""?(d.children&&d.children.length&&(d.name=ne(d.children)),l.value.push(d)):d.meta.addon!=""&&(t==null?void 0:t.apps.length)<=1&&(t==null?void 0:t.app[0])==d.meta.addon?d.children?(d.children.forEach(i=>{i.path=`${d.path}/${i.path}`,i.children&&i.children.length&&(i.name=ne(i.children))}),l.value.unshift(...d.children)):l.value.unshift(d):w[d.meta.addon]=d}),(t==null?void 0:t.apps.length)>1){const d=[];t==null||t.apps.forEach(i=>{d.push({path:w[i.key]?w[i.key].path:"",meta:{icon:H(i.icon),addon:i.key,title:i.title,app:i.app,show:!0},name:a[i.key]})}),l.value.unshift(...d)}const c=V(p.matched[1].path);return pe(p,()=>{(t==null?void 0:t.apps.length)>1?(g.value=p.matched[1].children,c.value=p.matched[1].path):p.meta.addon==""?(c.value=p.matched[1].path,g.value=p.matched[1].children??[]):p.meta.addon&&p.meta.addon!=(t==null?void 0:t.app[0])?(c.value="/site/app",g.value=p.matched[1].children??[]):(c.value=p.matched[2].path,g.value=p.matched[2].children??[])},{immediate:!0}),(d,i)=>{const _=_e,R=ie,L=N,T=ue,C=qe,j=O,B=me,W=X;return r(),b(W,{class:"w-100 h-screen"},{default:o(()=>[s(B,{class:"p-0 flex"},{default:o(()=>[n("div",Vt,[s(_,{class:"logo-wrap"},{default:o(()=>[e(x).menuIsCollapse?(r(),y("div",Rt,Ut)):(r(),y("div",Ct,[e(t).logo?(r(),y("img",{key:0,class:"max-h-[40px] max-w-[40px] rounded-full",src:e(H)(e(t).logo),alt:""},null,8,Dt)):(r(),y("img",It))]))]),_:1}),s(j,{class:"h-[calc( 100vh - 64px )]"},{default:o(()=>[s(C,{"default-active":c.value,router:!0,class:"aside-menu","unique-opened":"true",collapse:e(x).menuIsCollapse},{default:o(()=>[(r(!0),y(D,null,A(l.value,(m,S)=>(r(),y(D,{key:S},[m.meta.show?(r(),b(T,{key:0,index:m.path,onClick:Z=>e(v).push({name:m.name})},{title:o(()=>[n("div",Pt,[n("span",jt,$(m.meta.title),1)])]),default:o(()=>[m.meta.icon?(r(),y("div",Mt,[e(We)(m.meta.icon)?(r(),b(R,{key:0,class:"w-[16px] h-[16px] rounded-[50%] overflow-hidden",src:m.meta.icon,fit:"fill"},null,8,["src"])):(r(),b(L,{key:1,name:m.meta.icon,class:"absolute top-[50%] -translate-y-[50%]"},null,8,["name"]))])):E("",!0)]),_:2},1032,["index","onClick"])):E("",!0)],64))),128))]),_:1},8,["default-active","collapse"]),Bt]),_:1})]),g.value.length?(r(),b(j,{key:0,class:"two-menu w-[140px]"},{default:o(()=>[n("div",Lt,$(e(p).matched[1].meta.title),1),s(C,{"default-active":e(p).name,router:!0,class:"aside-menu","unique-opened":"true",collapse:e(x).menuIsCollapse},{default:o(()=>[(r(!0),y(D,null,A(g.value,(m,S)=>(r(),b(fe,{routes:m,key:S},null,8,["routes"]))),128))]),_:1},8,["default-active","collapse"]),Wt]),_:1})):E("",!0)]),_:1})]),_:1})}}});const qt=P({__name:"index",setup(u){const x=F(),f=I(()=>x.dark),p=Y();return pe(p,()=>{x.$patch(v=>{v.menuDrawer=!1})}),(v,t)=>{const k=Fe,a=le;return r(),y(D,null,[s(k,{class:M(["h-screen layout-aside w-auto",{bright:!e(f)}])},{default:o(()=>[s(ae,{class:"hidden-xs-only"})]),_:1},8,["class"]),s(a,{modelValue:e(x).menuDrawer,"onUpdate:modelValue":t[0]||(t[0]=l=>e(x).menuDrawer=l),direction:"ltr","with-header":!1,"custom-class":"aside-drawer",size:"210px"},{default:o(()=>[s(ae)]),_:1},8,["modelValue"])],64)}}});const Ft={class:"common-layout min-w-[1200px]"},Nt={class:"p-[10px]"},po=P({__name:"index",setup(u){const x=de(),f=Ne(),p=F(),v=I(()=>p.dark);return(t,k)=>{const a=_e,l=He("router-view"),g=O,w=me,c=X;return r(),y("div",Ft,[s(c,{class:"w-100 h-screen"},{default:o(()=>[s(qt),s(c,null,{default:o(()=>[s(a,null,{default:o(()=>[s(yt)]),_:1}),s(w,{class:M(["main-wrap h-full p-0",{"bg-page":e(v)}])},{default:o(()=>[s(g,null,{default:o(()=>[n("div",Nt,[e(x).routeRefreshTag?(r(),b(l,{key:0},{default:o(({Component:d,route:i})=>[(r(),b(Ae,{include:e(f).tabNames},[(r(),b(ze(d),{key:i.fullPath}))],1032,["include"]))]),_:1})):E("",!0)])]),_:1})]),_:1},8,["class"])]),_:1})]),_:1})])}}});export{po as default};