import{d as E,dN as L,ah as v,K as R,r as y,L as U,av as b,o as s,c as u,g as o,F as g,q as j,f as t,w,x as D,a5 as F,a as x,v as I,Q as K,j as M,bh as P,_ as Q,__tla as T}from"./index-04f8d540.js";import{E as X,__tla as B}from"./el-image-00a7d632.js";import{__tla as G}from"./el-image-viewer-5878bd7a.js";import{f as H,__tla as J}from"./spu-c37be05c.js";import O,{__tla as W}from"./SpuTableSelect-618d040a.js";import{__tla as Y}from"./Dialog-9afb5ba5.js";import{__tla as Z}from"./ContentWrap-0137c911.js";import{__tla as $}from"./ContentWrap.vue_vue_type_script_setup_true_lang-d7df3a9f.js";import{__tla as aa}from"./el-card-3a265a8d.js";import{__tla as la}from"./index-bf28d6af.js";import{__tla as ea}from"./index-1cf9f52b.js";import{__tla as ta}from"./el-tree-select-78c28ca5.js";import"./tree-0af4953a.js";import{__tla as ra}from"./category-d840f37d.js";let V,sa=Promise.all([(()=>{try{return T}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return J}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 ea}catch{}})(),(()=>{try{return ta}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=Q(E({name:"SpuShowcase",__name:"SpuShowcase",props:{modelValue:L([Number,Array]).isRequired,limit:v.number.def(Number.MAX_VALUE),disabled:v.bool.def(!1)},emits:["update:modelValue","change"],setup(_,{emit:S}){const e=_,k=R(()=>!e.disabled&&(!e.limit||l.value.length<e.limit)),l=y([]);U(()=>e.modelValue,async()=>{const a=b(e.modelValue)?e.modelValue:e.modelValue?[e.modelValue]:[];a.length!==0?(l.value.length===0||l.value.some(d=>!a.includes(d.id)))&&(l.value=await H(a)):l.value=[]},{immediate:!0});const m=y(),C=()=>{m.value.open(l.value)},A=a=>{l.value=b(a)?a:[a],p()},r=S,p=()=>{if(e.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,d)=>{const N=X,f=M,h=P;return s(),u(g,null,[o("div",i,[(s(!0),u(g,null,j(x(l),(c,q)=>(s(),u("div",{key:c.id,class:"select-box spu-pic"},[t(h,{content:c.name},{default:w(()=>[o("div",n,[t(N,{src:c.picUrl,class:"h-full w-full"},null,8,["src"]),D(t(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:_a=>(z=>{l.value.splice(z,1),p()})(q)},null,8,["onClick"]),[[F,!_.disabled]])])]),_:2},1032,["content"])]))),128)),x(k)?(s(),I(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:w(()=>[o("div",{class:"select-box",onClick:C},[t(f,{icon:"ep:plus"})])]),_:1})):K("",!0)]),t(O,{ref_key:"spuTableSelectRef",ref:m,multiple:_.limit!=1,onChange:A},null,8,["multiple"])],64)}}}),[["__scopeId","data-v-b2e1fd2c"],["__file","D:/zx/mall-newfeifan-zx-business/src/views/mall/product/spu/components/SpuShowcase.vue"]])});export{sa as __tla,V as default};
