SpuShowcase-2b9a67ca.js 2.8 KB

1
  1. import{d as R,dS as j,ag as v,K as D,r as y,L as E,av as b,o as s,c as u,g as o,F as g,q as L,f as t,w,x as N,a4 as U,a as x,v as F,P as I,j as K,aP as M,_ as T,__tla as X}from"./index-297c97b3.js";import{E as B,__tla as G}from"./el-image-82bf40c6.js";import{__tla as H}from"./el-image-viewer-3c943bf5.js";import{c as J,__tla as O}from"./spu-d00e1e27.js";import Q,{__tla as W}from"./SpuTableSelect-2ef61c3f.js";import{__tla as Y}from"./Dialog-6d866407.js";import{__tla as Z}from"./ContentWrap-2a772ce5.js";import{__tla as $}from"./el-card-22a26825.js";import{__tla as aa}from"./index-eead3ef4.js";import{__tla as la}from"./index-97931d72.js";import{__tla as ea}from"./el-tree-select-4c70bd2d.js";import"./tree-0af4953a.js";import{__tla as ta}from"./category-d1509c57.js";let V,ra=Promise.all([(()=>{try{return X}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return H}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"},V=T(R({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:S}){const e=_,k=D(()=>!e.disabled&&(!e.limit||l.value.length<e.limit)),l=y([]);E(()=>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=S,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 q=B,f=K,h=M;return s(),u(g,null,[o("div",i,[(s(!0),u(g,null,L(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(q,{src:c.picUrl,class:"h-full w-full"},null,8,["src"]),N(t(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:sa=>(P=>{l.value.splice(P,1),d()})(z)},null,8,["onClick"]),[[U,!_.disabled]])])]),_:2},1032,["content"])]))),128)),x(k)?(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(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-admin/src/views/mall/product/spu/components/SpuShowcase.vue"]])});export{ra as __tla,V as default};