InfoForm-7faea2d0.js 6.8 KB

1
  1. import{d as J,af as K,X as L,J as w,r as h,e as T,K as M,k as X,o as c,q as _,w as e,a,Y,C as B,f as l,c as F,n as G,F as H,O as U,N as A,b9 as Q,U as W,z as Z,E as $,x as ll,y as el,i as al,ba as tl,__tla as sl}from"./index-2eab2d23.js";import{_ as dl,__tla as rl}from"./UploadImgs-88de5939.js";import{h as ol,d as ul}from"./tree-fd3a041e.js";import{g as pl,__tla as nl}from"./category-c573377b.js";import{g as il,__tla as cl}from"./brand-f2788f28.js";import{u as ml,__tla as _l}from"./useMessage-171aa63e.js";import{r as m,__tla as fl}from"./formRules-228bd511.js";import{_ as bl}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as yl}from"./UploadImgs.vue_vue_type_style_index_0_scoped_0ff04634_lang-20f165d6.js";import{__tla as Vl}from"./el-image-viewer-5d14bc77.js";let C,wl=Promise.all([(()=>{try{return sl}catch{}})(),(()=>{try{return rl}catch{}})(),(()=>{try{return nl}catch{}})(),(()=>{try{return cl}catch{}})(),(()=>{try{return _l}catch{}})(),(()=>{try{return fl}catch{}})(),(()=>{try{return yl}catch{}})(),(()=>{try{return Vl}catch{}})()]).then(async()=>{let v;v={key:1},C=bl(J({name:"ProductSpuInfoForm",__name:"InfoForm",props:{propFormData:{type:Object,default:()=>{}},isDetail:K.bool.def(!1)},emits:["update:activeName"],setup(i,{expose:N,emit:O}){const R=L(),P=w(()=>R.getMobile),k=i,j=ml(),f=h(),d=T({name:"",categoryId:void 0,keyword:"",sliderPicUrls:[],introduction:"",brandId:void 0,specType:!1,salesCount:0,status:0,producerArea:"",spuType:void 0}),q=T({name:[m],categoryId:[m],keyword:[m],introduction:[m],sliderPicUrls:[m],brandId:[m],spuType:[m],producerArea:[m]}),b=w(()=>d.specType?"\u591A\u89C4\u683C":"\u5355\u89C4\u683C"),y=w(()=>{switch(d.status){case 0:return"\u4E0B\u67B6";case 1:return"\u4E0A\u67B6";case-1:return"\u56DE\u6536\u7AD9"}});M(()=>k.propFormData,u=>{var t;u&&(Q(d,u),d.sliderPicUrls=(t=u.sliderPicUrls)==null?void 0:t.map(p=>({url:p})))},{immediate:!0});const z=O;N({validate:async()=>{var u;if(f)try{await((u=a(f))==null?void 0:u.validate()),Object.assign(k.propFormData,d)}catch(t){throw j.error("\u3010\u57FA\u7840\u8BBE\u7F6E\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),z("update:activeName","info"),t}}});const I=h([]),g=h([]);return X(async()=>{const u=await pl({});g.value=ol(u,"id"),I.value=await il()}),(u,t)=>{const p=W,r=Z,o=$,V=ll,D=el,n=al,S=tl,x=dl,E=B;return c(),_(E,{ref_key:"formRef",ref:f,model:a(d),rules:a(q),class:Y({view:i.isDetail,"mobile-card":a(P)}),"label-width":"120px",disabled:i.isDetail},{default:e(()=>[l(n,null,{default:e(()=>[l(o,{span:12},{default:e(()=>[l(r,{label:"\u540D\u79F0",prop:"name"},{default:e(()=>[l(p,{modelValue:a(d).name,"onUpdate:modelValue":t[0]||(t[0]=s=>a(d).name=s),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",maxlength:"64","show-word-limit":!0,clearable:!0,class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1}),l(o,{span:12},{default:e(()=>[l(r,{label:"\u5546\u54C1\u54C1\u724C",prop:"brandId"},{default:e(()=>[l(D,{modelValue:a(d).brandId,"onUpdate:modelValue":t[1]||(t[1]=s=>a(d).brandId=s),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u54C1\u724C",class:"w-80"},{default:e(()=>[(c(!0),F(H,null,G(a(I),s=>(c(),_(V,{key:s.id,label:s.name,value:s.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(n,null,{default:e(()=>[l(o,{span:12},{default:e(()=>[l(r,{label:"\u4EA7\u5730",prop:"producerArea"},{default:e(()=>[l(p,{modelValue:a(d).producerArea,"onUpdate:modelValue":t[2]||(t[2]=s=>a(d).producerArea=s),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u4EA7\u5730",class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1}),l(o,{span:12},{default:e(()=>[l(r,{label:"\u5546\u54C1\u7C7B\u578B",prop:"spuType"},{default:e(()=>[l(D,{modelValue:a(d).spuType,"onUpdate:modelValue":t[3]||(t[3]=s=>a(d).spuType=s),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u7C7B\u578B",class:"w-80"},{default:e(()=>[l(V,{label:"\u5B9E\u4F53\u5546\u54C1",value:1}),l(V,{label:"\u865A\u62DF\u5546\u54C1",value:0})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(n,null,{default:e(()=>[l(o,{span:12},{default:e(()=>[l(r,{label:"\u5546\u54C1\u5173\u952E\u5B57",prop:"keyword"},{default:e(()=>[l(p,{modelValue:a(d).keyword,"onUpdate:modelValue":t[4]||(t[4]=s=>a(d).keyword=s),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u5173\u952E\u5B57",class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1}),l(o,{span:12},{default:e(()=>[l(r,{label:"\u5546\u54C1\u5206\u7C7B",prop:"categoryId"},{default:e(()=>[l(S,{modelValue:a(d).categoryId,"onUpdate:modelValue":t[5]||(t[5]=s=>a(d).categoryId=s),options:a(g),props:a(ul),class:"w-80",clearable:"",placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",filterable:""},null,8,["modelValue","options","props"])]),_:1})]),_:1})]),_:1}),l(n,null,{default:e(()=>[l(o,{span:12},{default:e(()=>[i.isDetail?(c(),_(r,{key:0,label:"\u9500\u91CF",prop:"salesCount"},{default:e(()=>[l(p,{modelValue:a(d).salesCount,"onUpdate:modelValue":t[6]||(t[6]=s=>a(d).salesCount=s),class:"w-80!"},null,8,["modelValue"])]),_:1})):U("",!0)]),_:1}),l(o,{span:12},{default:e(()=>[i.isDetail?(c(),_(r,{key:0,label:"\u89C4\u683C",prop:"specType"},{default:e(()=>[l(p,{modelValue:a(b),"onUpdate:modelValue":t[7]||(t[7]=s=>A(b)?b.value=s:null),class:"w-80!"},null,8,["modelValue"])]),_:1})):U("",!0)]),_:1})]),_:1}),i.isDetail?(c(),_(n,{key:0},{default:e(()=>[l(o,{span:24},{default:e(()=>[l(r,{label:"\u72B6\u6001",prop:"categoryStatus"},{default:e(()=>[l(p,{modelValue:a(y),"onUpdate:modelValue":t[8]||(t[8]=s=>A(y)?y.value=s:null),class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})):U("",!0),l(n,null,{default:e(()=>[l(o,{span:24},{default:e(()=>[l(r,{label:"\u5546\u54C1\u7B80\u4ECB",prop:"introduction"},{default:e(()=>[l(p,{modelValue:a(d).introduction,"onUpdate:modelValue":t[9]||(t[9]=s=>a(d).introduction=s),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",type:"textarea",autosize:{minRows:2,maxRows:2},maxlength:"128","show-word-limit":!0,clearable:!0,class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(P)?(c(),F("div",v,[l(n,null,{default:e(()=>[l(o,{span:12},{default:e(()=>[l(r,{style:{border:"none"},label:"\u5546\u54C1\u8F6E\u64AD\u56FE",prop:"businessLicensePicture"})]),_:1})]),_:1}),l(n,null,{default:e(()=>[l(o,{span:24},{default:e(()=>[l(r,{prop:"sliderPicUrls",class:"sliderPicUrls"},{default:e(()=>[l(x,{modelValue:a(d).sliderPicUrls,"onUpdate:modelValue":t[10]||(t[10]=s=>a(d).sliderPicUrls=s),limit:5,disabled:i.isDetail},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1})])):(c(),_(n,{key:2},{default:e(()=>[l(o,{span:24},{default:e(()=>[l(r,{label:"\u5546\u54C1\u8F6E\u64AD\u56FE",prop:"sliderPicUrls"},{default:e(()=>[l(x,{modelValue:a(d).sliderPicUrls,"onUpdate:modelValue":t[11]||(t[11]=s=>a(d).sliderPicUrls=s),limit:5,disabled:i.isDetail},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1}))]),_:1},8,["model","rules","class","disabled"])}}}),[["__scopeId","data-v-ee98b817"]])});export{wl as __tla,C as default};