content.jsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React, { Component } from 'react';
  2. import '../content.less';
  3. import LeftTab from './leftTab.jsx';
  4. import UserList from './userList.jsx';
  5. import OrgList from './orgList.jsx';
  6. class Content extends Component {
  7. constructor() {
  8. super();
  9. this.state = {
  10. loading: false,
  11. leftKey: 'orgList',
  12. };
  13. }
  14. getKey(key) {
  15. this.setState({
  16. leftKey: key,
  17. });
  18. }
  19. render() {
  20. return (
  21. <div className="manage-content">
  22. <LeftTab handlekey={this.getKey.bind(this)} />
  23. <div className="content-right">
  24. {(() => {
  25. switch (this.state.leftKey) {
  26. case 'userList':
  27. return <UserList />;
  28. case 'orgList':
  29. return <OrgList />;
  30. };
  31. })()}
  32. </div>
  33. </div>
  34. )
  35. }
  36. }
  37. export default Content;