MailTemplateForm-e8a81b95.js 3.6 KB

1
  1. import{g as T,d as O,B as V,r as c,o as Y,k as z,w as _,i as f,a as o,l as g,D as A,R as H,s as R,M as E,_ as I,__tla as U}from"./index-2f799233.js";import{_ as B,__tla as N}from"./Dialog-6fd39e06.js";import{_ as q,__tla as G}from"./Form-5e5465c1.js";import{g as J,c as K,u as L,__tla as Q}from"./index-bde5749e.js";import{d as W,__tla as X}from"./formatTime-2157894c.js";import{b as Z,__tla as $}from"./index-7a704c83.js";import{r as a,__tla as ee}from"./formRules-8aa12f76.js";import{D as ae,__tla as te}from"./dict-20c916e2.js";import{u as le,__tla as se}from"./useCrudSchemas-13251276.js";import{u as re,__tla as oe}from"./useMessage-e567ad40.js";let p,h,D,ie=Promise.all([(()=>{try{return U}catch{}})(),(()=>{try{return N}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return ee}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return oe}catch{}})()]).then(async()=>{let m,y,b;m=await Z(),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:(P,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:W,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=I(O({name:"SystemMailTemplateForm",__name:"MailTemplateForm",emits:["success"],setup(P,{expose:v,emit:u}){const{t}=V(),n=re(),l=c(!1),w=c(""),s=c(!1),S=c(""),i=c();v({open:async(r,e)=>{if(l.value=!0,w.value=t("action."+r),S.value=r,e){s.value=!0;try{const d=await J(e);i.value.setValues(d)}finally{s.value=!1}}}});const k=u,x=async()=>{if(i&&await i.value.getElFormRef().validate()){s.value=!0;try{const r=i.value.formModel;S.value==="create"?(await K(r),n.success(t("common.createSuccess"))):(await L(r),n.success(t("common.updateSuccess"))),l.value=!1,k("success")}finally{s.value=!1}}};return(r,e)=>{const d=q,F=R,C=B,j=E;return Y(),z(C,{modelValue:o(l),"onUpdate:modelValue":e[1]||(e[1]=M=>H(l)?l.value=M:null),"max-height":500,scroll:!0,title:o(w),width:800},{footer:_(()=>[f(F,{disabled:o(s),type:"primary",onClick:x},{default:_(()=>[g("\u786E \u5B9A")]),_:1},8,["disabled"]),f(F,{onClick:e[0]||(e[0]=M=>l.value=!1)},{default:_(()=>[g("\u53D6 \u6D88")]),_:1})]),default:_(()=>[A(f(d,{ref_key:"formRef",ref:i,rules:o(y),schema:o(h).formSchema},null,8,["rules","schema"]),[[j,o(s)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/system/mail/template/MailTemplateForm.vue"]]),D=Object.freeze(Object.defineProperty({__proto__:null,default:p},Symbol.toStringTag,{value:"Module"}))});export{p as M,ie as __tla,h as a,D as b};