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