LayoutRoute.js
2.4 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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);