import{S as I,z,k as p,r,H as C,o as b,a as F,d as t,w as o,m as V,f as e,e as h,I as k,p as S,b as D,t as L,J as O,C as B,D as Q}from"./index-CAjTdQe7.js";function j(m){return I({url:"/system/online/list",method:"get",params:m})}function E(m){return I({url:"/system/online/"+m,method:"delete"})}const H={class:"app-container"},J=Q({name:"Online"}),M=Object.assign(J,{setup(m){const{proxy:f}=z(),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 R(){f.resetForm("queryRef"),c()}function T(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"),U=r("el-form"),d=r("el-table-column"),$=r("el-table"),q=r("pagination"),K=C("hasPermi"),P=C("loading");return b(),F("div",H,[t(U,{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(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(),S($,{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=>[D("span",null,L((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=>[D("span",null,L(i.parseTime(n.row.loginTime)),1)]),_:1}),t(d,{label:"操作",align:"center","class-name":"small-padding fixed-width"},{default:o(n=>[k((b(),S(w,{link:"",type:"primary",icon:"Delete",onClick:A=>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(q,{total:e(g),page:e(a),"onUpdate:page":l[2]||(l[2]=n=>B(a)?a.value=n:null),limit:e(s),"onUpdate:limit":l[3]||(l[3]=n=>B(s)?s.value=n:null)},null,8,["total","page","limit"]),[[O,e(g)>0]])])}}});export{M as default};
