LogView-TQOFYcmz.js 2.0 KB

1
  1. import{systemApi as b}from"./index-C1NeD1gi.js";import{_ as y,h as x,o as w,c as D,a,k,m as I,w as p,b as e,g as s,C,r as c,t as v}from"./index-BPukwgZW.js";const B={class:"app-page log-workbench"},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"),h=c("el-table"),f=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)),k((w(),I(h,{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,v(g(l.oldDataJson)),1)]),_:1}),e(t,{label:"响应数据","min-width":"300","show-overflow-tooltip":""},{default:p(({row:l})=>[a("code",L,v(g(l.newDataJson)),1)]),_:1})]),_:1},8,["data"])),[[m,r.value]]),a("div",z,[e(f,{"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-55e3d4dd"]]);export{j as default};