import{d as k,r as i,f as q,o as _,x as f,w as s,g as u,a as t,q as h,y as S,c as T,F as U,v as z,Q as D,B as j,X as B,G,D as J,J as Q,_ as R,__tla as X}from"./index-7d5b26d3.js";import{_ as A,__tla as E}from"./Dialog-2be588df.js";import{_ as H,__tla as I}from"./Editor-7cbdb87d.js";import{g as K,s as L,__tla as N}from"./index-14fa43e2.js";import{u as O,__tla as W}from"./useMessage-c81eaa5b.js";let b,Y=Promise.all([(()=>{try{return X}catch{}})(),(()=>{try{return E}catch{}})(),(()=>{try{return I}catch{}})(),(()=>{try{return N}catch{}})(),(()=>{try{return W}catch{}})()]).then(async()=>{b=R(k({name:"SystemMailTemplateSendForm",__name:"MailTemplateSendForm",setup(Z,{expose:g}){const P=O(),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();g({open:async m=>{n.value=!0,w(),p.value=!0;try{const a=await K(m);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 V=async()=>{if(d&&await d.value.validate()){p.value=!0;try{const m=e.value,a=await L(m);a&&P.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 m;e.value={content:"",params:{},mail:"",templateCode:"",templateParams:new Map},c.templateParams={},(m=d.value)==null||m.resetFields()};return(m,a)=>{const o=H,r=j,v=B,x=G,y=J,C=A,M=Q;return _(),f(C,{modelValue:t(n),"onUpdate:modelValue":a[2]||(a[2]=l=>D(n)?n.value=l:null),title:"\u6D4B\u8BD5"},{footer:s(()=>[u(y,{disabled:t(p),type:"primary",onClick:V},{default:s(()=>[h("\u786E \u5B9A")]),_:1},8,["disabled"]),u(y,{onClick:a[1]||(a[1]=l=>n.value=!1)},{default:s(()=>[h("\u53D6 \u6D88")]),_:1})]),default:s(()=>[S((_(),f(x,{ref_key:"formRef",ref:d,model:t(e),rules:t(c),"label-width":"120px"},{default:s(()=>[u(r,{label:"\u6A21\u677F\u5185\u5BB9",prop:"content"},{default:s(()=>[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:s(()=>[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),T(U,null,z(t(e).params,l=>(_(),f(r,{key:l,label:"\u53C2\u6570 {"+l+"}",prop:"templateParams."+l},{default:s(()=>[u(v,{modelValue:t(e).templateParams[l],"onUpdate:modelValue":F=>t(e).templateParams[l]=F,placeholder:"\u8BF7\u8F93\u5165 "+l+" \u53C2\u6570"},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label","prop"]))),128))]),_:1},8,["model","rules"])),[[M,t(p)]])]),_:1},8,["modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/system/mail/template/MailTemplateSendForm.vue"]])});export{Y as __tla,b as default};
