1 |
- import{d as D,aV as E,p as v,b as X,r as y,aS as j,aw as b,o as r,c,g as o,F as w,k as q,i as t,w as V,C as z,a1 as F,a as g,l as H,a2 as I,v as L,aA as M,_ as P,__tla as T}from"./index-af173888.js";import{E as B,__tla as G}from"./el-image-fdde0035.js";import{__tla as J}from"./el-image-viewer-0d82b94c.js";import{b as K,__tla as O}from"./spu-41f2bf16.js";import Q,{__tla as W}from"./SpuTableSelect-13f3c2ad.js";import{__tla as Y}from"./Dialog-987c90a1.js";import{__tla as Z}from"./ContentWrap-b959c1be.js";import{__tla as $}from"./el-card-178b9654.js";import{__tla as aa}from"./index-a33d7937.js";import{__tla as la}from"./index-54b8f773.js";import{__tla as ea}from"./el-tree-select-cd58540b.js";import"./tree-02f455f9.js";import{__tla as ta}from"./category-8ca28490.js";let S,sa=Promise.all([(()=>{try{return T}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return J}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"},S=P(D({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=_,x=X(()=>!e.disabled&&(!e.limit||l.value.length<e.limit)),l=y([]);j(()=>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 K(a)):l.value=[]},{immediate:!0});const m=y(),C=()=>{m.value.open(l.value)},A=a=>{l.value=b(a)?a:[a],p()},s=k,p=()=>{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,d)=>{const R=B,f=L,h=M;return r(),c(w,null,[o("div",i,[(r(!0),c(w,null,q(g(l),(u,U)=>(r(),c("div",{key:u.id,class:"select-box spu-pic"},[t(h,{content:u.name},{default:V(()=>[o("div",n,[t(R,{src:u.picUrl,class:"h-full w-full"},null,8,["src"]),z(t(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:ra=>(N=>{l.value.splice(N,1),p()})(U)},null,8,["onClick"]),[[F,!_.disabled]])])]),_:2},1032,["content"])]))),128)),g(x)?(r(),H(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:V(()=>[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","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/product/spu/components/SpuShowcase.vue"]])});export{sa as __tla,S as default};
|