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