InfoForm-9b12586d.js 7.7 KB

1
  1. import{d as M,ar as q,y as B,e as v,r as P,x as I,w as x,b as E,o as m,C as _,A as l,a as t,ac as Z,V as G,f as e,a1 as A,a2 as y,c as J,dy as F,a8 as Q,U as W,H as X,K as Y,R as $,S as ee,b0 as le,__tla as ae}from"./index-a9d538d5.js";import{_ as te,__tla as se}from"./UploadImgs-bafc3b8f.js";import{h as oe,d as de}from"./tree-fd3a041e.js";import{g as re,__tla as ue}from"./category-3fc66a6d.js";import{g as pe,__tla as ie}from"./brand-90ae5930.js";import{u as ne,__tla as me}from"./useMessage-d5cbbfad.js";import{r as c,__tla as ce}from"./formRules-08c9aa65.js";import{_ as _e}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as fe}from"./UploadImgs.vue_vue_type_style_index_0_scoped_3d27d917_lang-e129a17c.js";import{__tla as ye}from"./el-image-viewer-2e77a3e7.js";let N,Ve=Promise.all([(()=>{try{return ae}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return fe}catch{}})(),(()=>{try{return ye}catch{}})()]).then(async()=>{let g;g={key:1},N=_e(M({name:"ProductSpuInfoForm",__name:"InfoForm",props:{propFormData:{type:Object,default:()=>{}},isDetail:q.bool.def(!1)},emits:["update:activeName"],setup(u,{expose:C,emit:R}){const j=B(),D=v(()=>j.getMobile),V=u,S=ne(),b=P(),s=I({name:"",categoryId:void 0,keyword:"",sliderPicUrls:[],introduction:"",brandId:void 0,specType:!1,salesCount:0,status:0,producerArea:"",spuType:void 0,shopName:"",spuPayType:void 0,deliveryTypes:[],deliveryTemplateId:void 0,highPrecision:!1}),O=I({name:[c],categoryId:[c],keyword:[c],introduction:[c],sliderPicUrls:[c],brandId:[c],spuType:[c],producerArea:[c]}),h=v(()=>s.specType?"\u591A\u89C4\u683C":"\u5355\u89C4\u683C"),w=v(()=>{switch(s.status){case 0:return"\u4E0B\u67B6";case 1:return"\u4E0A\u67B6";case-1:return"\u56DE\u6536\u7AD9"}});x(()=>V.propFormData,p=>{var a;p&&(F(s,p),s.sliderPicUrls=(a=p.sliderPicUrls)==null?void 0:a.map((i,d)=>({url:i})))},{immediate:!0}),x(()=>s,p=>{p&&F(V.propFormData,p)},{immediate:!0});const z=R;C({validate:async()=>{var p;if(b)try{await((p=t(b))==null?void 0:p.validate()),Object.assign(V.propFormData,s)}catch(a){throw S.error("\u3010\u57FA\u7840\u8BBE\u7F6E\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),z("update:activeName","info"),a}}});const H=P([]),k=P([]);return E(async()=>{const p=await re({});k.value=oe(p,"id"),H.value=await pe()}),(p,a)=>{const i=Q,d=W,r=X,n=Y,f=$,U=ee,K=le,T=te,L=G;return m(),_(L,{ref_key:"formRef",ref:b,model:t(s),rules:t(O),class:Z({view:u.isDetail,"mobile-card":t(D)}),"label-width":"120px",disabled:u.isDetail},{default:l(()=>[e(n,null,{default:l(()=>[e(r,{span:u.isDetail?12:24},{default:l(()=>[e(d,{label:"\u540D\u79F0",prop:"name"},{default:l(()=>[e(i,{modelValue:t(s).name,"onUpdate:modelValue":a[0]||(a[0]=o=>t(s).name=o),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",maxlength:"64","show-word-limit":!0,clearable:!0,class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1},8,["span"]),u.isDetail?(m(),_(r,{key:0,span:12},{default:l(()=>[e(d,{label:"\u72B6\u6001",prop:"categoryStatus"},{default:l(()=>[e(i,{modelValue:t(w),"onUpdate:modelValue":a[1]||(a[1]=o=>A(w)?w.value=o:null),class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1})):y("",!0)]),_:1}),e(n,null,{default:l(()=>[e(r,{span:12},{default:l(()=>[e(d,{label:"\u4EA7\u5730",prop:"producerArea"},{default:l(()=>[e(i,{modelValue:t(s).producerArea,"onUpdate:modelValue":a[2]||(a[2]=o=>t(s).producerArea=o),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u4EA7\u5730",class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(d,{label:"\u5546\u54C1\u7C7B\u578B",prop:"spuType"},{default:l(()=>[e(U,{modelValue:t(s).spuType,"onUpdate:modelValue":a[3]||(a[3]=o=>t(s).spuType=o),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u7C7B\u578B",class:"w-80"},{default:l(()=>[e(f,{label:"\u5B9E\u4F53\u5546\u54C1",value:1}),e(f,{label:"\u865A\u62DF\u5546\u54C1",value:0})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(n,null,{default:l(()=>[e(r,{span:12},{default:l(()=>[e(d,{label:"\u5546\u54C1\u5173\u952E\u5B57",prop:"keyword"},{default:l(()=>[e(i,{modelValue:t(s).keyword,"onUpdate:modelValue":a[4]||(a[4]=o=>t(s).keyword=o),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u5173\u952E\u5B57",class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(d,{label:"\u5546\u54C1\u5206\u7C7B",prop:"categoryId"},{default:l(()=>[e(K,{modelValue:t(s).categoryId,"onUpdate:modelValue":a[5]||(a[5]=o=>t(s).categoryId=o),options:t(k),props:t(de),class:"w-80",clearable:"",placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",filterable:""},null,8,["modelValue","options","props"])]),_:1})]),_:1})]),_:1}),u.isDetail?(m(),_(n,{key:0},{default:l(()=>[e(r,{span:12},{default:l(()=>[u.isDetail?(m(),_(d,{key:0,label:"\u9500\u91CF",prop:"salesCount"},{default:l(()=>[e(i,{modelValue:t(s).salesCount,"onUpdate:modelValue":a[6]||(a[6]=o=>t(s).salesCount=o),class:"w-80!"},null,8,["modelValue"])]),_:1})):y("",!0)]),_:1}),e(r,{span:12},{default:l(()=>[u.isDetail?(m(),_(d,{key:0,label:"\u89C4\u683C",prop:"specType"},{default:l(()=>[e(i,{modelValue:t(h),"onUpdate:modelValue":a[7]||(a[7]=o=>A(h)?h.value=o:null),class:"w-80!"},null,8,["modelValue"])]),_:1})):y("",!0)]),_:1})]),_:1})):y("",!0),e(n,null,{default:l(()=>[e(r,{span:u.isDetail?12:24},{default:l(()=>[e(d,{label:"\u4EF7\u683C\u9AD8\u7CBE\u5EA6",prop:"highPrecision"},{default:l(()=>[e(U,{modelValue:t(s).highPrecision,"onUpdate:modelValue":a[8]||(a[8]=o=>t(s).highPrecision=o),class:"w-80",disabled:""},{default:l(()=>[e(f,{label:"\u5426",value:!1}),e(f,{label:"\u662F",value:!0})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["span"]),u.isDetail?(m(),_(r,{key:0,span:12},{default:l(()=>[e(d,{label:"\u5546\u54C1\u652F\u4ED8\u65B9\u5F0F",prop:"spuPayType"},{default:l(()=>[e(U,{modelValue:t(s).spuPayType,"onUpdate:modelValue":a[9]||(a[9]=o=>t(s).spuPayType=o),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u652F\u4ED8\u65B9\u5F0F",class:"w-80"},{default:l(()=>[e(f,{label:"\u4EBA\u6C11\u5E01+\u4F63\u91D1",value:1}),e(f,{label:"\u7EAF\u4F63\u91D1",value:2})]),_:1},8,["modelValue"])]),_:1})]),_:1})):y("",!0)]),_:1}),e(n,null,{default:l(()=>[e(r,{span:24},{default:l(()=>[e(d,{label:"\u6240\u5C5E\u5E97\u94FA",prop:"shopName"},{default:l(()=>[e(i,{modelValue:t(s).shopName,"onUpdate:modelValue":a[10]||(a[10]=o=>t(s).shopName=o),class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(n,null,{default:l(()=>[e(r,{span:24},{default:l(()=>[e(d,{label:"\u5546\u54C1\u7B80\u4ECB",prop:"introduction"},{default:l(()=>[e(i,{modelValue:t(s).introduction,"onUpdate:modelValue":a[11]||(a[11]=o=>t(s).introduction=o),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}),t(D)?(m(),J("div",g,[e(n,null,{default:l(()=>[e(r,{span:12},{default:l(()=>[e(d,{style:{border:"none"},label:"\u5546\u54C1\u8F6E\u64AD\u56FE",prop:"businessLicensePicture"})]),_:1})]),_:1}),e(n,null,{default:l(()=>[e(r,{span:24},{default:l(()=>[e(d,{prop:"sliderPicUrls",class:"sliderPicUrls"},{default:l(()=>[e(T,{modelValue:t(s).sliderPicUrls,"onUpdate:modelValue":a[12]||(a[12]=o=>t(s).sliderPicUrls=o),limit:5,disabled:u.isDetail},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1})])):(m(),_(n,{key:2},{default:l(()=>[e(r,{span:24},{default:l(()=>[e(d,{label:"\u5546\u54C1\u8F6E\u64AD\u56FE",prop:"sliderPicUrls"},{default:l(()=>[e(T,{modelValue:t(s).sliderPicUrls,"onUpdate:modelValue":a[13]||(a[13]=o=>t(s).sliderPicUrls=o),limit:5,disabled:u.isDetail},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1}))]),_:1},8,["model","rules","class","disabled"])}}}),[["__scopeId","data-v-81602163"]])});export{Ve as __tla,N as default};