var f=(n,p,a)=>new Promise((u,r)=>{var c=o=>{try{l(a.next(o))}catch(s){r(s)}},m=o=>{try{l(a.throw(o))}catch(s){r(s)}},l=o=>o.done?u(o.value):Promise.resolve(o.value).then(c,m);l((a=a.apply(n,p)).next())});import{u as w,F as g}from"./useForm-kq1sxERw.js";import{u as R}from"./useValidator-BN3tPovt.js";import{_ as V}from"./message.vue_vue_type_script_setup_true_lang-Bq-3WI-Z.js";import{_ as y}from"./customUrlApi.vue_vue_type_script_setup_true_lang-Cfbl4w84.js";import{l as k,Z as v,w as x,m as I,M as U,u as b,U as i}from"./vue-chunks-DyZSmvoe.js";const $=k({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(n,{expose:p}){const{required:a,isUrl:u}=R(),r=n,{formRegister:c,formMethods:m}=w(),{setValues:l,getFormData:o,getElFormExpose:s,setSchema:F}=m,h=v([{field:"type",value:100,hidden:!0},{field:"keywords",label:"触发关键词",component:"Input",value:[],colProps:{span:16,push:4},formItemProps:{slots:{default:e=>i("div",{class:"w-[100%] flex"},[i(V,{modelValue:e.keywords,"onUpdate:modelValue":t=>e.keywords=t},null)])}}},{field:"reg",label:"匹配方式",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"}]}},{field:"needAt",label:"群中@触发",colProps:{span:16,push:4},component:"RadioGroup",value:1,componentProps:{options:[{label:"是",value:1},{label:"否",value:2}]}},{field:"timeout",label:"请求超时时间(秒)",component:"InputNumber",value:10,componentProps:{min:0},colProps:{span:16,push:4}},{field:"api",label:"回调地址",component:"Input",value:"",colProps:{span:16,push:4},formItemProps:{slots:{default:e=>i(y,{modelValue:e.api,"onUpdate:modelValue":t=>e.api=t},null)}}}]),_=v({customUrl:[a(),u()]}),P=()=>f(this,null,function*(){const e=yield s();if(yield e==null?void 0:e.validate().catch(d=>{}))return yield o()});return x(()=>r.currentRow,e=>{e&&l(e)},{deep:!0,immediate:!0}),p({submit:P}),(e,t)=>(I(),U(b(g),{rules:_,onRegister:b(c),schema:h},null,8,["rules","onRegister","schema"]))}});export{$ as _};
