12345678910111213141516171819202122232425262728293031 |
- import { Tree } from 'antd';
- function MenuTree(props){
- const {data,checkEv} = props;
- //菜单选中事件
- function onCheck(checkedKeys,e){
- const {checkedNodes} = e;
- const sourceIds = [];
- checkedNodes.map((it)=>{
- if(it.softwareResourceId){
- sourceIds.push(it.softwareResourceId);
- }
- });
- checkEv(checkedKeys,sourceIds)
- }
- function onSelect(){
- }
- const treeData = data?[data]:null;
- return (
- <Tree
- checkable
- onCheck={onCheck}
- onSelect={onSelect}
- treeData={treeData}
- />
- )
- }
- export default MenuTree;
|