EditTree-c5f1f501.js
2.68 KB
import{d as m,n as p,a8 as n,_ as E,a9 as B,aa as a,f as t,E as F,a1 as f}from"./vue-5a35c3f5.js";import{B as g}from"./index-51c65fdc.js";import{t as C,a as h,b as _}from"./data-1ad4e56f.js";import{P as A}from"./index-f532aa07.js";import{be as b,bf as k,aU as L,bM as R}from"./antd-6b087f69.js";import{_ as M}from"./index.js";import"./useContextMenu-d25efcaf.js";import"./useContentViewHeight-d0a5c58e.js";import"./useWindowSizeFn-cc2fb57c.js";import"./onMountedOrActivated-52afb7a7.js";const N=m({components:{BasicTree:g,PageWrapper:A,Row:b,Col:k},setup(){function e(u){console.log(u)}function s(u){return[{label:"新增",handler:()=>{console.log("点击了新增",u)},icon:"bi:plus"},{label:"删除",handler:()=>{console.log("点击了删除",u)},icon:"bx:bxs-folder-open"}]}const l=[{render:u=>p(L,{class:"ml-2",onClick:()=>{e(u)}})},{render:()=>p(R)}];function c({level:u}){return u===1?"ion:git-compare-outline":u===2?"ion:home":u===3?"ion:airplane":""}return{treeData:C,treeData2:h,treeData3:_,actionList:l,getRightMenuList:s,createIcon:c}}});function T(e,s,l,c,u,P){const r=n("BasicTree"),o=n("Col"),D=n("Row"),d=n("PageWrapper");return E(),B(d,{title:"Tree函数操作示例"},{default:a(()=>[t(D,{gutter:[16,16]},{default:a(()=>[t(o,{span:8},{default:a(()=>[t(r,{title:"右侧操作按钮/自定义图标",helpMessage:"帮助信息",treeData:e.treeData,actionList:e.actionList,renderIcon:e.createIcon},null,8,["treeData","actionList","renderIcon"])]),_:1}),t(o,{span:8},{default:a(()=>[t(r,{title:"右键菜单",treeData:e.treeData,beforeRightClick:e.getRightMenuList},null,8,["treeData","beforeRightClick"])]),_:1}),t(o,{span:8},{default:a(()=>[t(r,{title:"工具栏使用",toolbar:"",checkable:"",search:"",treeData:e.treeData,beforeRightClick:e.getRightMenuList},null,8,["treeData","beforeRightClick"])]),_:1}),t(o,{span:8},{default:a(()=>[t(r,{title:"没有fieldNames,插槽有效",helpMessage:"正确的示例",treeData:e.treeData3},{title:a(i=>[F(" 插槽:"+f(i.name),1)]),_:1},8,["treeData"])]),_:1}),t(o,{span:8},{default:a(()=>[t(r,{title:"有fieldNames后,插槽失效",helpMessage:"错误的示例, 应该显示插槽的内容才对",fieldNames:{key:"id",title:"name"},treeData:e.treeData2},{title:a(i=>[F(" 插槽:"+f(i.title),1)]),_:1},8,["treeData"])]),_:1}),t(o,{span:8},{default:a(()=>[t(r,{title:"有fieldNames后,actionList失效",helpMessage:"错误的示例,应该在鼠标移上去时,显示新增和删除按钮才对",treeData:e.treeData3,actionList:e.actionList,fieldNames:{key:"key",title:"name"}},null,8,["treeData","actionList"])]),_:1})]),_:1})]),_:1})}const j=M(N,[["render",T],["__file","E:/allcode/erp/test7901/order-erp-front/src/views/demo/tree/EditTree.vue"]]);export{j as default};