|
@@ -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
|
// 按照时间倒叙
|