1 |
- import{d as w,dU as D,ey as V,ah as z,o as p,c as C,g as e,w as a,n as j,h as i,a as s,x as q,Q as I,aG as $,F as E,aO as F,q as G,aS as O,D as P,_ as Q,__tla as R}from"./index-3fb48822.js";import{E as S,__tla as U}from"./el-text-5e72453c.js";import{V as A,__tla as B}from"./vuedraggable.umd-e01ae70c.js";import{u as H,__tla as J}from"./util-13cba6a8.js";let _,K=Promise.all([(()=>{try{return R}catch{}})(),(()=>{try{return U}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return J}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=i("span",null,"\u6DFB\u52A0",-1),_=Q(w({name:"Draggable",__name:"index",props:{modelValue:D().isRequired,emptyItem:V().def({}),limit:z.number.def(0)},emits:["update:modelValue"],setup(t,{emit:f}){const c=t,x=f,{formData:l}=H(c.modelValue,x),y=()=>l.value.push(F(c.emptyItem||{}));return(b,L)=>{const g=S,r=G,n=O,h=P;return p(),C(E,null,[e(g,{type:"info",size:"small"},{default:a(()=>[j(" \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})=>[i("div",o,[i("div",d,[e(n,{content:"\u62D6\u52A8\u6392\u5E8F"},{default:a(()=>[e(r,{icon:"ic:round-drag-indicator",class:"drag-icon cursor-move"})]),_:1}),e(n,{content:"\u5220\u9664"},{default:a(()=>[s(l).length>1?(p(),q(r,{key:0,icon:"ep:delete",class:"cursor-pointer text-red-5",onClick:M=>(v=>l.value.splice(v,1))(u)},null,8,["onClick"])):I("",!0)]),_:2},1024)]),$(b.$slots,"default",{element:k,index:u})])]),_:3},8,["list"]),e(n,{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:y},{default:a(()=>[e(r,{icon:"ep:plus"}),m]),_:1},8,["disabled"])]),_:1},8,["disabled","content"])],64)}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/components/Draggable/index.vue"]])});export{_,K as __tla};
|