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
9.9 KiB
1 lines
9.9 KiB
import{_ as j}from"./CnkSDgVO.js";import{u as B}from"./lLLegusN.js";import{g as f,o as a,c as o,F as h,r as _,n as T,a as t,t as n,M as r,J as k,w as z,l as x,T as E,_ as S,C as N,z as F,y as $,j as D,d as I,H as O,b as M,L as R,A as u}from"./CTAruH_8.js";import{u as G}from"./D9HxoMhB.js";import"./yUUyh6cG.js";const J={class:"toast toast-bottom toast-end z-50"},P=f({__name:"AppToast",setup(g){const{toasts:s}=B();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)=>(a(),o("div",J,[(a(!0),o(h,null,_(r(s),c=>(a(),o("div",{key:c.id,class:T(["alert",d(c.type)])},[t("span",null,n(c.msg),1)],2))),128))]))}}),U=Object.assign(P,{__name:"AppToast"}),W={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 backdrop-blur-[1px]","aria-busy":"true",role:"alert"},q=f({__name:"AppLoading",setup(g){const{loading:s}=G();return(d,i)=>(a(),k(E,{name:"fade"},{default:z(()=>[r(s)?(a(),o("div",W,[...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)])])):x("",!0)]),_:1}))}}),K=Object.assign(S(q,[["__scopeId","data-v-c1ace0c2"]]),{__name:"AppLoading"}),Q={class:"flex min-h-screen"},X={class:"fixed top-0 left-0 bottom-0 z-30 overflow-y-auto flex flex-col",style:{width:"256px",background:"#1E293B"}},Y={style:{padding:"20px 20px 16px","border-bottom":"1px solid rgba(255,255,255,0.06)"}},Z={style:{display:"flex","align-items":"center",gap:"12px"}},tt={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"}},et={style:{width:"22px",height:"22px",color:"#fff"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},st={style:{color:"#fff","font-weight":"700","font-size":"15px","letter-spacing":"-0.02em"}},at={style:{padding:"12px 0",flex:"1"}},ot={class:"icon",width:"18",height:"18",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},nt=["d"],it={style:{"margin-top":"auto",padding:"14px 18px","border-top":"1px solid rgba(255,255,255,0.06)"}},lt={style:{display:"flex","align-items":"center",gap:"10px"}},rt={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"}},dt={style:{"min-width":"0"}},ct={style:{color:"#E2E8F0","font-size":"13px","font-weight":"600","line-height":"1.2",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},pt={style:{color:"#64748B","font-size":"11px","margin-top":"2px"}},ht={class:"flex-1",style:{"margin-left":"256px"}},mt={class:"bg-white shadow-sm sticky top-0 z-20 h-16 flex items-center justify-between px-6"},ut={class:"flex items-center gap-2 text-sm"},vt={class:"text-slate-700 font-medium"},_t={class:"flex items-center gap-2"},xt={class:"dropdown dropdown-end"},ft={tabindex:"0",class:"flex items-center gap-2 cursor-pointer hover:bg-slate-50 rounded-lg px-3 py-1.5"},gt={class:"avatar placeholder"},bt={class:"bg-indigo-600 text-white rounded-full w-8"},wt={class:"text-sm"},yt={class:"text-sm text-slate-700 leading-tight"},Mt={class:"text-[10px] text-slate-400"},kt={class:"p-6"},Lt=f({__name:"default",setup(g){const s=N(),d=F(),i=$();function b(){s.logout(),d.push("/")}const c=u(()=>({1:"超级管理员",2:"管理员",3:"代理",4:"运营"})[s.identity]??""),V=u(()=>({1:"超管",2:"管理员",3:"代理",4:"运营"})[s.identity]??""),w=u(()=>(s.account||"A").charAt(0).toUpperCase()),y=[{label:"数据概览",items:[{id:"dashboard",label:"仪表盘",to:"/dashboard",icon:"M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}]},{label:"生产管理",items:[{id:"factory",label:"厂家管理",to:"/factory",icon:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"},{id:"product",label:"产品管理",to:"/product",icon:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"},{id:"code",label:"公码管理",to:"/code",icon:"M4 4h6v6H4V4zm10 0h6v6h-6V4zM4 14h6v6H4v-6zm10 2h2m-2 4h6m-4-4v4m4-8h2m-2 0v4"},{id:"device",label:"生产管理",to:"/device",icon:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"}]},{label:"用户管理",items:[{id:"user",label:"用户查询",to:"/users",icon:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"}]},{label:"服务配置",items:[{id:"globalconfig",label:"全局环境配置",to:"/globalconfig",icon:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},{id:"mcpconfig",label:"MCP配置",to:"/mcpconfig",icon:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-3-4h.01M16 16h.01"},{id:"meettemplate",label:"会议模板",to:"/meettemplates",icon:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},{id:"svcconfig",label:"第三方服务配置",to:"/serviceconfig",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"},{id:"calltranslate",label:"通话翻译配置",to:"/calltranslate",icon:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"}]},{label:"SaaS 管理",items:[{id:"apps",label:"应用管理",to:"/apps",icon:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"},{id:"environments",label:"环境节点",to:"/environments",icon:"M5 3h14a2 2 0 012 2v4a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM5 13h14a2 2 0 012 2v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4a2 2 0 012-2zM7 7h.01M7 17h.01"}]},{label:"系统管理",items:[{id:"systemconfig",label:"系统配置",to:"/systemconfig",icon:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"},{id:"statlog",label:"统计日志",to:"/statlog",icon:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},{id:"admin",label:"后台账号",to:"/accounts",icon:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"}]}];function A(l){return l.items.some(e=>s.hasAccess(e.id))}const C=u(()=>{if(i.meta?.title)return i.meta.title;for(const l of y){const e=l.items.find(v=>i.path.startsWith(v.to));if(e)return e.label}return"Console"});return D(()=>{s.token||d.push("/")}),(l,e)=>{const v=j,H=U,L=K;return a(),o("div",Q,[t("aside",X,[t("div",Y,[t("div",Z,[t("div",tt,[(a(),o("svg",et,[...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",st,n(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",at,[(a(),o(h,null,_(y,m=>(a(),o(h,null,[A(m)?(a(),o("div",{key:m.label,class:"group-title"},n(m.label),1)):x("",!0),(a(!0),o(h,null,_(m.items,p=>(a(),o(h,null,[r(s).hasAccess(p.id)?(a(),k(v,{key:p.id,to:p.to,class:"sidebar-link","active-class":"active"},{default:z(()=>[(a(),o("svg",ot,[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:p.icon},null,8,nt)])),I(" "+n(p.label),1)]),_:2},1032,["to"])):x("",!0)],64))),256))],64))),64))]),t("div",it,[t("div",lt,[t("div",rt,n(w.value),1),t("div",dt,[t("div",ct,n(r(s).account||"-"),1),t("div",pt,n(c.value),1)])])])]),t("main",ht,[t("header",mt,[t("div",ut,[e[2]||(e[2]=t("span",{class:"text-slate-400"},"首页",-1)),e[3]||(e[3]=t("span",{class:"text-slate-300"},"/",-1)),t("span",vt,n(C.value),1)]),t("div",_t,[e[4]||(e[4]=O('<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",xt,[t("div",ft,[t("div",gt,[t("div",bt,[t("span",wt,n(w.value),1)])]),t("div",null,[t("div",yt,n(r(s).account),1),t("div",Mt,n(V.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},"退出登录")])])])])]),M(H),M(L),t("div",kt,[R(l.$slots,"default")])])])}}});export{Lt as default};
|
|
|