|
@@ -1,23 +1,27 @@
|
|
|
import React from 'react'
|
|
import React from 'react'
|
|
|
import { Affix, Menu, Icon } from 'antd'
|
|
import { Affix, Menu, Icon } from 'antd'
|
|
|
import { Link } from 'react-router-dom'
|
|
import { Link } from 'react-router-dom'
|
|
|
|
|
+import { connect } from 'dva'
|
|
|
|
|
+import '../../models/main'
|
|
|
|
|
|
|
|
class Navigator extends React.Component {
|
|
class Navigator extends React.Component {
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super(props)
|
|
super(props)
|
|
|
this.state = {
|
|
this.state = {
|
|
|
- current: 'mypage'
|
|
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
|
|
+
|
|
|
|
|
+ const { main } = this.props;
|
|
|
|
|
+
|
|
|
return <Menu
|
|
return <Menu
|
|
|
className='navigator-menu'
|
|
className='navigator-menu'
|
|
|
- // selectedKeys={[this.state.current]}
|
|
|
|
|
|
|
+ selectedKeys={[main.currentPage]}
|
|
|
mode="horizontal"
|
|
mode="horizontal"
|
|
|
>
|
|
>
|
|
|
- <Menu.Item key="mypage">
|
|
|
|
|
- <Link to='/'><Icon type="home" />主页</Link>
|
|
|
|
|
|
|
+ <Menu.Item key="home">
|
|
|
|
|
+ <Link to='/home'><Icon type="home" />主页</Link>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
<Menu.Item key="dashboard">
|
|
<Menu.Item key="dashboard">
|
|
|
<Link to='/dashboard'><Icon type="desktop" />报告与看板</Link>
|
|
<Link to='/dashboard'><Icon type="desktop" />报告与看板</Link>
|
|
@@ -29,12 +33,16 @@ class Navigator extends React.Component {
|
|
|
<Link to='/datasource'><Icon type="database" />数据源</Link>
|
|
<Link to='/datasource'><Icon type="database" />数据源</Link>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
<Menu.Item key="modeling">
|
|
<Menu.Item key="modeling">
|
|
|
- <Icon type="tool" />建模分析
|
|
|
|
|
|
|
+ <Icon type="modeling" />建模分析
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
</Menu>
|
|
</Menu>
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export default Navigator
|
|
|
|
|
|
|
+function mapStateToProps({ present: { main } }) {
|
|
|
|
|
+ return { main };
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export default connect(mapStateToProps)(Navigator)
|
|
|
|
|
|
|
|
|
|
|