leftTab.jsx 3.4 KB

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