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-hbN0HDAk.js";import{_ as b,u as y,b as j,be as w,bf as x}from"./common-store-e_1WBubm.js";import{p as _}from"./popUpDialog-cRaJbZ6V.js";import{u as M,A as C,l as I,S as G}from"./common-utils-8H8K2JPG.js";/* empty css              */import"./SvgIcon-unOD6nfS.js";import"./vendor-mqtt-lYGapirz.js";import"./BtnClose-9Q8xqZiI.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(),K=a(!1),R=()=>{K.value=!K.value},J=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:J.userinfo.userId,userName:J.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===J.userinfo.ip?(await J.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:R},t(K.value?o(F)("完成"):o(F)("编辑")),1)])),_:1},8,["title"]),K.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(J).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,K.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};
