Files
aiot-platform-ui/apps/web-antd/dist/js/previewer-dqq0GIXj.js
lzh 19d36d1ffb
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 8s
chore: build and deploy web-antd
2026-03-09 13:05:46 +08:00

2 lines
3.2 KiB
JavaScript

import{an as p,ac as N}from"./bootstrap-CRjSNGHY.js";import{d as g}from"./vuedraggable.umd-C80eNCNV.js";import{m as $,aa as j,ad as u,b2 as b,j as a,ac as x,bJ as v,ae as m,aR as _,ai as D,u as s,bp as k,I as M}from"../jse/index-index-CMeVxoEG.js";import"./index-Bh-Hd8Ie.js";const U={class:"relative float-left box-border block w-[85.5px] cursor-pointer border border-[#ebedee] bg-white text-center"},B=["onClick"],P={key:0,class:"absolute bottom-[45px] left-0 w-[85.5px]"},S={class:"relative float-left box-border block w-[85.5px] cursor-pointer border border-[#ebedee] bg-white text-center"},T=["onClick"],L=["onClick"],O=$({__name:"previewer",props:{accountId:{},activeIndex:{},modelValue:{},parentIndex:{}},emits:["update:modelValue","menuClicked","submenuClicked"],setup(C,{emit:I}){const c=C,r=I,d=j({get:()=>c.modelValue,set:o=>r("update:modelValue",o)});function V(){const o=d.value.length,e={name:"菜单名称",children:[],reply:{type:"text",accountId:c.accountId}};d.value[o]=e,h(e,o-1)}function w(o,e){e.children[e.children.length]={name:"子菜单名称",reply:{type:"text",accountId:c.accountId}},f(e.children[e.children.length-1],o,e.children.length-1)}function h(o,e){r("menuClicked",o,e)}function f(o,e,t){r("submenuClicked",o,e,t)}function y({oldIndex:o,newIndex:e}){if(c.activeIndex==="__MENU_NOT_SELECTED__")return;const t=Array.from({length:d.value.length}).fill(!1);t[c.parentIndex]=!0;const[n]=t.splice(o,1);t.splice(e,0,n!=null?n:!1);const l=t.indexOf(!0),i=d.value[l];i&&l!==-1&&r("menuClicked",i,l)}function E({newIndex:o}){var l;const e=c.parentIndex,t=o,n=(l=d.value[e])==null?void 0:l.children;if(n&&(n==null?void 0:n.length)>0){const i=n[t];i&&r("submenuClicked",i,e,t)}}return(o,e)=>(b(),u(M,null,[a(s(g),{modelValue:d.value,"onUpdate:modelValue":e[0]||(e[0]=t=>d.value=t),"item-key":"id","ghost-class":"draggable-ghost",animation:400,onEnd:y},{item:v(({element:t,index:n})=>[m("div",U,[m("div",{onClick:l=>h(t,n),class:_(["box-border flex h-[44px] w-full items-center justify-center leading-[44px]",{"border border-[#2bb673]":c.activeIndex===`${n}`}])},[a(s(p),{icon:"lucide:panel-right-open",color:"black"}),D(" "+k(t.name),1)],10,B),c.parentIndex===n&&t.children?(b(),u("div",P,[a(s(g),{modelValue:t.children,"onUpdate:modelValue":l=>t.children=l,"item-key":"id","ghost-class":"draggable-ghost",animation:400,onEnd:E},{item:v(({element:l,index:i})=>[m("div",S,[m("div",{class:_(["box-border h-[44px] text-center leading-[44px]",{"border border-[#2bb673]":c.activeIndex===`${n}-${i}`}]),onClick:z=>f(l,n,i)},k(l.name),11,T)])]),_:2},1032,["modelValue","onUpdate:modelValue"]),!t.children||t.children.length<5?(b(),u("div",{key:0,class:"relative float-left box-border block flex h-[46px] w-[85.5px] cursor-pointer items-center justify-center border border-[#ebedee] bg-white text-center leading-[46px]",onClick:l=>w(n,t)},[a(s(p),{icon:"lucide:plus",class:"text-[#2bb673]"})],8,L)):x("",!0)])):x("",!0)])]),_:1},8,["modelValue"]),d.value.length<3?(b(),u("div",{key:0,class:"relative float-left box-border block flex h-[46px] w-[85.5px] cursor-pointer items-center justify-center border border-[#ebedee] bg-white text-center leading-[46px]",onClick:V},[a(s(p),{icon:"lucide:plus",class:"text-[#2bb673]"})])):x("",!0)],64))}}),q=N(O,[["__scopeId","data-v-dc646cec"]]);export{q as default};