index-87c3168b.js 2.1 KB

1
  1. import{d as w,aT as V,eq as D,p as j,o as p,c as C,i as e,w as a,j as q,g as n,a as s,l as z,a2 as F,aF as I,F as J,aJ as R,v as $,aw as E,J as H,_ as P,__tla as T}from"./index-b2b3c6c4.js";import{E as U,__tla as X}from"./el-text-466bfabe.js";import{V as A,__tla as B}from"./vuedraggable.umd-8fcf2deb.js";import{u as G,__tla as K}from"./util-c8690f25.js";let _,L=Promise.all([(()=>{try{return T}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return K}catch{}})()]).then(async()=>{let o,d,m;o={class:"mb-4px flex flex-col gap-4px border border-gray-2 border-rounded rounded border-solid p-8px"},d={class:"m--8px m-b-4px flex flex-row items-center justify-between bg-gray-1 p-8px"},m=n("span",null,"\u6DFB\u52A0",-1),_=P(w({name:"Draggable",__name:"index",props:{modelValue:V().isRequired,emptyItem:D().def({}),limit:j.number.def(0)},emits:["update:modelValue"],setup(t,{emit:f}){const c=t,x=f,{formData:l}=G(c.modelValue,x),b=()=>l.value.push(R(c.emptyItem||{}));return(y,M)=>{const g=U,r=$,i=E,h=H;return p(),C(J,null,[e(g,{type:"info",size:"small"},{default:a(()=>[q(" \u62D6\u52A8\u5DE6\u4E0A\u89D2\u7684\u5C0F\u5706\u70B9\u53EF\u5BF9\u5176\u6392\u5E8F ")]),_:1}),e(s(A),{list:s(l),"force-fallback":!0,animation:200,handle:".drag-icon",class:"m-t-8px","item-key":"index"},{item:a(({element:k,index:u})=>[n("div",o,[n("div",d,[e(i,{content:"\u62D6\u52A8\u6392\u5E8F"},{default:a(()=>[e(r,{icon:"ic:round-drag-indicator",class:"drag-icon cursor-move"})]),_:1}),e(i,{content:"\u5220\u9664"},{default:a(()=>[s(l).length>1?(p(),z(r,{key:0,icon:"ep:delete",class:"cursor-pointer text-red-5",onClick:N=>(v=>l.value.splice(v,1))(u)},null,8,["onClick"])):F("",!0)]),_:2},1024)]),I(y.$slots,"default",{element:k,index:u})])]),_:3},8,["list"]),e(i,{disabled:t.limit<1,content:`\u6700\u591A\u6DFB\u52A0${t.limit}\u4E2A`},{default:a(()=>[e(h,{type:"primary",plain:"",class:"m-t-4px w-full",disabled:t.limit>0&&s(l).length>=t.limit,onClick:b},{default:a(()=>[e(r,{icon:"ep:plus"}),m]),_:1},8,["disabled"])]),_:1},8,["disabled","content"])],64)}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/components/Draggable/index.vue"]])});export{_,L as __tla};