import{s as R,J as P,r as p,d as r,N as V,o as b,g as z,k as t,f as o,m as C,l as e,n as h,z as k,e as L,i as B,t as S,O as F,B as D,L as Q}from"./index-pKLhwQli.js";function j(m){return R({url:"/system/online/list",method:"get",params:m})}function E(m){return R({url:"/system/online/"+m,method:"delete"})}const J={class:"app-container"},A=Q({name:"Online"}),M=Object.assign(A,{setup(m){const{proxy:f}=P(),N=p([]),_=p(!0),g=p(0),a=p(1),s=p(10),u=p({ipaddr:void 0,userName:void 0});function v(){_.value=!0,j(u.value).then(i=>{N.value=i.rows,g.value=i.total,_.value=!1})}function c(){a.value=1,v()}function T(){f.resetForm("queryRef"),c()}function U(i){f.$modal.confirm('是否确认强退名称为"'+i.userName+'"的用户?').then(function(){return E(i.tokenId)}).then(()=>{v(),f.$modal.msgSuccess("删除成功")}).catch(()=>{})}return v(),(i,l)=>{const x=r("el-input"),y=r("el-form-item"),w=r("el-button"),$=r("el-form"),d=r("el-table-column"),q=r("el-table"),I=r("pagination"),K=V("hasPermi"),O=V("loading");return b(),z("div",J,[t($,{model:e(u),ref:"queryRef",inline:!0},{default:o(()=>[t(y,{label:"登录地址",prop:"ipaddr"},{default:o(()=>[t(x,{modelValue:e(u).ipaddr,"onUpdate:modelValue":l[0]||(l[0]=n=>e(u).ipaddr=n),placeholder:"请输入登录地址",clearable:"",style:{width:"200px"},onKeyup:C(c,["enter"])},null,8,["modelValue"])]),_:1}),t(y,{label:"用户名称",prop:"userName"},{default:o(()=>[t(x,{modelValue:e(u).userName,"onUpdate:modelValue":l[1]||(l[1]=n=>e(u).userName=n),placeholder:"请输入用户名称",clearable:"",style:{width:"200px"},onKeyup:C(c,["enter"])},null,8,["modelValue"])]),_:1}),t(y,null,{default:o(()=>[t(w,{type:"primary",icon:"Search",onClick:c},{default:o(()=>[...l[4]||(l[4]=[h("搜索",-1)])]),_:1}),t(w,{icon:"Refresh",onClick:T},{default:o(()=>[...l[5]||(l[5]=[h("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"]),k((b(),L(q,{data:e(N).slice((e(a)-1)*e(s),e(a)*e(s)),style:{width:"100%"}},{default:o(()=>[t(d,{label:"序号",width:"50",type:"index",align:"center"},{default:o(n=>[B("span",null,S((e(a)-1)*e(s)+n.$index+1),1)]),_:1}),t(d,{label:"会话编号",align:"center",prop:"tokenId","show-overflow-tooltip":!0}),t(d,{label:"登录名称",align:"center",prop:"userName","show-overflow-tooltip":!0}),t(d,{label:"主机",align:"center",prop:"ipaddr","show-overflow-tooltip":!0}),t(d,{label:"登录时间",align:"center",prop:"loginTime",width:"180"},{default:o(n=>[B("span",null,S(i.parseTime(n.row.loginTime)),1)]),_:1}),t(d,{label:"操作",align:"center","class-name":"small-padding fixed-width"},{default:o(n=>[k((b(),L(w,{link:"",type:"primary",icon:"Delete",onClick:G=>U(n.row)},{default:o(()=>[...l[6]||(l[6]=[h("强退",-1)])]),_:1},8,["onClick"])),[[K,["monitor:online:forceLogout"]]])]),_:1})]),_:1},8,["data"])),[[O,e(_)]]),k(t(I,{total:e(g),page:e(a),"onUpdate:page":l[2]||(l[2]=n=>D(a)?a.value=n:null),limit:e(s),"onUpdate:limit":l[3]||(l[3]=n=>D(s)?s.value=n:null)},null,8,["total","page","limit"]),[[F,e(g)>0]])])}}});export{M as default};
