import{d as M,r as _,x as N,o as d,A as c,B as r,f as s,a as l,E as y,k as f,c as v,F as V,R as b,G as A,v as T,a2 as G,a8 as K,V as W,as as j,at as Y,S as Z,U as z,W as H,K as J,Z as L,__tla as O}from"./index-92ad187a.js";import{_ as Q,__tla as X}from"./Dialog-44c9fa34.js";import{g as $,__tla as ee}from"./index-343decc0.js";import{g as ae,s as le,__tla as te}from"./index-dd19fc26.js";import{a as re,D as se,__tla as ue}from"./dict-221f3e01.js";import{u as oe,__tla as de}from"./useMessage-d9788660.js";let U,me=Promise.all([(()=>{try{return O}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return ee}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return de}catch{}})()]).then(async()=>{U=M({name:"SystemNotifyTemplateSendForm",__name:"NotifyTemplateSendForm",setup(pe,{expose:k}){const w=oe(),p=_(!1),n=_(!1),t=_({content:"",params:{},userId:void 0,userType:1,templateCode:"",templateParams:new Map}),h=N({userId:[{required:!0,message:"\u7528\u6237\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],templateCode:[{required:!0,message:"\u6A21\u7248\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],templateParams:{}}),i=_(),g=_([]);k({open:async m=>{p.value=!0,x(),n.value=!0;try{const a=await ae(m);t.value.content=a.content,t.value.params=a.params,t.value.templateCode=a.code,t.value.templateParams=a.params.reduce((o,u)=>(o[u]="",o),{}),h.templateParams=a.params.reduce((o,u)=>(o[u]={required:!0,message:"\u53C2\u6570 "+u+" \u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"},o),{})}finally{n.value=!1}g.value=await $()}});const I=async()=>{if(i&&await i.value.validate()){n.value=!0;try{const m=t.value,a=await le(m);a&&w.success("\u63D0\u4EA4\u53D1\u9001\u6210\u529F\uFF01\u53D1\u9001\u7ED3\u679C\uFF0C\u89C1\u53D1\u9001\u65E5\u5FD7\u7F16\u53F7\uFF1A"+a),p.value=!1}finally{n.value=!1}}},x=()=>{var m;t.value={content:"",params:{},mobile:"",templateCode:"",templateParams:new Map,userType:1},(m=i.value)==null||m.resetFields()};return(m,a)=>{const o=K,u=W,C=j,S=Y,F=Z,q=z,D=H,P=J,E=Q,R=L;return d(),c(E,{modelValue:l(p),"onUpdate:modelValue":a[5]||(a[5]=e=>G(p)?p.value=e:null),title:"\u6D4B\u8BD5\u53D1\u9001","max-height":500},{footer:r(()=>[s(P,{disabled:l(n),type:"primary",onClick:I},{default:r(()=>[y("\u786E \u5B9A")]),_:1},8,["disabled"]),s(P,{onClick:a[4]||(a[4]=e=>p.value=!1)},{default:r(()=>[y("\u53D6 \u6D88")]),_:1})]),default:r(()=>[f((d(),c(D,{ref_key:"formRef",ref:i,model:l(t),rules:l(h),"label-width":"140px"},{default:r(()=>[s(u,{label:"\u6A21\u677F\u5185\u5BB9",prop:"content"},{default:r(()=>[s(o,{modelValue:l(t).content,"onUpdate:modelValue":a[0]||(a[0]=e=>l(t).content=e),placeholder:"\u8BF7\u8F93\u5165\u6A21\u677F\u5185\u5BB9",readonly:"",type:"textarea"},null,8,["modelValue"])]),_:1}),s(u,{label:"\u7528\u6237\u7C7B\u578B",prop:"userType"},{default:r(()=>[s(S,{modelValue:l(t).userType,"onUpdate:modelValue":a[1]||(a[1]=e=>l(t).userType=e)},{default:r(()=>[(d(!0),v(V,null,b(l(re)(l(se).USER_TYPE),e=>(d(),c(C,{key:e.value,label:e.value},{default:r(()=>[y(A(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),f(s(u,{label:"\u63A5\u6536\u4EBAID",prop:"userId"},{default:r(()=>[s(o,{modelValue:l(t).userId,"onUpdate:modelValue":a[2]||(a[2]=e=>l(t).userId=e),style:{width:"160px"}},null,8,["modelValue"])]),_:1},512),[[T,l(t).userType===1]]),f(s(u,{label:"\u63A5\u6536\u4EBA",prop:"userId"},{default:r(()=>[s(q,{modelValue:l(t).userId,"onUpdate:modelValue":a[3]||(a[3]=e=>l(t).userId=e),placeholder:"\u8BF7\u9009\u62E9\u63A5\u6536\u4EBA"},{default:r(()=>[(d(!0),v(V,null,b(l(g),e=>(d(),c(F,{key:e.id,label:e.nickname,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},512),[[T,l(t).userType===2]]),(d(!0),v(V,null,b(l(t).params,e=>(d(),c(u,{key:e,label:"\u53C2\u6570 {"+e+"}",prop:"templateParams."+e},{default:r(()=>[s(o,{modelValue:l(t).templateParams[e],"onUpdate:modelValue":B=>l(t).templateParams[e]=B,placeholder:"\u8BF7\u8F93\u5165 "+e+" \u53C2\u6570"},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label","prop"]))),128))]),_:1},8,["model","rules"])),[[R,l(n)]])]),_:1},8,["modelValue"])}}})});export{U as _,me as __tla};
