@@ -86,8 +86,10 @@ const EventReportPage = () => {
86
86
}
87
87
} , [ ] ) ;
88
88
89
- const handleSubmit = useCatch ( async ( { deviceId, from, to, type } ) => {
90
- const query = new URLSearchParams ( { deviceId, from, to } ) ;
89
+ const handleSubmit = useCatch ( async ( { deviceIds, groupIds, from, to, type } ) => {
90
+ const query = new URLSearchParams ( { from, to } ) ;
91
+ deviceIds . forEach ( ( deviceId ) => query . append ( 'deviceId' , deviceId ) ) ;
92
+ groupIds . forEach ( ( groupId ) => query . append ( 'groupId' , groupId ) ) ;
91
93
eventTypes . forEach ( ( it ) => query . append ( 'type' , it ) ) ;
92
94
if ( eventTypes [ 0 ] !== 'allEvents' && eventTypes . includes ( 'alarm' ) ) {
93
95
alarmTypes . forEach ( ( it ) => query . append ( 'alarm' , it ) ) ;
@@ -132,6 +134,8 @@ const EventReportPage = () => {
132
134
const formatValue = ( item , key ) => {
133
135
const value = item [ key ] ;
134
136
switch ( key ) {
137
+ case 'deviceId' :
138
+ return devices [ value ] . name ;
135
139
case 'eventTime' :
136
140
return formatTime ( value , 'seconds' ) ;
137
141
case 'type' :
@@ -179,7 +183,7 @@ const EventReportPage = () => {
179
183
) }
180
184
< div className = { classes . containerMain } >
181
185
< div className = { classes . header } >
182
- < ReportFilter handleSubmit = { handleSubmit } handleSchedule = { handleSchedule } loading = { loading } >
186
+ < ReportFilter handleSubmit = { handleSubmit } handleSchedule = { handleSchedule } multiDevice includeGroups loading = { loading } >
183
187
< div className = { classes . filterItem } >
184
188
< FormControl fullWidth >
185
189
< InputLabel > { t ( 'reportEventTypes' ) } </ InputLabel >
@@ -222,6 +226,7 @@ const EventReportPage = () => {
222
226
< TableHead >
223
227
< TableRow >
224
228
< TableCell className = { classes . columnAction } />
229
+ < TableCell > { t ( 'sharedDevice' ) } </ TableCell >
225
230
{ columns . map ( ( key ) => ( < TableCell key = { key } > { t ( columnsMap . get ( key ) ) } </ TableCell > ) ) }
226
231
</ TableRow >
227
232
</ TableHead >
@@ -239,13 +244,14 @@ const EventReportPage = () => {
239
244
</ IconButton >
240
245
) ) ) || '' }
241
246
</ TableCell >
247
+ < TableCell > { devices [ item . deviceId ] . name } </ TableCell >
242
248
{ columns . map ( ( key ) => (
243
249
< TableCell key = { key } >
244
250
{ formatValue ( item , key ) }
245
251
</ TableCell >
246
252
) ) }
247
253
</ TableRow >
248
- ) ) : ( < TableShimmer columns = { columns . length + 1 } /> ) }
254
+ ) ) : ( < TableShimmer columns = { columns . length + 2 } /> ) }
249
255
</ TableBody >
250
256
</ Table >
251
257
</ div >
0 commit comments