Files
YG_FT/frontend/dist/assets/AuditLogView-XtqL-X-4.js

2 lines
4.2 KiB
JavaScript
Raw Permalink Normal View History

2026-07-27 09:12:47 +08:00
import{E as A}from"./index-DOTsJDGF.js";import{E as B}from"./index-CunlXsH6.js";import{E as I,a as K}from"./index-uEvcRnhb.js";import{E as T}from"./index-B6oDFOyL.js";import{a as h,E as R}from"./index-DbiC_J6H.js";import{v as z}from"./directive-DnYsEmpc.js";import{aF as D,dd as M,d as N,G as O,c,q as P,s as o,w as d,t as g,K as F,e as _,y as m,z as S,A as q,o as r,M as x,ad as C,x as L}from"./index-_T_ZwAU8.js";import{g as G}from"./tenant-DIdSWA56.js";import{g as H}from"./project-rPDb_gVb.js";import{_ as J}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./raf-BSHx3Xj9.js";import"./index-I-t9u_Se.js";import"./index-CaL9AHzU.js";import"./index-DPr6SX3u.js";import"./castArray-BlzMMKhq.js";import"./vnode-BBSgohgu.js";import"./index-DrL-DdXi.js";import"./index-CnFjh-NG.js";import"./index-jXIxALr6.js";import"./index-LblaQ-sT.js";import"./scroll-xdnWlbe1.js";import"./clamp-eKDmixUu.js";import"./toNumber-B7ieOfxs.js";import"./_baseIteratee-C37ZLjhl.js";import"./_baseClone-BuLLSdZ_.js";import"./debounce-CtiCYe7I.js";import"./index-dqKVgrM4.js";import"./omit-BNuYgpQl.js";const Q=(u={})=>D("/system/audit-logs",u),W=(u={})=>M({url:"/system/audit-logs/export",method:"get",params:u,responseType:"blob"}).then(s=>s.data),X={class:"page-wrap"},Y={class:"filter-bar"},Z=N({__name:"AuditLogView",setup(u){const s=m(!1),f=m([]),b=m(0),w=m([]),y=m([]),l=S({tenant_id:void 0,project_id:void 0,actor_id:void 0,action:void 0,target_type:void 0,limit:50,offset:0});async function n(){s.value=!0;try{const p=await Q(l);f.value=p.items,b.value=p.total}finally{s.value=!1}}async function k(){const p=await W(l),t=URL.createObjectURL(p),i=document.createElement("a");i.href=t,i.download="audit_logs.csv",i.click(),URL.revokeObjectURL(t),q.success("导出成功")}return O(async()=>{w.value=await G(),y.value=await H(l.tenant_id||"default"),n()}),(p,t)=>{const i=K,V=I,v=A,E=B,a=R,U=h,j=T,$=z;return r(),c("div",X,[P("div",Y,[o(V,{modelValue:l.tenant_id,"onUpdate:modelValue":t[0]||(t[0]=e=>l.tenant_id=e),placeholder:"租户",clearable:"",style:{width:"160px"},onChange:t[1]||(t[1]=e=>n())},{default:d(()=>[(r(!0),c(x,null,C(w.value,e=>(r(),_(i,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),o(V,{modelValue:l.project_id,"onUpdate:modelValue":t[2]||(t[2]=e=>l.project_id=e),placeholder:"项目",clearable:"",style:{width:"160px"},onChange:t[3]||(t[3]=e=>n())},{default:d(()=>[(r(!0),c(x,null,C(y.value,e=>(r(),_(i,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),o(v,{modelValue:l.actor_id,"onUpdate:modelValue":t[4]||(t[4]=e=>l.actor_id=e),placeholder:"操作人 ID",clearable:"",style:{width:"160px"},onKeyup:t[5]||(t[5]=g(e=>n(),["enter"]))},null,8,["modelValue"]),o(v,{modelValue:l.action,"onUpdate:modelValue":t[6]||(t[6]=e=>l.action=e),placeholder:"动作",clearable:"",style:{width:"140px"},onKeyup:t[7]||(t[7]=g(e=>n(),["enter"]))},null,8,["modelValue"]),o(v,{modelValue:l.target_type,"onUpdate:modelValue":t[8]||(t[8]=e=>l.target_type=e),placeholder:"目标类型",clearable:"",style:{width:"140px"},onKeyup:t[9]||(t[9]=g(e=>n(),["enter"]))},null,8,["modelValue"]),o(E,{type:"primary",onClick:t[10]||(t[10]=e=>n())},{default:d(()=>[...t[13]||(t[13]=[L("查询",-1)])]),_:1}),o(E,{onClick:t[11]||(t[11]=e=>k())},{default:d(()=>[...t[14]||(t[14]=[L("导出 CSV",-1)])]),_:1})]),F((r(),_(U,{data:f.value,border:"",height:"100%"},{default:d(()=>[o(a,{prop:"time",label:"时间","min-width":"180"}),o(a,{prop:"tenant_id",label:"租户","min-width":"120"}),o(a,{prop:"project_id",label:"项目","min-width":"120"}),o(a,{prop:"actor_id",label:"操作人","min-width":"120"}),o(a,{prop:"action",label:"动作","min-width":"120"}),o(a,{prop:"target_type",label:"目标类型","min-width":"120"}),o(a,{prop:"target_id",label:"目标 ID","min-width":"120"}),o(a,{prop:"detail",label:"详情","min-width":"200","show-overflow-tooltip":""}),o(a,{prop:"client_ip",label:"IP","min-width":"120"})]),_:1},8,["data"])),[[$,s.value]]),o(j,{class:"pager",layout:"total, prev, pager, next",total:b.value,"page-size":l.l