import{l as e,ao as a,Z as s,$ as t,M as l,x as o,a0 as r,z as n,a3 as i,q as u,a1 as p,_ as c}from"./utils-lib.js?v=20260328163632";import{u as d}from"./index92.js?v=20260328163632";import{h as m}from"./logs.js?v=20260328163632";import{r as g,O as v,k as h,o as x,J as f,V as y,W as b,a3 as _,Y as j,X as k,N as w,Z as z}from"./base-lib.js?v=20260328163632";import{ax as O}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const C=g(""),S=g(""),M=g({columns:[{title:e("用户"),key:"username",width:180,render:e=>e.username||"--"},{title:e("操作类型"),key:"type",...a(),width:150},{title:e("详情"),key:"log",render:e=>{const a=(new DOMParser).parseFromString(e.log,"text/html");return v("span",{innerHTML:s(a.body.innerHTML)},null)}},{title:e("操作时间"),key:"addtime",align:"right",textAlign:"right",...a(),minWidth:150}],data:[]}),V=g({page:1,pageSize:20,itemCount:0,pageSlot:5}),[q,H]=t(M),[U]=i(V),{BtOperation:K}=d({options:[{active:!0,label:e("刷新日志"),onClick:async()=>{await N(),l.success(e("刷新成功"))}},{label:e("清空日志"),onClick:async()=>{await n({title:e("清空面板操作日志"),content:e("风险操作，清空该日志后，将无法查询面板以往的操作记录，是否继续操作？"),type:"input",input:{content:e("清空日志")}}),o({request:m(),message:!0,success:()=>{N()}})}}]}),L=e=>{M.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"):"",N()},N=(e={table:"logs",search:C.value,p:V.value.page,limit:V.value.pageSize,order:S.value})=>{e.p!==V.value.page&&(V.value.page=e.p),o({request:r(e),success:e=>{M.value.data=e.data.data,V.value.itemCount=e.data.page.total}})},R=()=>{T(),N()},T=()=>{C.value="",Object.assign(V.value,{page:1,itemCount:0})},W={class:"text-14px text-[var(--text-color-2)]"},Z=c(h({__name:"index",setup:(a,{expose:s})=>(x(R),f(T),s({init:R}),(a,s)=>{const t=O;return y(),b("div",null,[v(t,{justify:"space-between"},{default:_((()=>[v(j(K),{class:"gap-10px"}),k("div",null,[v(j(u),{modelValue:j(C),"onUpdate:modelValue":s[0]||(s[0]=e=>w(C)?C.value=e:null),placeholder:j(e)("搜索日志"),class:"!w-[220px]",onSearch:s[1]||(s[1]=()=>j(N)({search:j(C),p:1,limit:Number(j(V).pageSize),table:"logs"}))},null,8,["modelValue","placeholder"])])])),_:1}),v(j(q),{class:"py-10px","onUpdate:sorter":j(L)},null,8,["onUpdate:sorter"]),v(t,{justify:"end"},{default:_((()=>[v(j(U),{"show-size-picker":"","page-sizes":j(p)([10,20,50,100]),onRefresh:j(N)},{suffix:_((()=>[k("span",W,z(j(e)("共 {0} 条",[j(V).itemCount])),1)])),_:1},8,["page-sizes","onRefresh"])])),_:1})])})}),[["__scopeId","data-v-cbe423eb"]]);export{Z as default};
