content.jsx 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import React from 'react';
  2. import '../content.less';
  3. import LeftTab from './leftTab.jsx';
  4. import Patent from './patent';
  5. import Intellectual from './intellectual';
  6. import Activity from './activity';
  7. import Standard from './standard';
  8. import ActivityCostList from './activityCostList';
  9. import TechProduct from './techProduct';
  10. import Ratepay from './ratepay';
  11. import Finance from './finance';
  12. import Achievement from './achievement';
  13. import HonorList from './honorList';
  14. import OrgTechCenter from './orgTechCenter';
  15. import AnnualReport from './annualReport';
  16. import Cognizance from './cognizance';
  17. import Copyright from './copyright/copyright';
  18. import Technology from './technology'
  19. const Content = React.createClass({
  20. getInitialState() {
  21. return {
  22. loading: false,
  23. leftKey: 'patent',
  24. userType: '0'
  25. };
  26. },
  27. handlekey(key) {
  28. this.setState({
  29. leftKey: key,
  30. });
  31. window.location.hash = key;
  32. },
  33. componentWillMount() {
  34. if (window.location.hash) {
  35. this.handlekey(window.location.hash.substr(1));
  36. };
  37. },
  38. render() {
  39. return (
  40. <div className="acc-content">
  41. <LeftTab handlekey={this.handlekey} />
  42. <div className="content-right">
  43. {(() => {
  44. switch (this.state.leftKey) {
  45. case 'patent':
  46. return <Patent />;
  47. case 'intellectual':
  48. return <Intellectual />;
  49. case 'activity':
  50. return <Activity />;
  51. case 'standard':
  52. return <Standard />;
  53. case 'activityCostList':
  54. return <ActivityCostList />;
  55. case 'techProduct':
  56. return <TechProduct />;
  57. case 'ratepay':
  58. return <Ratepay />;
  59. case 'finance':
  60. return <Finance />;
  61. case 'achievement':
  62. return <Achievement />;
  63. case 'honorList':
  64. return <HonorList />;
  65. case 'orgTechCenter':
  66. return <OrgTechCenter />;
  67. case 'annualReport':
  68. return <AnnualReport />;
  69. case 'cognizance':
  70. return <Cognizance />;
  71. case 'copyright':
  72. return <Copyright />;
  73. case 'technology':
  74. return <Technology />;
  75. };
  76. })()}
  77. </div>
  78. </div>
  79. )
  80. }
  81. });
  82. export default Content;