import React, {
	Component
} from 'react';
import {
	observer
} from 'mobx-react';
import OrganizationTree from '../../../coms/OrganizationTree';
import Tabs from '../../../coms/Tabs';
import {
	cloneDeep
} from 'lodash';

@observer
export default class AdjustLeftContainer extends Component {
	constructor(props) {
		super(props);
	}

	componentDidMount() {}

	componentWillReceiveProps(nextProps) {}

	render(){
		const {
			store,
			routeProps
		} = this.props;

		let orgTreeProps = cloneDeep(store.toJS(store.orgTreeProps));
		orgTreeProps.isMult = true;

		switch (routeProps.params) {
			case 'subCompany':
				break;
			case 'department':
				orgTreeProps.isLoadSubDepartment = true;
				break;
			case 'resource':
				orgTreeProps.isLoadUser = true;
				break;
		}

		return (
			<div className="left">
				<OrganizationTree ecId={`${this && this.props && this.props.ecId || ''}_OrganizationTree@6xyabi`} {...orgTreeProps} 
					checkStrictlyTitles={store.checkStrictlyTitles()} 
					onCheckStrictlyChangeCallback={store.onCheckStrictlyChange} 
					ref={dom => store.setTreeRef(dom)}/>
			</div>
		)
	}
}