import{e as T,r as l,d as f,M as z,P as p,a3 as _,a4 as m,a7 as r,ab as h,A as v,f as g,B as N,H as R,Q as V,a9 as I,I as M}from"./vue-bf422dc1.js";import{r as x,u as $,_ as j}from"./index-8db2df2c.js";import{p as A}from"./global-0d825ba6.js";import{_ as F}from"./search.vue_vue_type_script_setup_true_lang-6314f4d5.js";import{m as q,M as y,B as E,j as H,b as Q}from"./ui-ba7aaa7e.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";function U(n){return x.post({url:"/adminapi/permission/log/list",params:n})}function G(n){return x.post({url:"/adminapi/permission/log/delBatch",params:n})}const J=[{colKey:"id",type:"multiple"},{colKey:"username",title:"用户名",width:"80px"},{colKey:"action",title:"访问链接",width:"260px"},{colKey:"params",title:"请求参数",ellipsis:!0},{colKey:"content",title:"返回结果",ellipsis:!0},{colKey:"ip",title:"IP"},{colKey:"create_at",title:"日志时间",width:"160px"}],L={class:"category-header c-flex"},O={class:"category-header c-flex"},W={class:"l"},X={key:0,class:"selected-count"},Y=T({__name:"index",setup(n){const t=l([]),C=e=>{t.value=e},b=async()=>{const e=q({header:"提醒",body:"是否确认删除？",confirmBtn:"确认",onConfirm:()=>{e.hide();const a={ids:t.value};G(a).then(s=>{s.code===1?(c(),y.success(s.msg),t.value=[]):y.error(s.msg)})},onClose:()=>{e.hide()}})},i=l(!0),w=f(()=>i.value?"收起搜索":"展开搜索"),o=l({defaultPageSize:20,total:0,defaultCurrent:1}),d=l([]),u=l(),c=async(e={})=>{u.value={...e};const{data:a}=await U({page:o.value.defaultCurrent,limit:o.value.defaultPageSize,...u.value});d.value=a.list,o.value.total=a.total};c();const S=e=>{o.value.defaultCurrent=e.current,o.value.defaultPageSize=e.pageSize,c(u.value)},B=$(),k=f(()=>({offsetTop:B.isUseTabsRouter?48:0,container:`.${A}-layout`}));return(e,a)=>{const s=E,D=H,K=Q,P=z("perms");return p(),_(K,{title:"后台操作日志",class:"basic-container",bordered:!1},{actions:m(()=>[r("a",{href:"javascript:void(0)",onClick:a[0]||(a[0]=Z=>i.value=!i.value)},h(w.value),1)]),default:m(()=>[r("div",L,[v(g(F,{ref:"searchFormRef",onSuccess:c},null,512),[[N,i.value]])]),r("div",O,[r("div",W,[v((p(),_(s,{theme:"default",disabled:!t.value.length,onClick:b},{default:m(()=>[R(" 批量删除 ")]),_:1},8,["disabled"])),[[P,["adminapi/permission/log/delBatch"]]]),t.value.length?(p(),V("p",X,"已选"+h(t.value.length)+"项",1)):I("",!0)])]),g(D,{ref:"tableRef","row-key":"id",data:d.value,columns:M(J),hover:d.value.length>0,"header-affixed-top":k.value,pagination:o.value,"lazy-load":"","max-height":"100%","selected-row-keys":t.value,onPageChange:S,onSelectChange:C},null,8,["data","columns","hover","header-affixed-top","pagination","selected-row-keys"])]),_:1})}}});const de=j(Y,[["__scopeId","data-v-63e5692d"]]);export{de as default};
