- Spring Boot 后端服务 (hss-home-service) - delivery-miniapp 配送小程序 - website 官网 (Nuxt) - docs 架构设计文档 - Docker 容器化部署配置 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 lines
6.7 KiB
JavaScript
2 lines
6.7 KiB
JavaScript
import{l as N,S as j,w as M,h as i,e as t,k as c,T as d,F as f,B as b,K as n,M as o,f as w,g as k,A as R,_ as P,t as g,x as a,j as x,u as D}from"./4pHoJ_J-.js";import{_ as O}from"./CJNI7xdH.js";import{u as B}from"./CNoK31Ik.js";import{u as L}from"./zY3YTiZY.js";const V={class:"min-h-screen bg-surface flex"},F={class:"hidden lg:flex flex-col w-56 bg-white border-r shrink-0"},H={class:"p-4 border-b"},$={class:"flex-1 p-3 space-y-1"},z={class:"p-3 border-t"},K={class:"flex items-center gap-2 px-3 py-2 text-sm"},U={class:"w-7 h-7 rounded-full bg-primary-50 text-primary flex items-center justify-center text-xs font-bold"},q={class:"min-w-0"},G={class:"text-xs font-medium truncate"},J=["value","selected"],Q={class:"flex-1 overflow-auto"},W={class:"lg:hidden bg-white border-b px-4 py-3 flex items-center justify-between"},X={class:"flex items-center gap-2"},Y=["value","selected"],Z={class:"p-4 lg:p-8"},tt={class:"text-xl font-bold mb-6"},et={class:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8"},st={class:"bg-white rounded-xl p-4 shadow-sm border"},ot={class:"text-2xl font-bold font-mono text-primary"},nt={class:"bg-white rounded-xl p-4 shadow-sm border"},rt={class:"text-2xl font-bold font-mono text-accent-700"},at={class:"bg-white rounded-xl p-4 shadow-sm border"},lt={class:"text-2xl font-bold font-mono text-green-600"},dt={class:"bg-white rounded-xl p-4 shadow-sm border"},it={class:"text-2xl font-bold font-mono text-red-500"},ct={class:"grid lg:grid-cols-2 gap-6"},xt={class:"bg-white rounded-2xl shadow-sm border p-6"},mt={class:"grid grid-cols-2 gap-3"},ut={class:"bg-white rounded-2xl shadow-sm border p-6"},pt={class:"space-y-2 text-sm"},ft={class:"flex justify-between py-2 border-b border-gray-50"},bt={class:"font-medium"},gt={class:"flex justify-between py-2 border-b border-gray-50"},yt={class:"font-medium"},Rt=N({__name:"index",async setup(vt){let y,v;const{isLoggedIn:T,user:r,logout:_,switchRole:h,ROLES:u}=B(),{get:S}=L(),m=R({}),A=R("dashboard");T.value||([y,v]=j(()=>g("/platform/login")),await y,v()),M(async()=>{try{m.value=await S("/admin/dashboard").catch(()=>({}))}catch{}});const C=[{key:"dashboard",label:"工作台",icon:"chart"},{key:"applications",label:"服务申请",icon:"clipboard",href:"/platform/applications"},{key:"work-orders",label:"工单管理",icon:"document",href:"/platform/work-orders"}],I={RECEPTIONIST:["applications"],ASSESSOR:["applications"],DISPATCHER:["work-orders"],STAFF:["work-orders"],SETTLER:["dashboard"],SUPERVISOR:["dashboard"],ADMIN:["applications","work-orders"]};return(p,e)=>{const l=P,E=O;return a(),i("div",V,[t("aside",F,[t("div",H,[c(l,{to:"/platform",class:"flex items-center gap-2 font-bold text-primary"},{default:d(()=>[...e[4]||(e[4]=[t("div",{class:"w-8 h-8 rounded-lg bg-primary flex items-center justify-center text-white text-xs font-mono"},"H",-1),t("span",{class:"text-sm"},"智慧医养平台",-1)])]),_:1})]),t("nav",$,[(a(),i(f,null,b(C,s=>c(l,{key:s.key,to:s.href||"/platform",class:D(["flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors",A.value===s.key?"bg-primary-50 text-primary font-medium":"text-text-secondary hover:bg-gray-50"])},{default:d(()=>[c(E,{name:s.icon,class:"w-4 h-4"},null,8,["name"]),x(" "+n(s.label),1)]),_:2},1032,["to","class"])),64))]),t("div",z,[t("div",K,[t("div",U,n(o(r)?.userName?.charAt(0)),1),t("div",q,[t("div",G,n(o(r)?.userName),1),t("select",{onChange:e[0]||(e[0]=s=>o(h)(s.target.value)),class:"text-xs text-text-secondary bg-transparent border-none outline-none cursor-pointer"},[(a(!0),i(f,null,b(o(u),s=>(a(),i("option",{key:s.key,value:s.key,selected:o(r)?.userRole===s.key},n(s.label),9,J))),128))],32)])]),t("button",{onClick:e[1]||(e[1]=s=>{o(_)(),("navigateTo"in p?p.navigateTo:o(g))("/platform/login")}),class:"w-full mt-2 px-3 py-2 text-xs text-text-secondary hover:text-red-500 transition-colors text-left rounded-lg hover:bg-red-50"},"退出登录")])]),t("main",Q,[t("div",W,[c(l,{to:"/platform",class:"font-bold text-primary text-sm"},{default:d(()=>[...e[5]||(e[5]=[x("智慧医养平台",-1)])]),_:1}),t("div",X,[t("select",{onChange:e[2]||(e[2]=s=>o(h)(s.target.value)),class:"text-xs border rounded-lg px-2 py-1 outline-none"},[(a(!0),i(f,null,b(o(u),s=>(a(),i("option",{key:s.key,value:s.key,selected:o(r)?.userRole===s.key},n(s.label),9,Y))),128))],32),t("button",{onClick:e[3]||(e[3]=s=>{o(_)(),("navigateTo"in p?p.navigateTo:o(g))("/platform/login")}),class:"text-xs text-red-500"},"退出")])]),t("div",Z,[t("h2",tt,"工作台 — "+n(o(u).find(s=>s.key===o(r)?.userRole)?.label||o(r)?.userRole),1),t("div",et,[t("div",st,[t("div",ot,n(m.value.todayOrders||"--"),1),e[6]||(e[6]=t("div",{class:"text-xs text-text-secondary mt-1"},"今日工单",-1))]),t("div",nt,[t("div",rt,n(m.value.inProgress||"--"),1),e[7]||(e[7]=t("div",{class:"text-xs text-text-secondary mt-1"},"进行中",-1))]),t("div",at,[t("div",lt,n(m.value.completedToday||"--"),1),e[8]||(e[8]=t("div",{class:"text-xs text-text-secondary mt-1"},"已完成",-1))]),t("div",dt,[t("div",it,n(m.value.exceptions||"--"),1),e[9]||(e[9]=t("div",{class:"text-xs text-text-secondary mt-1"},"异常",-1))])]),t("div",ct,[t("div",xt,[e[14]||(e[14]=t("h3",{class:"font-bold mb-4"},"快捷操作",-1)),t("div",mt,[["RECEPTIONIST","ADMIN"].includes(o(r)?.userRole||"")?(a(),w(l,{key:0,to:"/platform/applications",class:"p-4 rounded-xl bg-primary-50 text-primary text-sm font-medium hover:bg-primary hover:text-white transition-colors text-center"},{default:d(()=>[...e[10]||(e[10]=[x("受理新申请",-1)])]),_:1})):k("",!0),["DISPATCHER","ADMIN"].includes(o(r)?.userRole||"")?(a(),w(l,{key:1,to:"/platform/work-orders",class:"p-4 rounded-xl bg-accent-50 text-accent-700 text-sm font-medium hover:bg-accent hover:text-white transition-colors text-center"},{default:d(()=>[...e[11]||(e[11]=[x("查看工单",-1)])]),_:1})):k("",!0),c(l,{to:"/demo",class:"p-4 rounded-xl bg-gray-50 text-text-secondary text-sm font-medium hover:bg-gray-100 transition-colors text-center"},{default:d(()=>[...e[12]||(e[12]=[x("平台演示",-1)])]),_:1}),c(l,{to:"/",class:"p-4 rounded-xl bg-gray-50 text-text-secondary text-sm font-medium hover:bg-gray-100 transition-colors text-center"},{default:d(()=>[...e[13]||(e[13]=[x("返回官网",-1)])]),_:1})])]),t("div",ut,[e[18]||(e[18]=t("h3",{class:"font-bold mb-4"},"当前角色权限",-1)),t("div",pt,[t("div",ft,[e[15]||(e[15]=t("span",{class:"text-text-secondary"},"角色",-1)),t("span",bt,n(o(u).find(s=>s.key===o(r)?.userRole)?.label),1)]),t("div",gt,[e[16]||(e[16]=t("span",{class:"text-text-secondary"},"可操作模块",-1)),t("span",yt,n((I[o(r)?.userRole||""]||["dashboard"]).join(", ")),1)]),e[17]||(e[17]=t("div",{class:"flex justify-between py-2"},[t("span",{class:"text-text-secondary"},"数据范围"),t("span",{class:"font-medium"},"本机构")],-1))])])])])])])}}});export{Rt as default};
|