import{d as D,aS as E,p as v,b as N,r as y,aP as X,as as b,o as r,c,g as o,F as w,k as j,i as t,w as g,C as q,a1 as z,a as V,l as F,a2 as H,v as I,aw as L,_ as M,__tla as T}from"./index-8c6726e5.js";import{E as B,__tla as G}from"./el-image-501b80b4.js";import{__tla as J}from"./el-image-viewer-49715a4b.js";import{e as K,__tla as O}from"./spu-be6be268.js";import Q,{__tla as W}from"./SpuTableSelect-43d3b025.js";import{__tla as Y}from"./Dialog-336bccec.js";import{__tla as Z}from"./ContentWrap-1defc267.js";import{__tla as $}from"./el-card-17d153e8.js";import{__tla as aa}from"./index-9e33d9ae.js";import{__tla as la}from"./index-ffb232b7.js";import{__tla as ea}from"./el-tree-select-9a22c115.js";import"./tree-0af4953a.js";import{__tla as ta}from"./category-92ed0a3a.js";let S,sa=Promise.all([(()=>{try{return T}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return J}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 ea}catch{}})(),(()=>{try{return ta}catch{}})()]).then(async()=>{let i,n;i={class:"flex flex-wrap items-center gap-8px"},n={class:"relative h-full w-full"},S=M(D({name:"SpuShowcase",__name:"SpuShowcase",props:{modelValue:E([Number,Array]).isRequired,limit:v.number.def(Number.MAX_VALUE),disabled:v.bool.def(!1)},emits:["update:modelValue","change"],setup(_,{emit:k}){const e=_,x=N(()=>!e.disabled&&(!e.limit||l.value.length<e.limit)),l=y([]);X(()=>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 K(a)):l.value=[]},{immediate:!0});const m=y(),C=()=>{m.value.open(l.value)},A=a=>{l.value=b(a)?a:[a],p()},s=k,p=()=>{if(e.limit===1){const a=l.value.length>0?l.value[0]:null;s("update:modelValue",(a==null?void 0:a.id)||0),s("change",a)}else s("update:modelValue",l.value.map(a=>a.id)),s("change",l.value)};return(a,d)=>{const R=B,f=I,h=L;return r(),c(w,null,[o("div",i,[(r(!0),c(w,null,j(V(l),(u,U)=>(r(),c("div",{key:u.id,class:"select-box spu-pic"},[t(h,{content:u.name},{default:g(()=>[o("div",n,[t(R,{src:u.picUrl,class:"h-full w-full"},null,8,["src"]),q(t(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:ra=>(P=>{l.value.splice(P,1),p()})(U)},null,8,["onClick"]),[[z,!_.disabled]])])]),_:2},1032,["content"])]))),128)),V(x)?(r(),F(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:g(()=>[o("div",{class:"select-box",onClick:C},[t(f,{icon:"ep:plus"})])]),_:1})):H("",!0)]),t(Q,{ref_key:"spuTableSelectRef",ref:m,multiple:_.limit!=1,onChange:A},null,8,["multiple"])],64)}}}),[["__scopeId","data-v-b2e1fd2c"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/product/spu/components/SpuShowcase.vue"]])});export{sa as __tla,S as default};
