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