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

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-DTIMLswB.js";import{t as m}from"./usePageLoad-DFTLo_Lv.js";async function h(e){let{data:t}=await p.get(`/admin/v1/operation-logs`,{params:e});return t.data}var g={class:`list-page`},_={class:`list-filter-bar`},v={class:`list-pager`},y=t({__name:`index`,setup(t){let p=u(!1),y=u([]),b=u({current_page:1,per_page:20,total:0}),x=u(1),S=u(``),C=u(``),w=u(``);async function T(){p.value=!0;try{let e=await h({page:x.value,page_size:b.value.per_page,keyword:S.value||void 0,from:C.value||void 0,to:w.value||void 0});y.value=e.items,b.value=e.meta}finally{p.value=!1}}function E(){x.value=1,T()}function D(){S.value=``,C.value=``,w.value=``,x.value=1,T()}return m(T),(t,u)=>{let m=o(`el-input`),h=o(`el-date-picker`),O=o(`el-button`),k=o(`el-table-column`),A=o(`el-table`),j=o(`el-pagination`),M=o(`el-card`),N=a(`loading`);return r(),e(`div`,g,[u[6]||=c(`div`,{class:`page-header`},[c(`h1`,{class:`page-title`},`操作日志`)],-1),n(M,{shadow:`never`,class:`admin-list-card`},{default:s(()=>[c(`div`,_,[n(m,{modelValue:S.value,"onUpdate:modelValue":u[0]||=e=>S.value=e,placeholder:`接口路径/操作人`,clearable:``,class:`filter-search`,onKeyup:l(E,[`enter`])},null,8,[`modelValue`]),n(h,{modelValue:C.value,"onUpdate:modelValue":u[1]||=e=>C.value=e,type:`datetime`,placeholder:`开始时间`,"value-format":`YYYY-MM-DD HH:mm:ss`,style:{width:`190px`}},null,8,[`modelValue`]),n(h,{modelValue:w.value,"onUpdate:modelValue":u[2]||=e=>w.value=e,type:`datetime`,placeholder:`结束时间`,"value-format":`YYYY-MM-DD HH:mm:ss`,style:{width:`190px`}},null,8,[`modelValue`]),n(O,{type:`primary`,onClick:E},{default:s(()=>[...u[4]||=[i(`搜索`,-1)]]),_:1}),n(O,{onClick:D},{default:s(()=>[...u[5]||=[i(`重置`,-1)]]),_:1})]),d((r(),f(A,{data:y.value,"row-key":`id`},{default:s(()=>[n(k,{prop:`operated_at`,label:`操作时间`,width:`180`}),n(k,{prop:`operator_name`,label:`操作人`,width:`120`}),n(k,{prop:`http_method`,label:`方法`,width:`80`}),n(k,{prop:`api_path`,label:`接口`,"min-width":`220`,"show-overflow-tooltip":``}),n(k,{prop:`action_label`,label:`操作项`,"min-width":`160`,"show-overflow-tooltip":``}),n(k,{prop:`ip`,label:`IP`,width:`140`}),n(k,{prop:`response_code`,label:`状态码`,width:`90`,align:`center`}),n(k,{prop:`duration_ms`,label:`耗时ms`,width:`90`,align:`center`})]),_:1},8,[`data`])),[[N,p.value]]),c(`div`,v,[n(j,{"current-page":x.value,"onUpdate:currentPage":u[3]||=e=>x.value=e,layout:`total, prev, pager, next`,total:b.value.total,"page-size":b.value.per_page,onCurrentChange:T},null,8,[`current-page`,`total`,`page-size`])])]),_:1})])}}});export{y as default};