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.
1 lines
6.5 KiB
1 lines
6.5 KiB
import{_ as T}from"./CA44cC15.js";import{u as V}from"./DTVGNZEd.js";import{g,o,c as n,F as u,r as f,n as M,a as t,t as a,G as r,I as A,w as C,l as m,T as N,_ as S,j as F,k as $,D,B as G,d as I,M as O,L as R,b as k,Q as U,z as x}from"./CCjf5Io-.js";import{u as H}from"./42htcooJ.js";const P={class:"toast toast-bottom toast-end z-50"},Q=g({__name:"AppToast",setup(v){const{toasts:s}=V();function d(i){switch(i){case"success":return"alert-success";case"error":return"alert-error";case"warning":return"alert-warning";default:return"alert-info"}}return(i,b)=>(o(),n("div",P,[(o(!0),n(u,null,f(r(s),c=>(o(),n("div",{key:c.id,class:M(["alert",d(c.type)])},[t("span",null,a(c.msg),1)],2))),128))]))}}),W=Object.assign(Q,{__name:"AppToast"}),q={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 backdrop-blur-[1px]","aria-busy":"true",role:"alert"},J=g({__name:"AppLoading",setup(v){const{loading:s}=H();return(d,i)=>(o(),A(N,{name:"fade"},{default:C(()=>[r(s)?(o(),n("div",q,[...i[0]||(i[0]=[t("div",{class:"flex flex-col items-center gap-3 rounded-2xl bg-white px-10 py-7 shadow-xl"},[t("span",{class:"loading loading-spinner loading-lg text-primary"}),t("span",{class:"text-sm text-slate-600"},"处理中,请稍候…")],-1)])])):m("",!0)]),_:1}))}}),K=Object.assign(S(J,[["__scopeId","data-v-c1ace0c2"]]),{__name:"AppLoading"}),X={class:"flex min-h-screen"},Y={class:"fixed top-0 left-0 bottom-0 z-30 overflow-y-auto flex flex-col",style:{width:"256px",background:"#1E293B"}},Z={style:{padding:"20px 20px 16px","border-bottom":"1px solid rgba(255,255,255,0.06)"}},tt={style:{display:"flex","align-items":"center",gap:"12px"}},et={style:{width:"40px",height:"40px",background:"linear-gradient(135deg,#4F46E5,#7C3AED)","border-radius":"12px",display:"flex","align-items":"center","justify-content":"center","box-shadow":"0 6px 20px rgba(79,70,229,0.35)","flex-shrink":"0"}},st={style:{width:"22px",height:"22px",color:"#fff"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},ot={style:{color:"#fff","font-weight":"700","font-size":"15px","letter-spacing":"-0.02em"}},nt={style:{padding:"12px 0",flex:"1"}},at={class:"icon",width:"18",height:"18",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},it=["d"],lt={style:{"margin-top":"auto",padding:"14px 18px","border-top":"1px solid rgba(255,255,255,0.06)"}},rt={style:{display:"flex","align-items":"center",gap:"10px"}},dt={style:{width:"32px",height:"32px","border-radius":"9px",background:"linear-gradient(135deg,#4F46E5,#7C3AED)",color:"#fff",display:"flex","align-items":"center","justify-content":"center","font-weight":"700","flex-shrink":"0"}},ct={style:{"min-width":"0"}},pt={style:{color:"#E2E8F0","font-size":"13px","font-weight":"600","line-height":"1.2",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},ut={style:{color:"#64748B","font-size":"11px","margin-top":"2px"}},_t={class:"flex-1",style:{"margin-left":"256px"}},xt={class:"bg-white shadow-sm sticky top-0 z-20 h-16 flex items-center justify-between px-6"},ht={class:"flex items-center gap-2 text-sm"},ft={class:"text-slate-700 font-medium"},mt={class:"flex items-center gap-2"},gt={class:"dropdown dropdown-end"},vt={tabindex:"0",class:"flex items-center gap-2 cursor-pointer hover:bg-slate-50 rounded-lg px-3 py-1.5"},bt={class:"avatar placeholder"},wt={class:"bg-indigo-600 text-white rounded-full w-8"},yt={class:"text-sm"},kt={class:"text-sm text-slate-700 leading-tight"},At={class:"text-[10px] text-slate-400"},Ct={class:"p-6"},Et=g({__name:"default",setup(v){const s=F(),d=$(),i=D();function b(){s.logout(),d.push("/")}const c=x(()=>({1:"超级管理员",2:"管理员",3:"代理",4:"运营"})[s.identity]??""),z=x(()=>({1:"超管",2:"管理员",3:"代理",4:"运营"})[s.identity]??""),w=x(()=>(s.account||"A").charAt(0).toUpperCase()),y=O;function j(l){return l.items.some(e=>s.hasAccess(e.id))}const B=x(()=>{if(i.meta?.title)return i.meta.title;for(const l of y){const e=l.items.find(h=>i.path.startsWith(h.to));if(e)return e.label}return"Console"});return G(()=>{s.token||d.push("/")}),(l,e)=>{const h=T,L=W,E=K;return o(),n("div",X,[t("aside",Y,[t("div",Z,[t("div",tt,[t("div",et,[(o(),n("svg",st,[...e[0]||(e[0]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)])]))]),t("div",null,[t("div",ot,a(r(s).siteTitle||"Admin"),1),e[1]||(e[1]=t("div",{style:{color:"#64748B","font-size":"11px","font-weight":"500"}},"Admin Console · v1.0.1",-1))])])]),t("nav",nt,[(o(!0),n(u,null,f(r(y),_=>(o(),n(u,null,[j(_)?(o(),n("div",{key:_.label,class:"group-title"},a(_.label),1)):m("",!0),(o(!0),n(u,null,f(_.items,p=>(o(),n(u,null,[r(s).hasAccess(p.id)?(o(),A(h,{key:p.id,to:p.to,class:"sidebar-link","active-class":"active"},{default:C(()=>[(o(),n("svg",at,[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:p.icon},null,8,it)])),I(" "+a(p.label),1)]),_:2},1032,["to"])):m("",!0)],64))),256))],64))),256))]),t("div",lt,[t("div",rt,[t("div",dt,a(w.value),1),t("div",ct,[t("div",pt,a(r(s).account||"-"),1),t("div",ut,a(c.value),1)])])])]),t("main",_t,[t("header",xt,[t("div",ht,[e[2]||(e[2]=t("span",{class:"text-slate-400"},"首页",-1)),e[3]||(e[3]=t("span",{class:"text-slate-300"},"/",-1)),t("span",ft,a(B.value),1)]),t("div",mt,[e[4]||(e[4]=R('<div class="dropdown dropdown-end"><div tabindex="0" class="btn btn-ghost btn-sm btn-circle relative"><svg class="h-5 w-5 text-slate-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"></path></svg></div><div tabindex="0" class="dropdown-content z-[2] shadow-xl bg-white rounded-xl w-80 border" style="max-height:400px;"><div class="flex items-center justify-between px-4 py-3 border-b"><span class="text-sm font-semibold text-slate-700">系统通知</span></div><div class="px-3 py-6 text-center text-slate-400 text-xs">暂无新通知</div></div></div>',1)),t("div",gt,[t("div",vt,[t("div",bt,[t("div",wt,[t("span",yt,a(w.value),1)])]),t("div",null,[t("div",kt,a(r(s).account),1),t("div",At,a(z.value),1)])]),t("ul",{tabindex:"0",class:"dropdown-content z-[1] menu p-2 shadow-lg bg-white rounded-lg w-44 border"},[t("li",null,[t("a",{class:"text-sm text-red-500 cursor-pointer",onClick:b},"退出登录")])])])])]),k(L),k(E),t("div",Ct,[U(l.$slots,"default")])])])}}});export{Et as default};
|
|
|