var _=(u,p,s)=>new Promise((n,c)=>{var i=o=>{try{t(s.next(o))}catch(a){c(a)}},d=o=>{try{t(s.throw(o))}catch(a){c(a)}},t=o=>o.done?n(o.value):Promise.resolve(o.value).then(i,d);t((s=s.apply(u,p)).next())});import{u as R,F}from"./useForm-DFfbRY9m.js";import{u as P}from"./useValidator-dY8qp_qX.js";import{_ as V}from"./material.vue_vue_type_script_setup_true_lang-yKaOPhwY.js";import{n as x}from"./element-plus-C2aeItNs.js";import{l as y,r as E,U as r,F as B,Z as I,w as N,m as k,p as q,u as g,q as m}from"./vue-chunks-l-AyUCfi.js";const C=m("p",null,null,-1),D=m("p",null,"1、多个消息发送时间会相差1s左右，防止频率过快。 ",-1),S=m("p",null,"2、只有群组类型才支持批量发送群公告(群公告只支持文字，且机器人必须是管理员或者群主) ",-1),U=m("p",null,"3、消息发送成功并不代表实际成功，以微信收到消息为准，失败时，请查看客户端日志 ",-1),$=y({__name:"send",props:{currentRow:{type:Object,default:()=>null}},setup(u,{expose:p}){const{required:s}=P(),n=u,c=[{label:"消息",value:"Room"},{label:"群公告",value:"RoomNotice"}],i=[{label:"消息",value:"Contact"}],d=E([{field:"name",label:"发送目标",component:"Input",colProps:{span:24},formItemProps:{slots:{default:e=>r(B,null,[(e.groups||[]).map(l=>r(x,{type:"primary"},{default:()=>[l.name]}))])}}},{field:"target",label:"群发类型",component:"RadioGroup",colProps:{span:24},componentProps:{options:n.currentRow.type=="contact"?i:c}},{field:"groups",label:"群发类型",hidden:!0},{field:"messages",label:"发送素材",colProps:{span:24},value:[],formItemProps:{slots:{default:e=>r("div",{class:"w-[100%] flex"},[r(V,{modelValue:e.messages,"onUpdate:modelValue":l=>e.messages=l},null)])}}}]),t=I({messages:[s()]}),{formRegister:o,formMethods:a}=R(),{setValues:h,getFormData:v,getElFormExpose:b,setSchema:j}=a,w=()=>_(this,null,function*(){const e=yield b();if(yield e==null?void 0:e.validate().catch(f=>{}))return yield v()});return N(()=>n.currentRow,e=>{e&&h(e)},{deep:!0,immediate:!0}),p({submit:w}),(e,l)=>(k(),q("div",null,[C,D,S,U,r(g(F),{rules:t,"auto-set-placeholder":!1,onRegister:g(o),schema:d.value},null,8,["rules","onRegister","schema"])]))}});export{$ as _};
