| 1 |
- import{fD as R,fI as A,dd as L,cQ as H,fL as O,gs as m,fr as F,fV as i,fW as E,ft as b,cs as U,cw as s,g$ as t,cv as _,gx as p,gN as v,cp as g,h0 as k,cq as G,e as J,O as Q,B as W,fM as w,y as C,ac as j}from"./builder-DygomDiV.js";const y="/email_setting",z=n=>L(`${y}`,void 0,n),K=(n,e)=>R(`${y}`,n,void 0,e),X=(n,e)=>A(`${y}`,n,void 0,e),h={getEmailSetting:z,postTestEmail:K,putEmailSetting:X},Y={class:"email-setting p-16-24"},Z={class:"ml-4 color-text-primary"},x={class:"email-setting__main p-16"},ee={class:"mr-12"},le=H({__name:"index",setup(n){const e=w({email_host:"",email_port:"",email_host_user:"",email_host_password:"",email_use_tls:!1,email_use_ssl:!1,from_email:""}),f=w(),u=w(!1),T=O({email_host:[{required:!0,message:m("views.system.email.smtpHostPlaceholder"),trigger:"blur"}],email_port:[{required:!0,message:m("views.system.email.smtpPortPlaceholder"),trigger:"blur"}],email_host_user:[{required:!0,message:m("views.system.email.smtpUserPlaceholder"),trigger:"blur"}],email_host_password:[{required:!0,message:m("views.system.email.smtpPasswordPlaceholder"),trigger:"blur"}],from_email:[{required:!0,message:m("views.system.email.sendEmailPlaceholder"),trigger:"blur"}]}),V=async(l,a)=>{l&&await l.validate((c,$)=>{c&&(a?h.postTestEmail(e.value,u).then(r=>{C(m("views.system.testSuccess"))}):h.putEmailSetting(e.value,u).then(r=>{C(m("common.saveSuccess"))}))})};function q(){h.getEmailSetting(u).then(l=>{l.data&&JSON.stringify(l.data)!=="{}"&&(e.value=l.data)})}return F(()=>{q()}),(l,a)=>{const c=i("el-breadcrumb-item"),$=i("el-breadcrumb"),r=i("el-input"),d=i("el-form-item"),P=i("el-checkbox"),S=i("el-button"),D=i("el-form"),N=i("el-scrollbar"),I=i("el-card"),B=E("hasPermission"),M=E("loading");return b(),U("div",Y,[s($,{"separator-icon":"ArrowRight",class:"mb-16"},{default:t(()=>[s(c,null,{default:t(()=>[_(p(v(m)("views.system.subTitle")),1)]),_:1}),s(c,null,{default:t(()=>[g("h5",Z,p(l.$t("views.system.email.title")),1)]),_:1})]),_:1}),k((b(),G(I,{style:{"--el-card-padding":"16px"}},{default:t(()=>[s(N,null,{default:t(()=>[g("div",x,[s(D,{ref_key:"emailFormRef",ref:f,rules:T,model:e.value,"label-position":"top","require-asterisk-position":"right"},{default:t(()=>[s(d,{label:l.$t("views.system.email.smtpHost"),prop:"email_host"},{default:t(()=>[s(r,{modelValue:e.value.email_host,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value.email_host=o),placeholder:l.$t("views.system.email.smtpHostPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(d,{label:l.$t("views.system.email.smtpPort"),prop:"email_port"},{default:t(()=>[s(r,{modelValue:e.value.email_port,"onUpdate:modelValue":a[1]||(a[1]=o=>e.value.email_port=o),placeholder:l.$t("views.system.email.smtpPortPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(d,{label:l.$t("views.system.email.smtpUser"),prop:"email_host_user"},{default:t(()=>[s(r,{modelValue:e.value.email_host_user,"onUpdate:modelValue":a[2]||(a[2]=o=>e.value.email_host_user=o),placeholder:l.$t("views.system.email.smtpUserPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(d,{label:l.$t("views.system.email.sendEmail"),prop:"from_email"},{default:t(()=>[s(r,{modelValue:e.value.from_email,"onUpdate:modelValue":a[3]||(a[3]=o=>e.value.from_email=o),placeholder:l.$t("views.system.email.sendEmailPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(d,{label:l.$t("views.system.password"),prop:"email_host_password"},{default:t(()=>[s(r,{modelValue:e.value.email_host_password,"onUpdate:modelValue":a[4]||(a[4]=o=>e.value.email_host_password=o),placeholder:l.$t("views.system.email.smtpPasswordPlaceholder"),"show-password":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(d,null,{default:t(()=>[s(P,{modelValue:e.value.email_use_ssl,"onUpdate:modelValue":a[5]||(a[5]=o=>e.value.email_use_ssl=o)},{default:t(()=>[_(p(l.$t("views.system.email.enableSSL")),1)]),_:1},8,["modelValue"])]),_:1}),s(d,null,{default:t(()=>[s(P,{modelValue:e.value.email_use_tls,"onUpdate:modelValue":a[6]||(a[6]=o=>e.value.email_use_tls=o)},{default:t(()=>[_(p(l.$t("views.system.email.enableTLS")),1)]),_:1},8,["modelValue"])]),_:1}),k((b(),U("span",ee,[s(S,{onClick:a[7]||(a[7]=o=>V(f.value)),type:"primary",disabled:u.value},{default:t(()=>[_(p(l.$t("common.save")),1)]),_:1},8,["disabled"])])),[[B,new(v(J))([v(Q).ADMIN],[v(W).EMAIL_SETTING_EDIT],[],"OR")]]),g("span",null,[s(S,{onClick:a[8]||(a[8]=o=>V(f.value,"test")),disabled:u.value},{default:t(()=>[_(p(l.$t("views.system.test")),1)]),_:1},8,["disabled"])])]),_:1},8,["rules","model"])])]),_:1})]),_:1})),[[M,u.value]])])}}}),ae=j(le,[["__scopeId","data-v-e059225d"]]);export{ae as default};
|