This commit is contained in:
Pringgosutono
2025-10-08 12:15:14 +07:00
parent f4202ce146
commit 136db1a158

View File

@ -1448,11 +1448,13 @@
},
showToListMovement: function(obj) {
let arrIdx = Helper.getIndexReversedSequence(obj.key_index - 1, Trucks.last_move.length - 1);
const unix = parseInt(obj?.lst_loc_crt_d) + AppState.TIMEFIX;
$('#infoMove-plots').append(`
<a href="#" class="plotMove-item" data-obj="${window.btoa( encodeURIComponent( JSON.stringify(obj) ) )}">
<li class="list-group-item p-1 px-2">
<p class="text-bold mb-0">${arrIdx + 1}</p>
<p class="text-bold mb-0">Time: ${moment.unix(obj?.lst_loc_crt_d).format('DD MMM YYYY HH:mm:ss')}</p>
<p class="text-bold mb-0">Time: ${moment.unix(unix).format('DD MMM YYYY HH:mm:ss')}</p>
<p class="text-muted mb-0">${Number(obj.latitude).toFixed(5)} - ${Number(obj.longitude).toFixed(6)}</p>
<p class="text-muted mb-2">${Helper.shortenText(decodeURIComponent(obj?.fulladdress || 'address'), 255)}</p>
<p class="mb-0">Current speed: ${Number(obj.speed)}km/h</p>
@ -1474,11 +1476,12 @@
},
createMarkerDetailPlotMovement: function(tr, opt = {}) {
Leaflet.clearLayer('eventRemoveDetailPlotMovement');
const unix = parseInt(tr?.lst_loc_crt_d) + AppState.TIMEFIX;
let marker = Leaflet.addMarkers({
lat: tr.latitude,
lng: tr.longitude,
// label: `<b>${tr.key_index}</b><br>${tr.nopol1} ${tr.nopol2} ${tr.nopol3}<br>${moment.unix(tr?.lst_loc_crt).format('DD MMM YYYY HH:mm')}<br>Speed: ${(typeof tr.lst_speed != 'undefined') ? tr.lst_speed : '0'}<br>${tr.latitude},${tr.longitude}<br>${decodeURIComponent(tr?.fulladdress || 'address')}`,
label: `<b>${tr.nopol1} ${tr.nopol2} ${tr.nopol3}</b><br>${moment.unix(tr?.lst_loc_crt).format('DD MMM YYYY HH:mm')}<br>${decodeURIComponent(tr?.fulladdress || 'address')}.<br><br>Current speed: ${tr?.speed}km/h`,
label: `<b>${tr.nopol1} ${tr.nopol2} ${tr.nopol3}</b><br>${moment.unix(unix).format('DD MMM YYYY HH:mm')}<br>${decodeURIComponent(tr?.fulladdress || 'address')}.<br><br>Current speed: ${tr?.speed}km/h`,
//label: `<b>${tr.nopol1} ${tr.nopol2} ${tr.nopol3}</b><br>${moment.unix(tr?.lst_loc_crt_d).utcOffset(9 * 60).format('DD MMM YYYY HH:mm:ss')}<br>${decodeURIComponent(tr?.fulladdress || 'address')}.<br><br>Current speed: ${tr?.speed}km/h`,
options: {
// icon: Icon.destination()
@ -2838,6 +2841,8 @@
allStartStop.push(marker)
}
const unix = parseInt(obj?.lst_loc_crt_d) + AppState.TIMEFIX;
return {
lat: obj.latitude,
lng: obj.longitude,
@ -2851,7 +2856,7 @@
radius: 5,
markerOpacity: 0
},
label: `<b>${obj.nopol1} ${obj.nopol2} ${obj.nopol3}</b><br>${moment.unix(obj?.lst_loc_crt_d).format('DD MMM YYYY HH:mm:ss')}<br>${decodeURIComponent(obj?.fulladdress || 'address')}`,
label: `<b>${obj.nopol1} ${obj.nopol2} ${obj.nopol3}</b><br>${moment.unix(unix).format('DD MMM YYYY HH:mm:ss')}<br>${decodeURIComponent(obj?.fulladdress || 'address')}`,
// startLast : (key == 0) ? 0 : (key == (groupTrip.length - 1)) ? 1 : null,
}
})