SpuShowcase-73813a50.js 3.0 KB

1
  1. import{d as q,dQ as z,ag as v,K as E,r as y,L as N,av as b,o as s,c as u,g as o,F as g,q as P,f as t,w,x as R,a4 as T,a as x,v as D,P as F,j as I,bh as K,_ as M,__tla as Q}from"./index-8e30b17f.js";import{E as W,__tla as X}from"./el-image-830684bc.js";import{__tla as B}from"./el-image-viewer-fb97741c.js";import{e as G,__tla as H}from"./spu-9278ab05.js";import J,{__tla as O}from"./SpuTableSelect-dee11d02.js";import{__tla as Y}from"./Dialog-9917188a.js";import{__tla as Z}from"./ContentWrap-0730b42c.js";import{__tla as $}from"./ContentWrap.vue_vue_type_script_setup_true_lang-14d08aa7.js";import{__tla as aa}from"./el-card-70b4f66a.js";import{__tla as la}from"./index-98081839.js";import{__tla as ea}from"./index-bcb8595f.js";import{__tla as ta}from"./el-tree-select-3cd6acef.js";import"./tree-0af4953a.js";import{__tla as ra}from"./category-d033fe8c.js";let V,sa=Promise.all([(()=>{try{return Q}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return O}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{}})(),(()=>{try{return ra}catch{}})()]).then(async()=>{let i,n;i={class:"flex flex-wrap items-center gap-8px"},n={class:"relative h-full w-full"},V=M(q({name:"SpuShowcase",__name:"SpuShowcase",props:{modelValue:z([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=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 G(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 L=W,f=I,h=K;return s(),u(g,null,[o("div",i,[(s(!0),u(g,null,P(x(l),(c,U)=>(s(),u("div",{key:c.id,class:"select-box spu-pic"},[t(h,{content:c.name},{default:w(()=>[o("div",n,[t(L,{src:c.picUrl,class:"h-full w-full"},null,8,["src"]),R(t(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:_a=>(j=>{l.value.splice(j,1),d()})(U)},null,8,["onClick"]),[[T,!_.disabled]])])]),_:2},1032,["content"])]))),128)),x(k)?(s(),D(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:w(()=>[o("div",{class:"select-box",onClick:C},[t(f,{icon:"ep:plus"})])]),_:1})):F("",!0)]),t(J,{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{sa as __tla,V as default};