var h=(m,c,a)=>new Promise((d,t)=>{var i=o=>{try{r(a.next(o))}catch(n){t(n)}},u=o=>{try{r(a.throw(o))}catch(n){t(n)}},r=o=>o.done?d(o.value):Promise.resolve(o.value).then(i,u);r((a=a.apply(m,c)).next())});import{u as b,F as y}from"./useForm-DFfbRY9m.js";import{u as w}from"./useValidator-dY8qp_qX.js";import{_ as V}from"./selectFriend.vue_vue_type_script_setup_true_lang-B_XN1vat.js";import{_ as g}from"./selectRoom.vue_vue_type_script_setup_true_lang-CqEi0UST.js";import{_ as D}from"./Corn.vue_vue_type_script_setup_true_lang-X0bhrmk_.js";import{l as x,r as F,Z as I,w as M,m as R,M as U,u as v,U as s}from"./vue-chunks-l-AyUCfi.js";const j=x({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(m,{expose:c}){const{required:a}=w(),d=m,t=e=>{e=="contact"?p([{field:"roomNames",path:"hidden",value:!0},{field:"friendNames",path:"hidden",value:!1}]):p([{field:"roomNames",path:"hidden",value:!1},{field:"friendNames",path:"hidden",value:!0}])},i=F([{field:"type",label:"发送对象",component:"Select",value:"contact",colProps:{span:24},componentProps:{clearable:!1,on:{change:e=>{t(e)}},options:[{value:"contact",label:"好友"},{value:"room",label:"群组"}]}},{field:"roomNames",label:"群名",colProps:{span:24},value:"",formItemProps:{slots:{default:e=>s("div",{class:"w-[100%]"},[s(g,{modelValue:e.roomNames,"onUpdate:modelValue":l=>e.roomNames=l},null)])}},hidden:!0},{field:"friendNames",label:"好友名称",colProps:{span:24},value:null,hidden:!1,formItemProps:{slots:{default:e=>s("div",{class:"w-[100%] flex"},[s(V,{modelValue:e.friendNames,"onUpdate:modelValue":l=>e.friendNames=l},null)])}}},{field:"city",label:"城市",component:"Input",colProps:{span:24}},{field:"memorialDay",label:"纪念日",component:"DatePicker",colProps:{span:24},componentProps:{valueFormat:"YYYY-MM-DD"}},{field:"endWord",label:"结尾备注",component:"Input",colProps:{span:24}},{field:"cronDate",label:"周期",colProps:{span:24},value:{type:"day",date:"",cron:"",month:"",day:""},formItemProps:{slots:{default:e=>s("div",{class:"w-[100%] flex"},[s(D,{modelValue:e.cronDate,"onUpdate:modelValue":l=>e.cronDate=l},null)])}}}]),u=I({roomNames:[a()],name:[a()],endWord:[a()],city:[a()],memorialDay:[a()],friendNames:[a()]}),{formRegister:r,formMethods:o}=b(),{setValues:n,getFormData:_,getElFormExpose:N,setSchema:p}=o,P=()=>h(this,null,function*(){const e=yield N();if(yield e==null?void 0:e.validate().catch(f=>{}))return yield _()});return M(()=>d.currentRow,e=>{e&&n(e)},{deep:!0,immediate:!0}),c({submit:P,change:t}),(e,l)=>(R(),U(v(y),{rules:u,"auto-set-placeholder":!1,onRegister:v(r),schema:i.value},null,8,["rules","onRegister","schema"]))}});export{j as _};
