1 |
- import{d as B,P as R,r as m,x as j,o,C as i,A as r,f as u,a,D as v,k as H,c as y,F as V,R as b,E as J,a2 as W,S as K,U as Q,V as Z,a9 as $,at as G,au as X,W as ee,J as ae,Z as le,_ as te,__tla as ue}from"./index-0b2503c4.js";import{_ as re,__tla as se}from"./Dialog-3207cd36.js";import{d as de,D as g,a as A,__tla as oe}from"./dict-0f5a88e6.js";import{g as me,c as ne,u as pe,__tla as ce}from"./index-91eea8dd.js";import{b as ie,__tla as _e}from"./index-fa5dd6b6.js";import{C as q}from"./constants-c811e5ff.js";import{u as fe,__tla as ve}from"./useMessage-d05433ee.js";let w,ye=Promise.all([(()=>{try{return ue}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return ve}catch{}})()]).then(async()=>{w=te(B({name:"SystemSmsTemplateForm",__name:"SmsTemplateForm",emits:["success"],setup(Ve,{expose:M,emit:P}){const{t:f}=R(),h=fe(),n=m(!1),S=m(""),p=m(!1),T=m(""),t=m({id:void 0,type:void 0,status:q.ENABLE,code:"",name:"",content:"",remark:"",apiTemplateId:"",channelId:void 0}),x=j({type:[{required:!0,message:"\u77ED\u4FE1\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],status:[{required:!0,message:"\u5F00\u542F\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],code:[{required:!0,message:"\u6A21\u677F\u7F16\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u6A21\u677F\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],content:[{required:!0,message:"\u6A21\u677F\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],apiTemplateId:[{required:!0,message:"\u77ED\u4FE1 API \u7684\u6A21\u677F\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],channelId:[{required:!0,message:"\u77ED\u4FE1\u6E20\u9053\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}]}),_=m(),I=m([]);M({open:async(s,l)=>{if(n.value=!0,S.value=f("action."+s),T.value=s,F(),l){p.value=!0;try{t.value=await me(l)}finally{p.value=!1}}I.value=await ie()}});const C=P,D=async()=>{if(_&&await _.value.validate()){p.value=!0;try{const s=t.value;T.value==="create"?(await ne(s),h.success(f("common.createSuccess"))):(await pe(s),h.success(f("common.updateSuccess"))),n.value=!1,C("success")}finally{p.value=!1}}},F=()=>{var s;t.value={id:void 0,type:void 0,status:q.ENABLE,code:"",name:"",content:"",remark:"",apiTemplateId:"",channelId:void 0},(s=_.value)==null||s.resetFields()};return(s,l)=>{const k=K,E=Q,d=Z,c=$,N=G,L=X,O=ee,U=ae,Y=re,z=le;return o(),i(Y,{modelValue:a(n),"onUpdate:modelValue":l[9]||(l[9]=e=>W(n)?n.value=e:null),title:a(S)},{footer:r(()=>[u(U,{disabled:a(p),type:"primary",onClick:D},{default:r(()=>[v("\u786E \u5B9A")]),_:1},8,["disabled"]),u(U,{onClick:l[8]||(l[8]=e=>n.value=!1)},{default:r(()=>[v("\u53D6 \u6D88")]),_:1})]),default:r(()=>[H((o(),i(O,{ref_key:"formRef",ref:_,model:a(t),rules:a(x),"label-width":"140px"},{default:r(()=>[u(d,{label:"\u77ED\u4FE1\u6E20\u9053\u7F16\u53F7",prop:"channelId"},{default:r(()=>[u(E,{modelValue:a(t).channelId,"onUpdate:modelValue":l[0]||(l[0]=e=>a(t).channelId=e),placeholder:"\u8BF7\u9009\u62E9\u77ED\u4FE1\u6E20\u9053\u7F16\u53F7"},{default:r(()=>[(o(!0),y(V,null,b(a(I),e=>(o(),i(k,{key:e.id,label:e.signature+`\u3010 ${a(de)(a(g).SYSTEM_SMS_CHANNEL_CODE,e.code)}\u3011`,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(d,{label:"\u77ED\u4FE1\u7C7B\u578B",prop:"type"},{default:r(()=>[u(E,{modelValue:a(t).type,"onUpdate:modelValue":l[1]||(l[1]=e=>a(t).type=e),placeholder:"\u8BF7\u9009\u62E9\u77ED\u4FE1\u7C7B\u578B"},{default:r(()=>[(o(!0),y(V,null,b(a(A)(a(g).SYSTEM_SMS_TEMPLATE_TYPE),e=>(o(),i(k,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(d,{label:"\u6A21\u677F\u7F16\u53F7",prop:"code"},{default:r(()=>[u(c,{modelValue:a(t).code,"onUpdate:modelValue":l[2]||(l[2]=e=>a(t).code=e),placeholder:"\u8BF7\u8F93\u5165\u6A21\u677F\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),u(d,{label:"\u6A21\u677F\u540D\u79F0",prop:"name"},{default:r(()=>[u(c,{modelValue:a(t).name,"onUpdate:modelValue":l[3]||(l[3]=e=>a(t).name=e),placeholder:"\u8BF7\u8F93\u5165\u6A21\u677F\u540D\u79F0"},null,8,["modelValue"])]),_:1}),u(d,{label:"\u6A21\u677F\u5185\u5BB9",prop:"content"},{default:r(()=>[u(c,{modelValue:a(t).content,"onUpdate:modelValue":l[4]||(l[4]=e=>a(t).content=e),placeholder:"\u8BF7\u8F93\u5165\u6A21\u677F\u5185\u5BB9",type:"textarea"},null,8,["modelValue"])]),_:1}),u(d,{label:"\u5F00\u542F\u72B6\u6001",prop:"status"},{default:r(()=>[u(L,{modelValue:a(t).status,"onUpdate:modelValue":l[5]||(l[5]=e=>a(t).status=e)},{default:r(()=>[(o(!0),y(V,null,b(a(A)(a(g).COMMON_STATUS),e=>(o(),i(N,{key:e.value,label:e.value},{default:r(()=>[v(J(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(d,{label:"\u77ED\u4FE1 API \u6A21\u677F\u7F16\u53F7",prop:"apiTemplateId"},{default:r(()=>[u(c,{modelValue:a(t).apiTemplateId,"onUpdate:modelValue":l[6]||(l[6]=e=>a(t).apiTemplateId=e),placeholder:"\u8BF7\u8F93\u5165\u77ED\u4FE1 API \u7684\u6A21\u677F\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),u(d,{label:"\u5907\u6CE8",prop:"remark"},{default:r(()=>[u(c,{modelValue:a(t).remark,"onUpdate:modelValue":l[7]||(l[7]=e=>a(t).remark=e),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[z,a(p)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/sms/template/SmsTemplateForm.vue"]])});export{ye as __tla,w as default};
|