Browse Source

gpsType调整0gps,1wifi,2基站

hand_device
xh 2 weeks ago
parent
commit
459a4183da
  1. 12
      web/src/views/HandDevice/Home/components/services/popup.service.ts
  2. 27
      web/src/views/gas/tdengine/original.vue

12
web/src/views/HandDevice/Home/components/services/popup.service.ts

@ -36,6 +36,14 @@ export class PopupService {
* *
*/ */
handleSingleMarkerPopup(markerData: MarkerData): string { handleSingleMarkerPopup(markerData: MarkerData): string {
let gpsTypeName = ''
if (markerData.gpsType === 0) {
gpsTypeName = 'GPS'
} else if (markerData.gpsType === 1) {
gpsTypeName = 'WIFI'
} else if (markerData.gpsType === 2) {
gpsTypeName = '基站'
}
return ` return `
<div style="font-weight: bold; margin-bottom: 4px;">${markerData.name}</div> <div style="font-weight: bold; margin-bottom: 4px;">${markerData.name}</div>
<div style="color: ${markerData.statusColor};"> <div style="color: ${markerData.statusColor};">
@ -54,10 +62,10 @@ export class PopupService {
<div>${markerData.sig||''}</div> <div>${markerData.sig||''}</div>
<div>${markerData.timeStr ? markerData.timeStr : '-'} </div> <div>${markerData.timeStr ? markerData.timeStr : '-'} </div>
<div> <div>
${markerData.coordinates[0].toFixed(6)}, ${markerData.coordinates[1].toFixed(6)}/${markerData.gpsType===0?"GPS":"基站"}
${markerData.coordinates[0].toFixed(6)}, ${markerData.coordinates[1].toFixed(6)}/${gpsTypeName}
</div> </div>
` `
// gpsType:0表示GPS,550表示基站(或者非0就判定为基站)
// gpsType:新0 GPS、1 Wi-Fi、2 基站,旧0表示GPS,550表示基站(或者非0就判定为基站)
} }
/** /**

27
web/src/views/gas/tdengine/original.vue

@ -135,9 +135,30 @@ const getList = async () => {
try { try {
let payload = JSON.parse(item.payload) let payload = JSON.parse(item.payload)
var loc = payload.loc as number[] var loc = payload.loc as number[]
if (loc && loc.length == 3) {
item.gpsType = loc[2] === 0 ? 'GPS' : '基站'
if (loc && loc.length == 3) {// 3
item.gpsType = ''
switch (loc[2]) {
case 0:
item.gpsType = 'GPS'
break
default:
item.gpsType = '基站'
}
} else if (loc && loc.length == 4) {// 40GPS1WIFI2
item.gpsType = ''
switch (loc[3]) {
case 0:
item.gpsType = 'GPS'
break
case 1:
item.gpsType = 'WIFI'
break
case 2:
item.gpsType = '基站'
break
default:
item.gpsType = loc[2]
}
} else { } else {
item.gpsType = '-' item.gpsType = '-'
} }

Loading…
Cancel
Save