leftTab.jsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import React from 'react';
  2. import { Menu, Icon } from 'antd';
  3. import '../leftTab.less';
  4. const SubMenu = Menu.SubMenu;
  5. const MenuItemGroup = Menu.ItemGroup;
  6. const LeftTab = React.createClass({
  7. getInitialState() {
  8. return {
  9. current: window.showCustomer ? 'customerList' : 'userList',
  10. };
  11. },
  12. handleClick(e) {
  13. this.props.handlekey(e.key);
  14. this.setState({
  15. current: e.key,
  16. });
  17. },
  18. componentWillMount() {
  19. if (window.location.hash) {
  20. this.state.current = window.location.hash.substr(1);
  21. };
  22. },
  23. render() {
  24. return (
  25. <Menu onClick={this.handleClick}
  26. selectedKeys={[this.state.current]}
  27. mode="vertical"
  28. className="account-left" >
  29. <Menu.Item key="userList">
  30. 个人用户列表
  31. </Menu.Item>
  32. <Menu.Item key="orgList">
  33. 组织用户列表
  34. </Menu.Item>
  35. <Menu.Item key="customerList">
  36. 我的客户列表
  37. </Menu.Item>
  38. <Menu.Item key="levelSet">
  39. 会员等级设置
  40. </Menu.Item>
  41. <Menu.Item key="customerSearch">
  42. 客户查询
  43. </Menu.Item>
  44. <Menu.Item key="highTechSearch">
  45. 高企查询
  46. </Menu.Item>
  47. </Menu>
  48. );
  49. },
  50. });
  51. export default LeftTab;