SpuShowcase-466ae5cc.js 2.8 KB

1
  1. import{d as U,dO as j,ai as v,e as E,r as y,O as N,a_ as b,o as r,c as u,j as o,F as w,C as O,i as t,w as V,D as q,a7 as F,a as g,k as I,S as L,n as M,aS as P,_ as T,__tla as X}from"./index-2f799233.js";import{E as B,__tla as G}from"./el-image-4d26fa76.js";import{__tla as H}from"./el-image-viewer-8e9e3571.js";import{h as J,__tla as K}from"./spu-980b34a1.js";import Q,{__tla as W}from"./SpuTableSelect-ce2b8bb8.js";import{__tla as Y}from"./Dialog-6fd39e06.js";import{__tla as Z}from"./ContentWrap-9da801df.js";import{__tla as $}from"./el-card-c64c83d1.js";import{__tla as aa}from"./index-e6cd813f.js";import{__tla as la}from"./index-1c180a16.js";import{__tla as ea}from"./el-tree-select-ef4257fc.js";import"./tree-0af4953a.js";import{__tla as ta}from"./category-6df467a3.js";let S,sa=Promise.all([(()=>{try{return X}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return H}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(U({name:"SpuShowcase",__name:"SpuShowcase",props:{modelValue:j([Number,Array]).isRequired,limit:v.number.def(Number.MAX_VALUE),disabled:v.bool.def(!1)},emits:["update:modelValue","change"],setup(_,{emit:x}){const e=_,k=E(()=>!e.disabled&&(!e.limit||l.value.length<e.limit)),l=y([]);N(()=>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()},s=x,d=()=>{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,p)=>{const z=B,f=M,h=P;return r(),u(w,null,[o("div",i,[(r(!0),u(w,null,O(g(l),(c,D)=>(r(),u("div",{key:c.id,class:"select-box spu-pic"},[t(h,{content:c.name},{default:V(()=>[o("div",n,[t(z,{src:c.picUrl,class:"h-full w-full"},null,8,["src"]),q(t(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:ra=>(R=>{l.value.splice(R,1),d()})(D)},null,8,["onClick"]),[[F,!_.disabled]])])]),_:2},1032,["content"])]))),128)),g(k)?(r(),I(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:V(()=>[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","D:/zx/mall-newfeifan-zx-business/src/views/mall/product/spu/components/SpuShowcase.vue"]])});export{sa as __tla,S as default};