index.js 833 Bytes
Newer Older
duanledexianxianxian's avatar
duanledexianxianxian committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
import React from 'react';
import { Tabs } from 'antd';
import router from 'umi/router';

import Operation from './components/operation';
import Business from './components/business';
import styles from './index.less';

const { TabPane } = Tabs;
const index = props => {
  // console.log(props);
  /**
   * 切换tab页签
   * @param {*} key
   */
  function onChangeTab(key) {
    router.push(key);
  }
  const {
    location: { hash },
  } = props;
  return (
    <div className={styles.root}>
      <Tabs defaultActiveKey={hash || '#operation'} onChange={onChangeTab}>
        <TabPane tab="运维参数管理" key="#operation">
          <Operation />
        </TabPane>
        <TabPane tab="业务参数管理" key="#business">
          <Business />
        </TabPane>
      </Tabs>
    </div>
  );
};

export default index;