InfoForm-45c1c088.js 8.1 KB

1
  1. import{d as M,ai as Y,b as q,e as v,r as P,g as x,aT as z,O as U,z as B,o as c,k as f,w as l,a as s,a1 as K,J as Z,i as e,R as C,S as y,c as Q,aU as W,Y as X,I as $,E as ee,G as le,H as ae,p as se,aV as te,_ as oe,__tla as de}from"./index-66208f93.js";import{_ as re,__tla as ue}from"./UploadImgs-d50ddd75.js";import{h as ie,d as pe}from"./tree-0af4953a.js";import{g as ne,__tla as ce}from"./category-4ba2dd2b.js";import{g as me,__tla as _e}from"./brand-4aea8334.js";import{u as fe,__tla as ye}from"./useMessage-798a77de.js";import{r as m,__tla as be}from"./formRules-f0247544.js";import{__tla as Ve}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-d74843b7.js";import{__tla as he}from"./el-image-viewer-3d1b9860.js";let F,we=Promise.all([(()=>{try{return de}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return he}catch{}})()]).then(async()=>{let g;g={key:1},F=oe(M({name:"ProductSpuInfoForm",__name:"InfoForm",props:{propFormData:{type:Object,default:()=>{}},isDetail:Y.bool.def(!1)},emits:["update:activeName"],setup(i,{expose:S,emit:A}){const R=q(),T=v(()=>R.getMobile),k=i,j=fe(),V=P(),a=x({name:"",categoryId:void 0,keyword:"",sliderPicUrls:[],introduction:"",brandId:void 0,specType:!1,salesCount:0,status:0,producerArea:"",spuType:void 0,spuPayType:void 0,deliveryTypes:[],deliveryTemplateId:void 0,highPrecision:!1}),O=x({name:[m],categoryId:[m],keyword:[m],introduction:[m],sliderPicUrls:[m],brandId:[m],spuType:[m],spuPayType:[m],producerArea:[m]}),h=v(()=>a.specType?"\u591A\u89C4\u683C":"\u5355\u89C4\u683C"),w=v(()=>{switch(a.status){case 0:return"\u4E0B\u67B6";case 1:return"\u4E0A\u67B6";case-1:return"\u56DE\u6536\u7AD9"}}),N=z("spuTypeChange");U(()=>a.spuType,u=>{N.value=u,a.highPrecision=!u},{immediate:!0});const E=z("highPrecisionChange");U(()=>a.highPrecision,u=>{E.value=u},{immediate:!0}),U(()=>k.propFormData,u=>{var t;u&&(W(a,u),a.sliderPicUrls=(t=u.sliderPicUrls)==null?void 0:t.map(p=>({url:p})))},{immediate:!0});const G=A;S({validate:async()=>{var u;if(V)try{await((u=s(V))==null?void 0:u.validate()),Object.assign(k.propFormData,a)}catch(t){throw j.error("\u3010\u57FA\u7840\u8BBE\u7F6E\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),G("update:activeName","info"),t}}});const H=P([]),D=P([]);return B(async()=>{const u=await ne({});D.value=ie(u,"id"),H.value=await me()}),(u,t)=>{const p=X,d=$,r=ee,_=le,b=ae,n=se,J=te,I=re,L=Z;return c(),f(L,{ref_key:"formRef",ref:V,model:s(a),rules:s(O),class:K({view:i.isDetail,"mobile-card":s(T)}),"label-width":"120px",disabled:i.isDetail},{default:l(()=>[e(n,null,{default:l(()=>[e(r,{span:12},{default:l(()=>[e(d,{label:"\u540D\u79F0",prop:"name"},{default:l(()=>[e(p,{modelValue:s(a).name,"onUpdate:modelValue":t[0]||(t[0]=o=>s(a).name=o),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",maxlength:"100","show-word-limit":!0,clearable:!0,class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1}),i.isDetail?(c(),f(r,{key:0,span:12},{default:l(()=>[e(d,{label:"\u72B6\u6001",prop:"categoryStatus"},{default:l(()=>[e(p,{modelValue:s(w),"onUpdate:modelValue":t[1]||(t[1]=o=>C(w)?w.value=o:null),class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1})):y("",!0),i.isDetail?y("",!0):(c(),f(r,{key:1,span:12},{default:l(()=>[e(d,{label:"\u5546\u54C1\u652F\u4ED8\u65B9\u5F0F",prop:"spuPayType"},{default:l(()=>[e(b,{modelValue:s(a).spuPayType,"onUpdate:modelValue":t[2]||(t[2]=o=>s(a).spuPayType=o),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u652F\u4ED8\u65B9\u5F0F",class:"w-80"},{default:l(()=>[e(_,{label:"\u4EBA\u6C11\u5E01+\u79EF\u5206",value:1}),e(_,{label:"\u7EAF\u79EF\u5206",value:2})]),_:1},8,["modelValue"])]),_:1})]),_:1}))]),_:1}),e(n,null,{default:l(()=>[e(r,{span:12},{default:l(()=>[e(d,{label:"\u4EA7\u5730",prop:"producerArea"},{default:l(()=>[e(p,{modelValue:s(a).producerArea,"onUpdate:modelValue":t[3]||(t[3]=o=>s(a).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(b,{modelValue:s(a).spuType,"onUpdate:modelValue":t[4]||(t[4]=o=>s(a).spuType=o),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u7C7B\u522B",class:"w-80"},{default:l(()=>[e(_,{label:"\u5B9E\u4F53\u5546\u54C1",value:1}),e(_,{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(p,{modelValue:s(a).keyword,"onUpdate:modelValue":t[5]||(t[5]=o=>s(a).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(J,{modelValue:s(a).categoryId,"onUpdate:modelValue":t[6]||(t[6]=o=>s(a).categoryId=o),options:s(D),props:s(pe),class:"w-80",clearable:"",placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",filterable:""},null,8,["modelValue","options","props"])]),_:1})]),_:1})]),_:1}),i.isDetail?(c(),f(n,{key:0},{default:l(()=>[e(r,{span:12},{default:l(()=>[i.isDetail?(c(),f(d,{key:0,label:"\u9500\u91CF",prop:"salesCount"},{default:l(()=>[e(p,{modelValue:s(a).salesCount,"onUpdate:modelValue":t[7]||(t[7]=o=>s(a).salesCount=o),class:"w-80!"},null,8,["modelValue"])]),_:1})):y("",!0)]),_:1}),e(r,{span:12},{default:l(()=>[i.isDetail?(c(),f(d,{key:0,label:"\u89C4\u683C",prop:"specType"},{default:l(()=>[e(p,{modelValue:s(h),"onUpdate:modelValue":t[8]||(t[8]=o=>C(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:i.isDetail?12:24},{default:l(()=>[e(d,{label:"\u4EF7\u683C\u9AD8\u7CBE\u5EA6",prop:"highPrecision"},{default:l(()=>[e(b,{modelValue:s(a).highPrecision,"onUpdate:modelValue":t[9]||(t[9]=o=>s(a).highPrecision=o),class:"w-80",disabled:s(a).spuType},{default:l(()=>[e(_,{label:"\u5426",value:!1}),e(_,{label:"\u662F",value:!0})]),_:1},8,["modelValue","disabled"])]),_:1})]),_:1},8,["span"]),i.isDetail?(c(),f(r,{key:0,span:12},{default:l(()=>[e(d,{label:"\u5546\u54C1\u652F\u4ED8\u65B9\u5F0F",prop:"spuPayType"},{default:l(()=>[e(b,{modelValue:s(a).spuPayType,"onUpdate:modelValue":t[10]||(t[10]=o=>s(a).spuPayType=o),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u652F\u4ED8\u65B9\u5F0F",class:"w-80"},{default:l(()=>[e(_,{label:"\u4EBA\u6C11\u5E01+\u79EF\u5206",value:1}),e(_,{label:"\u7EAF\u79EF\u5206",value:2})]),_:1},8,["modelValue"])]),_:1})]),_:1})):y("",!0)]),_:1}),e(n,null,{default:l(()=>[e(r,{span:24},{default:l(()=>[e(d,{label:"\u5546\u54C1\u7B80\u4ECB",prop:"introduction"},{default:l(()=>[e(p,{modelValue:s(a).introduction,"onUpdate:modelValue":t[11]||(t[11]=o=>s(a).introduction=o),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",type:"textarea",autosize:{minRows:2,maxRows:2},maxlength:"300","show-word-limit":!0,clearable:!0,resize:"none",class:"w-80!"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),s(T)?(c(),Q("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(I,{modelValue:s(a).sliderPicUrls,"onUpdate:modelValue":t[12]||(t[12]=o=>s(a).sliderPicUrls=o),limit:5,fileSize:.3,disabled:i.isDetail},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1})])):(c(),f(n,{key:2},{default:l(()=>[e(r,{span:24},{default:l(()=>[e(d,{label:"\u5546\u54C1\u8F6E\u64AD\u56FE",prop:"sliderPicUrls"},{default:l(()=>[e(I,{modelValue:s(a).sliderPicUrls,"onUpdate:modelValue":t[13]||(t[13]=o=>s(a).sliderPicUrls=o),limit:5,fileSize:.3,disabled:i.isDetail},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1}))]),_:1},8,["model","rules","class","disabled"])}}}),[["__scopeId","data-v-64c95680"],["__file","D:/zx/mall-newfeifan-zx-business/src/views/mall/product/spu/form/InfoForm.vue"]])});export{we as __tla,F as default};