leftTab.jsx 4.0 KB

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