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