import{C as D,B as F,a as p,k as r,G as C,b as w,c as O,l as t,m as o,p as V,f as e,q as h,H as k,v as B,d as L,t as S,I as Q,J as q,K as j}from"./index-B51TLSWN.js";function z(m){return D({url:"/system/online/list",method:"get",params:m})}function E(m){return D({url:"/system/online/"+m,method:"delete"})}const G={class:"app-container"},H=j({name:"Online"}),M=Object.assign(H,{setup(m){const{proxy:f}=F(),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,z(u.value).then(i=>{N.value=i.rows,g.value=i.total,_.value=!1})}function c(){a.value=1,v()}function I(){f.resetForm("queryRef"),c()}function K(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"),b=r("el-button"),R=r("el-form"),d=r("el-table-column"),T=r("el-table"),U=r("pagination"),$=C("hasPermi"),P=C("loading");return w(),O("div",G,[t(R,{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:V(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:V(c,["enter"])},null,8,["modelValue"])]),_:1}),t(y,null,{default:o(()=>[t(b,{type:"primary",icon:"Search",onClick:c},{default:o(()=>[...l[4]||(l[4]=[h("搜索",-1)])]),_:1}),t(b,{icon:"Refresh",onClick:I},{default:o(()=>[...l[5]||(l[5]=[h("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"]),k((w(),B(T,{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=>[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((w(),B(b,{link:"",type:"primary",icon:"Delete",onClick:J=>K(n.row)},{default:o(()=>[...l[6]||(l[6]=[h("强退",-1)])]),_:1},8,["onClick"])),[[$,["monitor:online:forceLogout"]]])]),_:1})]),_:1},8,["data"])),[[P,e(_)]]),k(t(U,{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"]),[[Q,e(g)>0]])])}}});export{M as default};
