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