import{m,e as f,u as _,d as x,a as w,t as c}from"./index-5df52834.js";const h=Vue.defineComponent({name:"ReTreeLine",props:{node:{type:Object,required:!0},data:{type:Array,default:()=>{}},treeData:{type:Array,default:()=>[]},indent:{type:Number,default:16},showLabelLine:{type:Boolean,default:!0}},setup(u,r){const{slots:a}=r;return{getScopedSlot:t=>{if(!t)return null;const o=t.split("||");let e=null;for(let n=0;n<o.length;n++){const s=o[n];e=(a||{})[s]}return e},getSlotValue:(t,o,e=null)=>m(t)?t(o)||e:t||e}},render(){const u=this.getScopedSlot("default"),r=this.getScopedSlot("node-label"),a=this.getScopedSlot("after-node-label"),i=u?this.getSlotValue(u,{node:this.node,data:this.data}):[r?this.getSlotValue(r,{node:this.node,data:this.data}):Vue.h("span",{class:"element-tree-node-label"},this.node.label),this.showLabelLine?Vue.h("span",{class:"element-tree-node-label-line"}):null,this.getSlotValue(a,{node:this.node,data:this.data})],l=[];let t=this.node;for(;t;){let e=t.parent;if(t.level===1&&!t.parent){if(!this.treeData||!Array.isArray(this.treeData))throw Error("if you using el-tree-v2 (Virtualized Tree) of element-plus,element-tree-line required data.");e={children:Array.isArray(this.treeData)?this.treeData.map(n=>({...n,key:n.id})):[],level:0,key:"node-0",parent:null}}if(e){const n=(e.children||e.childNodes).findIndex(s=>(s.key||s.id)===(t.key||t.id));l.unshift(n===(e.children||e.childNodes).length-1)}t=e}const o=[];for(let e=0;e<this.node.level;e++)o.push(Vue.h("span",{class:{"element-tree-node-line-ver":!0,"last-node-line":l[e]&&this.node.level-1!==e,"last-node-isLeaf-line":l[e]&&this.node.level-1===e},style:{left:this.indent*e+"px"}}));return Vue.h("span",{class:"element-tree-node-label-wrapper"},[i].concat(o).concat([Vue.h("span",{class:"element-tree-node-line-hor",style:{width:(this.node.isLeaf?24:8)+"px",left:(this.node.level-1)*this.indent+"px"}})]))}}),v=Vue.createElementVNode("div",{class:"card-header"},[Vue.createElementVNode("span",{class:"font-medium"}," 扩展elemenet-plus的树形组件包括虚拟树组件，支持连接线 ")],-1),y=Vue.createElementVNode("div",{class:"card-header"},[Vue.createElementVNode("span",{class:"font-medium"}," 普通树结构 ")],-1),N={class:"max-h-[550px] overflow-y-auto"},C={class:"text-sm"},S=Vue.createElementVNode("div",{class:"card-header"},[Vue.createElementVNode("span",{class:"font-medium"}," 虚拟树结构 ")],-1),b={class:"max-h-[550px] overflow-y-auto"},g={class:"text-sm"},L=Vue.defineComponent({name:"LineTree"}),E=Vue.defineComponent({...L,setup(u){const r=f(_().wholeMenus,!0),a=Vue.computed(()=>x(r)),i=w(a.value),l={value:"uniqueId",children:"children"};return(t,o)=>{const e=Vue.resolveComponent("el-tree"),n=Vue.resolveComponent("el-card"),s=Vue.resolveComponent("el-col"),V=Vue.resolveComponent("el-tree-v2"),p=Vue.resolveComponent("el-row");return Vue.openBlock(),Vue.createBlock(n,{shadow:"never"},{header:Vue.withCtx(()=>[v]),default:Vue.withCtx(()=>[Vue.createVNode(p,{gutter:24},{default:Vue.withCtx(()=>[Vue.createVNode(s,{xs:24,sm:24,md:12,lg:12,xl:12,class:"mb-[20px]"},{default:Vue.withCtx(()=>[Vue.createVNode(n,{shadow:"never"},{header:Vue.withCtx(()=>[y]),default:Vue.withCtx(()=>[Vue.createElementVNode("div",N,[Vue.createVNode(e,{data:Vue.unref(a),props:l,"show-checkbox":"","default-expand-all":"","node-key":"uniqueId",indent:30},{default:Vue.withCtx(({node:d})=>[Vue.createVNode(Vue.unref(h),{node:d,showLabelLine:!0},{"node-label":Vue.withCtx(()=>[Vue.createElementVNode("span",C,Vue.toDisplayString(Vue.unref(c)(d.data.meta.title)),1)]),_:2},1032,["node"])]),_:1},8,["data"])])]),_:1})]),_:1}),Vue.createVNode(s,{xs:24,sm:24,md:12,lg:12,xl:12},{default:Vue.withCtx(()=>[Vue.createVNode(n,{shadow:"never"},{header:Vue.withCtx(()=>[S]),default:Vue.withCtx(()=>[Vue.createElementVNode("div",b,[Vue.createVNode(V,{data:Vue.unref(a),props:l,"show-checkbox":"",height:550,"default-expanded-keys":Vue.unref(i)},{default:Vue.withCtx(({node:d})=>[Vue.createVNode(Vue.unref(h),{node:d,treeData:Vue.unref(a),showLabelLine:!0,indent:30},{"node-label":Vue.withCtx(()=>[Vue.createElementVNode("span",g,Vue.toDisplayString(Vue.unref(c)(d.data.meta.title)),1)]),_:2},1032,["node","treeData"])]),_:1},8,["data","default-expanded-keys"])])]),_:1})]),_:1})]),_:1})]),_:1})}}});export{E as default};
