import{d as U,r as i,f as q,o as _,l as f,w as m,i as u,a as t,j as h,C as x,c as S,F as j,k as T,y as H,H as A,U as E,K as G,J,N as K,_ as N,__tla as O}from"./index-2c56227b.js";import{_ as R,__tla as z}from"./Dialog-1050d437.js";import{_ as B,__tla as D}from"./Editor-d05caa83.js";import{g as I,s as L,__tla as Q}from"./index-47dfa0f9.js";import{u as W,__tla as X}from"./useMessage-96878a4a.js";let g,Y=Promise.all([(()=>{try{return O}catch{}})(),(()=>{try{return z}catch{}})(),(()=>{try{return D}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return X}catch{}})()]).then(async()=>{g=N(U({name:"SystemMailTemplateSendForm",__name:"MailTemplateSendForm",setup(Z,{expose:P}){const V=W(),n=i(!1),p=i(!1),e=i({content:"",params:{},mail:"",templateCode:"",templateParams:new Map}),c=q({mail:[{required:!0,message:"\u90AE\u7BB1\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],templateCode:[{required:!0,message:"\u6A21\u7248\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],templateParams:{}}),d=i();P({open:async s=>{n.value=!0,w(),p.value=!0;try{const a=await I(s);e.value.content=a.content,e.value.params=a.params,e.value.templateCode=a.code,e.value.templateParams=a.params.reduce((o,r)=>(o[r]="",o),{}),c.templateParams=a.params.reduce((o,r)=>(o[r]={required:!0,message:"\u53C2\u6570 "+r+" \u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"},o),{})}finally{p.value=!1}}});const b=async()=>{if(d&&await d.value.validate()){p.value=!0;try{const s=e.value,a=await L(s);a&&V.success("\u63D0\u4EA4\u53D1\u9001\u6210\u529F\uFF01\u53D1\u9001\u7ED3\u679C\uFF0C\u89C1\u53D1\u9001\u65E5\u5FD7\u7F16\u53F7\uFF1A"+a),n.value=!1}finally{p.value=!1}}},w=()=>{var s;e.value={content:"",params:{},mail:"",templateCode:"",templateParams:new Map},c.templateParams={},(s=d.value)==null||s.resetFields()};return(s,a)=>{const o=B,r=A,v=E,C=G,y=J,k=R,F=K;return _(),f(k,{modelValue:t(n),"onUpdate:modelValue":a[2]||(a[2]=l=>H(n)?n.value=l:null),title:"\u6D4B\u8BD5"},{footer:m(()=>[u(y,{disabled:t(p),type:"primary",onClick:b},{default:m(()=>[h("\u786E \u5B9A")]),_:1},8,["disabled"]),u(y,{onClick:a[1]||(a[1]=l=>n.value=!1)},{default:m(()=>[h("\u53D6 \u6D88")]),_:1})]),default:m(()=>[x((_(),f(C,{ref_key:"formRef",ref:d,model:t(e),rules:t(c),"label-width":"120px"},{default:m(()=>[u(r,{label:"\u6A21\u677F\u5185\u5BB9",prop:"content"},{default:m(()=>[u(o,{"model-value":t(e).content,height:"150px",readonly:""},null,8,["model-value"])]),_:1}),u(r,{label:"\u6536\u4EF6\u90AE\u7BB1",prop:"mail"},{default:m(()=>[u(v,{modelValue:t(e).mail,"onUpdate:modelValue":a[0]||(a[0]=l=>t(e).mail=l),placeholder:"\u8BF7\u8F93\u5165\u6536\u4EF6\u90AE\u7BB1"},null,8,["modelValue"])]),_:1}),(_(!0),S(j,null,T(t(e).params,l=>(_(),f(r,{key:l,label:"\u53C2\u6570 {"+l+"}",prop:"templateParams."+l},{default:m(()=>[u(v,{modelValue:t(e).templateParams[l],"onUpdate:modelValue":M=>t(e).templateParams[l]=M,placeholder:"\u8BF7\u8F93\u5165 "+l+" \u53C2\u6570"},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label","prop"]))),128))]),_:1},8,["model","rules"])),[[F,t(p)]])]),_:1},8,["modelValue"])}}}),[["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/system/mail/template/MailTemplateSendForm.vue"]])});export{Y as __tla,g as default};
