content.jsx 2.8 KB

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