Commit afab234b authored by XieZhiXiong's avatar XieZhiXiong

暴露勾选事件

parent 25ee2187
...@@ -39,6 +39,7 @@ export interface TabTreeProps extends TreeProps { ...@@ -39,6 +39,7 @@ export interface TabTreeProps extends TreeProps {
handleSubmit?(); handleSubmit?();
toolsRender?: toolsRenderProps; toolsRender?: toolsRenderProps;
getMenuSelectData?(): Promise<any>; getMenuSelectData?(): Promise<any>;
handleCheck?: (keys: any, nodes: any) => {};
} }
export interface InnermostTreeNodeProps {} export interface InnermostTreeNodeProps {}
...@@ -212,6 +213,7 @@ const TabTree: React.FC<TabTreeProps> = props => { ...@@ -212,6 +213,7 @@ const TabTree: React.FC<TabTreeProps> = props => {
showSave, showSave,
getMenuSelectData, getMenuSelectData,
handleSubmit, handleSubmit,
handleCheck,
} = props; } = props;
const selfActions = useTreeActions(actions) const selfActions = useTreeActions(actions)
...@@ -323,6 +325,10 @@ const TabTree: React.FC<TabTreeProps> = props => { ...@@ -323,6 +325,10 @@ const TabTree: React.FC<TabTreeProps> = props => {
checked checked
? batchSelect(keys as any) ? batchSelect(keys as any)
: setSelected(checkedNodes.map(v => v.key)); : setSelected(checkedNodes.map(v => v.key));
// 用户自定义的勾选后触发事件
if (handleCheck) {
handleCheck(keys, nodes);
}
}} }}
onSelect={(keys, e) => { onSelect={(keys, e) => {
// 控制点击node时可以展开 // 控制点击node时可以展开
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment