SpuShowcase-8c54f426.js 3.0 KB

1
  1. import{d as j,dR as D,ag as v,K as E,r as y,L,av as g,o as s,c as o,g as u,F as b,q as N,f as e,w,x as P,a4 as U,a as x,v as F,P as I,j as K,bh as M,_ as T,__tla as X}from"./index-bd9277a1.js";import{E as B,__tla as G}from"./el-image-c6b72263.js";import{__tla as H}from"./el-image-viewer-995341ab.js";import{f as J,__tla as O}from"./spu-1de6da31.js";import Q,{__tla as W}from"./SpuTableSelect-8c336949.js";import{__tla as Y}from"./Dialog-eba103da.js";import{__tla as Z}from"./ContentWrap-7c73ab26.js";import{__tla as $}from"./ContentWrap.vue_vue_type_script_setup_true_lang-5f6a2d0d.js";import{__tla as aa}from"./el-card-bc8cec83.js";import{__tla as la}from"./index-3118d255.js";import{__tla as ta}from"./index-49ecf2ef.js";import{__tla as ea}from"./el-tree-select-9425e295.js";import"./tree-0af4953a.js";import{__tla as ra}from"./category-ca717d96.js";let V,sa=Promise.all([(()=>{try{return X}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return ta}catch{}})(),(()=>{try{return ea}catch{}})(),(()=>{try{return ra}catch{}})()]).then(async()=>{let i,n;i={class:"flex flex-wrap items-center gap-8px"},n={class:"relative h-full w-full"},V=T(j({name:"SpuShowcase",__name:"SpuShowcase",props:{modelValue:D([Number,Array]).isRequired,limit:v.number.def(Number.MAX_VALUE),disabled:v.bool.def(!1)},emits:["update:modelValue","change"],setup(_,{emit:k}){const t=_,S=E(()=>!t.disabled&&(!t.limit||l.value.length<t.limit)),l=y([]);L(()=>t.modelValue,async()=>{const a=g(t.modelValue)?t.modelValue:t.modelValue?[t.modelValue]:[];a.length!==0?(l.value.length===0||l.value.some(p=>!a.includes(p.id)))&&(l.value=await J(a)):l.value=[]},{immediate:!0});const m=y(),C=()=>{m.value.open(l.value)},A=a=>{l.value=g(a)?a:[a],d()},r=k,d=()=>{if(t.limit===1){const a=l.value.length>0?l.value[0]:null;r("update:modelValue",(a==null?void 0:a.id)||0),r("change",a)}else r("update:modelValue",l.value.map(a=>a.id)),r("change",l.value)};return(a,p)=>{const R=B,f=K,h=M;return s(),o(b,null,[u("div",i,[(s(!0),o(b,null,N(x(l),(c,q)=>(s(),o("div",{key:c.id,class:"select-box spu-pic"},[e(h,{content:c.name},{default:w(()=>[u("div",n,[e(R,{src:c.picUrl,class:"h-full w-full"},null,8,["src"]),P(e(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:_a=>(z=>{l.value.splice(z,1),d()})(q)},null,8,["onClick"]),[[U,!_.disabled]])])]),_:2},1032,["content"])]))),128)),x(S)?(s(),F(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:w(()=>[u("div",{class:"select-box",onClick:C},[e(f,{icon:"ep:plus"})])]),_:1})):I("",!0)]),e(Q,{ref_key:"spuTableSelectRef",ref:m,multiple:_.limit!=1,onChange:A},null,8,["multiple"])],64)}}}),[["__scopeId","data-v-b2e1fd2c"],["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/views/mall/product/spu/components/SpuShowcase.vue"]])});export{sa as __tla,V as default};