DescriptionForm-e7baa464.js 1.9 KB

1
  1. import{d as k,ar as _,y as M,e as N,r as u,x as V,w as f,o,A as l,B as d,a,ac as j,U as H,f as L,C as O,dy as P,S as T,__tla as U}from"./index-631574a1.js";import{_ as A,__tla as B}from"./style.css_vue_type_style_index_0_src_true_lang-7d738eca.js";import{u as C,__tla as I}from"./useMessage-677fbbff.js";import{r as R,__tla as S}from"./formRules-8a04b904.js";import{_ as q}from"./_plugin-vue_export-helper-1b428a4d.js";let v,z=Promise.all([(()=>{try{return U}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return I}catch{}})(),(()=>{try{return S}catch{}})()]).then(async()=>{let p;p=["innerHTML"],v=q(k({name:"ProductDescriptionForm",__name:"DescriptionForm",props:{propFormData:{type:Object,default:()=>{}},activeName:_.string.def(""),isDetail:_.bool.def(!1)},emits:["update:activeName"],setup(r,{expose:y,emit:b}){const D=M(),c=N(()=>D.getMobile),h=C(),n=r,i=u(),e=u({description:""}),w=V({description:[R]});f(()=>e.value.description,t=>{t==="<p><br></p>"&&(e.value.description="")},{deep:!0,immediate:!0}),f(()=>n.propFormData,t=>{t&&P(e.value,t)},{immediate:!0});const F=b;return y({validate:async()=>{var t;if(i)try{await((t=a(i))==null?void 0:t.validate()),Object.assign(n.propFormData,e.value)}catch(s){throw h.error("\u3010\u5546\u54C1\u8BE6\u60C5\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),F("update:activeName","description"),s}}}),(t,s)=>{const m=T,x=H;return o(),l(x,{ref_key:"formRef",ref:i,model:a(e),rules:a(w),disabled:r.isDetail,class:j({view:r.isDetail,"mobile-card":a(c)})},{default:d(()=>[a(c)||r.isDetail?(o(),l(m,{key:1,prop:"description"},{default:d(()=>[O("div",{innerHTML:a(e).description,class:"editor-view"},null,8,p)]),_:1})):(o(),l(m,{key:0,prop:"description"},{default:d(()=>[L(a(A),{modelValue:a(e).description,"onUpdate:modelValue":s[0]||(s[0]=g=>a(e).description=g)},null,8,["modelValue"])]),_:1}))]),_:1},8,["model","rules","disabled","class"])}}}),[["__scopeId","data-v-41db4dd7"]])});export{z as __tla,v as default};