From 2d371784bd8a1fbefa0b489c3a4a2a1c04eaf7c9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 27 May 2022 09:24:32 -0700 Subject: Add route report map (fix #942) --- modern/src/reports/RouteReportPage.js | 110 ++++++++++++++++++++++++---------- 1 file changed, 78 insertions(+), 32 deletions(-) (limited to 'modern/src') diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js index c88da633..152d0ead 100644 --- a/modern/src/reports/RouteReportPage.js +++ b/modern/src/reports/RouteReportPage.js @@ -1,8 +1,10 @@ import React, { useState } from 'react'; import { - Table, TableBody, TableCell, TableHead, TableRow, + IconButton, Table, TableBody, TableCell, TableHead, TableRow, } from '@mui/material'; import { makeStyles } from '@mui/styles'; +import GpsFixedIcon from '@mui/icons-material/GpsFixed'; +import LocationSearchingIcon from '@mui/icons-material/LocationSearching'; import ReportFilter from './components/ReportFilter'; import { useTranslation } from '../common/components/LocalizationProvider'; import PageLayout from '../common/components/PageLayout'; @@ -12,8 +14,23 @@ import PositionValue from '../common/components/PositionValue'; import ColumnSelect from './components/ColumnSelect'; import usePositionAttributes from '../common/attributes/usePositionAttributes'; import { useCatch } from '../reactHelper'; +import Map from '../map/core/Map'; +import MapRoutePath from '../map/MapRoutePath'; +import MapPositions from '../map/MapPositions'; -const useStyles = makeStyles(() => ({ +const useStyles = makeStyles((theme) => ({ + container: { + height: '100%', + display: 'flex', + flexDirection: 'column', + }, + containerMap: { + flexBasis: '40%', + flexShrink: 0, + }, + containerMain: { + overflow: 'auto', + }, header: { position: 'sticky', left: 0, @@ -21,6 +38,10 @@ const useStyles = makeStyles(() => ({ flexDirection: 'column', alignItems: 'stretch', }, + columnAction: { + width: '1%', + paddingLeft: theme.spacing(1), + }, })); const RouteReportPage = () => { @@ -31,6 +52,7 @@ const RouteReportPage = () => { const [columns, setColumns] = usePersistedState('routeColumns', ['fixTime', 'latitude', 'longitude', 'speed', 'address']); const [items, setItems] = useState([]); + const [selectedItem, setSelectedItem] = useState(null); const handleSubmit = useCatch(async (deviceId, from, to, mail, headers) => { const query = new URLSearchParams({ @@ -53,37 +75,61 @@ const RouteReportPage = () => { return ( } breadcrumbs={['reportTitle', 'reportRoute']}> -
- - - -
- - - - {columns.map((key) => ({positionAttributes[key].name}))} - - - - {items.map((item) => ( - - {columns.map((key) => ( - - - +
+ {selectedItem && ( +
+ + + + +
+ )} +
+
+ + + +
+
+ + + + {columns.map((key) => ({positionAttributes[key].name}))} + + + + {items.map((item) => ( + + + {selectedItem === item ? ( + setSelectedItem(null)}> + + + ) : ( + setSelectedItem(item)}> + + + )} + + {columns.map((key) => ( + + + + ))} + ))} - - ))} - -
+ + + +
); }; -- cgit v1.2.3