|
@@ -1,10 +1,13 @@
|
1
|
1
|
import React, { useCallback, useEffect, useState } from 'react';
|
2
|
2
|
// import { Row, Col } from 'antd'
|
|
3
|
+import { connect } from 'dva'
|
3
|
4
|
import Link from 'umi/link'
|
4
|
5
|
import IconText from './components/IconText'
|
5
|
6
|
import styles from './style.less';
|
6
|
7
|
|
7
|
|
-export default (props) => {
|
|
8
|
+const Welcome = (props) => {
|
|
9
|
+ const { user } = props
|
|
10
|
+ const { bossDisplay } = user
|
8
|
11
|
const [containerStyle, setContainerStyle] = useState({})
|
9
|
12
|
|
10
|
13
|
const computeStyle = useCallback(() => {
|
|
@@ -12,12 +15,14 @@ export default (props) => {
|
12
|
15
|
const header = document.getElementsByClassName('ant-pro-global-header')[0]
|
13
|
16
|
|
14
|
17
|
const style = {
|
|
18
|
+ background: `url(${bossDisplay}) no-repeat`,
|
|
19
|
+ backgroundSize: '100% 100%',
|
15
|
20
|
width: header.offsetWidth,
|
16
|
21
|
height: body.offsetHeight - header.offsetHeight,
|
17
|
22
|
}
|
18
|
23
|
|
19
|
24
|
setContainerStyle(style)
|
20
|
|
- }, [setContainerStyle])
|
|
25
|
+ }, [setContainerStyle, bossDisplay])
|
21
|
26
|
|
22
|
27
|
useEffect(() => {
|
23
|
28
|
computeStyle()
|
|
@@ -28,7 +33,7 @@ export default (props) => {
|
28
|
33
|
|
29
|
34
|
return (
|
30
|
35
|
<div className={styles.welcome} style={containerStyle}>
|
31
|
|
- <div className={styles['action-list']}>
|
|
36
|
+ {/* <div className={styles['action-list']}>
|
32
|
37
|
<div>
|
33
|
38
|
<Link to="/building/list">
|
34
|
39
|
<IconText name='building'>项目列表</IconText>
|
|
@@ -54,17 +59,19 @@ export default (props) => {
|
54
|
59
|
</div>
|
55
|
60
|
|
56
|
61
|
<div>
|
57
|
|
- {/* <Link to="/customer/customer/list"> */}
|
|
62
|
+ <Link to="/customer/customer/list">
|
58
|
63
|
<IconText name='report'>数据报表</IconText>
|
59
|
|
- {/* </Link> */}
|
|
64
|
+ </Link>
|
60
|
65
|
</div>
|
61
|
66
|
|
62
|
67
|
<div>
|
63
|
|
- {/* <Link to="/customer/customer/list"> */}
|
|
68
|
+ <Link to="/customer/customer/list">
|
64
|
69
|
<IconText name='channel'>渠道统计</IconText>
|
65
|
|
- {/* </Link> */}
|
|
70
|
+ </Link>
|
66
|
71
|
</div>
|
67
|
|
- </div>
|
|
72
|
+ </div> */}
|
68
|
73
|
</div>
|
69
|
74
|
)
|
70
|
75
|
};
|
|
76
|
+
|
|
77
|
+export default connect(s => ({ user: s.user.currentUser }))(Welcome);
|