1 |
- import{d as j,r as n,g as z,o as i,k as _,w as u,i as r,a,l as f,D as B,c as g,F as k,C as h,t as I,R,Y as G,I as H,G as J,H as K,aj as Q,ak as W,J as X,s as Z,M as $,_ as ee,__tla as ae}from"./index-2f799233.js";import{_ as le,__tla as te}from"./Dialog-6fd39e06.js";import{a as T,D as U,__tla as re}from"./dict-20c916e2.js";import{g as ue,c as se,u as oe,__tla as de}from"./index-38623920.js";import{C as w}from"./constants-d55a3460.js";import{u as me,__tla as ne}from"./useMessage-e567ad40.js";let E,ie=Promise.all([(()=>{try{return ae}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ne}catch{}})()]).then(async()=>{E=ee(j({__name:"NotifyTemplateForm",emits:["success"],setup(ce,{expose:q,emit:N}){const v=me(),d=n(!1),y=n(""),m=n(!1),V=n(""),t=n({id:void 0,name:"",nickname:"",code:"",content:"",type:void 0,params:"",status:w.ENABLE,remark:""}),x=z({type:[{required:!0,message:"\u6D88\u606F\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"}],nickname:[{required:!0,message:"\u53D1\u4EF6\u4EBA\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],content:[{required:!0,message:"\u6A21\u677F\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),p=n();q({open:async(s,l)=>{if(d.value=!0,y.value=s,V.value=s,M(),l){m.value=!0;try{t.value=await ue(l)}finally{m.value=!1}}}});const C=N,F=async()=>{if(p&&await p.value.validate()){m.value=!0;try{const s=t.value;V.value==="create"?(await se(s),v.success("\u65B0\u589E\u6210\u529F")):(await oe(s),v.success("\u4FEE\u6539\u6210\u529F")),d.value=!1,C("success")}finally{m.value=!1}}},M=()=>{var s;t.value={id:void 0,name:"",nickname:"",code:"",content:"",type:void 0,params:"",status:w.ENABLE,remark:""},(s=p.value)==null||s.resetFields()};return(s,l)=>{const c=G,o=H,A=J,L=K,S=Q,Y=W,D=X,b=Z,O=le,P=$;return i(),_(O,{title:a(y),modelValue:a(d),"onUpdate:modelValue":l[8]||(l[8]=e=>R(d)?d.value=e:null)},{footer:u(()=>[r(b,{onClick:F,type:"primary",disabled:a(m)},{default:u(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),r(b,{onClick:l[7]||(l[7]=e=>d.value=!1)},{default:u(()=>[f("\u53D6 \u6D88")]),_:1})]),default:u(()=>[B((i(),_(D,{ref_key:"formRef",ref:p,model:a(t),rules:a(x),"label-width":"140px"},{default:u(()=>[r(o,{label:"\u6A21\u7248\u7F16\u7801",prop:"code"},{default:u(()=>[r(c,{modelValue:a(t).code,"onUpdate:modelValue":l[0]||(l[0]=e=>a(t).code=e),placeholder:"\u8BF7\u8F93\u5165\u6A21\u7248\u7F16\u7801"},null,8,["modelValue"])]),_:1}),r(o,{label:"\u6A21\u677F\u540D\u79F0",prop:"name"},{default:u(()=>[r(c,{modelValue:a(t).name,"onUpdate:modelValue":l[1]||(l[1]=e=>a(t).name=e),placeholder:"\u8BF7\u8F93\u5165\u6A21\u7248\u540D\u79F0"},null,8,["modelValue"])]),_:1}),r(o,{label:"\u53D1\u4EF6\u4EBA\u540D\u79F0",prop:"nickname"},{default:u(()=>[r(c,{modelValue:a(t).nickname,"onUpdate:modelValue":l[2]||(l[2]=e=>a(t).nickname=e),placeholder:"\u8BF7\u8F93\u5165\u53D1\u4EF6\u4EBA\u540D\u79F0"},null,8,["modelValue"])]),_:1}),r(o,{label:"\u6A21\u677F\u5185\u5BB9",prop:"content"},{default:u(()=>[r(c,{type:"textarea",modelValue:a(t).content,"onUpdate:modelValue":l[3]||(l[3]=e=>a(t).content=e),placeholder:"\u8BF7\u8F93\u5165\u6A21\u677F\u5185\u5BB9"},null,8,["modelValue"])]),_:1}),r(o,{label:"\u7C7B\u578B",prop:"type"},{default:u(()=>[r(L,{modelValue:a(t).type,"onUpdate:modelValue":l[4]||(l[4]=e=>a(t).type=e),placeholder:"\u8BF7\u9009\u62E9\u7C7B\u578B"},{default:u(()=>[(i(!0),g(k,null,h(a(T)(a(U).SYSTEM_NOTIFY_TEMPLATE_TYPE),e=>(i(),_(A,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(o,{label:"\u5F00\u542F\u72B6\u6001",prop:"status"},{default:u(()=>[r(Y,{modelValue:a(t).status,"onUpdate:modelValue":l[5]||(l[5]=e=>a(t).status=e)},{default:u(()=>[(i(!0),g(k,null,h(a(T)(a(U).COMMON_STATUS),e=>(i(),_(S,{key:e.value,label:e.value},{default:u(()=>[f(I(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(o,{label:"\u5907\u6CE8",prop:"remark"},{default:u(()=>[r(c,{modelValue:a(t).remark,"onUpdate:modelValue":l[6]||(l[6]=e=>a(t).remark=e),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[P,a(m)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/system/notify/template/NotifyTemplateForm.vue"]])});export{ie as __tla,E as default};
|