2023-03-14 09:11:54 +08:00
|
|
|
import {
|
|
|
|
|
observer
|
|
|
|
|
} from 'mobx-react';
|
|
|
|
|
import {
|
|
|
|
|
WeaOrgTree,
|
|
|
|
|
} from 'ecCom';
|
|
|
|
|
|
|
|
|
|
@observer
|
|
|
|
|
export default class OrgTree extends React.Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.tree = null;
|
|
|
|
|
this.setRef = element => {
|
|
|
|
|
this.tree = element;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
init = () => {
|
|
|
|
|
if (this.tree) this.tree.reset(() => this.tree.fetchData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const {
|
|
|
|
|
store
|
|
|
|
|
} = this.props, {
|
|
|
|
|
triggerRefresh,
|
|
|
|
|
orgTreeProps,
|
|
|
|
|
handleOrgTreeNodeClick,
|
|
|
|
|
} = store;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div style={{height: '100%'}}>
|
2024-12-11 15:32:14 +08:00
|
|
|
<WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@0bel37`}
|
2023-03-14 09:11:54 +08:00
|
|
|
{...orgTreeProps}
|
|
|
|
|
treeNodeClick={handleOrgTreeNodeClick}
|
|
|
|
|
ref={this.setRef}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|