var w=(n,p,o)=>new Promise((u,l)=>{var s=a=>{try{r(o.next(a))}catch(d){l(d)}},c=a=>{try{r(o.throw(a))}catch(d){l(d)}},r=a=>a.done?u(a.value):Promise.resolve(a.value).then(s,c);r((o=o.apply(n,p)).next())});import{u as x,F as k}from"./useForm-DFfbRY9m.js";import{u as R}from"./useValidator-dY8qp_qX.js";import{_ as I}from"./message.vue_vue_type_script_setup_true_lang-C0R52Rsd.js";import{_}from"./material.vue_vue_type_script_setup_true_lang-yKaOPhwY.js";import{p as M}from"./index-Cl3s0rC0.js";import{G as U}from"./element-plus-C2aeItNs.js";import{l as v,aL as F,aK as N,m as V,M as g,K as B,u as i,B as E,Z as h,U as m,w as $}from"./vue-chunks-l-AyUCfi.js";const j=v({__name:"room",props:F({formModel:{type:Object,default:()=>({})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const p=(u,l)=>{M({name:u}).then(s=>{const c=(s.list||[]).map(r=>({value:r.name,link:r.link}));l(c)}).catch(s=>{l([])})};let o=N(n,"modelValue");return(u,l)=>(V(),g(i(U),B(u.$attrs,{modelValue:i(o),"onUpdate:modelValue":l[0]||(l[0]=s=>E(o)?o.value=s:o=s),"fetch-suggestions":p,clearable:""}),null,16,["modelValue"]))}}),Z=v({__name:"write",props:{currentRow:{type:Object,default:()=>null}},setup(n,{expose:p}){const{required:o}=R(),u=n,{formRegister:l,formMethods:s}=x(),{setValues:c,getFormData:r,getElFormExpose:a,setSchema:d}=s,y=h([{field:"roomName",label:"群名称",colProps:{span:16,push:4},value:[],formItemProps:{slots:{default:e=>m("div",{class:"w-[100%] flex"},[m(j,{modelValue:e.roomName,"onUpdate:modelValue":t=>e.roomName=t},null)])}}},{field:"reg",label:"匹配方式",formItemProps:{rules:[o()]},colProps:{span:16,push:4},component:"RadioGroup",value:1,componentProps:{options:[{label:"模糊匹配",value:1},{label:"精确匹配",value:2}]}},{field:"keywords",label:"进群关键词",component:"Input",value:[],formItemProps:{rules:[o()],slots:{default:e=>m("div",{class:"w-[100%] flex"},[m(I,{modelValue:e.keywords,"onUpdate:modelValue":t=>e.keywords=t},null)])}},colProps:{span:16,push:4}},{field:"replys",label:"回复内容",colProps:{span:16,push:4},value:[],formItemProps:{slots:{default:e=>m("div",{class:"w-[100%] flex"},[m(_,{modelValue:e.replys,"onUpdate:modelValue":t=>e.replys=t},null)])}}},{field:"welcomes",label:"群欢迎词",colProps:{span:16,push:4},value:[],formItemProps:{slots:{default:e=>m("div",{class:"w-[100%] flex"},[m(_,{modelValue:e.welcomes,"onUpdate:modelValue":t=>e.welcomes=t},null)])}}}]),P=h({title:[o()],author:[o()],importance:[o()],pageviews:[o()],display_time:[o()],content:[o()]}),b=()=>w(this,null,function*(){const e=yield a();if(yield e==null?void 0:e.validate().catch(f=>{}))return yield r()});return $(()=>u.currentRow,e=>{e&&c(e)},{deep:!0,immediate:!0}),p({submit:b}),(e,t)=>(V(),g(i(k),{rules:P,onRegister:i(l),schema:y},null,8,["rules","onRegister","schema"]))}});export{Z as _};
