SpuShowcase-ec62fe43.js 2.9 KB

1
  1. import{d as N,dU as R,ar as v,e as T,r as y,w as j,dA as b,o as s,c as u,B as o,F as V,Q as B,f as e,A as g,k as D,v as F,a as w,C as I,a2 as L,_ as M,bf as P,__tla as Q}from"./index-f65577b8.js";import{E as X,__tla as z}from"./el-image-6b44629c.js";import{__tla as G}from"./el-image-viewer-7e496319.js";import{h as H,__tla as J}from"./spu-f470600f.js";import{_ as K,__tla as O}from"./SpuTableSelect.vue_vue_type_script_setup_true_lang-247a2538.js";import{_ as W}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as Y}from"./Dialog-bd3317a7.js";import{__tla as Z}from"./ContentWrap.vue_vue_type_script_setup_true_lang-9fbbd655.js";import{__tla as $}from"./el-card-ab53e6aa.js";import{__tla as aa}from"./index.vue_vue_type_script_setup_true_lang-53598c8e.js";import{__tla as la}from"./index-1896261a.js";import{__tla as ta}from"./el-tree-select-27b84fc4.js";import"./tree-0af4953a.js";import{__tla as ea}from"./category-60c03943.js";let k,ra=Promise.all([(()=>{try{return Q}catch{}})(),(()=>{try{return z}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return J}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 ta}catch{}})(),(()=>{try{return ea}catch{}})()]).then(async()=>{let i,m;i={class:"flex flex-wrap items-center gap-8px"},m={class:"relative h-full w-full"},k=W(N({name:"SpuShowcase",__name:"SpuShowcase",props:{modelValue:R([Number,Array]).isRequired,limit:v.number.def(Number.MAX_VALUE),disabled:v.bool.def(!1)},emits:["update:modelValue","change"],setup(_,{emit:x}){const t=_,C=T(()=>!t.disabled&&(!t.limit||l.value.length<t.limit)),l=y([]);j(()=>t.modelValue,async()=>{const a=b(t.modelValue)?t.modelValue:t.modelValue?[t.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 n=y(),A=()=>{n.value.open(l.value)},S=a=>{l.value=b(a)?a:[a],d()},r=x,d=()=>{if(t.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 U=X,f=M,h=P;return s(),u(V,null,[o("div",i,[(s(!0),u(V,null,B(w(l),(c,q)=>(s(),u("div",{key:c.id,class:"select-box spu-pic"},[e(h,{content:c.name},{default:g(()=>[o("div",m,[e(U,{src:c.picUrl,class:"h-full w-full"},null,8,["src"]),D(e(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:sa=>(E=>{l.value.splice(E,1),d()})(q)},null,8,["onClick"]),[[F,!_.disabled]])])]),_:2},1032,["content"])]))),128)),w(C)?(s(),I(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:g(()=>[o("div",{class:"select-box",onClick:A},[e(f,{icon:"ep:plus"})])]),_:1})):L("",!0)]),e(K,{ref_key:"spuTableSelectRef",ref:n,multiple:_.limit!=1,onChange:S},null,8,["multiple"])],64)}}}),[["__scopeId","data-v-83497b1b"]])});export{ra as __tla,k as default};