import{K as e,k as t,bq as s,c5 as a}from"./utils-lib.js?v=1761009159";import{c as o,g as l,e as r,C as p,v as u,N as m,y as i}from"./base-lib.js?v=1761009159";import{g as n,m as c,s as d}from"./index.vue_vue_type_script_setup_true_lang19.js?v=1761009159";import{u as v}from"./useStore4.js?v=1761009159";import{aI as _}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./column.js?v=1761009159";import"./index106.js?v=1761009159";import"./form-item.js?v=1761009159";import"./useController6.js?v=1761009159";import"./site.js?v=1761009159";const y=o({__name:"project-exception-alarm",props:{compData:{}},setup(o,{expose:y}){const j=o,{siteInfo:b}=v(),{BtForm:f,submit:x}=e({data:async()=>{var e,t,s;const{data:a}=await n();return a&&(a.status="open"===(null==(e=j.compData)?void 0:e.type)),a||{status:"open"===(null==(t=j.compData)?void 0:t.type),type:"project_status",title:"项目停止告警",project:null==(s=b.value)?void 0:s.id,tid:"site_push@9",interval:600,count:1,push_count:1,module:[],id:""}},options:e=>l(()=>[{type:"switch",label:"停止告警",key:"status",attrs:{onChange:e=>{c.status=e}}},{type:"radio",label:"自动重启",key:"count",options:[{label:"自动尝试重启项目",value:1},{label:"不做重启尝试",value:2}]},{type:"custom",render:()=>r(s,{label:"间隔时间",prop:"interval"},{default:()=>[r("div",{class:"flex items-center"},[r(t,{class:"!w-[12rem]",width:"12rem",type:"number",modelValue:e.value.interval,"onUpdate:modelValue":t=>e.value.interval=t},{append:"秒"}),r("span",{class:"text-small text-secondary ml-[12px]"},[p("后再次监控检测条件 ")])])]}),rules:{interval:[a({message:"请输入间隔时间"}),{validator:(e,t,s)=>{!/^[1-9]\d*$/.test(t)||t<=0?s(new Error("请输入大于0的整数")):s()}}]}},{type:"custom",render:()=>r(s,{label:"每天发送",prop:"push_count"},{default:()=>[r("div",{class:"flex items-center"},[r(t,{class:"!w-[12rem]",width:"12rem",type:"number",modelValue:e.value.push_count,"onUpdate:modelValue":t=>e.value.push_count=t},{append:"次"}),r("span",{class:"text-small text-secondary ml-[12px]"},[p("后，当日不再发送，次日恢复 ")])])]}),rules:{push_count:[a({message:"请输入发送次数"}),{validator:(e,t,s)=>{!/^[1-9]\d*$/.test(t)||t<=0?s(new Error("请输入大于0的整数")):s()}}]}},_("告警方式","module",{attrs:{limit:["sms"]},rules:{module:[a({message:"请选择告警方式"})]}})]),submit:async(e,t)=>(await t(),await d(e.value))});return y({onConfirm:x}),(e,t)=>(u(),m(i(f),{class:"p-2rem"}))}});export{y as default};
