LayoutRoute.js 2.4 KB
import React from 'react';
import { connect } from 'react-redux';
import { Layout, Button } from 'antd';
import SysMenu from '../../components/reduxAntd/SysMenu';
import cx from 'classnames';
import homeRoute from '../home';

const { Header, Sider, Content } = Layout;



class LayoutRoute extends React.Component {
    static propTypes = {
    }
    constructor(props) {
        super(props);
        this.renderLoad = this.renderLoad.bind(this);
    }
    componentDidMount() {
        const { uaa_tenant, dispatch } = this.props;

    }
    changeMenu(menu) {
        const { key } = menu;
        console.log(key);
        if ('logout' == key) {
            document.location.href = '/signOut';
        } else if ('percenter_pwdsetting' == key) {
            document.location.href = '#/main/setting/changePassword';
        }
    }
    renderLoad() {
        return (
            <div style={{ textAlign: 'center', margin: '300px auto' }}>
                <div className="sk-folding-cube">
                    <div className="sk-cube1 sk-cube"></div>
                    <div className="sk-cube2 sk-cube"></div>
                    <div className="sk-cube4 sk-cube"></div>
                    <div className="sk-cube3 sk-cube"></div>
                </div>
                页面数据加载中...
            </div>
        );
    }
    render() {
        const { match, location: { pathname } } = this.props;
        return (
            <Layout className={cx("layout-wrap")}>
                <Header className={cx("layout-header-wrap")} style={{ background: '#529CE2', padding: '0 25px' }}>
                    headcccc
                    <a href="/signOut">退出</a>
                </Header>
                <Layout className={cx("layout-content-wrap")}>
                    <Sider className="layout-sider-wrap" collapsedWidth={0} collapsible={false} width={180}>
                        <div>
                            <SysMenu></SysMenu>
                        </div>
                    </Sider>
                    <Content>
                        <div className="app-routes-wrap">
                            {homeRoute(match)}
                        </div>
                    </Content>
                </Layout>
            </Layout>
        );
    }
}



const mapState = (state) => {
    const {
        router = {}
    } = state;
    return {
        router
    };
};
export default connect(mapState)(LayoutRoute);