import{d as N,dO as E,ai as v,L,r as y,M as U,a$ as b,o as s,c as u,h as o,F as g,v as j,g as t,w,y as q,a6 as D,a as x,x as F,R as I,k as O,b6 as P,_ as T,__tla as X}from"./index-7d5b26d3.js";import{E as $,__tla as B}from"./el-image-c9079635.js";import{__tla as G}from"./el-image-viewer-2f0c9a58.js";import{f as H,__tla as J}from"./spu-d111aae3.js";import K,{__tla as Q}from"./SpuTableSelect-4d123eb2.js";import{__tla as W}from"./Dialog-2be588df.js";import{__tla as Y}from"./ContentWrap-07931e94.js";import{__tla as Z}from"./ContentWrap.vue_vue_type_script_setup_true_lang-831d711e.js";import{__tla as aa}from"./el-card-698191e2.js";import{__tla as la}from"./index-966eea36.js";import{__tla as ea}from"./index-cdb8fe72.js";import{__tla as ta}from"./el-tree-select-50c86e57.js";import"./tree-0af4953a.js";import{__tla as ra}from"./category-4f7cc9ea.js";let V,sa=Promise.all([(()=>{try{return X}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return J}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return Z}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=T(N({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=_,S=L(()=>!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=k,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 R=$,f=O,h=P;return s(),u(g,null,[o("div",i,[(s(!0),u(g,null,j(x(l),(c,z)=>(s(),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"]),q(t(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:_a=>(M=>{l.value.splice(M,1),p()})(z)},null,8,["onClick"]),[[D,!_.disabled]])])]),_:2},1032,["content"])]))),128)),x(S)?(s(),F(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:w(()=>[o("div",{class:"select-box",onClick:C},[t(f,{icon:"ep:plus"})])]),_:1})):I("",!0)]),t(K,{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};
