var h=(n,u,a)=>new Promise((m,r)=>{var c=o=>{try{l(a.next(o))}catch(s){r(s)}},i=o=>{try{l(a.throw(o))}catch(s){r(s)}},l=o=>o.done?m(o.value):Promise.resolve(o.value).then(c,i);l((a=a.apply(n,u)).next())});import{u as P,F as w}from"./useForm-kq1sxERw.js";import{u as R}from"./useValidator-BN3tPovt.js";import{_ as v}from"./selectFriend.vue_vue_type_script_setup_true_lang-BzxfNWW1.js";import{_ as x}from"./selectRoom.vue_vue_type_script_setup_true_lang-C-AHDN4k.js";import{l as F,r as I,Z as L,w as U,m as y,M as D,u as _,U as p}from"./vue-chunks-DyZSmvoe.js";const j=F({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(n,{expose:u}){const{required:a}=R(),m=n,r=e=>{e!="contact"?d([{field:"roomList",path:"hidden",value:!1},{field:"friendList",path:"hidden",value:!0}]):d([{field:"roomList",path:"hidden",value:!0},{field:"friendList",path:"hidden",value:!1}])},c=I([{field:"names",label:"指定用户",component:"Input",colProps:{span:24},value:null,formItemProps:{slots:{default:e=>p(v,{modelValue:e.names,"onUpdate:modelValue":t=>e.names=t},null)}}},{field:"type",label:"转发消息类型",component:"RadioGroup",value:1,colProps:{span:24},componentProps:{options:[{value:1,label:"只转发文字"},{value:2,label:"转发所有消息"}]}},{field:"rooms",label:"转发到的群",value:"contact",colProps:{span:24},value:[],formItemProps:{slots:{default:e=>p(x,{multiple:!0,modelValue:e.rooms,"onUpdate:modelValue":t=>e.rooms=t},null)}}},{field:"contacts",label:"转发到的好友",colProps:{span:24},value:[],formItemProps:{slots:{default:e=>p(v,{multiple:!0,modelValue:e.contacts,"onUpdate:modelValue":t=>e.contacts=t},null)}}}]),i=L({name:[a()]}),{formRegister:l,formMethods:o}=P(),{setValues:s,getFormData:V,getElFormExpose:b,setSchema:d}=o,g=()=>h(this,null,function*(){const e=yield b();if(yield e==null?void 0:e.validate().catch(f=>{}))return yield V()});return U(()=>m.currentRow,e=>{e&&s(e)},{deep:!0,immediate:!0}),u({submit:g,change:r}),(e,t)=>(y(),D(_(w),{rules:i,"auto-set-placeholder":!1,onRegister:_(l),schema:c.value},null,8,["rules","onRegister","schema"]))}});export{j as _};
