张延森 4 年之前
父節點
當前提交
bf64b9ddca

+ 7
- 3
src/pages/dashboard/components/ABPart.jsx 查看文件

@@ -2,10 +2,14 @@ import React, { useEffect, useState } from 'react'
2 2
 import { Row, Col } from 'antd'
3 3
 
4 4
 export default props => {
5
+
6
+  const left = props.left || 16
7
+  const right = 24 - left
8
+
5 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 13
     </Row>
10 14
   )
11 15
 }

+ 7
- 5
src/pages/dashboard/components/ScrollAlert.jsx 查看文件

@@ -7,12 +7,14 @@ import { fetch, apis } from '@/utils/request'
7 7
 const getDynamic = fetch(apis.dashboard.dynamic)
8 8
 
9 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 11
     <Col span={8}>{props.dataSource.createDate}</Col>
12 12
     <Col span={16}>{`${props.dataSource.nickname} ${props.dataSource.desc}`}</Col>
13 13
   </Row>
14 14
 )
15 15
 
16
+const showMax = 10
17
+
16 18
 export default props => {
17 19
   const [loading, setLoading] = useState(false)
18 20
   const [list, setList] = useState([])
@@ -31,15 +33,15 @@ export default props => {
31 33
 
32 34
       // 组合list
33 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 41
       if (compList.length === 0) {
40 42
         setShowSlides(0)
41 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 查看文件

@@ -6,7 +6,7 @@ import { fetch, apis } from '@/utils/request'
6 6
 import ABPart from './ABPart'
7 7
 
8 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 11
 const getStatis = fetch(apis.dashboard.statis)
12 12
 
@@ -37,6 +37,8 @@ export default props => {
37 37
           <Card title={false}>
38 38
             <ABPart
39 39
               align="middle"
40
+              gutter={8}
41
+              left={12}
40 42
               a={<Title icon="home" color="#f50">楼栋管理</Title>}
41 43
               b={<StatNum loading={loading} value={data.buildingNum} unit="栋" />}
42 44
             />
@@ -48,6 +50,8 @@ export default props => {
48 50
           <Card title={false}>
49 51
             <ABPart
50 52
               align="middle"
53
+              gutter={8}
54
+              left={12}
51 55
               a={<Title icon="user" color="#2db7f5">业主管理</Title>}
52 56
               b={<StatNum loading={loading} value={data.propNum} unit="人" />}
53 57
             />
@@ -59,7 +63,9 @@ export default props => {
59 63
           <Card title={false}>
60 64
             <ABPart
61 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 69
               b={<StatNum loading={loading} value={data.houseNum} unit="单" />}
64 70
             />
65 71
           </Card>
@@ -70,7 +76,9 @@ export default props => {
70 76
           <Card title={false}>
71 77
             <ABPart
72 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 82
               b={<StatNum loading={loading} value={data.ticketNum} unit="条" />}
75 83
             />
76 84
           </Card>