index.jsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import React,{Component} from "react";
  2. import { Tabs } from 'antd';
  3. import Inauguration from './inauguration';
  4. const { TabPane } = Tabs;
  5. class DataClassify extends Component{
  6. constructor(props) {
  7. super(props);
  8. this.state={
  9. activeKey: "1"
  10. }
  11. this.callback = this.callback.bind(this);
  12. }
  13. callback=(key)=>{
  14. this.setState({
  15. activeKey: key
  16. })
  17. }
  18. componentDidMount() {
  19. console.log(this.props.userInfor)
  20. }
  21. render() {
  22. return (
  23. <>
  24. {
  25. this.props.readonly ?
  26. <div>
  27. <Inauguration {...this.props}/>
  28. </div>:
  29. <Tabs defaultActiveKey="1" activeKey={this.state.activeKey} onChange={this.callback} tabBarGutter={85}>
  30. <TabPane tab="任职信息" key="1">
  31. <Inauguration {...this.props}/>
  32. </TabPane>
  33. <TabPane tab="联系信息" key="2">
  34. Content of Tab Pane 2
  35. </TabPane>
  36. <TabPane tab="入职资料" key="3">
  37. Content of Tab Pane 3
  38. </TabPane>
  39. <TabPane tab="晋升情况" key="4">
  40. Content of Tab Pane 3
  41. </TabPane>
  42. <TabPane tab="合同情况" key="5">
  43. Content of Tab Pane 3
  44. </TabPane>
  45. <TabPane tab="奖惩情况" key="6">
  46. Content of Tab Pane 3
  47. </TabPane>
  48. <TabPane tab="离职情况" key="7">
  49. Content of Tab Pane 3
  50. </TabPane>
  51. <TabPane tab="福利情况" key="8">
  52. Content of Tab Pane 3
  53. </TabPane>
  54. </Tabs>
  55. }
  56. </>
  57. )
  58. }
  59. }
  60. export default DataClassify;