1 |
- import{d as w,dS as C,ew as D,ag as V,o as _,c as j,f as e,w as a,n as z,g as i,a as s,v as I,P,aD as $,F as q,a_ as E,j as F,bh as R,C as S,_ as A,__tla as B}from"./index-bd9277a1.js";import{E as G,__tla as H}from"./el-text-97725720.js";import{V as J,__tla as K}from"./vuedraggable.umd-028f7aee.js";import{u as L,__tla as M}from"./util-2d21ab6c.js";let p,N=Promise.all([(()=>{try{return B}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return K}catch{}})(),(()=>{try{return M}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),p=A(w({name:"Draggable",__name:"index",props:{modelValue:C().isRequired,emptyItem:D().def({}),limit:V.number.def(0)},emits:["update:modelValue"],setup(t,{emit:f}){const c=t,x=f,{formData:l}=L(c.modelValue,x),b=()=>l.value.push(E(c.emptyItem||{}));return(g,O)=>{const y=G,n=F,r=R,h=S;return _(),j(q,null,[e(y,{type:"info",size:"small"},{default:a(()=>[z(" \u62D6\u52A8\u5DE6\u4E0A\u89D2\u7684\u5C0F\u5706\u70B9\u53EF\u5BF9\u5176\u6392\u5E8F ")]),_:1}),e(s(J),{list:s(l),"force-fallback":!0,animation:200,handle:".drag-icon",class:"m-t-8px","item-key":"index"},{item:a(({element:v,index:u})=>[i("div",o,[i("div",d,[e(r,{content:"\u62D6\u52A8\u6392\u5E8F"},{default:a(()=>[e(n,{icon:"ic:round-drag-indicator",class:"drag-icon cursor-move"})]),_:1}),e(r,{content:"\u5220\u9664"},{default:a(()=>[s(l).length>1?(_(),I(n,{key:0,icon:"ep:delete",class:"cursor-pointer text-red-5",onClick:Q=>(k=>l.value.splice(k,1))(u)},null,8,["onClick"])):P("",!0)]),_:2},1024)]),$(g.$slots,"default",{element:v,index:u})])]),_:3},8,["list"]),e(r,{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(n,{icon:"ep:plus"}),m]),_:1},8,["disabled"])]),_:1},8,["disabled","content"])],64)}}}),[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/Draggable/index.vue"]])});export{p as _,N as __tla};
|