SpuShowcase-bae91a79.js 2.9 KB

1
  1. import{d as D,dW as E,ar as v,e as N,r as y,w as j,dA as b,o as s,c as u,C as o,F as V,R as q,f as e,B as g,k as F,v as I,a as w,A as L,D as M,_ as P,bh as T,__tla as W}from"./index-e8bff8cb.js";import{E as X,__tla as z}from"./el-image-7cacfc0f.js";import{__tla as G}from"./el-image-viewer-aab7739e.js";import{h as H,__tla as J}from"./spu-0f678412.js";import{_ as K,__tla as O}from"./SpuTableSelect.vue_vue_type_script_setup_true_lang-7cdbe06f.js";import{_ as Q}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as Y}from"./Dialog-4d17ac25.js";import{__tla as Z}from"./ContentWrap.vue_vue_type_script_setup_true_lang-33dea697.js";import{__tla as $}from"./el-card-f9558d99.js";import{__tla as aa}from"./index.vue_vue_type_script_setup_true_lang-75f84d87.js";import{__tla as la}from"./index-35928fe5.js";import{__tla as ta}from"./el-tree-select-d9ced475.js";import"./tree-0af4953a.js";import{__tla as ea}from"./category-fea8d45b.js";let k,ra=Promise.all([(()=>{try{return W}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=Q(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:x}){const t=_,C=N(()=>!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 R=X,f=P,h=T;return s(),u(V,null,[o("div",i,[(s(!0),u(V,null,q(w(l),(c,U)=>(s(),u("div",{key:c.id,class:"select-box spu-pic"},[e(h,{content:c.name},{default:g(()=>[o("div",m,[e(R,{src:c.picUrl,class:"h-full w-full"},null,8,["src"]),F(e(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:sa=>(B=>{l.value.splice(B,1),d()})(U)},null,8,["onClick"]),[[I,!_.disabled]])])]),_:2},1032,["content"])]))),128)),w(C)?(s(),L(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:g(()=>[o("div",{class:"select-box",onClick:A},[e(f,{icon:"ep:plus"})])]),_:1})):M("",!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};