1 |
- import{d as O,Y as S,o as u,c as o,f as r,w as C,g as k,T as E,y as j,t as U,a as _,a0 as h,l as z,F,j as H,_ as L,__tla as R}from"./index-35524533.js";import{V as q,__tla as X}from"./vuedraggable.umd-17ae9196.js";let N,Y=Promise.all([(()=>{try{return R}catch{}})(),(()=>{try{return X}catch{}})()]).then(async()=>{let y,x,I,g,b,f;y={class:"menu_bottom"},x=["onClick"],I={key:0,class:"submenu"},g={class:"menu_bottom subtitle"},b=["onClick"],f=["onClick"],N=L(O({__name:"MenuPreviewer",props:{modelValue:{type:Array,required:!0},activeIndex:{type:String,required:!0},parentIndex:{type:Number,required:!0},accountId:{type:Number,required:!0}},emits:["update:modelValue","menu-clicked","submenu-clicked"],setup(M,{emit:P}){const s=M,i=P,d=S({get:()=>s.modelValue,set:n=>i("update:modelValue",n)}),T=()=>{const n=d.value.length,l={name:"\u83DC\u5355\u540D\u79F0",children:[],reply:{type:"text",accountId:s.accountId}};d.value[n]=l,V(l,n-1)},V=(n,l)=>{i("menu-clicked",n,l)},w=(n,l,a)=>{i("submenu-clicked",n,l,a)},$=({oldIndex:n,newIndex:l})=>{if(s.activeIndex==="__MENU_NOT_SELECTED__")return;let a=new Array(d.value.length).fill(!1);a[s.parentIndex]=!0;const[e]=a.splice(n,1);a.splice(l,0,e);const t=a.indexOf(!0),c=d.value[t];i("menu-clicked",c,t)},A=({newIndex:n})=>{var t;const l=s.parentIndex,a=n,e=(t=d.value[l])==null?void 0:t.children;if(e&&(e==null?void 0:e.length)>0){const c=e[a];i("submenu-clicked",c,l,a)}};return(n,l)=>{const a=H;return u(),o(F,null,[r(_(q),{modelValue:_(d),"onUpdate:modelValue":l[0]||(l[0]=e=>z(d)?d.value=e:null),"item-key":"id","ghost-class":"draggable-ghost",animation:400,onEnd:$},{item:C(({element:e,index:t})=>[k("div",y,[k("div",{onClick:c=>V(e,t),class:E(["menu_item",{active:s.activeIndex===`${t}`}])},[r(a,{icon:"ep:fold",color:"black"}),j(U(e.name),1)],10,x),s.parentIndex===t&&e.children?(u(),o("div",I,[r(_(q),{modelValue:e.children,"onUpdate:modelValue":c=>e.children=c,"item-key":"id","ghost-class":"draggable-ghost",animation:400,onEnd:A},{item:C(({element:c,index:m})=>[k("div",g,[e.children?(u(),o("div",{key:0,class:E(["menu_subItem",{active:s.activeIndex===`${t}-${m}`}]),onClick:p=>w(c,t,m)},U(c.name),11,b)):h("",!0)])]),_:2},1032,["modelValue","onUpdate:modelValue"]),!e.children||e.children.length<5?(u(),o("div",{key:0,class:"menu_bottom menu_addicon",onClick:c=>((m,p)=>{const v=p.children.length,D={name:"\u5B50\u83DC\u5355\u540D\u79F0",reply:{type:"text",accountId:s.accountId}};p.children[v]=D,w(p.children[v],m,v)})(t,e)},[r(a,{icon:"ep:plus",class:"plus"})],8,f)):h("",!0)])):h("",!0)])]),_:1},8,["modelValue"]),_(d).length<3?(u(),o("div",{key:0,class:"menu_bottom menu_addicon",onClick:T},[r(a,{icon:"ep:plus",class:"plus"})])):h("",!0)],64)}}}),[["__scopeId","data-v-733d6a82"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-business/src/views/mp/menu/components/MenuPreviewer.vue"]])});export{Y as __tla,N as default};
|