index-1b6ds9cx.js 3.2 KB

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