diff options
author | Iván Ávalos <avalos@disroot.org> | 2023-03-05 21:43:11 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2023-03-05 21:43:11 -0600 |
commit | 19a5dc94fcb678e27e766258b2839c139953776c (patch) | |
tree | 3e6e9d2c11f082b3980260541abaf4ea0a7b3392 /modern/src/reports | |
parent | 5c425999cf2d2aed657c61dbc636d9ac178aa63a (diff) | |
download | etbsa-traccar-web-19a5dc94fcb678e27e766258b2839c139953776c.tar.gz etbsa-traccar-web-19a5dc94fcb678e27e766258b2839c139953776c.tar.bz2 etbsa-traccar-web-19a5dc94fcb678e27e766258b2839c139953776c.zip |
Cambios en reportes
Diffstat (limited to 'modern/src/reports')
-rw-r--r-- | modern/src/reports/EventReportPage.js | 18 | ||||
-rw-r--r-- | modern/src/reports/ReportLayout.js | 1 | ||||
-rw-r--r-- | modern/src/reports/StopReportPage.js | 32 | ||||
-rw-r--r-- | modern/src/reports/SummaryReportPage.js | 30 | ||||
-rw-r--r-- | modern/src/reports/TripReportPage.js | 5 |
5 files changed, 34 insertions, 52 deletions
diff --git a/modern/src/reports/EventReportPage.js b/modern/src/reports/EventReportPage.js index 8e81039..27f8bf9 100644 --- a/modern/src/reports/EventReportPage.js +++ b/modern/src/reports/EventReportPage.js @@ -18,20 +18,14 @@ const Filter = ({ setItems }) => { const [data, setData] = useState({url: '', filename: ''}); const [eventTypes, setEventTypes] = useState([ - 'deviceInactive', - 'deviceMoving', - 'deviceStopped', 'deviceOverspeed', 'deviceFuelDrop', 'commandResult', 'geofenceEnter', 'geofenceExit', - 'alarm', 'ignitionOn', 'ignitionOff', 'maintenance', - 'textMessage', - 'driverChanged', ]); const renderSelectedEvents = (value) => { @@ -109,20 +103,20 @@ const Filter = ({ setItems }) => { {/*<MenuItem value="deviceOnline">{t('eventDeviceOnline')}</MenuItem>*/} {/*<MenuItem value="deviceUnknown">{t('eventDeviceUnknown')}</MenuItem>*/} {/*<MenuItem value="deviceOffline">{t('eventDeviceOffline')}</MenuItem>*/} - <MenuItem value="deviceInactive">{t('eventDeviceInactive')}</MenuItem> - <MenuItem value="deviceMoving">{t('eventDeviceMoving')}</MenuItem> - <MenuItem value="deviceStopped">{t('eventDeviceStopped')}</MenuItem> + {/*<MenuItem value="deviceInactive">{t('eventDeviceInactive')}</MenuItem>*/} + {/*<MenuItem value="deviceMoving">{t('eventDeviceMoving')}</MenuItem>*/} + {/*<MenuItem value="deviceStopped">{t('eventDeviceStopped')}</MenuItem>*/} <MenuItem value="deviceOverspeed">{t('eventDeviceOverspeed')}</MenuItem> <MenuItem value="deviceFuelDrop">{t('eventDeviceFuelDrop')}</MenuItem> <MenuItem value="commandResult">{t('eventCommandResult')}</MenuItem> <MenuItem value="geofenceEnter">{t('eventGeofenceEnter')}</MenuItem> <MenuItem value="geofenceExit">{t('eventGeofenceExit')}</MenuItem> - <MenuItem value="alarm">{t('eventAlarm')}</MenuItem> + {/*<MenuItem value="alarm">{t('eventAlarm')}</MenuItem>*/} <MenuItem value="ignitionOn">{t('eventIgnitionOn')}</MenuItem> <MenuItem value="ignitionOff">{t('eventIgnitionOff')}</MenuItem> <MenuItem value="maintenance">{t('eventMaintenance')}</MenuItem> - <MenuItem value="textMessage">{t('eventTextMessage')}</MenuItem> - <MenuItem value="driverChanged">{t('eventDriverChanged')}</MenuItem> + {/*<MenuItem value="textMessage">{t('eventTextMessage')}</MenuItem>*/} + {/*<MenuItem value="driverChanged">{t('eventDriverChanged')}</MenuItem>*/} </Select> </FormControl> </Grid> diff --git a/modern/src/reports/ReportLayout.js b/modern/src/reports/ReportLayout.js index f6e71db..f95787b 100644 --- a/modern/src/reports/ReportLayout.js +++ b/modern/src/reports/ReportLayout.js @@ -66,7 +66,6 @@ const ReportLayout = ({ children, filter }) => { { name: t('reportTrips'), href: '/reports/trip', icon: <PlayCircleFilledIcon /> }, { name: t('reportStops'), href: '/reports/stop', icon: <PauseCircleFilledIcon /> }, { name: t('reportSummary'), href: '/reports/summary', icon: <FormatListBulletedIcon /> }, - { name: t('reportChart'), href: '/reports/chart', icon: <TrendingUpIcon /> }, ], [t]); useEffect(() => { diff --git a/modern/src/reports/StopReportPage.js b/modern/src/reports/StopReportPage.js index 5012637..208c604 100644 --- a/modern/src/reports/StopReportPage.js +++ b/modern/src/reports/StopReportPage.js @@ -83,12 +83,6 @@ const StopReportPage = () => { width: theme.dimensions.columnWidthNumber, valueFormatter: ({ value }) => formatDistance(value, distanceUnit, t), }, { - headerName: t('positionAddress'), - field: 'address', - type: 'string', - hide: true, - width: theme.dimensions.columnWidthString, - }, { headerName: t('reportEndTime'), field: 'endTime', type: 'dateTime', @@ -101,29 +95,29 @@ const StopReportPage = () => { width: theme.dimensions.columnWidthNumber, valueFormatter: ({ value }) => formatHours(value, t), }, { - headerName: t('reportEngineHours'), - field: 'engineHours', - type: 'string', - width: theme.dimensions.columnWidthNumber, - valueFormatter: ({ value }) => formatHours(value, t), - }, { headerName: t('reportSpentFuel'), field: 'spentFuel', type: 'number', width: theme.dimensions.columnWidthNumber, hide: true, valueFormatter: ({ value }) => formatVolume(value, volumeUnit, t), + }, { + headerName: t('positionAddress'), + field: 'address', + type: 'string', + width: theme.dimensions.columnWidthString, + // valueFormatter: ({ value }) => formatVolume(value, volumeUnit, t), }]; return ( <ReportLayout filter={<Filter setItems={setItems} />}> - <DataGrid - rows={items} - columns={columns} - hideFooter - autoHeight - getRowId={() => Math.random()} - /> + <DataGrid + rows={items} + columns={columns} + hideFooter + autoHeight + getRowId={() => Math.random()} + /> </ReportLayout> ); }; diff --git a/modern/src/reports/SummaryReportPage.js b/modern/src/reports/SummaryReportPage.js index 4413895..3c0d292 100644 --- a/modern/src/reports/SummaryReportPage.js +++ b/modern/src/reports/SummaryReportPage.js @@ -83,18 +83,24 @@ const SummaryReportPage = () => { const [items, setItems] = useState([]); const columns = [{ - headerName: t('reportStartDate'), + headerName: t('reportStartTime'), field: 'startTime', type: 'dateTime', width: theme.dimensions.columnWidthDate, valueFormatter: ({ value }) => formatDate(value), }, { - headerName: t('sharedDistance'), - field: 'distance', - type: 'number', - width: theme.dimensions.columnWidthNumber, - valueFormatter: ({ value }) => formatDistance(value, distanceUnit, t), + headerName: t('reportEndTime'), + field: 'endTime', + type: 'dateTime', + width: theme.dimensions.columnWidthDate, + valueFormatter: ({ value }) => formatDate(value), }, { + headerName: t('sharedDistance'), + field: 'distance', + type: 'number', + width: theme.dimensions.columnWidthNumber, + valueFormatter: ({ value }) => formatDistance(value, distanceUnit, t), + }, { headerName: t('reportStartOdometer'), field: 'startOdometer', type: 'number', @@ -107,18 +113,6 @@ const SummaryReportPage = () => { width: theme.dimensions.columnWidthNumber, valueFormatter: ({ value }) => formatDistance(value, distanceUnit, t), }, { - headerName: t('reportAverageSpeed'), - field: 'averageSpeed', - type: 'number', - width: theme.dimensions.columnWidthNumber, - valueFormatter: ({ value }) => formatSpeed(value, speedUnit, t), - }, { - headerName: t('reportMaximumSpeed'), - field: 'maxSpeed', - type: 'number', - width: theme.dimensions.columnWidthNumber, - valueFormatter: ({ value }) => formatSpeed(value, speedUnit, t), - }, { headerName: t('reportEngineHours'), field: 'engineHours', type: 'string', diff --git a/modern/src/reports/TripReportPage.js b/modern/src/reports/TripReportPage.js index 74451bc..0803eec 100644 --- a/modern/src/reports/TripReportPage.js +++ b/modern/src/reports/TripReportPage.js @@ -71,6 +71,8 @@ const TripReportPage = () => { const [items, setItems] = useState([]); + console.log(items); + const columns = [{ headerName: t('reportStartTime'), field: 'startTime', @@ -87,7 +89,6 @@ const TripReportPage = () => { headerName: t('reportStartAddress'), field: 'startAddress', type: 'string', - hide: true, width: theme.dimensions.columnWidthString, }, { headerName: t('reportEndTime'), @@ -105,7 +106,6 @@ const TripReportPage = () => { headerName: t('reportEndAddress'), field: 'endAddress', type: 'string', - hide: true, width: theme.dimensions.columnWidthString, }, { headerName: t('sharedDistance'), @@ -124,6 +124,7 @@ const TripReportPage = () => { field: 'maxSpeed', type: 'number', width: theme.dimensions.columnWidthNumber, + hide: true, valueFormatter: ({ value }) => formatSpeed(value, speedUnit, t), }, { headerName: t('reportDuration'), |