SpuShowcase-1e55a0db.js 2.8 KB

1
  1. import{d as E,dY as M,as as v,e as N,r as y,w as U,dC as b,o as s,c as u,B as o,F as w,R as j,f as t,A as V,k as q,v as B,a as g,C as F,a3 as I,Q as L,bi as P,_ as Q,__tla as T}from"./index-54aa57d8.js";import{E as X,__tla as Y}from"./el-image-94dad5a7.js";import{__tla as G}from"./el-image-viewer-ec0edec4.js";import{h as H,__tla as J}from"./spu-b4744276.js";import K,{__tla as O}from"./SpuTableSelect-082c4e0a.js";import{__tla as W}from"./Dialog-7bb778a5.js";import{__tla as Z}from"./ContentWrap-260746ab.js";import{__tla as $}from"./el-card-e7d6628c.js";import{__tla as aa}from"./index-e6a7fd1e.js";import{__tla as la}from"./index-254a9b5e.js";import{__tla as ea}from"./el-tree-select-20b2a9f3.js";import"./tree-0af4953a.js";import{__tla as ta}from"./category-25a5e37a.js";let x,ra=Promise.all([(()=>{try{return T}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return J}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return W}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"},x=Q(E({name:"SpuShowcase",__name:"SpuShowcase",props:{modelValue:M([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=N(()=>!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(p=>!a.includes(p.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],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 R=X,f=L,h=P;return s(),u(w,null,[o("div",i,[(s(!0),u(w,null,j(g(l),(c,z)=>(s(),u("div",{key:c.id,class:"select-box spu-pic"},[t(h,{content:c.name},{default:V(()=>[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:sa=>(D=>{l.value.splice(D,1),d()})(z)},null,8,["onClick"]),[[B,!_.disabled]])])]),_:2},1032,["content"])]))),128)),g(S)?(s(),F(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(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-admin/src/views/mall/product/spu/components/SpuShowcase.vue"]])});export{ra as __tla,x as default};