import{c as e,r as a,aA as s,o as l,q as t,v as o,x as u,e as n,B as r,y as m,z as i,C as d,an as c,ab as p,a9 as f}from"./base-lib.js?v=1761009159";import{_ as b}from"./validator.js?v=1761009159";import{P as _,k as v,b as h}from"./utils-lib.js?v=1761009159";import{bk as x,bl as V}from"./firewall.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";const g={class:"p-[2rem]"},j={class:"flex"},y=e({__name:"index",setup(e,{expose:y}){const w=h(),k=a(!1),C=s("popupClose"),U=a(),q=l({give:[],status:!1,hour:12,minute:0}),A=e=>{q.give=e},z=async()=>{_({request:V(),success:e=>{const a=e.data;q.status="1"===a.status||1===a.status,q.hour=a.hour,q.minute=a.minute,""!=a.channel&&(q.give=a.channel.split(","))}})};return t(()=>{z()}),y({onConfirm:async()=>{const{give:e,minute:a,hour:s,status:l}=q;let t=e.join(",");if(0===t.indexOf(",")&&(t=t.substring(1)),0===e.length||""===t)return w.error("请选择告警方式");const o={status:l?1:0,hour:s,minute:a,channel:t};await U.value.validate(),_({request:x(o),loading:k,message:!0,success:e=>{e.status&&C&&C()}})}}),(e,a)=>{const s=c,l=p,t=v,_=b,h=f;return o(),u("div",g,[n(h,{model:m(q),disabled:m(k),ref_key:"scanForm",ref:U},{default:r(()=>[n(l,{label:"自动扫描"},{default:r(()=>[n(s,{modelValue:m(q).status,"onUpdate:modelValue":a[0]||(a[0]=e=>m(q).status=e)},null,8,["modelValue"])]),_:1}),n(l,{label:"每天"},{default:r(()=>[i("div",j,[n(t,{type:"number",class:"!w-[13rem] mr-4",min:"0",max:"23",modelValue:m(q).hour,"onUpdate:modelValue":a[1]||(a[1]=e=>m(q).hour=e)},{append:r(()=>a[4]||(a[4]=[d("小时",-1)])),_:1},8,["modelValue"]),n(t,{type:"number",class:"!w-[13rem]",min:"0",max:"59",modelValue:m(q).minute,"onUpdate:modelValue":a[2]||(a[2]=e=>m(q).minute=e)},{append:r(()=>a[5]||(a[5]=[d("分钟",-1)])),_:1},8,["modelValue"])])]),_:1}),n(l,{label:"告警方式"},{default:r(()=>[n(_,{class:"!w-[30rem]",modelValue:m(q).give,"onUpdate:modelValue":a[3]||(a[3]=e=>m(q).give=e),limit:["sms","wx_account"],isMult:!0,needAll:!1,onChange:A},null,8,["modelValue"])]),_:1}),n(l,{label:" "},{default:r(()=>[i("div",{class:"text-secondary"},[a[6]||(a[6]=d(" 配置后状态未更新,请尝试[ ",-1)),i("span",{class:"text-primary hover:text-primaryDark cursor-pointer",onClick:z}," 手动刷新 "),a[7]||(a[7]=d(" ] ",-1))])]),_:1})]),_:1},8,["model","disabled"])])}}});export{y as default};
