content.jsx 2.7 KB

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