import{$ as e,a2 as t,o as s,X as d,z as i,A as o,t as r,p as h,w as n,v as a,H as l,Q as c,x as u,y as p,R as f,B as y,D as k,F as N,E as C,I as g,q as x,a5 as m,at as w,ag as b}from"./index-P0fyQ2Em.js";import{_ as I}from"./ly-tree.DZ8MU_HY.js";import{r as K}from"./uni-app.es.DOtS5Ldl.js";import{_ as v}from"./u-popup.CXrq2y3n.js";import{_ as E}from"./u-icon.wXcRZHbn.js";import{_}from"./_plugin-vue_export-helper.BCo6x5W8.js";const L="$treeNodeId",A=function(e,t){t&&!t[L]&&Object.defineProperty(t,L,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},D=function(e,t){return t?e?t[e]:t[L]:null},S=function(e){for(let t=1,s=arguments.length;t-1?t[s+1]:null,this.previousSibling=s>0?t[s-1]:null}else e={level:0};this.level=e.level+1}}_handleProps(){const e=this.store().props;if(this.store().showNodeIcon&&(e&&void 0!==e.icon?this.icon=O(this,"icon"):console.warn('请配置props属性中的"icon"字段')),this.store().registerNode(this),e&&void 0!==e.isLeaf){const e=O(this,"isLeaf");"boolean"==typeof e&&(this.isLeafByUser=e)}}_handleExpand(){if(!0!==this.store().lazy&&this.data?(this.setData(this.data),this.store().defaultExpandAll&&(this.expanded=!0)):this.level>0&&this.store().lazy&&this.store().defaultExpandAll&&this.expand(),Array.isArray(this.data)||A(this,this.data),!this.data)return;const e=this.store().defaultExpandedKeys;this.store().key&&e&&-1!==e.indexOf(this.key)&&this.expand(null,this.store().autoExpandparent)}_handleCurrent(){this.store().key&&void 0!==this.store().currentNodeKey&&this.key===this.store().currentNodeKey&&(this.store().currentNode=this,this.store().currentNode.isCurrent=!0)}destroyStore(){}setData(e){let t;Array.isArray(e)||A(this,e),this.data=e,this.childNodesId=[],t=0===this.level&&Array.isArray(this.data)?this.data:O(this,"children")||[];for(let s=0,d=t.length;s-1&&t.splice(s,1);const d=this.childNodesId.indexOf(e.key);d>-1&&(this.store()&&this.store().deregisterNode(e),e.parentId=null,this.childNodesId.splice(d,1)),this.updateLeafState()}removeChildByData(e){let t=null;for(let s=0;s{t.push(this.store().nodesMap[e])})),t}expand(e,t){const s=()=>{if(t){let e=this.getParent(this.parentId);for(;e&&e.level>0;)e.expanded=!0,e=this.getParent(e.parentId)}this.expanded=!0,e&&e()};this.shouldLoadData()?this.loadData((function(e){Array.isArray(e)&&(this.checked?this.setChecked(!0,!0):this.store().checkStrictly||B(this),s())})):s()}doCreateChildren(e,t={}){e.forEach((e=>{this.insertChild(S({data:e},t),void 0,!0)}))}collapse(){this.expanded=!1}shouldLoadData(){return!0===this.store().lazy&&this.store().load&&!this.loaded}updateLeafState(){if(!0===this.store().lazy&&!0!==this.loaded&&void 0!==this.isLeafByUser)return void(this.isLeaf=this.isLeafByUser);const e=this.childNodesId;!this.store().lazy||!0===this.store().lazy&&!0===this.loaded?this.isLeaf=!e||0===e.length:this.isLeaf=!1}setChecked(e,t,s,d){if(this.indeterminate="half"===e,this.checked=!0===e,this.checked&&this.store().expandOnCheckNode&&this.expand(null,!0),this.store().checkStrictly)return;if(this.store().showRadio)return;if(!this.shouldLoadData()||this.store().checkDescendants){let s=this.getChildNodes(this.childNodesId),{all:i,allWithoutDisable:o}=P(s);this.isLeaf||i||!o||(this.checked=!1,e=!1);const r=()=>{if(t){let s=this.getChildNodes(this.childNodesId);for(let r=0,h=s.length;r{r(),B(this)}),{checked:!1!==e});r()}if(!this.parentId)return;let i=this.getParent(this.parentId);i&&0===i.level||s||B(i)}setRadioChecked(e){this.store()._getAllNodes().sort(((e,t)=>t.level-e.level)).forEach((e=>e.setChecked(!1,!1))),this.checked=!0===e}getChildren(e=!1){if(0===this.level)return this.data;const t=this.data;if(!t)return null;const s=this.store().props;let d="children";return s&&(d=s.children||"children"),void 0===t[d]&&(t[d]=null),e&&!t[d]&&(t[d]=[]),t[d]}updateChildren(){let e=this.getChildNodes(this.childNodesId);const t=this.getChildren()||[],s=e.map((e=>e.data)),d={},i=[];t.forEach(((e,t)=>{const o=e[L];!!o&&function(e,t){for(let s=0;s!==e.length;++s)if(t(e[s]))return s;return-1}(s,(e=>e[L]===o))>=0?d[o]={index:t,data:e}:i.push({index:t,data:e})})),this.store().lazy||s.forEach((e=>{d[e[L]]||this.removeChildByData(e)})),i.forEach((({index:e,data:t})=>{this.insertChild({data:t},e)})),this.updateLeafState()}loadData(e,t={}){if(!0!==this.store().lazy||!this.store().load||this.loaded||this.loading&&!Object.keys(t).length)e&&e.call(this);else{this.loading=!0;const s=s=>{this.loaded=!0,this.loading=!1,this.childNodesId=[],this.doCreateChildren(s,t),this.updateLeafState(),e&&e.call(this,s)};this.store().load(this,s)}}}class j{constructor(t){if(this.ready=!1,this.currentNode=null,this.currentNodeKey=null,Object.assign(this,t),!this.key)throw new Error("[Tree] nodeKey is required");if(this.nodesMap={},this.root=new $({data:this.data,store:this}),this.lazy&&this.load){(0,this.load)(this.root,(t=>{this.root.doCreateChildren(t),this._initDefaultCheckedNodes(),this.ready=!0,e("updateKey")}))}else this._initDefaultCheckedNodes(),this.ready=!0}getReady(){return this.ready}filter(e,t){const s=this.filterNodeMethod,d=this.lazy,i=this,o=function(r){const h=r.root?r.root.getChildNodes(r.root.childNodesId):r.getChildNodes(r.childNodesId);if(h.forEach((d=>{if(t&&"object"==typeof t){if(!i.getNodePath(d.data).some((e=>e[i.key]===t[i.key])))return d.visible=!1,void o(d)}if(i.childVisibleForFilterNode){let t=d.getParent(d.parentId);d.visible=s.call(d,e,d.data,d)||t&&t.visible}else d.visible=s.call(d,e,d.data,d);o(d)})),!r.visible&&h.length){let e=!0;e=!h.some((e=>e.visible)),r.root?r.root.visible=!1===e:r.visible=!1===e}e&&(!r.visible||r.isLeaf||d||r.expand())};o(this)}setData(e){e!==this.root.data?(this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(e){if(e instanceof $)return e;const t="object"!=typeof e?e:D(this.key,e);return t&&this.nodesMap[t]||null}insertBefore(e,t){const s=this.getNode(t);s.getParent(s.parentId).insertBefore({data:e},s)}insertAfter(e,t){const s=this.getNode(t);s.getParent(s.parentId).insertAfter({data:e},s)}remove(e){const t=this.getNode(e);if(t&&null!==t.parentId){let e=t.getParent(t.parentId);t===this.currentNode&&(this.currentNode=null),e.removeChild(t)}}append(e,t){const s=t?this.getNode(t):this.root;s&&s.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],t=this.nodesMap;let s=[],d=[];for(let i in t){(O(t[i],"checked")||!1)&&s.push(i)}d=Array.from(new Set([...e,...s])),d.forEach((e=>{const s=t[e];s&&s.setChecked(!0,!this.checkStrictly)}))}_initDefaultCheckedNode(e){-1!==(this.defaultCheckedKeys||[]).indexOf(e.key)&&e.setChecked(!0,!this.checkStrictly)}toggleExpendAll(e){this._getAllNodes().forEach((t=>{const s=this.getNode(t.key);s&&(e?s.expand():s.collapse())}))}setCheckAll(e){this._getAllNodes().forEach((t=>{t.setChecked(e,!1)}))}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){if(!this.key||!e||!e.data)return;void 0!==e.key&&(this.nodesMap[e.key]=e)}deregisterNode(e){if(!this.key||!e||!e.data)return;e.getChildNodes(e.childNodesId).forEach((e=>{this.deregisterNode(e)})),delete this.nodesMap[e.key]}getNodePath(e){if(!this.key)throw new Error("[Tree] nodeKey is required in getNodePath");const t=this.getNode(e);if(!t)return[];const s=[t.data];let d=t.getParent(t.parentId);for(;d&&d!==this.root;)s.push(d.data),d=d.getParent(d.parentId);return s.reverse()}getCheckedNodes(e=!1,t=!1){const s=[],d=function(i){(i.root?i.root.getChildNodes(i.root.childNodesId):i.getChildNodes(i.childNodesId)).forEach((i=>{(i.checked||t&&i.indeterminate)&&(!e||e&&i.isLeaf)&&s.push(i.data),d(i)}))};return d(this),s}getCheckedKeys(e=!1,t=!1){return this.getCheckedNodes(e,t).map((e=>(e||{})[this.key]))}getHalfCheckedNodes(){const e=[],t=function(s){(s.root?s.root.getChildNodes(s.root.childNodesId):s.getChildNodes(s.childNodesId)).forEach((s=>{s.indeterminate&&e.push(s.data),t(s)}))};return t(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map((e=>(e||{})[this.key]))}_getAllNodes(){const e=[],t=this.nodesMap;for(let s in t)t.hasOwnProperty(s)&&e.push(t[s]);return e}updateChildren(e,t){const s=this.nodesMap[e];if(!s)return;const d=s.getChildNodes(s.childNodesId);for(let i=d.length-1;i>=0;i--){const e=d[i];this.remove(e.data)}for(let i=0,o=t.length;it.level-e.level)),i=Object.create(null),o=Object.keys(s);d.forEach((e=>e.setChecked(!1,!1)));for(let r=0,h=d.length;r-1)){s.checked&&!i[h]&&s.setChecked(!1,!1);continue}let n=s.getParent(s.parentId);for(;n&&n.level>0;)i[n.data[e]]=!0,n=n.getParent(n.parentId);if(s.isLeaf||this.checkStrictly)s.setChecked(!0,!1);else if(s.setChecked(!0,!0),t){s.setChecked(!1,!1);const e=function(t){t.getChildNodes(t.childNodesId).forEach((t=>{t.isLeaf||t.setChecked(!1,!1),e(t)}))};e(s)}}}setCheckedNodes(e,t=!1){const s=this.key,d={};e.forEach((e=>{d[(e||{})[s]]=!0})),this._setCheckedKeys(s,t,d)}setCheckedKeys(e,t=!1){this.defaultCheckedKeys=e;const s=this.key,d={};e.forEach((e=>{d[e]=!0})),this._setCheckedKeys(s,t,d)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach((e=>{const t=this.getNode(e);t&&t.expand(null,this.autoExpandParent)}))}setChecked(e,t,s){const d=this.getNode(e);d&&d.setChecked(!!t,s)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const t=this.currentNode;t&&(t.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0,this.expandCurrentNodeParent&&this.currentNode.expand(null,!0)}setUserCurrentNode(e){const t=e[this.key],s=this.nodesMap[t];this.setCurrentNode(s)}setCurrentNodeKey(e){if(null==e)return this.currentNode&&(this.currentNode.isCurrent=!1),void(this.currentNode=null);const t=this.getNode(e);t&&this.setCurrentNode(t)}}const M=_({components:{LyTree:_({name:"LyTree",componentName:"LyTree",components:{LyTreeNode:_({name:"LyTreeNode",componentName:"LyTreeNode",props:{nodeId:[Number,String],renderAfterExpand:{type:Boolean,default:!0},checkOnlyLeaf:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},showRadio:{type:Boolean,default:!1},indent:Number,iconClass:String},data:()=>({iconName:"arrow-down",node:{indeterminate:!1,checked:!1,expanded:!1},expanded:!1,childNodeRendered:!1,oldChecked:null,oldIndeterminate:null,highlightCurrent:!1}),inject:["tree"],computed:{checkboxVisible(){return this.checkOnlyLeaf?this.showCheckbox&&this.node.isLeaf:this.showCheckbox},radioVisible(){return this.checkOnlyLeaf?this.showRadio&&this.node.isLeaf:this.showRadio}},watch:{"node.indeterminate"(e){this.handleSelectChange(this.node.checked,e)},"node.checked"(e){this.handleSelectChange(e,this.node.indeterminate)},"node.expanded"(e){this.$nextTick((()=>this.expanded=e)),e&&(this.childNodeRendered=!0)}},methods:{getNodeKey(e){let t=this.tree.store.root.getChildNodes([e])[0];return D(this.tree.nodeKey,t.data)},handleSelectChange(e,t){if(this.oldChecked!==e&&this.oldIndeterminate!==t){if(this.checkOnlyLeaf&&!this.node.isLeaf)return;if(this.checkboxVisible){const s=this.tree.store._getAllNodes();this.tree.$emit("check-change",{checked:e,indeterminate:t,node:this.node,data:this.node.data,checkedall:s.every((e=>e.checked))})}else this.tree.$emit("radio-change",{checked:e,node:this.node,data:this.node.data,checkedall:!1})}!this.expanded&&this.tree.expandOnCheckNode&&e&&this.handleExpandIconClick(),this.oldChecked=e,this.indeterminate=t},handleClick(){this.tree.store.setCurrentNode(this.node),this.tree.$emit("current-change",{node:this.node,data:this.tree.store.currentNode?this.tree.store.currentNode.data:null,currentNode:this.tree.store.currentNode}),this.tree.currentNode=this.node,this.tree.expandOnClickNode&&this.handleExpandIconClick(),this.tree.checkOnClickNode&&!this.node.disabled&&(this.checkboxVisible||this.radioVisible)&&this.handleCheckChange(!this.node.checked),this.tree.$emit("node-click",this.node)},handleExpandIconClick(){this.node.isLeaf||(this.expanded?(this.tree.$emit("node-collapse",this.node),this.node.collapse(),this.iconName="arrow-down"):(this.node.expand(),this.iconName="arrow-up",this.tree.accordion))},handleCheckChange(t){this.node.disabled||(this.checkboxVisible?this.node.setChecked(t,!(this.tree.checkStrictly||this.checkOnlyLeaf)):this.node.setRadioChecked(t),this.$nextTick((()=>{this.tree.$emit("check",{node:this.node,data:this.node.data,checkedNodes:this.tree.store.getCheckedNodes(),checkedKeys:this.tree.store.getCheckedKeys(),halfCheckedNodes:this.tree.store.getHalfCheckedNodes(),halfCheckedKeys:this.tree.store.getHalfCheckedKeys()})})),e("updateKey"))},handleImageError(){this.node.icon=this.tree.defaultNodeIcon}},created(){if(!this.tree)throw new Error("Can not find node's tree.");this.node=this.tree.store.nodesMap[this.nodeId],this.highlightCurrent=this.tree.highlightCurrent,this.node.expanded&&(this.expanded=!0,this.childNodeRendered=!0);const e=(this.tree.props||{}).children||"children";this.$watch(`node.data.${e}`,(()=>{this.node.updateChildren()})),this.tree.accordion&&t(`${this.tree.elId}-tree-node-expand`,(e=>{this.node.id!==e.id&&this.node.level===e.level&&this.node.collapse()}))},beforeDestroy(){this.$parent=null}},[["render",function(e,t,m,w,b,I){const v=g,_=x,L=K(s("u-icon"),E),A=d("ly-tree-node",!0);return i((r(),h(_,{ref:"node",name:"LyTreeNode",class:l(["ly-tree-node",{"is-expanded":b.expanded,"is-hidden":!b.node.visible,"is-checked":!b.node.disabled&&b.node.checked}]),role:"treeitem",onClick:f(I.handleClick,["stop"])},{default:n((()=>[a(_,{class:l(["ly-tree-node__content",{"is-current":b.node.isCurrent&&b.highlightCurrent}]),style:c({"padding-left":(b.node.level-1)*m.indent+"px"})},{default:n((()=>[a(_,{class:""},{default:n((()=>[a(v,{class:l([b.node.data.icon,"u-m-r-12"])},null,8,["class"]),a(v,{class:"ly-tree-node__label u-line-1"},{default:n((()=>[u(p(b.node.label),1)])),_:1})])),_:1}),a(_,{class:"",onClick:f(I.handleExpandIconClick,["stop"])},{default:n((()=>[b.node.data.hasChildren?(r(),h(L,{key:0,name:b.iconName},null,8,["name"])):y("",!0)])),_:1},8,["onClick"])])),_:1},8,["class","style"]),!m.renderAfterExpand||b.childNodeRendered?i((r(),h(_,{key:0,class:"ly-tree-node__children",role:"group"},{default:n((()=>[(r(!0),k(N,null,C(b.node.childNodesId,(e=>(r(),h(A,{nodeId:e,"render-after-expand":m.renderAfterExpand,"show-checkbox":m.showCheckbox,"show-radio":m.showRadio,"check-only-leaf":m.checkOnlyLeaf,key:I.getNodeKey(e),indent:m.indent,"icon-class":m.iconClass},null,8,["nodeId","render-after-expand","show-checkbox","show-radio","check-only-leaf","indent","icon-class"])))),128))])),_:1},512)),[[o,b.expanded]]):y("",!0)])),_:1},8,["class","onClick"])),[[o,b.node.visible]])}],["__scopeId","data-v-3822c8b2"]])},data:()=>({updateKey:(new Date).getTime(),elId:`ly_${Math.ceil(1e6*Math.random()).toString(36)}`,visible:!0,store:{ready:!1},currentNode:null,childNodesId:[],mathKey:1}),provide(){return{tree:this}},props:{treeData:Array,ready:{type:Boolean,default:!0},emptyText:{type:String,default:"暂无数据"},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:{type:Boolean,default:!0},toggleExpendAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},expandOnCheckNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,expandCurrentNodeParent:Boolean,currentNodeKey:[String,Number],checkOnlyLeaf:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},showRadio:{type:Boolean,default:!1},props:{type:[Object,Function],default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,childVisibleForFilterNode:{type:Boolean,default:!1},accordion:Boolean,indent:{type:Number,default:18},iconClass:String,showNodeIcon:{type:Boolean,default:!1},defaultNodeIcon:{type:String,default:""},isInjectParentInNode:{type:Boolean,default:!1}},computed:{isEmpty(){if(this.store.root){const e=this.store.root.getChildNodes(this.childNodesId);return!e||0===e.length||e.every((({visible:e})=>!e))}return!0},showLoading(){return this.mathKey,!(this.store.getReady()&&this.ready)}},watch:{toggleExpendAll(e){this.store.toggleExpendAll(e)},defaultCheckedKeys(e){this.store.setDefaultCheckedKey(e)},defaultExpandedKeys(e){this.store.defaultExpandedKeys=e,this.store.setDefaultExpandedKeys(e)},checkStrictly(e){this.store.checkStrictly=e||this.checkOnlyLeaf},"store.root.childNodesId"(e){this.childNodesId=e},"store.root.visible"(e){this.visible=e},childNodesId(){this.$nextTick((()=>{this.$emit("ly-tree-render-completed")}))},treeData:{handler(e){this.updateKey=(new Date).getTime(),this.store.setData(e)},deep:!0}},methods:{filter(e,t){if(!this.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");this.store.filter(e,t),this.handleUpdateKey()},handleUpdateKey(){this.updateKey=(new Date).getTime()},getNodeKey(e){let t=this.store.root.getChildNodes([e])[0];return D(this.nodeKey,t.data)},getNodePath(e){return this.store.getNodePath(e)},getCheckedNodes(e,t){return this.store.getCheckedNodes(e,t)},getCheckedKeys(e,t){return this.store.getCheckedKeys(e,t)},getCurrentNode(){const e=this.store.getCurrentNode();return e?e.data:null},getCurrentKey(){const e=this.getCurrentNode();return e?e[this.nodeKey]:null},setCheckAll(e=!0){if(this.showRadio)throw new Error('You set the "show-radio" property, so you cannot select all nodes');this.showCheckbox||console.warn('You have not set the property "show-checkbox". Please check your settings'),this.store.setCheckAll(e)},setCheckedNodes(e,t){this.store.setCheckedNodes(e,t)},setCheckedKeys(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");this.store.setCheckedKeys(e,t),this.handleUpdateKey()},setChecked(e,t,s){this.store.setChecked(e,t,s)},getHalfCheckedNodes(){return this.store.getHalfCheckedNodes()},getHalfCheckedKeys(){return this.store.getHalfCheckedKeys()},setCurrentNode(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");this.store.setUserCurrentNode(e)},setCurrentKey(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");this.store.setCurrentNodeKey(e)},getNode(e){return this.store.getNode(e)},remove(e){this.store.remove(e)},append(e,t){this.store.append(e,t)},insertBefore(e,t){this.store.insertBefore(e,t)},insertAfter(e,t){this.store.insertAfter(e,t)},updateKeyChildren(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");this.store.updateChildren(e,t)}},created(){this.isTree=!0;let e=this.props;if("function"==typeof this.props&&(e=this.props()),"object"!=typeof e)throw new Error("props must be of object type.");this.store=new j({key:this.nodeKey,data:this.treeData,lazy:this.lazy,props:e,load:this.load,showCheckbox:this.showCheckbox,showRadio:this.showRadio,currentNodeKey:this.currentNodeKey,checkStrictly:this.checkStrictly||this.checkOnlyLeaf,checkDescendants:this.checkDescendants,expandOnCheckNode:this.expandOnCheckNode,defaultCheckedKeys:this.defaultCheckedKeys,defaultExpandedKeys:this.defaultExpandedKeys,expandCurrentNodeParent:this.expandCurrentNodeParent,autoExpandParent:this.autoExpandParent,defaultExpandAll:this.defaultExpandAll,filterNodeMethod:this.filterNodeMethod,childVisibleForFilterNode:this.childVisibleForFilterNode,showNodeIcon:this.showNodeIcon,isInjectParentInNode:this.isInjectParentInNode}),this.childNodesId=this.store.root.childNodesId,t("updateKey",(()=>{this.handleUpdateKey(),this.mathKey++}))},beforeDestroy(){this.accordion&&m(`${this.elId}-tree-node-expand`),m("updateKey")}},[["render",function(e,t,s,i,o,c){const f=x,g=d("ly-tree-node");return r(),h(f,null,{default:n((()=>[c.showLoading?(r(),h(f,{key:0,class:"ly-loader ly-flex-center"},{default:n((()=>[a(f,{class:"ly-loader-inner"},{default:n((()=>[u("加载中...")])),_:1})])),_:1})):(r(),k(N,{key:1},[c.isEmpty||!o.visible?(r(),h(f,{key:0,class:"ly-empty"},{default:n((()=>[u(p(s.emptyText),1)])),_:1})):y("",!0),(r(),h(f,{key:o.updateKey,class:l(["ly-tree",{"is-empty":c.isEmpty||!o.visible}]),role:"tree",name:"LyTreeExpand"},{default:n((()=>[(r(!0),k(N,null,C(o.childNodesId,(e=>(r(),h(g,{nodeId:e,"render-after-expand":s.renderAfterExpand,"show-checkbox":s.showCheckbox,"show-radio":s.showRadio,"check-only-leaf":s.checkOnlyLeaf,key:c.getNodeKey(e),indent:s.indent,"icon-class":s.iconClass,updateKey:"hanldeUpdateKey"},null,8,["nodeId","render-after-expand","show-checkbox","show-radio","check-only-leaf","indent","icon-class"])))),128))])),_:1},8,["class"]))],64))])),_:1})}],["__scopeId","data-v-fcf6e0b2"]])},props:{type:{type:String,default:""},show:{type:Boolean,default:!1},treeData:Array,mode:{type:String,default:"top"},height:{type:String,default:"600rpx"},width:{type:String,default:"400rpx"}},data:()=>({statusBarHeight:w().statusBarHeight+"px",showApply:!1,isReady:!1,prop:{label:"fullName",isLeaf:"isLeaf",value:"id",icon:"avatar"},customStyle:{"margin-top":"80rpx"}}),watch:{show:{handler(e){this.showApply=e},immediate:!0}},created(){this.isReady=!0},computed:{baseURL(){return this.define.baseURL}},methods:{handleNodeClick(e){1!=e.data.type&&this.$emit("change",e.data)},close(){this.$emit("close")}}},[["render",function(e,t,d,i,o,l){const c=K(s("ly-tree"),I),u=x,p=K(s("u-popup"),v);return r(),h(p,{modelValue:o.showApply,"onUpdate:modelValue":t[0]||(t[0]=e=>o.showApply=e),mode:d.mode,height:d.height,onClose:l.close,width:d.width,"custom-style":o.customStyle},{default:n((()=>[b(e.$slots,"default",{},void 0,!0),a(u,{class:"tree-main"},{default:n((()=>[a(c,{props:o.prop,"node-key":o.prop.value,"tree-data":d.treeData,"show-node-icon":"",defaultExpandAll:!0,ref:"tree",onNodeClick:l.handleNodeClick,"highlight-current":!0},null,8,["props","node-key","tree-data","onNodeClick"])])),_:1})])),_:3},8,["modelValue","mode","height","onClose","width","custom-style"])}],["__scopeId","data-v-e4511515"]]);export{M as t};