import{d as A,f as F,u as K,U as p,a2 as N,ad as S,af as l,a4 as f,k as o,G as s}from"./vue-vendor-CxLCUzY4.js";import{_ as $}from"./index-BKs2x_To.js";import{t as g}from"./data-B6s_JPbS.js";import{u as G,_ as T}from"./index-B_2CoVdl.js";import{P as b}from"./index-DaObvZxT.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./index-DAURrYyA.js";import"./bem-C6eT35UB.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./props-BLY2qIO5.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useTimeout-CB9F1PLu.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./useContextMenu-CSt5a1-F.js";import"./useContentHeight-BWLGvKEC.js";import"./useWindowSizeFn-C3WExEpc.js";import"./useContentViewHeight-DlpfApuB.js";import"./usePageContext-HMYqek-Q.js";import"./injectionKey-DPVn4AgL.js";const w=A({components:{BasicTree:$,PageWrapper:b},setup(){const t=F(null),{createMessage:e}=G();function a(){const u=K(t);if(!u)throw new Error("tree is null!");return u}function m(u){a().filterByLevel(u)}function k(){a().setCheckedKeys(["0-0"])}function C(){const u=a().getCheckedKeys();e.success(JSON.stringify(u))}function n(){a().setSelectedKeys(["0-0"])}function i(){const u=a().getSelectedKeys();e.success(JSON.stringify(u))}function d(){a().setExpandedKeys(["0-0"])}function r(){const u=a().getExpandedKeys();e.success(JSON.stringify(u))}function B(u){a().checkAll(u)}function y(u){a().expandAll(u)}function E(u=null){a().insertNodeByKey({parentKey:u,node:{title:"新增节点",key:"2-2-2"},push:"push"})}function D(u){a().deleteNodeByKey(u)}function v(u){a().updateNodeByKey(u,{title:"parent2-new"})}return{treeData:g,treeRef:t,handleLevel:m,handleSetCheckData:k,handleGetCheckData:C,handleSetSelectData:n,handleGetSelectData:i,handleSetExpandData:d,handleGetExpandData:r,appendNodeByKey:E,deleteNodeByKey:D,updateNodeByKey:v,checkAll:B,expandAll:y}}}),L={class:"mb-4"},P={class:"mb-4"},J={class:"mb-4"};function O(t,e,a,m,k,C){const n=p("a-button"),i=p("BasicTree"),d=p("PageWrapper");return N(),S(d,{title:"Tree函数操作示例",contentBackground:"",contentClass:"p-4"},{default:l(()=>[f("div",L,[o(n,{onClick:e[0]||(e[0]=r=>t.expandAll(!0)),class:"mr-2"},{default:l(()=>e[10]||(e[10]=[s(" 展开全部 ")])),_:1}),o(n,{onClick:e[1]||(e[1]=r=>t.expandAll(!1)),class:"mr-2"},{default:l(()=>e[11]||(e[11]=[s(" 折叠全部 ")])),_:1}),o(n,{onClick:e[2]||(e[2]=r=>t.checkAll(!0)),class:"mr-2"},{default:l(()=>e[12]||(e[12]=[s(" 全选 ")])),_:1}),o(n,{onClick:e[3]||(e[3]=r=>t.checkAll(!1)),class:"mr-2"},{default:l(()=>e[13]||(e[13]=[s(" 全不选 ")])),_:1}),o(n,{onClick:e[4]||(e[4]=r=>t.handleLevel(2)),class:"mr-2"},{default:l(()=>e[14]||(e[14]=[s(" 显示到第2级 ")])),_:1}),o(n,{onClick:e[5]||(e[5]=r=>t.handleLevel(1)),class:"mr-2"},{default:l(()=>e[15]||(e[15]=[s(" 显示到第1级 ")])),_:1})]),f("div",P,[o(n,{onClick:t.handleSetCheckData,class:"mr-2"},{default:l(()=>e[16]||(e[16]=[s(" 设置勾选数据 ")])),_:1},8,["onClick"]),o(n,{onClick:t.handleGetCheckData,class:"mr-2"},{default:l(()=>e[17]||(e[17]=[s(" 获取勾选数据 ")])),_:1},8,["onClick"]),o(n,{onClick:t.handleSetSelectData,class:"mr-2"},{default:l(()=>e[18]||(e[18]=[s(" 设置选中数据 ")])),_:1},8,["onClick"]),o(n,{onClick:t.handleGetSelectData,class:"mr-2"},{default:l(()=>e[19]||(e[19]=[s(" 获取选中数据 ")])),_:1},8,["onClick"]),o(n,{onClick:t.handleSetExpandData,class:"mr-2"},{default:l(()=>e[20]||(e[20]=[s(" 设置展开数据 ")])),_:1},8,["onClick"]),o(n,{onClick:t.handleGetExpandData,class:"mr-2"},{default:l(()=>e[21]||(e[21]=[s(" 获取展开数据 ")])),_:1},8,["onClick"])]),f("div",J,[o(n,{onClick:e[6]||(e[6]=r=>t.appendNodeByKey(null)),class:"mr-2"},{default:l(()=>e[22]||(e[22]=[s(" 添加根节点 ")])),_:1}),o(n,{onClick:e[7]||(e[7]=r=>t.appendNodeByKey("2-2")),class:"mr-2"},{default:l(()=>e[23]||(e[23]=[s(" 添加在parent3内添加节点 ")])),_:1}),o(n,{onClick:e[8]||(e[8]=r=>t.deleteNodeByKey("2-2")),class:"mr-2"},{default:l(()=>e[24]||(e[24]=[s(" 删除parent3节点 ")])),_:1}),o(n,{onClick:e[9]||(e[9]=r=>t.updateNodeByKey("1-1")),class:"mr-2"},{default:l(()=>e[25]||(e[25]=[s(" 更新parent2节点 ")])),_:1})]),o(i,{treeData:t.treeData,title:"函数操作",ref:"treeRef",checkable:!0},null,8,["treeData"])]),_:1})}const ne=T(w,[["render",O]]);export{ne as default};
