import{c as e,r as a,o as s,q as t,v as r,x as i,e as o,B as l,y as n,R as m,ab as p,a9 as d,bp as u}from"./base-lib.js?v=1761009159";import{_ as c}from"./validator.js?v=1761009159";import{bH as g}from"./firewall.js?v=1761009159";import{M as _,_ as v}from"./utils-lib.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";const f={class:"p-[2.4rem] give-dialog"},b=v(e({__name:"alert-setting-dialog",props:{compData:{default:()=>({})}},setup(e,{expose:v}){const{proxy:b}=u(),h=e;a(!1);const j=s({switch:!1,give:[]}),y=s({give:[{required:!0,trigger:"blur",message:"请选择告警方式"}]});return t(async()=>{(async()=>{j.give=h.compData.sender,j.switch=!0})()}),v({onCancel:()=>h.compData.refreshEvent(),onConfirm:e=>{try{b.$refs.pushMsg.validate(async a=>{if(a){if(!j.give.length)return _.error("请选择告警方式");const a=await g({task_data:JSON.stringify({task_data:{tid:"7",type:"ssh_login",title:"SSH登录告警",status:j.switch,count:0,interval:600,project:""},sender:j.give,number_rule:{day_num:3,total:0},time_rule:{send_interval:0,time_range:[0,86399]}}),template_id:"7"});h.compData.refreshEvent&&h.compData.refreshEvent(),e(),_.request(a)}})}catch(a){}}}),(e,a)=>{const s=c,t=p,u=d;return r(),i("div",f,[o(u,{ref:"pushMsg",model:n(j),"label-width":"80px",rules:n(y),onSubmit:a[1]||(a[1]=m(()=>{},["prevent"]))},{default:l(()=>[o(t,{label:"告警方式",prop:"give"},{default:l(()=>[o(s,{modelValue:n(j).give,"onUpdate:modelValue":a[0]||(a[0]=e=>n(j).give=e),class:"!w-[28rem]",limit:["sms"]},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])])}}}),[["__scopeId","data-v-b141d634"]]);export{b as default};
