import{q as e,F as a,S as s}from"./common-utils-RDWuRZ1M.js";import{U as t,a4 as o,r as i,b as r,h as l,q as n,u as m,F as u,e as c,I as p,y as d,f as v,s as g,o as f,t as h,x as y}from"./vendor-jA_NIjzi.js";import{_ as w,b as j,u as k,aO as _}from"./common-store-kFD1YPwN.js";import{H as x}from"./Header-X_QfKFhH.js";import{p as C}from"./popUpDialog-XAGVjhm2.js";import{S as I}from"./SvgIcon-a1Rg7hQY.js";import"./vendor-crypto-Vtl7-GZS.js";import"./vendor-mqtt-lYGapirz.js";/* empty css              */import"./BtnClose-8jXpWY6_.js";const b={class:"system"},S={class:"system-userInfo",id:"system"},H=["onClick"],T={class:"system-userInfo-item-left"},U={class:"logout-wrapper"},V=w({__name:"system",setup(w){const{t:V}=t(),q=j(),L=k(),R=o(),W=i(!1),F=i(!1),G=[{id:0,name:V("清空缓存")},{id:1,name:V("系统与装置")}],A=async()=>{"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations&&navigator.serviceWorker.getRegistrations().then((e=>{e.forEach((e=>e.unregister()))})).catch((e=>{})),await B(),F.value=!1},B=async()=>{q.showGlobalLoading();const s=await _();if(q.clearGlobalLoading(),!s.success)return g(s.message);L.logout(),W.value=!1,e()?(a("logout"),await R.push({path:"/mine",replace:!0})):await R.push({path:"/",replace:!0})};return(e,a)=>{const t=s;return f(),r(u,null,[l("div",b,[n(x,{title:m(V)("系统设置"),isRightShow:!1},null,8,["title"]),l("div",S,[(f(),r(u,null,c(G,(e=>l("div",{class:"system-userInfo-item",key:e.id,onClick:a=>(e=>{if(1===e)return R.push("/systemSetting");F.value=!0})(e.id)},[l("div",T,h(e.name),1),n(I,{name:"rightArrow"})],8,H))),64))]),l("div",U,[n(t,{block:"",type:"danger",onClick:a[0]||(a[0]=e=>W.value=!0)},{default:p((()=>[y(h(m(V)("退出登录")),1)])),_:1})])]),W.value?(f(),d(C,{key:0,dialog:W.value,"onUpdate:dialog":a[1]||(a[1]=e=>W.value=e),showValue:W.value,title:m(V)("退出登录"),content:m(V)("您确定要退出吗"),confrimText:m(V)("退出"),teleport:"#system",onHandleConfrim:B},null,8,["dialog","showValue","title","content","confrimText"])):v("",!0),F.value?(f(),d(C,{key:1,dialog:F.value,"onUpdate:dialog":a[2]||(a[2]=e=>F.value=e),showValue:F.value,title:m(V)("清空缓存"),content:m(V)("提醒您缓存清空后需重新加载相关资源"),confrimText:m(V)("立即清空"),teleport:"#system",onHandleConfrim:A},null,8,["dialog","showValue","title","content","confrimText"])):v("",!0)],64)}}},[["__scopeId","data-v-3913744a"],["__file","system.vue"]]);export{V as default};
