var d=(r,s,t)=>new Promise((o,l)=>{var c=a=>{try{i(t.next(a))}catch(n){l(n)}},m=a=>{try{i(t.throw(a))}catch(n){l(n)}},i=a=>a.done?o(a.value):Promise.resolve(a.value).then(c,m);i((t=t.apply(r,s)).next())});import{r as p,a as f,m as h,a_ as b,bq as v,I as W}from"./index-BXySHhHT.js";import{d as S}from"./system-DCf6ZbVd.js";function P(){const r=p({username:""}),s=f([]),t=f(!0),o=p({total:0,pageSize:10,currentPage:1,background:!0}),l=[{label:"序号",prop:"id",minWidth:60},{label:"用户名",prop:"username",minWidth:100},{label:"登录 IP",prop:"ip",minWidth:140},{label:"登录地点",prop:"address",minWidth:140},{label:"操作系统",prop:"system",minWidth:100},{label:"浏览器类型",prop:"browser",minWidth:100},{label:"登录时间",prop:"loginTime",minWidth:180,formatter:({loginTime:e})=>b(e).format("YYYY-MM-DD HH:mm:ss")},{label:"操作",fixed:"right",slot:"operation"}];function c(e){}function m(e){}function i(e){}function a(e){W(`${e.username}已被强制下线`,{type:"success"}),n()}function n(){return d(this,null,function*(){t.value=!0;const{code:e,data:u}=yield S(v(r));e===0&&(s.value=u.list,o.total=u.total,o.pageSize=u.pageSize,o.currentPage=u.currentPage),setTimeout(()=>{t.value=!1},500)})}const g=e=>{e&&(e.resetFields(),n())};return h(()=>{n()}),{form:r,loading:t,columns:l,dataList:s,pagination:o,onSearch:n,resetForm:g,handleOffline:a,handleSizeChange:c,handleCurrentChange:m,handleSelectionChange:i}}export{P as useRole};