vue-pure-admin/static/js/hook-DJWlwh3Y.js

2 lines
1.4 KiB
JavaScript

var p=(r,s,t)=>new Promise((o,l)=>{var u=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(u,m);i((t=t.apply(r,s)).next())});import{r as c,a as d,m as f,aZ as h,bp as b,J as v}from"./index-DMqaFtX4.js";import{d as W}from"./system-rA6lrtqS.js";function C(){const r=c({username:""}),s=d([]),t=d(!0),o=c({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})=>h(e).format("YYYY-MM-DD HH:mm:ss")},{label:"操作",fixed:"right",slot:"operation"}];function u(e){}function m(e){}function i(e){}function a(e){v(`${e.username}已被强制下线`,{type:"success"}),n()}function n(){return p(this,null,function*(){t.value=!0;const{data:e}=yield W(b(r));s.value=e.list,o.total=e.total,o.pageSize=e.pageSize,o.currentPage=e.currentPage,setTimeout(()=>{t.value=!1},500)})}const g=e=>{e&&(e.resetFields(),n())};return f(()=>{n()}),{form:r,loading:t,columns:l,dataList:s,pagination:o,onSearch:n,resetForm:g,handleOffline:a,handleSizeChange:u,handleCurrentChange:m,handleSelectionChange:i}}export{C as useRole};