var f=(p,u,e)=>new Promise((m,r)=>{var c=l=>{try{s(e.next(l))}catch(t){r(t)}},i=l=>{try{s(e.throw(l))}catch(t){r(t)}},s=l=>l.done?m(l.value):Promise.resolve(l.value).then(c,i);s((e=e.apply(p,u)).next())});import{u as P,F as y}from"./useForm-DFfbRY9m.js";import{u as g}from"./useValidator-dY8qp_qX.js";import{_ as R}from"./message.vue_vue_type_script_setup_true_lang-C0R52Rsd.js";import{_ as V}from"./material.vue_vue_type_script_setup_true_lang-yKaOPhwY.js";import{l as x,Z as v,U as n,w as I,m as k,M as F,u as b}from"./vue-chunks-l-AyUCfi.js";const j=x({__name:"write",props:{currentRow:{type:Object,default:()=>null}},setup(p,{expose:u}){const{required:e}=g(),m=p,{formRegister:r,formMethods:c}=P(),{setValues:i,getFormData:s,getElFormExpose:l,setSchema:t}=c,h=v([{field:"keywords",label:"关键词",component:"Input",value:[],formItemProps:{rules:[e()],slots:{default:o=>n("div",{class:"w-[100%] flex"},[n(R,{modelValue:o.keywords,"onUpdate:modelValue":a=>o.keywords=a},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:"replys",label:"回复内容",colProps:{span:16,push:4},value:[],formItemProps:{slots:{default:o=>n("div",{class:"w-[100%] flex"},[n(V,{modelValue:o.replys,"onUpdate:modelValue":a=>o.replys=a},null)])}}},{field:"needAt",label:"群中@触发",colProps:{span:16,push:4},component:"RadioGroup",value:1,formItemProps:{rules:[e()]},componentProps:{options:[{label:"是",value:1},{label:"否",value:2}]}}]),_=v({title:[e()],author:[e()],importance:[e()],pageviews:[e()],display_time:[e()],content:[e()]}),w=()=>f(this,null,function*(){const o=yield l();if(yield o==null?void 0:o.validate().catch(d=>{}))return yield s()});return I(()=>m.currentRow,o=>{o&&i(o)},{deep:!0,immediate:!0}),u({submit:w}),(o,a)=>(k(),F(b(y),{rules:_,onRegister:b(r),schema:h},null,8,["rules","onRegister","schema"]))}});export{j as _};
