一公司人员定位系统没有人员信息bug修复
							parent
							
								
									26e8b67eba
								
							
						
					
					
						commit
						9adaee5a09
					
				|  | @ -1051,7 +1051,7 @@ export default { | |||
|         password: '58d06a44d56c4445b4c019492f86ee8d' | ||||
|       }, | ||||
|       subscription: { | ||||
|         topic: '1698584148364034050/UwbBQ/+/prop', | ||||
|         topic: '1698584148364034050/+/+/prop', | ||||
|         qos: 0 | ||||
|       }, | ||||
| 
 | ||||
|  | @ -1997,11 +1997,17 @@ export default { | |||
|     }, | ||||
|     mqttMessage(CORP_INFO_ID) { | ||||
|       this.client.on('message', (topic, message) => { | ||||
|         // console.info(message) | ||||
|         // if(this.intOne === 0){ | ||||
|         // this.receiveNews = this.receiveNews.concat(message) | ||||
|         // console.log(`Received message ${message} from topic ${topic}`) | ||||
|         const item = JSON.parse(message) | ||||
|         // created by liu jun mqtt返回的参数可能是一个数组 | ||||
|         let peopleList = JSON.parse(message) | ||||
|         if (!Array.isArray(peopleList)) { | ||||
|           peopleList = [peopleList] | ||||
|         } | ||||
|         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 => { | ||||
|             return item1.id.toString() === item.deviceCode.toString() | ||||
|  | @ -2032,12 +2038,7 @@ export default { | |||
|             ry_drag.addEntity(perLoc) | ||||
|             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) { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue