var f=(l,c,n)=>new Promise((s,i)=>{var d=t=>{try{a(n.next(t))}catch(o){i(o)}},p=t=>{try{a(n.throw(t))}catch(o){i(o)}},a=t=>t.done?s(t.value):Promise.resolve(t.value).then(d,p);a((n=n.apply(l,c)).next())});import{V as g,r as m,dT as k,o as A,i as h,h as v,m as R,j as x,b,aW as M,A as u,an as P,bn as V}from"./index-mvcdiyNT.js";import{b as Y}from"./system-BxoMNPmR.js";const Z={width:24,height:24,body:''};function N(l){const c=g({module:"",requestTime:""}),n=m([]),s=m(!0),i=m(0),{copied:d,update:p}=k(),a=g({total:0,pageSize:10,currentPage:1,background:!0}),t=[{label:"勾选列",type:"selection",fixed:"left",reserveSelection:!0},{label:"ID",prop:"id",minWidth:90},{label:"所属模块",prop:"module",minWidth:100},{headerRenderer:()=>h("span",{class:"flex-c"},[v("请求接口"),R(h(b("iconifyIconOffline"),{icon:Z,class:"ml-1 cursor-help"},null),[[x("tippy"),{content:"双击下面请求接口进行拷贝"}]])]),prop:"url",minWidth:140},{label:"请求方法",prop:"method",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:"takesTime",minWidth:100,cellRenderer:({row:e,props:z})=>h(b("el-tag"),{size:z.size,type:e.takesTime<1e3?"success":"warning",effect:"plain"},{default:()=>[e.takesTime,v(" ms")]})},{label:"请求时间",prop:"requestTime",minWidth:180,formatter:({requestTime:e})=>M(e).format("YYYY-MM-DD HH:mm:ss")}];function o(e){}function S(e){}function y(e){i.value=e.length,l.value.setAdaptive()}function T(){i.value=0,l.value.getTableRef().clearSelection()}function W({url:e}){p(e),d.value?u(`${e} 已拷贝`,{type:"success"}):u("拷贝失败",{type:"warning"})}function C(){const e=l.value.getTableRef().getSelectionRows();u(`已删除序号为 ${P(e,"id")} 的数据`,{type:"success"}),l.value.getTableRef().clearSelection(),r()}function w(){u("已删除所有日志数据",{type:"success"}),r()}function r(){return f(this,null,function*(){s.value=!0;const{data:e}=yield Y(V(c));n.value=e.list,a.total=e.total,a.pageSize=e.pageSize,a.currentPage=e.currentPage,setTimeout(()=>{s.value=!1},500)})}const D=e=>{e&&(e.resetFields(),r())};return A(()=>{r()}),{form:c,loading:s,columns:t,dataList:n,pagination:a,selectedNum:i,onSearch:r,clearAll:w,resetForm:D,onbatchDel:C,handleSizeChange:o,onSelectionCancel:T,handleCellDblclick:W,handleCurrentChange:S,handleSelectionChange:y}}export{N as useRole};