import{s as I,I as z,r as p,d as r,M as V,o as b,g as F,k as t,f as o,m as C,l as e,n as h,z as k,e as B,i as L,t as S,N as O,B as D,K as Q}from"./index-Yv4yXRHK.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 M={class:"app-container"},A=Q({name:"Online"}),J=Object.assign(A,{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 K(){f.resetForm("queryRef"),c()}function R(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"),T=r("el-form"),d=r("el-table-column"),U=r("el-table"),$=r("pagination"),q=V("hasPermi"),P=V("loading");return b(),F("div",M,[t(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:K},{default:o(()=>[...l[5]||(l[5]=[h("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"]),k((b(),B(U,{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((b(),B(w,{link:"",type:"primary",icon:"Delete",onClick:G=>R(n.row)},{default:o(()=>[...l[6]||(l[6]=[h("强退",-1)])]),_:1},8,["onClick"])),[[q,["monitor:online:forceLogout"]]])]),_:1})]),_:1},8,["data"])),[[P,e(_)]]),k(t($,{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"]),[[O,e(g)>0]])])}}});export{J as default};
