import{d as M,r as _,x as S,o as i,A as f,B as s,f as u,a as t,E as h,k as U,c as q,F as R,R as T,a2 as j,V as A,a8 as B,W as E,K,Z as W,__tla as Z}from"./index-92ad187a.js";import{_ as z,__tla as D}from"./Dialog-44c9fa34.js";import{_ as G,__tla as H}from"./style.css_vue_type_style_index_0_src_true_lang-4e9b772e.js";import{g as I,s as J,__tla as L}from"./index-ab809518.js";import{u as N,__tla as O}from"./useMessage-d9788660.js";let g,Q=Promise.all([(()=>{try{return Z}catch{}})(),(()=>{try{return D}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return L}catch{}})(),(()=>{try{return O}catch{}})()]).then(async()=>{g=M({name:"SystemMailTemplateSendForm",__name:"MailTemplateSendForm",setup(X,{expose:P}){const V=N(),p=_(!1),n=_(!1),e=_({content:"",params:{},mail:"",templateCode:"",templateParams:new Map}),c=S({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=_();P({open:async m=>{p.value=!0,w(),n.value=!0;try{const a=await I(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{n.value=!1}}});const b=async()=>{if(d&&await d.value.validate()){n.value=!0;try{const m=e.value,a=await J(m);a&&V.success("\u63D0\u4EA4\u53D1\u9001\u6210\u529F\uFF01\u53D1\u9001\u7ED3\u679C\uFF0C\u89C1\u53D1\u9001\u65E5\u5FD7\u7F16\u53F7\uFF1A"+a),p.value=!1}finally{n.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=G,r=A,v=B,C=E,y=K,x=z,k=W;return i(),f(x,{modelValue:t(p),"onUpdate:modelValue":a[2]||(a[2]=l=>j(p)?p.value=l:null),title:"\u6D4B\u8BD5"},{footer:s(()=>[u(y,{disabled:t(n),type:"primary",onClick:b},{default:s(()=>[h("\u786E \u5B9A")]),_:1},8,["disabled"]),u(y,{onClick:a[1]||(a[1]=l=>p.value=!1)},{default:s(()=>[h("\u53D6 \u6D88")]),_:1})]),default:s(()=>[U((i(),f(C,{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}),(i(!0),q(R,null,T(t(e).params,l=>(i(),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"])),[[k,t(n)]])]),_:1},8,["modelValue"])}}})});export{g as _,Q as __tla};
