var m=(r,l,t)=>new Promise((p,n)=>{var c=e=>{try{a(t.next(e))}catch(s){n(s)}},i=e=>{try{a(t.throw(e))}catch(s){n(s)}},a=e=>e.done?p(e.value):Promise.resolve(e.value).then(c,i);a((t=t.apply(r,l)).next())});import{u as h,F as v}from"./useForm-DFfbRY9m.js";import"./useValidator-dY8qp_qX.js";import{l as P,r as w,Z as _,w as g,m as x,M as R,u as d}from"./vue-chunks-l-AyUCfi.js";const B=P({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(r,{expose:l}){const t=r,p=w([{field:"name",label:"好友昵称",component:"Input",colProps:{span:24},componentProps:{disabled:!0}},{field:"alias",label:"好友备注",component:"Input",colProps:{span:24},componentProps:{disabled:!0}},{field:"type",label:"消息类型",component:"RadioGroup",value:1,colProps:{span:24},componentProps:{disabled:!0,options:[{label:"文字",value:1},{label:"文件",value:2},{label:"h5链接",value:4},{label:"小程序",value:5}]}},{field:"content",label:"内容",colProps:{span:24},component:"Input",componentProps:{type:"textarea",rows:"3"}},{field:"weixin",componentProps:{hidden:!0}}]),n=_({}),{formRegister:c,formMethods:i}=h(),{setValues:a,getFormData:e,getElFormExpose:s,setSchema:y}=i,f=()=>m(this,null,function*(){const o=yield s();if(yield o==null?void 0:o.validate().catch(u=>{}))return yield e()});return g(()=>t.currentRow,o=>{o&&a(o)},{deep:!0,immediate:!0}),l({submit:f}),(o,b)=>(x(),R(d(v),{rules:n,"auto-set-placeholder":!1,onRegister:d(c),schema:p.value},null,8,["rules","onRegister","schema"]))}});export{B as _};
