import{d as R,aS as U,p as v,b as j,r as y,aP as q,as as b,o as s,c,g as o,F as w,k as F,i as t,w as g,C as G,a1 as H,a as V,l as I,a2 as L,v as M,aw as O,_ as T,__tla as X}from"./index-2c56227b.js";import{E as z,__tla as B}from"./el-image-cae97e2e.js";import{__tla as D}from"./el-image-viewer-da1b6008.js";import{e as J,__tla as K}from"./spu-885c4bfc.js";import Q,{__tla as W}from"./SpuTableSelect-d34d78c7.js";import{__tla as Y}from"./Dialog-1050d437.js";import{__tla as Z}from"./ContentWrap-f1610353.js";import{__tla as $}from"./el-card-9c148b4f.js";import{__tla as aa}from"./index-8106be8e.js";import{__tla as la}from"./index-d17bd909.js";import{__tla as ea}from"./el-tree-select-97cbdeb3.js";import"./tree-0af4953a.js";import{__tla as ta}from"./category-6b00ba40.js";let S,ra=Promise.all([(()=>{try{return X}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return D}catch{}})(),(()=>{try{return K}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=T(R({name:"SpuShowcase",__name:"SpuShowcase",props:{modelValue:U([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=j(()=>!e.disabled&&(!e.limit||l.value.length<e.limit)),l=y([]);q(()=>e.modelValue,async()=>{const a=b(e.modelValue)?e.modelValue:e.modelValue?[e.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=b(a)?a:[a],d()},r=k,d=()=>{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,p)=>{const E=z,f=M,h=O;return s(),c(w,null,[o("div",i,[(s(!0),c(w,null,F(V(l),(u,P)=>(s(),c("div",{key:u.id,class:"select-box spu-pic"},[t(h,{content:u.name},{default:g(()=>[o("div",n,[t(E,{src:u.picUrl,class:"h-full w-full"},null,8,["src"]),G(t(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:sa=>(N=>{l.value.splice(N,1),d()})(P)},null,8,["onClick"]),[[H,!_.disabled]])])]),_:2},1032,["content"])]))),128)),V(x)?(s(),I(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:g(()=>[o("div",{class:"select-box",onClick:C},[t(f,{icon:"ep:plus"})])]),_:1})):L("",!0)]),t(Q,{ref_key:"spuTableSelectRef",ref:m,multiple:_.limit!=1,onChange:A},null,8,["multiple"])],64)}}}),[["__scopeId","data-v-b2e1fd2c"],["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/mall/product/spu/components/SpuShowcase.vue"]])});export{ra as __tla,S as default};
