1 |
- import{d as O,dQ as R,af as v,J as U,r as y,K as j,au as b,o as s,c as u,g as o,F as g,n as F,f as e,w as V,v as I,a3 as J,a as w,q as K,O as L,_ as M,aO as P,__tla as Q}from"./index-73e02845.js";import{E as T,__tla as X}from"./el-image-6a280602.js";import{__tla as z}from"./el-image-viewer-a6b3dac3.js";import{c as B,__tla as D}from"./spu-a6b1f90b.js";import{_ as G,__tla as H}from"./SpuTableSelect.vue_vue_type_script_setup_true_lang-96cc336d.js";import{_ as W}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as Y}from"./Dialog-1f04d1b7.js";import{__tla as Z}from"./ContentWrap.vue_vue_type_script_setup_true_lang-589371a6.js";import{__tla as $}from"./el-card-ada74e7d.js";import{__tla as aa}from"./index.vue_vue_type_script_setup_true_lang-2534a34f.js";import{__tla as la}from"./index-c1a24aa4.js";import{__tla as ta}from"./el-tree-select-a05a2d94.js";import"./tree-fd3a041e.js";import{__tla as ea}from"./category-ee994b51.js";let k,ra=Promise.all([(()=>{try{return Q}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return z}catch{}})(),(()=>{try{return D}catch{}})(),(()=>{try{return H}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(O({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=U(()=>!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 B(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 q=T,f=M,h=P;return s(),u(g,null,[o("div",i,[(s(!0),u(g,null,F(w(l),(c,E)=>(s(),u("div",{key:c.id,class:"select-box spu-pic"},[e(h,{content:c.name},{default:V(()=>[o("div",m,[e(q,{src:c.picUrl,class:"h-full w-full"},null,8,["src"]),I(e(f,{class:"del-icon",icon:"ep:circle-close-filled",onClick:sa=>(N=>{l.value.splice(N,1),d()})(E)},null,8,["onClick"]),[[J,!_.disabled]])])]),_:2},1032,["content"])]))),128)),w(C)?(s(),K(h,{key:0,content:"\u9009\u62E9\u5546\u54C1"},{default:V(()=>[o("div",{class:"select-box",onClick:S},[e(f,{icon:"ep:plus"})])]),_:1})):L("",!0)]),e(G,{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};
|