import{U as e,r as a,b as s,q as i,I as l,u as o,t,h as n,y as d,f as c,s as r,b4 as v,o as u,F as m,e as g,x as p,w as f,v as h}from"./vendor-jA_NIjzi.js";import{H as k}from"./Header-X_QfKFhH.js";import{_ as b,u as y,b as j,be as w,bf as x}from"./common-store-kFD1YPwN.js";import{p as _}from"./popUpDialog-XAGVjhm2.js";import{u as M,A as C,l as I,S as G}from"./common-utils-RDWuRZ1M.js";/* empty css              */import"./SvgIcon-a1Rg7hQY.js";import"./vendor-mqtt-lYGapirz.js";import"./BtnClose-8jXpWY6_.js";import"./vendor-crypto-Vtl7-GZS.js";const L={class:"deviceManagement"},P={key:0,class:"deviceManagement-title"},S={key:1,class:"deviceManagement-title"},U={class:"deviceManagement-box",id:"deviceManagement"},V={class:"left"},H=["src"],N=["src"],T=["src"],q=["src"],A={class:"middle"},z={class:"middle-top"},B=["onClick"],D=["src"],E=b({__name:"index",setup(b){const{theme:E}=M(),{t:F}=e(),R=a(!1),J=()=>{R.value=!R.value},K=y(),O=j(),Q=a(!1),W=a(!1),X=a(!1),Y=a(1),Z=a([]),$=a({}),ee=async(e=!1)=>{e&&(Z.value=[],Y.value=1,W.value=!0);const a=await w({pageNo:Y.value,pageSize:10,userId:K.userinfo.userId,userName:K.userinfo.userName});Z.value.push(...a.data.records),Y.value++,W.value=!1,Z.value.length>=a.data.totalCount&&(X.value=!0)},ae=async()=>{O.showPartialLoading();const e=await x({id:$.value.id});return O.clearPartialLoading(),e.success?(r(e.message),Q.value=!1,$.value.ip===K.userinfo.ip?(await K.logout(),void C.replace("/login")):void(await ee(!0))):e.message&&r(e.message)};return(e,a)=>{const r=v;return u(),s("div",L,[i(k,{title:o(F)("设备管理"),isRightShow:!1},{right:l((()=>[n("div",{class:"rightEdit",onClick:J},t(R.value?o(F)("完成"):o(F)("编辑")),1)])),_:1},8,["title"]),R.value?(u(),s("div",S,t(o(F)("你可以删除列表中的设备")),1)):(u(),s("div",P,t(o(F)("当玩家登入超过10笔设备时自动替换掉最久未登入的设备")),1)),n("div",U,[i(r,{loading:W.value,"onUpdate:loading":a[0]||(a[0]=e=>W.value=e),finished:X.value,"finished-text":o(F)("没有更多了"),onLoad:ee},{default:l((()=>[(u(!0),s(m,null,g(Z.value,(e=>(u(),s("div",{class:"deviceManagement-box-content",key:e.id},[n("div",V,["iPhone"===e.osVersion?(u(),s("img",{key:0,src:o(I)("mine/blackGold/".concat(o(E),"ios.svg")),alt:"device"},null,8,H)):"Android"===e.osVersion?(u(),s("img",{key:1,src:o(I)("mine/blackGold/".concat(o(E),"android.svg")),alt:"device"},null,8,N)):"others"===e.osVersion?(u(),s("img",{key:2,src:o(I)("mine/blackGold/".concat(o(E),"pc.svg")),alt:"device"},null,8,T)):(u(),s("img",{key:3,src:o(I)("mine/blackGold/".concat(o(E),"mac.svg")),alt:"device"},null,8,q))]),n("div",A,[n("div",null,[n("div",z,[n("h3",null,t(e.osVersion),1),e.ip===o(K).userinfo.ip?(u(),d(G,{key:0,class:"current-device"},{default:l((()=>[p(t(o(F)("当前设备")),1)])),_:1})):c("",!0)]),n("div",null,[n("p",null,t(o(F)("最近登录"))+"："+t(e.lastLoginTime),1),n("p",null,t(o(F)("登录IP"))+"："+t(e.ip),1)])]),n("div",{class:"bottom",onClick:a=>{return s=e,Q.value=!0,void($.value=s);var s}},[f(n("img",{src:o(I)("mine/blackGold/del-".concat(o(E),".svg")),alt:"delete"},null,8,D),[[h,R.value]])],8,B)])])))),128))])),_:1},8,["loading","finished","finished-text"])]),Q.value?(u(),d(_,{key:2,teleport:"#deviceManagement","show-value":Q.value,"onUpdate:dialog":a[1]||(a[1]=e=>Q.value=!1),title:o(F)("删除设备"),confrimText:o(F)("删除"),content:o(F)("设备删除后下次登录需进行身分验证"),onHandleConfrim:ae},null,8,["show-value","title","confrimText","content"])):c("",!0)])}}},[["__scopeId","data-v-0f23d562"],["__file","index.vue"]]);export{E as default};
