|
@@ -1,5 +1,5 @@
|
1
|
1
|
import moment from 'moment'
|
2
|
|
-import { Card, List } from 'antd'
|
|
2
|
+import { Card, List, Badge, Space, Carousel } from 'antd'
|
3
|
3
|
import { useCallback, useEffect, useMemo, useState } from 'react'
|
4
|
4
|
import { getList } from '@/services/work'
|
5
|
5
|
import { random } from '@/utils/number'
|
|
@@ -39,6 +39,21 @@ const Avatar = (props) => {
|
39
|
39
|
return <div style={style}>{props.children}</div>
|
40
|
40
|
}
|
41
|
41
|
|
|
42
|
+
|
|
43
|
+const Content = (props) => {
|
|
44
|
+ const { item } = props;
|
|
45
|
+
|
|
46
|
+ const abnormal = item.antigenIsNormal === 0 || item.nucleicIsNormal === 0
|
|
47
|
+ const status = abnormal ? 'error' : 'success'
|
|
48
|
+
|
|
49
|
+ return (
|
|
50
|
+ <Space size="large">
|
|
51
|
+ <span><Badge status={status} /> { abnormal ? '异常' : '正常' }</span>
|
|
52
|
+ <span>{moment(item.createDate).format('HH:mm')}</span>
|
|
53
|
+ </Space>
|
|
54
|
+ )
|
|
55
|
+}
|
|
56
|
+
|
42
|
57
|
export default (props) => {
|
43
|
58
|
const [loading, setLoading] = useState(false)
|
44
|
59
|
const [list, setList] = useState([])
|
|
@@ -47,13 +62,13 @@ export default (props) => {
|
47
|
62
|
setLoading(true)
|
48
|
63
|
getList(
|
49
|
64
|
{
|
50
|
|
- pageSize: 500,
|
|
65
|
+ pageSize: 50, // 过多会很卡
|
51
|
66
|
start: moment().format('YYYY-MM-DD'),
|
52
|
67
|
end: moment().format('YYYY-MM-DD'),
|
53
|
68
|
isAll: true
|
54
|
69
|
}).then(res => {
|
55
|
70
|
setLoading(false)
|
56
|
|
- setList(res.records)
|
|
71
|
+ setList((res.records || []).reverse())
|
57
|
72
|
}).catch(er => {
|
58
|
73
|
setLoading(false)
|
59
|
74
|
})
|
|
@@ -65,21 +80,34 @@ export default (props) => {
|
65
|
80
|
|
66
|
81
|
return (
|
67
|
82
|
<Card title="今日提交记录" loading={loading} bodyStyle={{ height: 600 }}>
|
68
|
|
- <List
|
69
|
|
- itemLayout="horizontal"
|
70
|
|
- dataSource={list}
|
71
|
|
- renderItem={item => (
|
72
|
|
- <List.Item>
|
73
|
|
- <List.Item.Meta
|
74
|
|
- avatar={<Avatar>{item.orgName.substring(0,1)}</Avatar>}
|
75
|
|
- title={item.userName}
|
76
|
|
- con
|
77
|
|
- description={item.orgName}
|
78
|
|
- />
|
79
|
|
- <div>{moment(item.createDate).format('HH:mm')}</div>
|
80
|
|
- </List.Item>
|
81
|
|
- )}
|
82
|
|
- />
|
|
83
|
+ <List style={{ height: '100%', overflow: 'hidden' }} itemLayout="horizontal">
|
|
84
|
+ <Carousel
|
|
85
|
+ autoplay
|
|
86
|
+ infinite
|
|
87
|
+ rtl
|
|
88
|
+ slidesToShow={8}
|
|
89
|
+ slidesToScroll={1}
|
|
90
|
+ dot={false}
|
|
91
|
+ dotPosition="right"
|
|
92
|
+ style={{ height: '100%' }}
|
|
93
|
+ >
|
|
94
|
+ {
|
|
95
|
+ list.map(item => (
|
|
96
|
+ <div key={item.formId} style={{ display: 'flex' }}>
|
|
97
|
+ <List.Item>
|
|
98
|
+ <List.Item.Meta
|
|
99
|
+ avatar={<Avatar>{item.orgName.substring(0,1)}</Avatar>}
|
|
100
|
+ title={item.userName}
|
|
101
|
+ con
|
|
102
|
+ description={item.orgName}
|
|
103
|
+ />
|
|
104
|
+ <Content item={item} />
|
|
105
|
+ </List.Item>
|
|
106
|
+ </div>
|
|
107
|
+ ))
|
|
108
|
+ }
|
|
109
|
+ </Carousel>
|
|
110
|
+ </List>
|
83
|
111
|
</Card>
|
84
|
112
|
)
|
85
|
113
|
}
|