import{r as s,u as a,w as n,b as l,c as o,d as e,j as c,e as i,k as t,t as r,l as u,m as d,W as p,X as v,H as g,S as x,p as h,ac as k}from"./index.1696777084030.js";const m={class:"user-control space-y-2"},y={key:0,class:"space-y-2 grid grid-cols-3 gap-x-3"},f={userBox:"",class:"col-span-3",style:{height:"60px"}},C={class:"ml-2"},b=[i("div",{class:"text-black"},[i("span",{class:"iconfont icon-xiugaimima"}),i("span",null,"修改密码")],-1)],B=["onClick"],z=[i("div",{class:"text-yellow-500"},[i("span",{class:"iconfont icon-zhongzhi"}),i("span",null,"重置图标")],-1)],w=["onClick"],L=[i("div",{class:"text-blue-500"},[i("span",{class:"iconfont icon-daochu"}),i("span",null,"导出图标")],-1)],_=["onClick"],j=[i("div",{class:"text-cyan-500"},[i("span",{class:"iconfont icon-yanshengguanliyuan"}),i("span",null,"管理后台")],-1)],O=[i("div",{class:"text-red-500"},[i("span",{class:"iconfont icon-tuichudenglu"}),i("span",null,"退出登录")],-1)],S={key:1,class:"space-y-2 grid grid-cols-3 gap-x-3"},H=i("div",{userBox:"",class:"col-span-3"},[i("span",{class:"text-blue-400"},[p(" 登录即可享更多功能和数据同步 "),i("br"),p(" 传输双重数据加密更加安全 ")])],-1),J=["onClick"],M=[i("div",{class:"text-yellow-500"},[i("span",{class:"iconfont icon-zhongzhi"}),i("span",null,"重置图标")],-1)],N=["onClick"],W=[i("div",{class:"text-blue-500"},[i("span",{class:"iconfont icon-daochu"}),i("span",null,"导出图标")],-1)],X=[i("div",{class:"ml-2 text-emerald-600"},[i("span",{class:"iconfont icon-dengluzhanghu"}),i("span",null,"立即登录")],-1)],q={__name:"user",setup(p){const q=s({}),A=a(),D=async()=>{try{await v.confirm("重置将会恢复到初始状态，是否重置图标？","温馨提示")}catch(s){return}g.del("link").del("config").del("tabbar"),x({url:"/link/reset"}).then((s=>{1===s.code&&h.emit("reload")}))},E=()=>{location.href="/Manager"},F=()=>{x({url:"/user/get"}).then((s=>{1===s.code?q.value=s.data:(A.state.isLogin=!1,g.del("token").del("user_id"))}))},G=s=>{h.emit("openController",!1),h.emit("openLogin",s)},I=()=>{k("link",JSON.stringify({link:A.state.link,tabbar:A.state.tabbar}))};return n((()=>A.state.isLogin),(s=>{s&&F()})),F(),(s,a)=>{var n;const p=l("el-avatar");return o(),e("div",m,[c(A).state.isLogin?(o(),e("div",y,[i("div",f,[t(p,{size:30,src:c("/dist/assets/boy.1696777084030.svg")},null,8,["src"]),i("span",C,r(null==(n=q.value)?void 0:n.mail),1)]),i("div",{userBox:"",onClick:a[0]||(a[0]=u((s=>G(3)),["stop"])),class:"hover user-card"},b),i("div",{userBox:"",onClick:u(D,["stop"]),class:"hover user-card"},z,8,B),i("div",{userBox:"",onClick:u(I,["stop"]),class:"hover user-card"},L,8,w),1===q.value.manager?(o(),e("div",{key:0,userBox:"",onClick:u(E,["stop"]),class:"hover user-card"},j,8,_)):d("",!0),i("div",{userBox:"",onClick:a[1]||(a[1]=u((s=>c(A).commit("loginOut")),["stop"])),class:"hover user-card"},O)])):(o(),e("div",S,[H,i("div",{userBox:"",onClick:u(D,["stop"]),class:"hover"},M,8,J),i("div",{userBox:"",onClick:u(I,["stop"]),class:"hover user-card"},W,8,N),i("div",{userBox:"",onClick:a[2]||(a[2]=u((s=>G(1)),["stop"])),class:"hover"},X)]))])}}};export{q as default};
