var d=(n,p,e)=>new Promise((m,o)=>{var c=a=>{try{t(e.next(a))}catch(s){o(s)}},i=a=>{try{t(e.throw(a))}catch(s){o(s)}},t=a=>a.done?m(a.value):Promise.resolve(a.value).then(c,i);t((e=e.apply(n,p)).next())});import{u as v,F as _}from"./useForm-kq1sxERw.js";import{u as w}from"./useValidator-BN3tPovt.js";import{_ as F}from"./index.vue_vue_type_script_setup_true_lang-CnnupGui.js";import{T as R}from"./index-BQDMfDLE.js";import{l as x,r,ao as y,Z as U,w as k,m as D,M as V,u as b,U as P,F as B}from"./vue-chunks-DyZSmvoe.js";const q=x({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(n,{expose:p}){const{required:e}=w();r(null);const m=n;r(),r({name:123});const o=(l,u="")=>()=>P(B,null,[P(R,{label:l,tooltip:u},null)]),c=r([{field:"name",label:"素材别名",component:"Input",colProps:{span:24}},{field:"tag",label:"素材标签",component:"Input",colProps:{span:24},formItemProps:{slots:{label:o("素材标签","方便素材分类")}}},{field:"type",label:"素材类型",component:"RadioGroup",value:5,colProps:{span:24},componentProps:{disabled:!0,options:[{label:"文字",value:1},{label:"文件",value:2},{label:"h5链接",value:4},{label:"小程序",value:5}]}},{field:"appid",label:"appid",component:"Input",colProps:{span:24},formItemProps:{slots:{label:o("appid","把小程序发给小助手后可以得到解析的数据，appid")}}},{field:"username",label:"username",component:"Input",colProps:{span:24},formItemProps:{slots:{label:o("username","把小程序发给小助手后可以得到解析的数据，类似gh_cc962a747b3c")}}},{field:"title",label:"标题",component:"Input",colProps:{span:24}},{field:"description",label:"描述",component:"Input",colProps:{span:24}},{field:"pagePath",label:"分享路径",component:"Input",colProps:{span:24},formItemProps:{slots:{label:o("pagePath","把小程序发给小助手后可以得到解析的数据，pagePath")}}},{field:"thumbUrl",label:"缩略图",asyncComponent:y(F),colProps:{span:24},value:"",formItemProps:{slots:{label:o("缩略图","推荐在 200K 以内，比例 5：4，宽度不大于 1080px")}}},{field:"iconUrl",label:"小程序logo",component:"Input",colProps:{span:24},formItemProps:{slots:{label:o("小程序logo","把小程序发给小助手后可以得到解析的数据，iconUrl，非必填")}}}]),i=U({description:[e()],name:[e()],thumbUrl:[e()],title:[e()],type:[e()],url:[e()],appid:[e()],username:[e()],pagePath:[e()]}),{formRegister:t,formMethods:a}=v(),{setValues:s,getFormData:h,getElFormExpose:g,setSchema:C}=a,I=()=>d(this,null,function*(){const l=yield g();if(yield l==null?void 0:l.validate().catch(f=>{}))return yield h()});return k(()=>m.currentRow,l=>{l&&s(l)},{deep:!0,immediate:!0}),p({submit:I}),(l,u)=>(D(),V(b(_),{rules:i,"auto-set-placeholder":!1,onRegister:b(t),schema:c.value},null,8,["rules","onRegister","schema"]))}});export{q as _};
