张延森 4 lat temu
rodzic
commit
bf64b9ddca

+ 7
- 3
src/pages/dashboard/components/ABPart.jsx Wyświetl plik

2
 import { Row, Col } from 'antd'
2
 import { Row, Col } from 'antd'
3
 
3
 
4
 export default props => {
4
 export default props => {
5
+
6
+  const left = props.left || 16
7
+  const right = 24 - left
8
+
5
   return (
9
   return (
6
-    <Row type="flex" align={props.align || "top"} justify="space-around" gutter={24}>
7
-      <Col span={16}>{props.a}</Col>
8
-      <Col span={8}>{props.b}</Col>
10
+    <Row type="flex" align={props.align || "top"} justify="space-around" gutter={props.gutter || 24}>
11
+      <Col span={left}>{props.a}</Col>
12
+      <Col span={right}>{props.b}</Col>
9
     </Row>
13
     </Row>
10
   )
14
   )
11
 }
15
 }

+ 7
- 5
src/pages/dashboard/components/ScrollAlert.jsx Wyświetl plik

7
 const getDynamic = fetch(apis.dashboard.dynamic)
7
 const getDynamic = fetch(apis.dashboard.dynamic)
8
 
8
 
9
 const Item = props => (
9
 const Item = props => (
10
-  <Row gutter={24} type="flex" align="middle" style={{ marginTop: 8, marginBottom: 8 }}>
10
+  <Row gutter={16} type="flex" align="middle" style={{ marginTop: 8, marginBottom: 8 }}>
11
     <Col span={8}>{props.dataSource.createDate}</Col>
11
     <Col span={8}>{props.dataSource.createDate}</Col>
12
     <Col span={16}>{`${props.dataSource.nickname} ${props.dataSource.desc}`}</Col>
12
     <Col span={16}>{`${props.dataSource.nickname} ${props.dataSource.desc}`}</Col>
13
   </Row>
13
   </Row>
14
 )
14
 )
15
 
15
 
16
+const showMax = 10
17
+
16
 export default props => {
18
 export default props => {
17
   const [loading, setLoading] = useState(false)
19
   const [loading, setLoading] = useState(false)
18
   const [list, setList] = useState([])
20
   const [list, setList] = useState([])
31
 
33
 
32
       // 组合list
34
       // 组合list
33
       const compList = [
35
       const compList = [
34
-        ...(ticketList || []).map(x => ({...x, createDate: moment(x.createDate).format('YYYY-MM-DD HH:mm'), desc: '提了一个工单'})),
35
-        ...(propList || []).map(x => ({...x, createDate: moment(x.createDate).format('YYYY-MM-DD HH:mm'), desc: '申请了一个业主认证'})),
36
-        ...(billList || []).map(x => ({...x, createDate: moment(x.createDate).format('YYYY-MM-DD HH:mm'), desc: '缴了一笔费用'})),
36
+        ...(ticketList || []).map(x => ({...x, createDate: moment(x.createDate).format('MM-DD HH:mm'), desc: '提了一个工单'})),
37
+        ...(propList || []).map(x => ({...x, createDate: moment(x.createDate).format('MM-DD HH:mm'), desc: '申请了一个业主认证'})),
38
+        ...(billList || []).map(x => ({...x, createDate: moment(x.createDate).format('MM-DD HH:mm'), desc: '缴了一笔费用'})),
37
       ]
39
       ]
38
       
40
       
39
       if (compList.length === 0) {
41
       if (compList.length === 0) {
40
         setShowSlides(0)
42
         setShowSlides(0)
41
       } else {
43
       } else {
42
-        setShowSlides(compList.length > 10 ? 10 : compList.length - 1)
44
+        setShowSlides(compList.length > showMax ? showMax : compList.length - 1)
43
       }
45
       }
44
 
46
 
45
       // 按照时间倒叙
47
       // 按照时间倒叙

+ 11
- 3
src/pages/dashboard/components/ShortCut.jsx Wyświetl plik

6
 import ABPart from './ABPart'
6
 import ABPart from './ABPart'
7
 
7
 
8
 const Title = props => <div> <Icon type={props.icon} style={{color: props.color, fontSize: '1.2em'}} /> <span style={{display: 'inline-block', marginLeft: 8}}>{props.children}</span></div>
8
 const Title = props => <div> <Icon type={props.icon} style={{color: props.color, fontSize: '1.2em'}} /> <span style={{display: 'inline-block', marginLeft: 8}}>{props.children}</span></div>
9
-const StatNum = props => <Spin spinning={props.loading}><div style={{textAlign: 'center'}}><span style={{fontSize: '2em'}}>{props.value}</span> {props.unit}</div></Spin>
9
+const StatNum = props => <Spin spinning={props.loading}><div style={{textAlign: 'center'}}><span style={{fontSize: '1.6em'}}>{props.value}</span> {props.unit}</div></Spin>
10
 
10
 
11
 const getStatis = fetch(apis.dashboard.statis)
11
 const getStatis = fetch(apis.dashboard.statis)
12
 
12
 
37
           <Card title={false}>
37
           <Card title={false}>
38
             <ABPart
38
             <ABPart
39
               align="middle"
39
               align="middle"
40
+              gutter={8}
41
+              left={12}
40
               a={<Title icon="home" color="#f50">楼栋管理</Title>}
42
               a={<Title icon="home" color="#f50">楼栋管理</Title>}
41
               b={<StatNum loading={loading} value={data.buildingNum} unit="栋" />}
43
               b={<StatNum loading={loading} value={data.buildingNum} unit="栋" />}
42
             />
44
             />
48
           <Card title={false}>
50
           <Card title={false}>
49
             <ABPart
51
             <ABPart
50
               align="middle"
52
               align="middle"
53
+              gutter={8}
54
+              left={12}
51
               a={<Title icon="user" color="#2db7f5">业主管理</Title>}
55
               a={<Title icon="user" color="#2db7f5">业主管理</Title>}
52
               b={<StatNum loading={loading} value={data.propNum} unit="人" />}
56
               b={<StatNum loading={loading} value={data.propNum} unit="人" />}
53
             />
57
             />
59
           <Card title={false}>
63
           <Card title={false}>
60
             <ABPart
64
             <ABPart
61
               align="middle"
65
               align="middle"
62
-              a={<Title icon="bank" color="#87d068">缴费管理(本月)</Title>}
66
+              gutter={8}
67
+              left={12}
68
+              a={<Title icon="bank" color="#87d068">缴费(本月)</Title>}
63
               b={<StatNum loading={loading} value={data.houseNum} unit="单" />}
69
               b={<StatNum loading={loading} value={data.houseNum} unit="单" />}
64
             />
70
             />
65
           </Card>
71
           </Card>
70
           <Card title={false}>
76
           <Card title={false}>
71
             <ABPart
77
             <ABPart
72
               align="middle"
78
               align="middle"
73
-              a={<Title icon="bell" color="#108ee9">工单管理(本月)</Title>}
79
+              gutter={8}
80
+              left={12}
81
+              a={<Title icon="bell" color="#108ee9">工单(本月)</Title>}
74
               b={<StatNum loading={loading} value={data.ticketNum} unit="条" />}
82
               b={<StatNum loading={loading} value={data.ticketNum} unit="条" />}
75
             />
83
             />
76
           </Card>
84
           </Card>