import{x as k,d as C,Q as V,r as i,o as Y,A as E,B as _,f,a as o,E as M,k as H,a2 as j,K as I,Z as O,__tla as R}from"./index-92ad187a.js";import{_ as U,__tla as B}from"./Dialog-44c9fa34.js";import{_ as K,__tla as N}from"./Form-e4dc4c6b.js";import{g as Q,c as Z,u as q,__tla as z}from"./index-ab809518.js";import{d as G,__tla as J}from"./formatTime-c7f253d6.js";import{b as L,__tla as W}from"./index-9fa0b586.js";import{r as e,__tla as X}from"./formRules-bab8ffd5.js";import{D as $,__tla as aa}from"./dict-221f3e01.js";import{u as ea,__tla as ta}from"./useCrudSchemas-4b408cc7.js";import{u as la,__tla as ra}from"./useMessage-d9788660.js";let T,p,sa=Promise.all([(()=>{try{return R}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return N}catch{}})(),(()=>{try{return z}catch{}})(),(()=>{try{return J}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return ta}catch{}})(),(()=>{try{return ra}catch{}})()]).then(async()=>{let m,h,y;m=await L(),h=k({name:[e],code:[e],accountId:[e],label:[e],content:[e],params:[e],status:[e]}),y=k([{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,b,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:$.COMMON_STATUS,dictClass:"number"},{label:"\u5907\u6CE8",field:"remark",isTable:!1},{label:"\u521B\u5EFA\u65F6\u95F4",field:"createTime",isForm:!1,formatter:G,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:p}=ea(y),T=C({name:"SystemMailTemplateForm",__name:"MailTemplateForm",emits:["success"],setup(x,{expose:b,emit:u}){const{t}=V(),n=la(),l=i(!1),v=i(""),r=i(!1),w=i(""),c=i();b({open:async(s,a)=>{if(l.value=!0,v.value=t("action."+s),w.value=s,a){r.value=!0;try{const d=await Q(a);c.value.setValues(d)}finally{r.value=!1}}}});const D=u,g=async()=>{if(c&&await c.value.getElFormRef().validate()){r.value=!0;try{const s=c.value.formModel;w.value==="create"?(await Z(s),n.success(t("common.createSuccess"))):(await q(s),n.success(t("common.updateSuccess"))),l.value=!1,D("success")}finally{r.value=!1}}};return(s,a)=>{const d=K,S=I,P=U,A=O;return Y(),E(P,{modelValue:o(l),"onUpdate:modelValue":a[1]||(a[1]=F=>j(l)?l.value=F:null),"max-height":500,scroll:!0,title:o(v),width:800},{footer:_(()=>[f(S,{disabled:o(r),type:"primary",onClick:g},{default:_(()=>[M("\u786E \u5B9A")]),_:1},8,["disabled"]),f(S,{onClick:a[0]||(a[0]=F=>l.value=!1)},{default:_(()=>[M("\u53D6 \u6D88")]),_:1})]),default:_(()=>[H(f(d,{ref_key:"formRef",ref:c,rules:o(h),schema:o(p).formSchema},null,8,["rules","schema"]),[[A,o(r)]])]),_:1},8,["modelValue","title"])}}})});export{T as _,sa as __tla,p as a};
