import{x as T,d as A,P as O,r as c,o as V,C as Y,A as _,f,a as o,D,k as z,a2 as H,J as E,Z as I,_ as R,__tla as U}from"./index-54aa57d8.js";import{_ as J,__tla as N}from"./Dialog-7bb778a5.js";import{_ as Z,__tla as q}from"./Form-0974edc5.js";import{g as B,c as G,u as K,__tla as L}from"./index-21c6b25e.js";import{d as Q,__tla as W}from"./formatTime-e6197688.js";import{b as X,__tla as $}from"./index-a81de46d.js";import{r as a,__tla as ee}from"./formRules-de58d92d.js";import{D as ae,__tla as te}from"./dict-573b3b04.js";import{u as le,__tla as re}from"./useCrudSchemas-648c24f2.js";import{u as se,__tla as oe}from"./useMessage-f56cafbb.js";let p,h,k,ie=Promise.all([(()=>{try{return U}catch{}})(),(()=>{try{return N}catch{}})(),(()=>{try{return q}catch{}})(),(()=>{try{return L}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return ee}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return oe}catch{}})()]).then(async()=>{let m,y,b;m=await X(),y=T({name:[a],code:[a],accountId:[a],label:[a],content:[a],params:[a],status:[a]}),b=T([{label:"\u6A21\u677F\u7F16\u7801",field:"code",isSearch:!0},{label:"\u6A21\u677F\u540D\u79F0",field:"name",isSearch:!0},{label:"\u6A21\u677F\u6807\u9898",field:"title"},{label:"\u6A21\u677F\u5185\u5BB9",field:"content",form:{component:"Editor",componentProps:{valueHtml:"",height:200}}},{label:"\u90AE\u7BB1\u8D26\u53F7",field:"accountId",width:"200px",formatter:(x,v,u)=>{var t;return(t=m.find(n=>n.id===u))==null?void 0:t.mail},search:{show:!0,component:"Select",api:()=>m,componentProps:{optionsAlias:{labelField:"mail",valueField:"id"}}},form:{component:"Select",api:()=>m,componentProps:{optionsAlias:{labelField:"mail",valueField:"id"}}}},{label:"\u53D1\u9001\u4EBA\u540D\u79F0",field:"nickname"},{label:"\u5F00\u542F\u72B6\u6001",field:"status",isSearch:!0,dictType:ae.COMMON_STATUS,dictClass:"number"},{label:"\u5907\u6CE8",field:"remark",isTable:!1},{label:"\u521B\u5EFA\u65F6\u95F4",field:"createTime",isForm:!1,formatter:Q,search:{show:!0,component:"DatePicker",componentProps:{valueFormat:"YYYY-MM-DD HH:mm:ss",type:"daterange",defaultTime:[new Date("1 00:00:00"),new Date("1 23:59:59")]}}},{label:"\u64CD\u4F5C",field:"action",isForm:!1}]),{allSchemas:h}=le(b),p=R(A({name:"SystemMailTemplateForm",__name:"MailTemplateForm",emits:["success"],setup(x,{expose:v,emit:u}){const{t}=O(),n=se(),l=c(!1),S=c(""),r=c(!1),w=c(""),i=c();v({open:async(s,e)=>{if(l.value=!0,S.value=t("action."+s),w.value=s,e){r.value=!0;try{const d=await B(e);i.value.setValues(d)}finally{r.value=!1}}}});const P=u,g=async()=>{if(i&&await i.value.getElFormRef().validate()){r.value=!0;try{const s=i.value.formModel;w.value==="create"?(await G(s),n.success(t("common.createSuccess"))):(await K(s),n.success(t("common.updateSuccess"))),l.value=!1,P("success")}finally{r.value=!1}}};return(s,e)=>{const d=Z,F=E,C=J,j=I;return V(),Y(C,{modelValue:o(l),"onUpdate:modelValue":e[1]||(e[1]=M=>H(l)?l.value=M:null),"max-height":500,scroll:!0,title:o(S),width:800},{footer:_(()=>[f(F,{disabled:o(r),type:"primary",onClick:g},{default:_(()=>[D("\u786E \u5B9A")]),_:1},8,["disabled"]),f(F,{onClick:e[0]||(e[0]=M=>l.value=!1)},{default:_(()=>[D("\u53D6 \u6D88")]),_:1})]),default:_(()=>[z(f(d,{ref_key:"formRef",ref:i,rules:o(y),schema:o(h).formSchema},null,8,["rules","schema"]),[[j,o(r)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/mail/template/MailTemplateForm.vue"]]),k=Object.freeze(Object.defineProperty({__proto__:null,default:p},Symbol.toStringTag,{value:"Module"}))});export{p as M,ie as __tla,h as a,k as b};