leftTab.jsx 4.4 KB

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