mirror of
https://github.com/traccar/traccar-web.git
synced 2025-01-09 04:37:33 +08:00
Add Device Name column to Route report
This commit is contained in:
parent
a252dbe435
commit
11826f4b3e
@ -47,6 +47,10 @@ Ext.define('Traccar.AttributeFormatter', {
|
||||
return (hours + ' ' + Strings.sharedHourAbbreviation + ' ' + minutes + ' ' + Strings.sharedMinuteAbbreviation);
|
||||
},
|
||||
|
||||
deviceNameFormatter: function (value) {
|
||||
return Ext.getStore('Devices').findRecord('id', value).get('name');
|
||||
},
|
||||
|
||||
defaultFormatter: function (value) {
|
||||
if (typeof value === 'number') {
|
||||
return Number(value.toFixed(Traccar.Style.numberPrecision));
|
||||
@ -78,6 +82,8 @@ Ext.define('Traccar.AttributeFormatter', {
|
||||
return this.hoursFormatter;
|
||||
} else if (key === 'duration') {
|
||||
return this.durationFormatter;
|
||||
} else if (key === 'deviceName') {
|
||||
return this.deviceNameFormatter;
|
||||
} else {
|
||||
return this.defaultFormatter;
|
||||
}
|
||||
|
@ -225,6 +225,10 @@ Ext.define('Traccar.view.ReportController', {
|
||||
},
|
||||
|
||||
routeColumns: [{
|
||||
text: Strings.reportDeviceName,
|
||||
dataIndex: 'deviceId',
|
||||
renderer: Traccar.AttributeFormatter.getFormatter('deviceName')
|
||||
}, {
|
||||
text: Strings.positionValid,
|
||||
dataIndex: 'valid',
|
||||
renderer: Traccar.AttributeFormatter.getFormatter('valid')
|
||||
@ -263,9 +267,7 @@ Ext.define('Traccar.view.ReportController', {
|
||||
}, {
|
||||
text: Strings.reportDeviceName,
|
||||
dataIndex: 'deviceId',
|
||||
renderer: function (value) {
|
||||
return Ext.getStore('Devices').findRecord('id', value).get('name');
|
||||
}
|
||||
renderer: Traccar.AttributeFormatter.getFormatter('deviceName')
|
||||
}, {
|
||||
text: Strings.sharedType,
|
||||
dataIndex: 'type',
|
||||
@ -286,9 +288,7 @@ Ext.define('Traccar.view.ReportController', {
|
||||
summaryColumns: [{
|
||||
text: Strings.reportDeviceName,
|
||||
dataIndex: 'deviceId',
|
||||
renderer: function (value) {
|
||||
return Ext.getStore('Devices').findRecord('id', value).get('name');
|
||||
}
|
||||
renderer: Traccar.AttributeFormatter.getFormatter('deviceName')
|
||||
}, {
|
||||
text: Strings.sharedDistance,
|
||||
dataIndex: 'distance',
|
||||
@ -310,9 +310,7 @@ Ext.define('Traccar.view.ReportController', {
|
||||
tripsColumns: [{
|
||||
text: Strings.reportDeviceName,
|
||||
dataIndex: 'deviceId',
|
||||
renderer: function (value) {
|
||||
return Ext.getStore('Devices').findRecord('id', value).get('name');
|
||||
}
|
||||
renderer: Traccar.AttributeFormatter.getFormatter('deviceName')
|
||||
}, {
|
||||
text: Strings.reportStartTime,
|
||||
dataIndex: 'startTime',
|
||||
|
Loading…
Reference in New Issue
Block a user