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