import{_ as e,r as a,b as l,d as s,e as t,f as d,h as o,w as m,g as c,j as n,k as i,i as u,F as r,l as p,an as y,n as b,E as f,q as V}from"./index.286e9b79.js";import{v as j}from"./loading.c49775a6.js";import{E as v,a as _}from"./form.ad10dcd5.js";import{E as g,a as K}from"./tab-pane.1cc0f769.js";import{E as h}from"./input.31de1b37.js";import"./form-item.9355e6dc.js";/* empty css            */import{E as x,a as I}from"./select.297a82d5.js";import{_ as w}from"./page-header.29890ed0.js";import{g as S,p as U}from"./http.f588794f.js";import"./_initCloneObject.fb8fbaea.js";import"./strings.8c60bfae.js";import"./event.776e7e11.js";import"./index.ed3ed02e.js";import"./index.27150c7e.js";import"./token.34cb8214.js";import"./isEqual.57d72c4a.js";import"./scroll.a50153b5.js";import"./_baseIteratee.9ead53a1.js";import"./debounce.caafe00b.js";import"./divider.948c4b18.js";const N={class:"editor-card"},k={class:"editor-card-box"},E={class:"tool"},q={class:"tool-box"},C=e({__name:"setting",setup(e){let C=a(!1),F=a(!1),P=a("0"),A=a(),D=l([{label:"阿里云短信",value:"aliyun"},{label:"腾讯云短信",value:"tencent"}]),O=l({sms:{type:"aliyun",aliyun:{accessKeyId:"",accessKeySecret:"",singName:""},tencent:{accessKeyId:"",accessKeySecret:"",singName:"",appid:""}}});F.value=!0,S("addons.sms/setting").then((e=>{F.value=!1,e.code&&(O.sms=e.data)}));const R=async()=>{A.value&&await A.value.validate(((e,a)=>{F.value=!1,e?(F.value=!0,U("addons.sms/setting",O).then((e=>{F.value=!1,e.code?f.success("操作成功"):f.error(e.msg)})).catch((e=>{f.error(e)}))):f.error("请完善内容")}))};return(e,a)=>{const l=w,f=x,S=I,U=v,z=h,B=g,G=K,H=_,J=V,L=j;return s(),t("div",null,[d(l,{title:"短信设置"}),o("div",N,[m((s(),n(H,{model:c(O).sms,ref_key:"ruleFormRef",ref:A},{default:i((()=>[o("div",k,[d(G,{modelValue:c(P),"onUpdate:modelValue":a[8]||(a[8]=e=>u(P)?P.value=e:P=e)},{default:i((()=>[d(B,{label:"基本信息",name:"0"},{default:i((()=>[d(U,{label:"短信类型",required:!0,"label-width":"140px"},{default:i((()=>[d(S,{modelValue:c(O).sms.type,"onUpdate:modelValue":a[0]||(a[0]=e=>c(O).sms.type=e),placeholder:"请选择短信类型",style:{width:"100%"}},{default:i((()=>[(s(!0),t(r,null,p(c(D),((e,a)=>(s(),n(f,{key:a,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),"aliyun"==c(O).sms.type?(s(),t(r,{key:0},[d(U,{label:"accessKeyId",prop:"accessKeyId","label-width":"140px"},{default:i((()=>[d(z,{modelValue:c(O).sms.aliyun.accessKeyId,"onUpdate:modelValue":a[1]||(a[1]=e=>c(O).sms.aliyun.accessKeyId=e)},null,8,["modelValue"])])),_:1}),d(U,{label:"accessKeySecret",prop:"accessKeySecret","label-width":"140px"},{default:i((()=>[d(z,{modelValue:c(O).sms.aliyun.accessKeySecret,"onUpdate:modelValue":a[2]||(a[2]=e=>c(O).sms.aliyun.accessKeySecret=e)},null,8,["modelValue"])])),_:1}),d(U,{label:"短信签名",prop:"singName","label-width":"140px"},{default:i((()=>[d(z,{modelValue:c(O).sms.aliyun.singName,"onUpdate:modelValue":a[3]||(a[3]=e=>c(O).sms.aliyun.singName=e)},null,8,["modelValue"])])),_:1})],64)):y("",!0),"tencent"==c(O).sms.type?(s(),t(r,{key:1},[d(U,{label:"accessKeyId",prop:"accessKeyId","label-width":"140px"},{default:i((()=>[d(z,{modelValue:c(O).sms.tencent.accessKeyId,"onUpdate:modelValue":a[4]||(a[4]=e=>c(O).sms.tencent.accessKeyId=e)},null,8,["modelValue"])])),_:1}),d(U,{label:"accessKeySecret",prop:"accessKeySecret","label-width":"140px"},{default:i((()=>[d(z,{modelValue:c(O).sms.tencent.accessKeySecret,"onUpdate:modelValue":a[5]||(a[5]=e=>c(O).sms.tencent.accessKeySecret=e)},null,8,["modelValue"])])),_:1}),d(U,{label:"APPID",prop:"appid","label-width":"140px"},{default:i((()=>[d(z,{modelValue:c(O).sms.tencent.appid,"onUpdate:modelValue":a[6]||(a[6]=e=>c(O).sms.tencent.appid=e)},null,8,["modelValue"])])),_:1}),d(U,{label:"短信签名",prop:"singName","label-width":"140px"},{default:i((()=>[d(z,{modelValue:c(O).sms.tencent.singName,"onUpdate:modelValue":a[7]||(a[7]=e=>c(O).sms.tencent.singName=e)},null,8,["modelValue"])])),_:1})],64)):y("",!0)])),_:1})])),_:1},8,["modelValue"])])])),_:1},8,["model"])),[[L,c(C)]])]),o("div",E,[o("div",q,[d(J,{type:"primary",loading:c(F),onClick:R},{default:i((()=>[b("保存")])),_:1},8,["loading"])])])])}}},[["__scopeId","data-v-215f982e"]]);export{C as default};
