var d=(n,c,e)=>new Promise((p,l)=>{var u=t=>{try{a(e.next(t))}catch(s){l(s)}},m=t=>{try{a(e.throw(t))}catch(s){l(s)}},a=t=>t.done?p(t.value):Promise.resolve(t.value).then(u,m);a((e=e.apply(n,c)).next())});import{u as g,F as w}from"./useForm-DFfbRY9m.js";import{u as _}from"./useValidator-dY8qp_qX.js";import{l as P,r,Z as x,w as y,m as R,M as F,u as f}from"./vue-chunks-l-AyUCfi.js";const M=P({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(n,{expose:c}){const{required:e}=_();r(null);const p=n;r(),r({name:123});const l=r([{field:"name",label:"素材别名",component:"Input",colProps:{span:24}},{field:"tag",label:"素材标签",component:"Input",colProps:{span:24}},{field:"type",label:"素材类型",component:"RadioGroup",value:1,colProps:{span:24},componentProps:{disabled:!0,options:[{label:"文字",value:1},{label:"文件",value:2},{label:"h5链接",value:4},{label:"小程序",value:5}]}},{field:"content",label:"内容",colProps:{span:24},component:"Input",componentProps:{rows:3,type:"textarea",placeholder:""}}]),u=x({description:[e()],name:[e()],thumbUrl:[e()],title:[e()],type:[e()],url:[e()]}),{formRegister:m,formMethods:a}=g(),{setValues:t,getFormData:s,getElFormExpose:b,setSchema:D}=a,h=()=>d(this,null,function*(){const o=yield b();if(yield o==null?void 0:o.validate().catch(i=>{}))return yield s()});return y(()=>p.currentRow,o=>{o&&t(o)},{deep:!0,immediate:!0}),c({submit:h}),(o,v)=>(R(),F(f(w),{rules:u,"auto-set-placeholder":!1,onRegister:f(m),schema:l.value},null,8,["rules","onRegister","schema"]))}});export{M as _};
