fleetmap-reports 1.0.568 → 1.0.570
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/events-report.js +10 -2
- package/src/location-report.js +1 -1
package/package.json
CHANGED
package/src/events-report.js
CHANGED
|
@@ -173,7 +173,9 @@ async function exportSpeedingReportToPDF (userData, reportData) {
|
|
|
173
173
|
})
|
|
174
174
|
d.alerts.forEach(a => {
|
|
175
175
|
const temp = [
|
|
176
|
-
a.type === 'alarm'
|
|
176
|
+
a.type === 'alarm'
|
|
177
|
+
? getEventType(a, translations, d.device)
|
|
178
|
+
: translations.report['event_' + a.type],
|
|
177
179
|
getAlertDate(userData.user, a),
|
|
178
180
|
a.geofenceName || (a.position ? a.position.address : ''),
|
|
179
181
|
getAlertInfo(userData.drivers, a, d.device, translations)
|
|
@@ -214,6 +216,12 @@ async function exportSpeedingReportToPDF (userData, reportData) {
|
|
|
214
216
|
}
|
|
215
217
|
}
|
|
216
218
|
|
|
219
|
+
function getEventType (a, translations, device) {
|
|
220
|
+
let sensor
|
|
221
|
+
if (a.attributes.alarm === 'sensor') { sensor = device.attributes.sensor1 }
|
|
222
|
+
return sensor || translations.report['event_' + a.attributes.alarm] || a.attributes.alarm
|
|
223
|
+
}
|
|
224
|
+
|
|
217
225
|
function exportSpeedingReportToExcel (userData, reportData) {
|
|
218
226
|
console.log('exportSpeedingReportToExcel')
|
|
219
227
|
|
|
@@ -240,7 +248,7 @@ function exportSpeedingReportToExcel (userData, reportData) {
|
|
|
240
248
|
return {
|
|
241
249
|
name: d.device.name,
|
|
242
250
|
eventType: a.type === 'alarm'
|
|
243
|
-
?
|
|
251
|
+
? getEventType(a, translations, d.device)
|
|
244
252
|
: translations.report['event_' + a.type],
|
|
245
253
|
fixTime: getAlertDate(userData.user, a),
|
|
246
254
|
address: a.geofenceName || (a.position ? a.position.address : ''),
|
package/src/location-report.js
CHANGED
|
@@ -313,7 +313,7 @@ function getDigitalPort2Label (row, translations) {
|
|
|
313
313
|
return row.attributes.door2 || translations.report.digital_ports2
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
|
|
316
|
+
function getDigitalPortValue (row, index, translations, dAttributes) {
|
|
317
317
|
switch (index) {
|
|
318
318
|
case 1:
|
|
319
319
|
if (row.attributes && row.attributes.door1 !== undefined) {
|