import{_ as N}from"./index.9d5559d9.js";import{t as S}from"./data.ec134722.js";import{aP as v,a as A,r as F,aQ as c,o as K,aR as g,p as u,i as p,j as o,q as l,x as $,k as G}from"./index.0d073eaa.js";import{P as T}from"./index.566277e5.js";import"./fromPairs.84aabb58.js";import"./index.e8b360cf.js";import"./eagerComputed.156e81ff.js";import"./useContextMenu.cd4142a5.js";import"./index.0fb15725.js";import"./get.49a42f2e.js";import"./index.e9a84cba.js";import"./index.0972fd96.js";import"./useSize.bb4e5ce5.js";import"./useWindowSizeFn.ef20ece8.js";import"./useContentViewHeight.01b9d1c6.js";import"./ArrowLeftOutlined.90d2e05e.js";import"./index.8680e4c4.js";import"./transButton.8c1b1a4f.js";const b=A({components:{BasicTree:N,PageWrapper:T},setup(){const n=F(null),{createMessage:e}=$();function a(){const t=G(n);if(!t)throw new Error("tree is null!");return t}function f(t){a().filterByLevel(t)}function m(){a().setCheckedKeys(["0-0"])}function k(){const t=a().getCheckedKeys();e.success(JSON.stringify(t))}function s(){a().setSelectedKeys(["0-0"])}function i(){const t=a().getSelectedKeys();e.success(JSON.stringify(t))}function r(){const t=a().getSelectedKeys(),C=a().getSelectedNode(t[0]);e.success(C!==null?JSON.stringify(C):null)}function d(){a().setExpandedKeys(["0-0"])}function B(){const t=a().getExpandedKeys();e.success(JSON.stringify(t))}function _(t){a().checkAll(t)}function y(t){a().expandAll(t)}function h(t=null){a().insertNodeByKey({parentKey:t,node:{title:"\u65B0\u589E\u8282\u70B9",key:"2-2-2"},push:"push"})}function E(t){a().deleteNodeByKey(t)}function D(t){a().updateNodeByKey(t,{title:"parent2-new"})}return{treeData:S,treeRef:n,handleLevel:f,handleSetCheckData:m,handleGetCheckData:k,handleSetSelectData:s,handleGetSelectData:i,handleSetExpandData:d,handleGetExpandData:B,handleGetSelectNode:r,appendNodeByKey:h,deleteNodeByKey:E,updateNodeByKey:D,checkAll:_,expandAll:y}}}),P={class:"mb-4"},w=l(" \u5C55\u5F00\u5168\u90E8 "),J=l(" \u6298\u53E0\u5168\u90E8 "),L=l(" \u5168\u9009 "),O=l(" \u5168\u4E0D\u9009 "),R=l(" \u663E\u793A\u5230\u7B2C2\u7EA7 "),V=l(" \u663E\u793A\u5230\u7B2C1\u7EA7 "),W={class:"mb-4"},M=l(" \u8BBE\u7F6E\u52FE\u9009\u6570\u636E "),j=l(" \u83B7\u53D6\u52FE\u9009\u6570\u636E "),q=l(" \u8BBE\u7F6E\u9009\u4E2D\u6570\u636E "),Q=l(" \u83B7\u53D6\u9009\u4E2D\u6570\u636E "),z=l(" \u83B7\u53D6\u9009\u4E2D\u8282\u70B9 "),H=l(" \u8BBE\u7F6E\u5C55\u5F00\u6570\u636E "),I=l(" \u83B7\u53D6\u5C55\u5F00\u6570\u636E "),U={class:"mb-4"},X=l(" \u6DFB\u52A0\u6839\u8282\u70B9 "),Y=l(" \u6DFB\u52A0\u5728parent3\u5185\u6DFB\u52A0\u8282\u70B9 "),Z=l(" \u5220\u9664parent3\u8282\u70B9 "),x=l(" \u66F4\u65B0parent2\u8282\u70B9 ");function ee(n,e,a,f,m,k){const s=c("a-button"),i=c("BasicTree"),r=c("PageWrapper");return K(),g(r,{title:"Tree\u51FD\u6570\u64CD\u4F5C\u793A\u4F8B",contentBackground:"",contentClass:"p-4"},{default:u(()=>[p("div",P,[o(s,{onClick:e[0]||(e[0]=d=>n.expandAll(!0)),class:"mr-2"},{default:u(()=>[w]),_:1}),o(s,{onClick:e[1]||(e[1]=d=>n.expandAll(!1)),class:"mr-2"},{default:u(()=>[J]),_:1}),o(s,{onClick:e[2]||(e[2]=d=>n.checkAll(!0)),class:"mr-2"},{default:u(()=>[L]),_:1}),o(s,{onClick:e[3]||(e[3]=d=>n.checkAll(!1)),class:"mr-2"},{default:u(()=>[O]),_:1}),o(s,{onClick:e[4]||(e[4]=d=>n.handleLevel(2)),class:"mr-2"},{default:u(()=>[R]),_:1}),o(s,{onClick:e[5]||(e[5]=d=>n.handleLevel(1)),class:"mr-2"},{default:u(()=>[V]),_:1})]),p("div",W,[o(s,{onClick:n.handleSetCheckData,class:"mr-2"},{default:u(()=>[M]),_:1},8,["onClick"]),o(s,{onClick:n.handleGetCheckData,class:"mr-2"},{default:u(()=>[j]),_:1},8,["onClick"]),o(s,{onClick:n.handleSetSelectData,class:"mr-2"},{default:u(()=>[q]),_:1},8,["onClick"]),o(s,{onClick:n.handleGetSelectData,class:"mr-2"},{default:u(()=>[Q]),_:1},8,["onClick"]),o(s,{onClick:n.handleGetSelectNode,class:"mr-2"},{default:u(()=>[z]),_:1},8,["onClick"]),o(s,{onClick:n.handleSetExpandData,class:"mr-2"},{default:u(()=>[H]),_:1},8,["onClick"]),o(s,{onClick:n.handleGetExpandData,class:"mr-2"},{default:u(()=>[I]),_:1},8,["onClick"])]),p("div",U,[o(s,{onClick:e[6]||(e[6]=d=>n.appendNodeByKey(null)),class:"mr-2"},{default:u(()=>[X]),_:1}),o(s,{onClick:e[7]||(e[7]=d=>n.appendNodeByKey("2-2")),class:"mr-2"},{default:u(()=>[Y]),_:1}),o(s,{onClick:e[8]||(e[8]=d=>n.deleteNodeByKey("2-2")),class:"mr-2"},{default:u(()=>[Z]),_:1}),o(s,{onClick:e[9]||(e[9]=d=>n.updateNodeByKey("1-1")),class:"mr-2"},{default:u(()=>[x]),_:1})]),o(i,{treeData:n.treeData,title:"\u51FD\u6570\u64CD\u4F5C",ref:"treeRef",checkable:!0},null,8,["treeData"])]),_:1})}var ye=v(b,[["render",ee]]);export{ye as default};
