This commit is contained in:
Jay
2017-03-24 16:14:30 +08:00
parent c5236f9ad3
commit d6250577fe
14 changed files with 261 additions and 153257 deletions
+17 -1
View File
@@ -4,6 +4,8 @@ import Datetime from 'react-datetime';
import MainMenu from '../../containers/MenuControl';
import Loading from '../../containers/LoadingControl';
import Dialog from '../DialogControl';
import Dashboard from '../../containers/DashBoard';
import {toggle_dashboard} from '../../actions'
class AdmPage extends React.Component {
@@ -11,6 +13,13 @@ class AdmPage extends React.Component {
super(props);
}
componentDidMount(){
let showDashboard = localStorage.getItem('show_dashboard');
if(showDashboard != null && showDashboard == 1){
this.props.toggleDashboard(true);
}
}
render() {
let {i18n, children} = this.props;
if(!i18n || Object.keys(i18n).length == 0 || !i18n.t || !i18n.getResource) return null;
@@ -19,6 +28,7 @@ class AdmPage extends React.Component {
<Loading />
<Dialog />
<MainMenu i18n={i18n} >
<Dashboard />
{children}
</MainMenu>
</div>
@@ -30,4 +40,10 @@ const mapStateToProps = (state) => ({
i18n: state.i18n
})
export default connect(mapStateToProps)(AdmPage);
const mapDispatchToProps = (dispatch, ownProps) =>({
toggleDashboard: (flag)=>{
dispatch(toggle_dashboard(flag))
}
})
export default connect(mapStateToProps, mapDispatchToProps)(AdmPage);