import React from 'react';
import { Menu, Icon } from 'antd';
import '../leftTab.less';
import './content.less';
import '../content.less';
const SubMenu = Menu.SubMenu;
const MenuItemGroup = Menu.ItemGroup;

const LeftTab = React.createClass({
    getInitialState() {
        return {
            current: 'member', 
            subKey: 'sub1', 
            keyList: [
                { key: 'sub1', value: ['member','permission','role','site'] },
                { key: 'sub2', value: ['organization'] },
                { key: 'sub3', value: ['businessCategory', 'businessProject'] },
            ]
        };
    },
    handleClick(e) {
        this.props.handlekey(e.key);
        this.setState({
            current: e.key,
        });
    },
    componentWillMount(){
        if ( window.location.hash ) {
            this.state.current = window.location.hash.substr(1);
        };
    },
    render() {
        return (
            <Menu onClick={this.handleClick}
                selectedKeys={[this.state.current]}
                mode="inline"
                className="account-left"
                >
	            <SubMenu key="sub1" title={<span>用户管理</span>}>	
	            		<Menu.Item key="member">
		                    管理员列表
		                </Menu.Item>
		                <Menu.Item key="permission">
		                    权限控制
		                </Menu.Item>
		                <Menu.Item key="role">
		                    角色控制
		                </Menu.Item>
		                 <Menu.Item key="site" style={{display:'none'}}>
                		    站点设置
                		</Menu.Item>
		        </SubMenu> 
		        <SubMenu key="sub2" title={<span>组织机构管理</span>}>	            	
		                <Menu.Item key="organization">
		                    组织机构
		                </Menu.Item>               	               		           
		        </SubMenu>
		        <SubMenu key="sub3" title={<span>业务品种管理</span>}>		            
		                <Menu.Item key="businessCategory">
		                    业务品类管理
		                </Menu.Item>               
		                <Menu.Item key="businessProject">
		                    业务项目管理
		                </Menu.Item>	               		           
		        </SubMenu>
            </Menu>
        );
    }
});

export default LeftTab;