SpuShowcase-372fd6fc.js 2.9 KB

1
  1. import{d as j,dP as D,ah as v,e as N,r as y,O as P,a$ as b,o as s,c as u,k as o,F as V,C as U,i as e,w as g,D as q,a6 as F,a as w,j as I,l as L,_ as M,aT as O,__tla as X}from"./index-1e808f2e.js";import{E as $,__tla as z}from"./el-image-263fb014.js";import{__tla as B}from"./el-image-viewer-dddb6285.js";import{f as G,__tla as H}from"./spu-d8bf9472.js";import{_ as J,__tla as K}from"./SpuTableSelect.vue_vue_type_script_setup_true_lang-482aeb8f.js";import{_ as Q}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as W}from"./Dialog-f44f9d78.js";import{__tla as Y}from"./ContentWrap.vue_vue_type_script_setup_true_lang-cc335a20.js";import{__tla as Z}from"./el-card-03b3588b.js";import{__tla as aa}from"./index.vue_vue_type_script_setup_true_lang-571824c6.js";import{__tla as la}from"./index-73afebcf.js";import{__tla as ta}from"./el-tree-select-e8e05888.js";import"./tree-fd3a041e.js";import{__tla as ea}from"./category-9d0fc28e.js";let k,ra=Promise.all([(()=>{try{return X}catch{}})(),(()=>{try{return z}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return K}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return Z}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=Q(j({name:"SpuShowcase",__name:"SpuShowcase",props:{modelValue:D([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=N(()=>!t.disabled&&(!t.limit||l.value.length<t.limit)),l=y([]);P(()=>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 G(a)):l.value=[]},{immediate:!0});const n=y(),S=()=>{n.value.open(l.value)},A=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 E=$,f=M,h=O;return s(),u(V,null,[o("div",i,[(s(!0),u(V,null,U(w(l),(c,R)=>(s(),u("div",{key:c.id,class:"select-box spu-pic"},[e(h,{content:c.name},{default:g(()=>[o("div",m,[e(E,{src:c.picUrl,class:"h-full w-full"},null,8,["src"]),q(e(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:sa=>(T=>{l.value.splice(T,1),d()})(R)},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:S},[e(f,{icon:"ep:plus"})])]),_:1})):L("",!0)]),e(J,{ref_key:"spuTableSelectRef",ref:n,multiple:_.limit!=1,onChange:A},null,8,["multiple"])],64)}}}),[["__scopeId","data-v-83497b1b"]])});export{ra as __tla,k as default};