var g=(n,p,a)=>new Promise((i,o)=>{var m=t=>{try{r(a.next(t))}catch(c){o(c)}},l=t=>{try{r(a.throw(t))}catch(c){o(c)}},r=t=>t.done?i(t.value):Promise.resolve(t.value).then(m,l);r((a=a.apply(n,p)).next())});import{m as z,H as f,aG as C,l as d,r as h,f as T,a as P,a_ as H,bq as R}from"./index-Cdx-WL5u.js";import{a as Y}from"./system-BAMo4vJa.js";import{u as w}from"./hooks-Ik_4gkti.js";function k(n){const p=h({module:"",status:"",operatingTime:""}),a=d([]),i=d(!0),o=d(0),{tagStyle:m}=w(),l=h({total:0,pageSize:10,currentPage:1,background:!0}),r=[{label:"勾选列",type:"selection",fixed:"left",reserveSelection:!0},{label:"序号",prop:"id",minWidth:90},{label:"操作人员",prop:"username",minWidth:100},{label:"所属模块",prop:"module",minWidth:140},{label:"操作概要",prop:"summary",minWidth:140},{label:"操作 IP",prop:"ip",minWidth:100},{label:"操作地点",prop:"address",minWidth:140},{label:"操作系统",prop:"system",minWidth:100},{label:"浏览器类型",prop:"browser",minWidth:100},{label:"操作状态",prop:"status",minWidth:100,cellRenderer:({row:e,props:s})=>T(P("el-tag"),{size:s.size,style:m.value(e.status)},{default:()=>[e.status===1?"成功":"失败"]})},{label:"操作时间",prop:"operatingTime",minWidth:180,formatter:({operatingTime:e})=>H(e).format("YYYY-MM-DD HH:mm:ss")}];function t(e){}function c(e){}function b(e){o.value=e.length,n.value.setAdaptive()}function v(){o.value=0,n.value.getTableRef().clearSelection()}function S(){const e=n.value.getTableRef().getSelectionRows();f(`已删除序号为 ${C(e,"id")} 的数据`,{type:"success"}),n.value.getTableRef().clearSelection(),u()}function W(){f("已删除所有日志数据",{type:"success"}),u()}function u(){return g(this,null,function*(){i.value=!0;const{code:e,data:s}=yield Y(R(p));e===0&&(a.value=s.list,l.total=s.total,l.pageSize=s.pageSize,l.currentPage=s.currentPage),setTimeout(()=>{i.value=!1},500)})}const y=e=>{e&&(e.resetFields(),u())};return z(()=>{u()}),{form:p,loading:i,columns:r,dataList:a,pagination:l,selectedNum:o,onSearch:u,clearAll:W,resetForm:y,onbatchDel:S,handleSizeChange:t,onSelectionCancel:v,handleCurrentChange:c,handleSelectionChange:b}}export{k as useRole};