import{c as e,bb as a,o as s,r as l,q as t,v as n,x as r,e as c,B as o,y as u,C as m,z as i,an as d,ab as p,a9 as f}from"./base-lib.js?v=1761009159";import{_ as y}from"./validator.js?v=1761009159";import{u as _,P as b,k as h,b as v,_ as V}from"./utils-lib.js?v=1761009159";import{aV as j,aW as x}from"./firewall.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";const w={class:"p-[2rem]"},k=V(e({__name:"index",emits:["close"],setup(e,{expose:V,emit:k}){const g=k,{payment:q}=_(),{authType:C}=q.value,S=a("alarmSelectRef"),U=v(),R=s({cycle:"0",channel:[],status:!1}),T=l(),z=l(!1),B=async(e=!1)=>{const{data:a}=await b({request:j()});R.cycle=a.cycle,R.channel=""===a.channel?[]:a.channel.split(","),R.status=!!a.status,e&&U.success("刷新成功")},F=()=>{var e;null==(e=S.value)||e.refresh(),B(!0)};return V({onConfirm:async()=>{if("ltd"!==C)return U.error("抱歉！该功能为企业版专享功能！");R.channel=R.channel.filter(e=>e);let e=R.channel.join(",");e||!R.status?(await T.value.validate(),b({loading:z,request:x({day:Number(R.cycle),channel:e,status:R.status?1:0}),message:!0,success:e=>{e.status&&(B(),g("close"))}})):U.error("请选择告警方式")}}),t(()=>{B()}),(e,a)=>{const s=d,l=p,t=h,_=y,b=f;return n(),r("div",w,[c(b,{model:u(R),ref_key:"safeScanForm",ref:T,disabled:u(z)},{default:o(()=>[c(l,{label:"自动扫描"},{default:o(()=>[c(s,{modelValue:u(R).status,"onUpdate:modelValue":a[0]||(a[0]=e=>u(R).status=e)},null,8,["modelValue"])]),_:1}),c(l,{label:"周期",prop:"cycle"},{default:o(()=>[c(t,{class:"!w-[14rem]",modelValue:u(R).cycle,"onUpdate:modelValue":a[1]||(a[1]=e=>u(R).cycle=e),min:0,type:"number",textType:"天"},{append:o(()=>a[3]||(a[3]=[m(" 天 ",-1)])),_:1},8,["modelValue"])]),_:1}),c(l,{label:"告警方式",prop:"give"},{default:o(()=>[c(_,{ref_key:"alarmSelectRef",ref:S,class:"!w-[36rem]",modelValue:u(R).channel,"onUpdate:modelValue":a[2]||(a[2]=e=>u(R).channel=e),limit:["sms","wx_account"]},null,8,["modelValue"])]),_:1})]),_:1},8,["model","disabled"]),i("div",{class:"tip"},[i("ul",null,[i("li",null,[a[4]||(a[4]=m(" 点击配置后状态未更新，尝试点击【 ",-1)),i("span",{class:"text-primary hover:text-[#1d9534] cursor-pointer",onClick:F},"手动刷新"),a[5]||(a[5]=m(" 】 ",-1))])])])])}}}),[["__scopeId","data-v-03919c49"]]);export{k as default};
