var i=(n,l,e)=>new Promise((c,r)=>{var p=t=>{try{a(e.next(t))}catch(s){r(s)}},m=t=>{try{a(e.throw(t))}catch(s){r(s)}},a=t=>t.done?c(t.value):Promise.resolve(t.value).then(p,m);a((e=e.apply(n,l)).next())});import{u as w,F as v}from"./useForm-DFfbRY9m.js";import{u as _}from"./useValidator-dY8qp_qX.js";import{l as P,r as f,Z as x,w as F,m as I,M as R,u as d}from"./vue-chunks-l-AyUCfi.js";const B=P({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(n,{expose:l}){const{required:e}=_();f(null);const c=n,r=f([{field:"name",label:"预设角色",component:"Input",colProps:{span:24}},{field:"tag",label:"标签",component:"Input",colProps:{span:24}},{field:"promot",label:"提示词",component:"Input",value:"",colProps:{span:24},componentProps:{type:"textarea",rows:"5"}},{field:"isAiMba",label:"是否是智能体",component:"Switch",value:!1,colProps:{span:24}},{field:"desc",label:"备注",component:"Input",colProps:{span:24}}]),p=x({name:[e()],thumbUrl:[e()],title:[e()],tag:[e()],promot:[e()]}),{formRegister:m,formMethods:a}=w(),{setValues:t,getFormData:s,getElFormExpose:h,setSchema:y}=a,b=()=>i(this,null,function*(){const o=yield h();if(yield o==null?void 0:o.validate().catch(u=>{}))return yield s()});return F(()=>c.currentRow,o=>{o&&t(o)},{deep:!0,immediate:!0}),l({submit:b}),(o,g)=>(I(),R(d(v),{rules:p,"auto-set-placeholder":!1,onRegister:d(m),schema:r.value},null,8,["rules","onRegister","schema"]))}});export{B as _};
