import{d as q,aP as z,ac as v,Y as E,r as y,aM as M,ap as b,o as r,c as u,g as o,F as g,v as N,f as t,w,z as P,$ as T,a as V,x as X,a0 as D,j as F,at as H,_ as I,__tla as L}from"./index-8dc1e40a.js";import{E as Y,__tla as $}from"./el-image-6a48e9f1.js";import{__tla as B}from"./el-image-viewer-3b8905e6.js";import{e as G,__tla as J}from"./spu-559f5d98.js";import K,{__tla as O}from"./SpuTableSelect-573b2ba6.js";import{__tla as Q}from"./Dialog-41802231.js";import{__tla as W}from"./ContentWrap-0aca5216.js";import{__tla as Z}from"./el-card-18df90f0.js";import{__tla as aa}from"./index-64aeaa78.js";import{__tla as ea}from"./index-803dbf9a.js";import{__tla as la}from"./el-tree-select-d82790d8.js";import"./tree-0af4953a.js";import{__tla as ta}from"./category-e7433506.js";let x,sa=Promise.all([(()=>{try{return L}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return J}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return ea}catch{}})(),(()=>{try{return la}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"},x=I(q({name:"SpuShowcase",__name:"SpuShowcase",props:{modelValue:z([Number,Array]).isRequired,limit:v.number.def(Number.MAX_VALUE),disabled:v.bool.def(!1)},emits:["update:modelValue","change"],setup(_,{emit:k}){const l=_,S=E(()=>!l.disabled&&(!l.limit||e.value.length<l.limit)),e=y([]);M(()=>l.modelValue,async()=>{const a=b(l.modelValue)?l.modelValue:l.modelValue?[l.modelValue]:[];a.length!==0?(e.value.length===0||e.value.some(d=>!a.includes(d.id)))&&(e.value=await G(a)):e.value=[]},{immediate:!0});const m=y(),C=()=>{m.value.open(e.value)},A=a=>{e.value=b(a)?a:[a],p()},s=k,p=()=>{if(l.limit===1){const a=e.value.length>0?e.value[0]:null;s("update:modelValue",(a==null?void 0:a.id)||0),s("change",a)}else s("update:modelValue",e.value.map(a=>a.id)),s("change",e.value)};return(a,d)=>{const R=Y,f=F,h=H;return r(),u(g,null,[o("div",i,[(r(!0),u(g,null,N(V(e),(c,U)=>(r(),u("div",{key:c.id,class:"select-box spu-pic"},[t(h,{content:c.name},{default:w(()=>[o("div",n,[t(R,{src:c.picUrl,class:"h-full w-full"},null,8,["src"]),P(t(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:ra=>(j=>{e.value.splice(j,1),p()})(U)},null,8,["onClick"]),[[T,!_.disabled]])])]),_:2},1032,["content"])]))),128)),V(S)?(r(),X(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:w(()=>[o("div",{class:"select-box",onClick:C},[t(f,{icon:"ep:plus"})])]),_:1})):D("",!0)]),t(K,{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,x as default};
