leftTab.jsx 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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', 'patent', 'copyright', 'intellectual'] },
  13. { key: 'sub2', value: ['standard', 'activity', 'activityCostList', 'orgTechCenter', 'techProduct', 'ratepay', 'finance', 'achievement', 'honorList', 'annualReport', 'cognizance', 'companyDetail'] },
  14. { key: 'sub3', value: ['technology'] },
  15. { key: 'sub4', value: ['evaluate'] }
  16. ]
  17. };
  18. },
  19. handleClick(e) {
  20. this.props.handlekey(e.key);
  21. this.setState({
  22. current: e.key,
  23. });
  24. },
  25. componentWillMount() {
  26. const _me = this;
  27. if (window.location.hash) {
  28. let theKey = window.location.hash.substr(1);
  29. this.state.keyList.map(function (item1) {
  30. item1.value.map(function (item2) {
  31. if (theKey == item2) {
  32. _me.state.subKey = item1.key
  33. }
  34. });
  35. });
  36. this.state.current = theKey;
  37. if (theKey == 'createEvaluate') {
  38. this.state.subKey = 'sub4'
  39. this.state.current = 'evaluate';
  40. }
  41. };
  42. },
  43. render() {
  44. if (window.userData && window.userData.type == 1) {
  45. return (<Menu onClick={this.handleClick}
  46. selectedKeys={[this.state.current]}
  47. defaultOpenKeys={[this.state.subKey]}
  48. mode="vertical"
  49. className="account-left"
  50. mode="inline" >
  51. <SubMenu key="sub1" title={<span>知识产权管理</span>}>
  52. <Menu.Item key="contract">
  53. 合同申请
  54. </Menu.Item>
  55. <Menu.Item key="patent">
  56. 专利管理
  57. </Menu.Item>
  58. <Menu.Item key="copyright">
  59. 软著管理
  60. </Menu.Item>
  61. <Menu.Item key="intellectual">
  62. 知识产权管理
  63. </Menu.Item>
  64. </SubMenu>
  65. <SubMenu key="sub2" title={<span>高企认定</span>}>
  66. <Menu.Item key="cognizance">
  67. 高企申请管理
  68. </Menu.Item>
  69. <Menu.Item key="companyDetail">
  70. 企业基本信息
  71. </Menu.Item>
  72. <Menu.Item key="standard">
  73. 标准制定情况
  74. </Menu.Item>
  75. <Menu.Item key="activity">
  76. 企业研究开发活动
  77. </Menu.Item>
  78. <Menu.Item key="activityCostList">
  79. 企业研发费用详情
  80. </Menu.Item>
  81. <Menu.Item key="orgTechCenter">
  82. 企业研发机构
  83. </Menu.Item>
  84. <Menu.Item key="techProduct">
  85. 高新技术产品(服务)情况
  86. </Menu.Item>
  87. <Menu.Item key="ratepay">
  88. 所得税纳税申报信息
  89. </Menu.Item>
  90. <Menu.Item key="finance">
  91. 财务报表信息
  92. </Menu.Item>
  93. <Menu.Item key="achievement">
  94. 科技成果转化
  95. </Menu.Item>
  96. <Menu.Item key="honorList">
  97. 企业荣誉及其他证明材料
  98. </Menu.Item>
  99. <Menu.Item key="annualReport">
  100. 企业年报
  101. </Menu.Item>
  102. </SubMenu>
  103. <SubMenu key="sub3" title={<span>科技项目申报</span>}>
  104. <Menu.Item key="technology">
  105. 申报管理
  106. </Menu.Item>
  107. </SubMenu>
  108. <SubMenu key="sub4" title={<span>科技评估</span>}>
  109. <Menu.Item key="evaluate">
  110. 科技评估管理
  111. </Menu.Item>
  112. </SubMenu>
  113. </Menu>
  114. );
  115. } else {
  116. return (<Menu onClick={this.handleClick}
  117. selectedKeys={[this.state.current]}
  118. defaultOpenKeys={[this.state.subKey]}
  119. mode="vertical"
  120. className="account-left"
  121. mode="inline" >
  122. <SubMenu key="sub4" title={<span>科技评估</span>}>
  123. <Menu.Item key="evaluate">
  124. 科技评估管理
  125. </Menu.Item>
  126. </SubMenu>
  127. </Menu>
  128. );
  129. }
  130. }
  131. });
  132. export default LeftTab;