import{_ as e,r as a,b as l,d as s,e as r,f as d,h as m,w as o,g as t,j as i,k as u,i as p,n,E as f,q as b}from"./index.286e9b79.js";import{v as _}from"./loading.c49775a6.js";import{E as c,a as g}from"./form.ad10dcd5.js";import{E as V,a as j}from"./tab-pane.1cc0f769.js";/* empty css                    *//* empty css              */import"./form-item.9355e6dc.js";import{E as v}from"./input.31de1b37.js";import{_ as w}from"./page-header.29890ed0.js";import{g as h,p as x}from"./http.f588794f.js";import{E as y,a as q}from"./index.569c0449.js";import"./_initCloneObject.fb8fbaea.js";import"./strings.8c60bfae.js";import"./event.776e7e11.js";import"./index.ed3ed02e.js";import"./divider.948c4b18.js";const S={class:"editor-card"},U={class:"editor-card-box"},M={class:"tool"},P={class:"tool-box"},T=e({__name:"email",setup(e){let T=a(!1),E=a(!1),k=a("0"),C=a(),F=l({email:{address:"",port:"",username:"",password:"",smtp_name:"",smtp_send:"",is_ssl:"1"}});const I=l({address:[{required:!0,message:"请输入SMTP地址",trigger:"blur"}],port:[{required:!0,message:"请输入SMTP端口",trigger:"blur"}],username:[{required:!0,message:"请输入邮箱用户名",trigger:"blur"}],password:[{required:!0,message:"请输入SMTP密码",trigger:"blur"}],smtp_name:[{required:!0,message:"请输入发送者名称",trigger:"blur"}],smtp_send:[{required:!0,message:"请输入发件人邮箱",trigger:"blur"}]});E.value=!0,h("system.system/email").then((e=>{E.value=!1,e.code&&(F.email=e.data)}));const L=async()=>{C.value&&await C.value.validate(((e,a)=>{E.value=!1,e?(E.value=!0,x("system.system/email",F).then((e=>{E.value=!1,e.code?f.success("操作成功"):f.error(e.msg)})).catch((e=>{f.error(e)}))):f.error("请完善内容")}))};return(e,a)=>{const l=w,f=v,h=c,x=y,O=q,R=V,z=j,A=g,B=b,D=_;return s(),r("div",null,[d(l,{title:"邮箱设置"}),m("div",S,[o((s(),i(A,{model:t(F).email,rules:t(I),ref_key:"ruleFormRef",ref:C},{default:u((()=>[m("div",U,[d(z,{modelValue:t(k),"onUpdate:modelValue":a[7]||(a[7]=e=>p(k)?k.value=e:k=e)},{default:u((()=>[d(R,{label:"基本信息",name:"0"},{default:u((()=>[d(h,{label:"SMTP地址",prop:"address","label-width":"100px"},{default:u((()=>[d(f,{modelValue:t(F).email.address,"onUpdate:modelValue":a[0]||(a[0]=e=>t(F).email.address=e)},null,8,["modelValue"])])),_:1}),d(h,{label:"SMTP端口",prop:"port","label-width":"100px"},{default:u((()=>[d(f,{type:"number",modelValue:t(F).email.port,"onUpdate:modelValue":a[1]||(a[1]=e=>t(F).email.port=e),modelModifiers:{number:!0}},null,8,["modelValue"])])),_:1}),d(h,{label:"邮箱用户名",prop:"username","label-width":"100px"},{default:u((()=>[d(f,{modelValue:t(F).email.username,"onUpdate:modelValue":a[2]||(a[2]=e=>t(F).email.username=e)},null,8,["modelValue"])])),_:1}),d(h,{label:"SMTP密码",prop:"password","label-width":"100px"},{default:u((()=>[d(f,{modelValue:t(F).email.password,"onUpdate:modelValue":a[3]||(a[3]=e=>t(F).email.password=e)},null,8,["modelValue"])])),_:1}),d(h,{label:"发送者名称",prop:"smtp_name","label-width":"100px"},{default:u((()=>[d(f,{modelValue:t(F).email.smtp_name,"onUpdate:modelValue":a[4]||(a[4]=e=>t(F).email.smtp_name=e)},null,8,["modelValue"])])),_:1}),d(h,{label:"发件人邮箱",prop:"smtp_send","label-width":"100px"},{default:u((()=>[d(f,{modelValue:t(F).email.smtp_send,"onUpdate:modelValue":a[5]||(a[5]=e=>t(F).email.smtp_send=e)},null,8,["modelValue"])])),_:1}),d(h,{label:"SSL",prop:"is_ssl",required:!0,"label-width":"100px"},{default:u((()=>[d(O,{modelValue:t(F).email.is_ssl,"onUpdate:modelValue":a[6]||(a[6]=e=>t(F).email.is_ssl=e)},{default:u((()=>[d(x,{label:1},{default:u((()=>[n("启用")])),_:1}),d(x,{label:0},{default:u((()=>[n("关闭")])),_:1})])),_:1},8,["modelValue"])])),_:1})])),_:1})])),_:1},8,["modelValue"])])])),_:1},8,["model","rules"])),[[D,t(T)]])]),m("div",M,[m("div",P,[d(B,{type:"primary",loading:t(E),onClick:L},{default:u((()=>[n("保存")])),_:1},8,["loading"])])])])}}},[["__scopeId","data-v-e4237093"]]);export{T as default};
