← Back
Editing: alert-setting-dialog.js
import{c as e,r as a,k as s,p as t,q as r,v as i,e as o,A as l,x as n,Q as m,a9 as p,a7 as c,bl as d}from"./base-lib.js?v=VERSION_NUMBER";import{_ as u}from"./validator.js?v=VERSION_NUMBER";import{bH as g}from"./firewall.js?v=VERSION_NUMBER";import{M as v,e as _}from"./utils-lib.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";import"./column.js?v=VERSION_NUMBER";const f={class:"p-[2.4rem] give-dialog"},h=_(e({__name:"alert-setting-dialog",props:{compData:{default:()=>({})}},setup(e,{expose:_}){const{proxy:h}=d(),b=e;a(!1);const j=s({switch:!1,give:[]}),y=s({give:[{required:!0,trigger:"blur",message:"请选择告警方式"}]});return t((async()=>{(async()=>{j.give=b.compData.sender,j.switch=!0})()})),_({onCancel:()=>b.compData.refreshEvent(),onConfirm:e=>{try{h.$refs.pushMsg.validate((async a=>{if(a){if(!j.give.length)return v.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"});b.compData.refreshEvent&&b.compData.refreshEvent(),e(),v.request(a)}}))}catch(a){}}}),(e,a)=>{const s=u,t=p,d=c;return r(),i("div",f,[o(d,{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-b9ae6c17"]]);export{h as default};
Save File
Cancel