var f=(n,p,e)=>new Promise((c,l)=>{var i=a=>{try{t(e.next(a))}catch(s){l(s)}},u=a=>{try{t(e.throw(a))}catch(s){l(s)}},t=a=>a.done?c(a.value):Promise.resolve(a.value).then(i,u);t((e=e.apply(n,p)).next())});import{u as v,F as _}from"./useForm-DFfbRY9m.js";import{u as y}from"./useValidator-dY8qp_qX.js";import{_ as w}from"./index.vue_vue_type_script_setup_true_lang-BoXeCa4d.js";import{l as P,r,ao as R,Z as x,w as F,m as T,M as j,u as d}from"./vue-chunks-l-AyUCfi.js";const M=P({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(n,{expose:p}){const{required:e}=y();r(null);const c=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:2,colProps:{span:24},componentProps:{disabled:!0,options:[{label:"文字",value:1},{label:"文件",value:2},{label:"h5链接",value:4},{label:"小程序",value:5}]}},{field:"fileType",hidden:!0},{field:"url",label:"文件",asyncComponent:R(w),colProps:{span:24},value:"",componentProps:{accept:".jpg,.jpeg,.png,.txt,.zip",isType:!1,onchange:o=>{a({fileType:o.fileType})}}}]),i=x({description:[e()],name:[e()],thumbUrl:[e()],title:[e()],type:[e()],url:[e()]}),{formRegister:u,formMethods:t}=v(),{setValues:a,getFormData:s,getElFormExpose:h,setSchema:k}=t,b=()=>f(this,null,function*(){const o=yield h();if(yield o==null?void 0:o.validate().catch(m=>{}))return yield s()});return F(()=>c.currentRow,o=>{o&&a(o)},{deep:!0,immediate:!0}),p({submit:b}),(o,g)=>(T(),j(d(_),{rules:i,"auto-set-placeholder":!1,onRegister:d(u),schema:l.value},null,8,["rules","onRegister","schema"]))}});export{M as _};
