import{l as e,Z as a,ao as s,$ as t,M as l,x as o,a0 as r,a3 as n,q as i,a1 as u,_ as d}from"./utils-lib.js?v=20260328163632";import{u as p}from"./index92.js?v=20260328163632";import{r as c,O as m,k as v,o as g,J as h,V as x,W as f,a3 as y,Y as _,X as b,N as j,Z as k}from"./base-lib.js?v=20260328163632";import{ax as w}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const O=c(""),S=c(""),z=c({columns:[{title:e("用户名"),key:"username",render:e=>e.username||"--",width:180},{title:e("类型"),key:"type",width:100},{title:e("日志"),key:"log",render:e=>{const s=(new DOMParser).parseFromString(e.log,"text/html");return m("span",{innerHTML:a(s.body.innerHTML)},null)}},{title:e("时间"),key:"addtime",...s(),align:"right",minWidth:150}],data:[]}),C=e=>{z.value.columns.forEach((a=>{void 0!==a.sortOrder&&(e&&a.key===e.columnKey?a.sortOrder=e.order:a.sortOrder=!1)}));const{order:a,columnKey:s}=e;S.value=a?"".concat(s," ").concat("descend"===a?"desc":"asc"):"",L()},M=c({page:1,pageSize:20,itemCount:0,pageSlot:5}),[V,H]=t(z),[U]=n(M),{BtOperation:q}=p({options:[{active:!0,label:e("刷新日志"),onClick:async()=>{await L(),l.success(e("刷新成功"))}}]}),K=()=>{M.value.page=1,L()},L=(e={table:"logs",search_type:"用户登录",search:O.value,p:M.value.page,limit:M.value.pageSize,order:S.value})=>{o({request:r(e),success:e=>{z.value.data=e.data.data,M.value.itemCount=e.data.page.total}})},R=()=>{T(),L()},T=()=>{O.value="",Object.assign(M.value,{page:1,itemCount:0})},W={class:"text-14px text-[var(--text-color-2)]"},Z=d(v({__name:"index",setup:(a,{expose:s})=>(g(R),h(T),s({init:R}),(a,s)=>{const t=w;return x(),f("div",null,[m(t,{justify:"space-between"},{default:y((()=>[m(_(q),{class:"gap-10px"}),b("div",null,[m(_(i),{modelValue:_(O),"onUpdate:modelValue":s[0]||(s[0]=e=>j(O)?O.value=e:null),placeholder:_(e)("搜索日志"),class:"!w-[220px]",onSearch:_(K)},null,8,["modelValue","placeholder","onSearch"])])])),_:1}),m(_(V),{"onUpdate:sorter":_(C),class:"py-10px"},null,8,["onUpdate:sorter"]),m(t,{justify:"end"},{default:y((()=>[m(_(U),{"show-size-picker":"","page-sizes":_(u)([10,20,50,100]),onRefresh:_(L)},{suffix:y((()=>[b("span",W,k(_(e)("共 {0} 条",[_(M).itemCount])),1)])),_:1},8,["page-sizes","onRefresh"])])),_:1})])})}),[["__scopeId","data-v-bda63c6a"]]);export{Z as default};
