| 1 |
- import{systemApi as b}from"./index-fQv2WpIJ.js";import{_ as y,k as x,o as w,c as D,a,n as I,g as k,w as p,d as e,f as s,C,r as c,t as f}from"./index-BNtoQzpv.js";const B={class:"page"},V={class:"log-code"},L={class:"log-code"},z={style:{display:"flex","justify-content":"flex-end","margin-top":"20px"}},A={__name:"LogView",setup(J){const d=s([]),i=s(1),u=s(0),r=s(!1);x(()=>_());async function _(){r.value=!0;try{const o=await b.getLogs({page:i.value,size:20});d.value=o.records||[],u.value=o.total||0}finally{r.value=!1}}function g(o){return o?o.length>120?o.slice(0,120)+"...":o:"--"}return(o,n)=>{const t=c("el-table-column"),v=c("el-table"),h=c("el-pagination"),m=C("loading");return w(),D("div",B,[n[1]||(n[1]=a("div",{class:"page-hero"},[a("div",{class:"hero-info"},[a("h2",null,"操作日志"),a("p",null,"全操作留痕,不可删除")])],-1)),I((w(),k(v,{data:d.value,stripe:"",style:{width:"100%"},class:"data-table"},{default:p(()=>[e(t,{prop:"id",label:"ID",width:"70"}),e(t,{prop:"action",label:"操作类型","min-width":"120","show-overflow-tooltip":""}),e(t,{prop:"entityType",label:"实体类型","min-width":"120","show-overflow-tooltip":""}),e(t,{prop:"entityId",label:"实体ID",width:"80"}),e(t,{prop:"operatorId",label:"操作人",width:"90"}),e(t,{prop:"ip",label:"IP 地址","min-width":"140","show-overflow-tooltip":""}),e(t,{prop:"createdAt",label:"操作时间","min-width":"160"}),e(t,{label:"请求参数","min-width":"300","show-overflow-tooltip":""},{default:p(({row:l})=>[a("code",V,f(g(l.oldDataJson)),1)]),_:1}),e(t,{label:"响应数据","min-width":"300","show-overflow-tooltip":""},{default:p(({row:l})=>[a("code",L,f(g(l.newDataJson)),1)]),_:1})]),_:1},8,["data"])),[[m,r.value]]),a("div",z,[e(h,{"current-page":i.value,"onUpdate:currentPage":n[0]||(n[0]=l=>i.value=l),total:u.value,"page-size":20,layout:"total, prev, pager, next",onCurrentChange:_,background:""},null,8,["current-page","total"])])])}}},j=y(A,[["__scopeId","data-v-5f09be01"]]);export{j as default};
|