var d=(r,n,e)=>new Promise((u,s)=>{var p=a=>{try{o(e.next(a))}catch(t){s(t)}},c=a=>{try{o(e.throw(a))}catch(t){s(t)}},o=a=>a.done?u(a.value):Promise.resolve(a.value).then(p,c);o((e=e.apply(r,n)).next())});import{u as g,F as _}from"./useForm-DFfbRY9m.js";import{u as y}from"./useValidator-dY8qp_qX.js";import{_ as k}from"./message.vue_vue_type_script_setup_true_lang-C0R52Rsd.js";import{l as R,Z as v,U as b,w as x,m as F,M as I,u as f}from"./vue-chunks-l-AyUCfi.js";const E=R({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(r,{expose:n}){const{required:e}=y(),u=r,{formRegister:s,formMethods:p}=g(),{setValues:c,getFormData:o,getElFormExpose:a,setSchema:t}=p,h=v([{field:"keywords",label:"关键词",component:"Input",value:[],formItemProps:{rules:[e()],slots:{default:l=>b("div",{class:"w-[100%] flex"},[b(k,{modelValue:l.keywords,"onUpdate:modelValue":m=>l.keywords=m},null)])}},colProps:{span:16,push:4}},{field:"reg",label:"匹配方式",formItemProps:{rules:[e()]},colProps:{span:16,push:4},component:"RadioGroup",value:1,componentProps:{options:[{label:"模糊匹配",value:1},{label:"精确匹配",value:2}]}},{field:"scope",label:"触发范围",component:"RadioGroup",value:"all",colProps:{span:16,push:4},componentProps:{options:[{label:"群与好友",value:"all"},{label:"群",value:"room"},{label:"好友",value:"friend"}]},formItemProps:{rules:[e()]}},{field:"event",label:"触发事件",component:"Select",colProps:{span:16,push:4},value:"",componentProps:{options:[{label:"土味情话",value:"sweetword"},{label:"分类新闻",value:"news"},{label:"网络取名",value:"cname"},{label:"垃圾分类",value:"rubbish"},{label:"名人名言",value:"mingyan"},{label:"星座运势",value:"star"},{label:"姓氏起源",value:"xing"},{label:"老黄历查询",value:"lunar"},{label:"神回复",value:"goldreply"},{label:"绕口令",value:"rkl"},{label:"顺口溜",value:"skl"},{label:"获取表情包",value:"emo"},{label:"获取美女图",value:"meinv"},{label:"重新同步好友及群信息",value:"reloadFriend"},{label:"更新配置文件",value:"updateConfig"}]}},{field:"needAt",label:"群中@触发",colProps:{span:16,push:4},component:"RadioGroup",value:1,formItemProps:{rules:[e()]},componentProps:{options:[{label:"是",value:1},{label:"否",value:2}]}}]),w=v({title:[e()],author:[e()],importance:[e()],pageviews:[e()],display_time:[e()],content:[e()]}),P=()=>d(this,null,function*(){const l=yield a();if(yield l==null?void 0:l.validate().catch(i=>{}))return yield o()});return x(()=>u.currentRow,l=>{l&&c(l)},{deep:!0,immediate:!0}),n({submit:P}),(l,m)=>(F(),I(f(_),{rules:w,onRegister:f(s),schema:h},null,8,["rules","onRegister","schema"]))}});export{E as _};
