You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
2.7 KiB
1 line
2.7 KiB
import{C as e,D as t,E as n,G as r,T as i,X as a,Y as o,at as s,b as c,d as l,ht as u,ot as d,x as f}from"./vue.runtime.esm-bundler-DUiYyeqQ.js";import{r as p}from"./index-BKGTVidA.js";import{n as m,t as h}from"./usePageLoad-D9c6HmVf.js";async function g(e){let{data:t}=await p.get(`/admin/v1/operation-logs`,{params:e});return t.data}var _={class:`list-page`},v={class:`page-header`},y={class:`list-filter-bar`},b={class:`list-pager`},x=t({__name:`index`,setup(t){let p=u(!1),x=u([]),S=u({current_page:1,per_page:20,total:0}),C=u(1),w=u(``),T=u(``),E=u(``);async function D(){p.value=!0;try{let e=await g({page:C.value,page_size:S.value.per_page,keyword:w.value||void 0,from:T.value||void 0,to:E.value||void 0});x.value=e.items,S.value=e.meta}finally{p.value=!1}}function O(){C.value=1,D()}function k(){w.value=``,T.value=``,E.value=``,C.value=1,D()}return h(D),(t,u)=>{let h=o(`el-input`),g=o(`el-date-picker`),A=o(`el-button`),j=o(`el-table-column`),M=o(`el-table`),N=o(`el-pagination`),P=o(`el-card`),F=a(`loading`);return r(),e(`div`,_,[c(`div`,v,[n(m)]),n(P,{shadow:`never`,class:`admin-list-card`},{default:s(()=>[c(`div`,y,[n(h,{modelValue:w.value,"onUpdate:modelValue":u[0]||=e=>w.value=e,placeholder:`接口路径/操作人`,clearable:``,class:`filter-search`,onKeyup:l(O,[`enter`])},null,8,[`modelValue`]),n(g,{modelValue:T.value,"onUpdate:modelValue":u[1]||=e=>T.value=e,type:`datetime`,placeholder:`开始时间`,"value-format":`YYYY-MM-DD HH:mm:ss`,style:{width:`190px`}},null,8,[`modelValue`]),n(g,{modelValue:E.value,"onUpdate:modelValue":u[2]||=e=>E.value=e,type:`datetime`,placeholder:`结束时间`,"value-format":`YYYY-MM-DD HH:mm:ss`,style:{width:`190px`}},null,8,[`modelValue`]),n(A,{type:`primary`,onClick:O},{default:s(()=>[...u[4]||=[i(`搜索`,-1)]]),_:1}),n(A,{onClick:k},{default:s(()=>[...u[5]||=[i(`重置`,-1)]]),_:1})]),d((r(),f(M,{data:x.value,"row-key":`id`},{default:s(()=>[n(j,{prop:`operated_at`,label:`操作时间`,width:`180`}),n(j,{prop:`operator_name`,label:`操作人`,width:`120`}),n(j,{prop:`http_method`,label:`方法`,width:`80`}),n(j,{prop:`api_path`,label:`接口`,"min-width":`220`,"show-overflow-tooltip":``}),n(j,{prop:`action_label`,label:`操作项`,"min-width":`160`,"show-overflow-tooltip":``}),n(j,{prop:`ip`,label:`IP`,width:`140`}),n(j,{prop:`response_code`,label:`状态码`,width:`90`,align:`center`}),n(j,{prop:`duration_ms`,label:`耗时ms`,width:`90`,align:`center`})]),_:1},8,[`data`])),[[F,p.value]]),c(`div`,b,[n(N,{"current-page":C.value,"onUpdate:currentPage":u[3]||=e=>C.value=e,layout:`total, prev, pager, next`,total:S.value.total,"page-size":S.value.per_page,onCurrentChange:D},null,8,[`current-page`,`total`,`page-size`])])]),_:1})])}}});export{x as default}; |