import"./rolldown-runtime-BM3Ffeng.js";import{$ as e,D as t,O as n,Q as r,X as i,ot as a}from"./element-plus-vendor-BF9PNysW.js";import{A as o,D as s,E as c,N as l,O as u,P as d,Pt as f,Tt as p,Xt as m,bt as h,et as g,ht as _,k as v}from"./vue-vendor-DMUmTARL.js";import{p as y,v as b}from"./index-kSn5YXd0.js";import{t as x}from"./ZDialog-D5yc_FjB.js";import{i as S}from"./admin-audit-log-BIxwiuNf.js";var C={class:`mb-5 rounded bg-gray-50 p-3 text-sm text-regular dark:bg-white/5`},w={class:`flex flex-col gap-1`},T={class:`font-mono`},E={class:`font-mono`},D={key:0,class:`text-warning ml-2 text-xs`},O={key:0,class:`text-warning ml-2 text-xs`},k={__name:`InlineMaskConfirmDialog`,props:{modelValue:{type:Boolean,default:!1},row:{type:Object,default:()=>({})},options:{type:Object,required:!0},disabledTypeSet:{type:Object,required:!0},disabledActionSet:{type:Object,required:!0}},emits:[`update:modelValue`,`saved`],setup(k,{emit:A}){let j=b(),M=k,N=A,P=c({get:()=>M.modelValue,set:e=>N(`update:modelValue`,e)}),F=p(`action`),I=p(!1),L=p(!1),R=(e,t)=>e?.find(e=>e.value===t),z=c(()=>R(M.options?.types,M.row?.type)?.description||M.row?.type||`-`),B=c(()=>R(M.options?.actions,M.row?.action)?.description||M.row?.action||`-`),V=c(()=>M.disabledActionSet?.has(M.row?.action)),H=c(()=>M.disabledTypeSet?.has(M.row?.type)),U=c(()=>(F.value===`type`||!V.value)&&!H.value),W=()=>{F.value=V.value?`type`:`action`,I.value=!1,L.value=!1},G=async()=>{if(U.value){L.value=!0;try{await S({types:F.value===`type`?[M.row.type]:[],actions:F.value===`action`?[M.row.action]:[],purgeHistorical:I.value}),j.success(I.value?`屏蔽规则已更新且历史已清理`:`屏蔽规则已更新`),N(`saved`),P.value=!1}finally{L.value=!1}}};return(c,p)=>{let b=i,S=r,k=n,A=e,j=t,M=a;return g(),u(x,{modelValue:f(P),"onUpdate:modelValue":p[3]||=e=>h(P)?P.value=e:null,title:`快捷屏蔽确认`,width:f(y)?`480px`:void 0,fullscreen:!f(y),"hidden-full-btn":!0,"destroy-on-close":``,"dialog-class":`zf-dialog-max-h-80`,onOpen:W},{footer:_(()=>[d(M,{onClick:p[2]||=e=>P.value=!1},{default:_(()=>[...p[9]||=[l(`取消`,-1)]]),_:1}),d(M,{type:`primary`,loading:f(L),disabled:!f(U),onClick:G},{default:_(()=>[...p[10]||=[l(` 确认屏蔽 `,-1)]]),_:1},8,[`loading`,`disabled`])]),default:_(()=>[s(`div`,C,[p[6]||=s(`div`,{class:`mb-2 font-bold`},`即将屏蔽来自如下来源的审计日志：`,-1),s(`div`,w,[s(`div`,null,[p[4]||=s(`span`,{class:`text-secondary`},`类型：`,-1),s(`span`,T,m(f(z)),1)]),s(`div`,null,[p[5]||=s(`span`,{class:`text-secondary`},`动作：`,-1),s(`span`,E,m(f(B)),1)])])]),d(j,{"label-position":`top`},{default:_(()=>[d(k,{label:`选择屏蔽范围`},{default:_(()=>[d(S,{modelValue:f(F),"onUpdate:modelValue":p[0]||=e=>h(F)?F.value=e:null,class:`flex flex-col items-start gap-2`},{default:_(()=>[d(b,{value:`action`,disabled:f(V)||f(H)},{default:_(()=>[l(` 仅屏蔽此动作（`+m(f(B))+`） `,1),f(V)?(g(),o(`span`,D,`已屏蔽`)):v(``,!0)]),_:1},8,[`disabled`]),d(b,{value:`type`,disabled:f(H)},{default:_(()=>[l(` 屏蔽此类型包含的全部动作（`+m(f(z))+`） `,1),f(H)?(g(),o(`span`,O,`已屏蔽`)):v(``,!0)]),_:1},8,[`disabled`])]),_:1},8,[`modelValue`])]),_:1}),d(k,{label:`历史数据`},{default:_(()=>[d(A,{modelValue:f(I),"onUpdate:modelValue":p[1]||=e=>h(I)?I.value=e:null},{default:_(()=>[...p[7]||=[l(`同时清理已存在的同类历史记录`,-1)]]),_:1},8,[`modelValue`]),p[8]||=s(`div`,{class:`mt-1 text-xs leading-tight text-secondary`},` 勾选后将不可恢复地删除数据库中匹配的现有审计日志，本次清理操作会被强制写入一条自审计记录。 `,-1)]),_:1})]),_:1})]),_:1},8,[`modelValue`,`width`,`fullscreen`])}}};export{k as default};