var h=(m,c,a)=>new Promise((d,s)=>{var i=o=>{try{r(a.next(o))}catch(n){s(n)}},u=o=>{try{r(a.throw(o))}catch(n){s(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 P,F as V}from"./useForm-kq1sxERw.js";import{u as w}from"./useValidator-BN3tPovt.js";import{_ as g}from"./selectFriend.vue_vue_type_script_setup_true_lang-BzxfNWW1.js";import{_ as y}from"./selectRoom.vue_vue_type_script_setup_true_lang-C-AHDN4k.js";import{_ as x}from"./Corn.vue_vue_type_script_setup_true_lang-BmMviSI3.js";import"./element-plus-DNKe9-lk.js";import{_ as I}from"./material.vue_vue_type_script_setup_true_lang-BiDSEO_l.js";import{l as U,r as F,Z as R,w as S,m as $,M as D,u as v,U as t}from"./vue-chunks-DyZSmvoe.js";const Z=U({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(m,{expose:c}){const{required:a}=w(),d=m,s=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=>{s(e)}},options:[{value:"contact",label:"好友"},{value:"room",label:"群组"}]}},{field:"roomNames",label:"群名",colProps:{span:24},value:"",formItemProps:{slots:{default:e=>t("div",{class:"w-[100%]"},[t(y,{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=>t("div",{class:"w-[100%] flex"},[t(g,{modelValue:e.friendNames,"onUpdate:modelValue":l=>e.friendNames=l},null)])}}},{field:"contents",label:"素材选择",component:"Select",colProps:{span:24},value:[],formItemProps:{slots:{default:e=>t("div",{class:"w-[100%] flex"},[t(I,{modelValue:e.contents,"onUpdate:modelValue":l=>e.contents=l},null)])}}},{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=>t("div",{class:"w-[100%] flex"},[t(x,{modelValue:e.cronDate,"onUpdate:modelValue":l=>e.cronDate=l},null)])}}}]),u=R({name:[a()],endWord:[a()],city:[a()],memorialDay:[a()],friendNames:[a()]}),{formRegister:r,formMethods:o}=P(),{setValues:n,getFormData:_,getElFormExpose:N,setSchema:p}=o,b=()=>h(this,null,function*(){const e=yield N();if(yield e==null?void 0:e.validate().catch(f=>{}))return yield _()});return S(()=>d.currentRow,e=>{e&&n(e)},{deep:!0,immediate:!0}),c({submit:b,change:s}),(e,l)=>($(),D(v(V),{rules:u,"auto-set-placeholder":!1,onRegister:v(r),schema:i.value},null,8,["rules","onRegister","schema"]))}});export{Z as _};
