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