import React from 'react'; import { Menu, Icon } from 'antd'; import '../leftTab.less'; const SubMenu = Menu.SubMenu; const MenuItemGroup = Menu.ItemGroup; const LeftTab = React.createClass({ getInitialState() { return { current: 'contract', subKey: 'sub1', keyList: [ { key: 'sub1', value: ['contract', 'patent', 'copyright', 'intellectual'] }, { key: 'sub2', value: ['standard', 'activity', 'activityCostList', 'orgTechCenter', 'techProduct', 'ratepay', 'finance', 'achievement', 'honorList', 'annualReport', 'cognizance', 'companyDetail'] }, { key: 'sub3', value: ['technology'] }, { key: 'sub4', value: ['evaluate'] } ] }; }, handleClick(e) { this.props.handlekey(e.key); this.setState({ current: e.key, }); }, componentWillMount() { const _me = this; if (window.location.hash) { let theKey = window.location.hash.substr(1); this.state.keyList.map(function (item1) { item1.value.map(function (item2) { if (theKey == item2) { _me.state.subKey = item1.key } }); }); this.state.current = theKey; if (theKey == 'createEvaluate') { this.state.subKey = 'sub4' this.state.current = 'evaluate'; } }; }, render() { if (window.userData && window.userData.type == 1) { return (
); } else { return ( ); } } }); export default LeftTab;