leftTab.jsx 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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: 'comprehensive',
  10. subKey: 'sub1',
  11. keyList: [
  12. { key: 'sub1', value: ['comprehensive', 'payment', 'correction', 'express', 'applyFee'] },
  13. { key: 'sub2', value: [] },
  14. { key: 'sub3', value: ['highTechApply', 'highTechFoster'] }
  15. ]
  16. };
  17. },
  18. handleClick(e) {
  19. if (this.state.subKey !== e.keyPath[1]) {
  20. switch (e.keyPath[1]) {
  21. case 'sub1':
  22. location.href = globalConfig.context + '/admin/servicesManage/patent.html#' + e.key;
  23. case 'sub2':
  24. return;
  25. case 'sub3':
  26. location.href = globalConfig.context + '/admin/servicesManage/highTech.html#' + e.key;
  27. }
  28. };
  29. this.props.handlekey(e.key);
  30. this.setState({
  31. current: e.key,
  32. });
  33. },
  34. componentWillMount() {
  35. const _me = this;
  36. if (window.location.hash) {
  37. let theKey = window.location.hash.substr(1);
  38. this.state.keyList.map(function (item1) {
  39. item1.value.map(function (item2) {
  40. if (theKey == item2) {
  41. _me.state.subKey = item1.key
  42. }
  43. });
  44. });
  45. this.state.current = theKey;
  46. };
  47. },
  48. render() {
  49. return (
  50. <Menu onClick={this.handleClick}
  51. selectedKeys={[this.state.current]}
  52. defaultOpenKeys={[this.state.subKey]}
  53. mode="vertical"
  54. className="account-left"
  55. mode="inline"
  56. >
  57. <SubMenu key="sub1"
  58. title={<div>专利申请管理</div>}>
  59. <Menu.Item key="comprehensive">
  60. 专利综合管理
  61. </Menu.Item>
  62. <Menu.Item key="payment">
  63. 待缴费专利管理
  64. </Menu.Item>
  65. <Menu.Item key="correction">
  66. 补正审查通知管理
  67. </Menu.Item>
  68. <Menu.Item key="express">
  69. 专利纸件收发登记
  70. </Menu.Item>
  71. <Menu.Item key="applyFee">
  72. 专利申请费用管理
  73. </Menu.Item>
  74. </SubMenu>
  75. <SubMenu key="sub2" title={<span>软著申请管理</span>}>
  76. </SubMenu>
  77. <SubMenu key="sub3"
  78. title={<div>高企认定管理</div>}>
  79. <Menu.Item key="highTechApply">
  80. 高企认定申请
  81. </Menu.Item>
  82. <Menu.Item key="highTechFoster">
  83. 高企认定培育
  84. </Menu.Item>
  85. </SubMenu>
  86. <SubMenu key="sub4" title={<span>科技项目申报管理</span>}>
  87. </SubMenu>
  88. </Menu>
  89. );
  90. }
  91. });
  92. export default LeftTab;