var f=(n,u,a)=>new Promise((m,l)=>{var c=o=>{try{s(a.next(o))}catch(t){l(t)}},p=o=>{try{s(a.throw(o))}catch(t){l(t)}},s=o=>o.done?m(o.value):Promise.resolve(o.value).then(c,p);s((a=a.apply(n,u)).next())});import{u as w,F as V}from"./useForm-kq1sxERw.js";import{u as R}from"./useValidator-BN3tPovt.js";import{_ as v}from"./selectRoom.vue_vue_type_script_setup_true_lang-C-AHDN4k.js";import{l as y,r as x,Z as F,w as D,m as U,M as k,u as h,U as b}from"./vue-chunks-DyZSmvoe.js";const S=y({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(n,{expose:u}){const{required:a}=R(),m=n,l=e=>{e==3?i([{field:"ones",path:"hidden",value:!0}]):i([{field:"ones",path:"hidden",value:!1}])},c=x([{field:"model",label:"同步模式",component:"RadioGroup",colProps:{span:24},value:1,componentProps:{options:[{value:1,label:"一对多模式"},{value:2,label:"多对一模式"},{value:3,label:"多对多模式"}],on:{change:e=>{l(e)}}}},{field:"ones",label:"主群名",colProps:{span:24},value:null,formItemProps:{slots:{default:e=>b(v,{modelValue:e.ones,"onUpdate:modelValue":r=>e.ones=r},null)}}},{field:"manys",label:"子群添加",colProps:{span:24},value:[],formItemProps:{slots:{default:e=>b(v,{multiple:!0,modelValue:e.manys,"onUpdate:modelValue":r=>e.manys=r},null)}}},{field:"forward",label:"转发消息类型",component:"RadioGroup",value:1,colProps:{span:24},componentProps:{options:[{value:1,label:"只转发文字"},{value:2,label:"转发文字和图片"}]}}]),p=F({name:[a()]}),{formRegister:s,formMethods:o}=w(),{setValues:t,getFormData:_,getElFormExpose:g,setSchema:i}=o,P=()=>f(this,null,function*(){const e=yield g();if(yield e==null?void 0:e.validate().catch(d=>{}))return yield _()});return D(()=>m.currentRow,e=>{e&&t(e)},{deep:!0,immediate:!0}),u({submit:P,change:l}),(e,r)=>(U(),k(h(V),{rules:p,"auto-set-placeholder":!1,onRegister:h(s),schema:c.value},null,8,["rules","onRegister","schema"]))}});export{S as _};
