一公司人员定位系统没有人员信息bug修复

5_7_地图同步
liujun 2024-03-26 10:14:33 +08:00
parent 87ef70fcbe
commit 47d48eebb3
1 changed files with 39 additions and 41 deletions

View File

@ -1105,7 +1105,7 @@ export default {
password: '58d06a44d56c4445b4c019492f86ee8d' password: '58d06a44d56c4445b4c019492f86ee8d'
}, },
subscription: { subscription: {
topic: '1698584148364034050/UwbBQ/+/prop', topic: '1698584148364034050/+/+/prop',
qos: 0 qos: 0
}, },
@ -2519,12 +2519,18 @@ export default {
}, },
mqttMessage(CORP_INFO_ID) { mqttMessage(CORP_INFO_ID) {
this.client.on('message', (topic, message) => { this.client.on('message', (topic, message) => {
// console.info(message) // created by liu jun mqtt
// if(this.intOne === 0){ let peopleList = JSON.parse(message)
// this.receiveNews = this.receiveNews.concat(message) if (!Array.isArray(peopleList)) {
// console.log(`Received message ${message} from topic ${topic}`) peopleList = [peopleList]
const item = JSON.parse(message) }
// for (let i = 0; i < peopleList.length; i++) {
const item = peopleList[i]
//
if (item.properties.length < 3 || item.properties[2].identifier !== 'X' || item.properties[3].identifier !== 'Y') {
continue
}
//
const index = this.onePerLocArr.findIndex(item1 => { const index = this.onePerLocArr.findIndex(item1 => {
return item1.id.toString() === item.deviceCode.toString() return item1.id.toString() === item.deviceCode.toString()
}) })
@ -2537,14 +2543,11 @@ export default {
this.onePerLocArr[index].icon_type = 'img4_0' + pointColor this.onePerLocArr[index].icon_type = 'img4_0' + pointColor
ry_drag.getPosition(this.onePerLocArr[index]) ry_drag.getPosition(this.onePerLocArr[index])
} else { } else {
// const id = '4_0_' +item.deviceCode
const perLoc = { const perLoc = {
id: item.deviceCode, id: item.deviceCode,
// name: item.realName,
x: x, x: x,
y: y, y: y,
icon_type: 'img4_0' + pointColor, icon_type: 'img4_0' + pointColor,
// infoname: item.realName,
data_id: item.deviceCode, data_id: item.deviceCode,
point_type: '标记点peoplePositionOne', point_type: '标记点peoplePositionOne',
label: '人员定位', label: '人员定位',
@ -2554,12 +2557,7 @@ export default {
ry_drag.addEntity(perLoc) ry_drag.addEntity(perLoc)
this.mqttPoint[this.subscription.topic.substring(0, this.subscription.topic.lastIndexOf('+')) + item.deviceCode] = item.deviceCode this.mqttPoint[this.subscription.topic.substring(0, this.subscription.topic.lastIndexOf('+')) + item.deviceCode] = item.deviceCode
} }
// this.intOne++ }
// } else if(this.intOne < 5){
// this.intOne++
// } else {
// this.intOne = 0
// }
}) })
}, },
clearMqttPoint(prefix) { clearMqttPoint(prefix) {