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