import{c as a,r as e,v as l,x as s,e as u,B as t,y as n,R as o,z as d,C as r,Q as c,T as m,ab as i,G as p,a9 as _,aC as f,aE as b}from"./base-lib.js?v=1761009159";import{bG as g}from"./firewall.js?v=1761009159";import{P as v,b as y,_ as V}from"./utils-lib.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const j={class:"flex flex-col p-[1.6rem]"},q=V(a({__name:"advanced",props:{compData:{default:()=>({config:{minutes:"",scan_count:"",cleanup_days:""}})}},emits:["update:config"],setup(a,{emit:V}){const q=a,w=V,x=e("1"),C=e(),U=e(q.compData.config),k={minutes:[{required:!0,message:"请输入扫描时间",trigger:"blur"}],scan_count:[{required:!0,message:"请输入访问次数",trigger:"blur"}],cleanup_days:[{required:!0,message:"请输入最大天数",trigger:"blur"}]},h=async()=>{await C.value.validate();let a={};"1"===x.value?(a.minutes=U.value.minutes,a.scan_count=U.value.scan_count):a.cleanup_days=U.value.cleanup_days,await v({loading:"正在保存规则，请稍后...",request:g(a),success:e=>{y().request(e),e.status&&w("update:config",a)}})};return(a,e)=>{const g=m,v=i,y=p,V=_,q=f,w=b;return l(),s("div",j,[u(w,{type:"card",modelValue:n(x),"onUpdate:modelValue":e[5]||(e[5]=a=>c(x)?x.value=a:null)},{default:t(()=>[u(q,{label:"拦截规则",name:"1"},{default:t(()=>[u(V,{model:n(U),rules:k,ref_key:"formRef",ref:C,class:"relative w-full","label-position":"right",onSubmit:e[2]||(e[2]=o(()=>{},["prevent"]))},{default:t(()=>[u(v,{prop:"minutes",label:"扫描时间"},{default:t(()=>[u(g,{modelValue:n(U).minutes,"onUpdate:modelValue":e[0]||(e[0]=a=>n(U).minutes=a),class:"form-input"},null,8,["modelValue"]),e[6]||(e[6]=d("span",{class:"ad-unit"},"分钟",-1))]),_:1,__:[6]}),u(v,{prop:"scan_count",label:"访问次数"},{default:t(()=>[u(g,{modelValue:n(U).scan_count,"onUpdate:modelValue":e[1]||(e[1]=a=>n(U).scan_count=a),class:"form-input"},null,8,["modelValue"]),e[7]||(e[7]=d("span",{class:"ad-unit"},"次",-1))]),_:1,__:[7]}),u(v,{label:"",class:"ml-40"},{default:t(()=>[u(y,{type:"primary",onClick:h},{default:t(()=>e[8]||(e[8]=[r("保存",-1)])),_:1,__:[8]})]),_:1})]),_:1},8,["model"])]),_:1}),u(q,{label:"数据清理",name:"2"},{default:t(()=>[u(V,{model:n(U),rules:k,class:"relative w-full","label-position":"right",onSubmit:e[4]||(e[4]=o(()=>{},["prevent"]))},{default:t(()=>[u(v,{prop:"cleanup_days",label:"扫描数据超过"},{default:t(()=>[u(g,{modelValue:n(U).cleanup_days,"onUpdate:modelValue":e[3]||(e[3]=a=>n(U).cleanup_days=a),class:"form-input"},null,8,["modelValue"]),e[9]||(e[9]=d("span",{class:"ad-unit"},"天，将自动清理",-1))]),_:1,__:[9]}),u(v,{class:"ml-40"},{default:t(()=>[u(y,{type:"primary",onClick:h},{default:t(()=>e[10]||(e[10]=[r("保存",-1)])),_:1,__:[10]})]),_:1})]),_:1},8,["model"])]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-ecb2336d"]]);export{q as default};
