报警信息
parent
c863afb393
commit
718756ad84
|
@ -1116,8 +1116,8 @@ export default {
|
||||||
},
|
},
|
||||||
subscription: {
|
subscription: {
|
||||||
// '+'是通配符
|
// '+'是通配符
|
||||||
// topic: '+/+/+/alarm',
|
|
||||||
topic: '+/UwbBQ/+/prop',
|
topic: '+/UwbBQ/+/prop',
|
||||||
|
topic1: '+/+/+/alarm',
|
||||||
qos: 0
|
qos: 0
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1484,6 +1484,7 @@ export default {
|
||||||
const point_id = pick.id._monitoItems.data.id
|
const point_id = pick.id._monitoItems.data.id
|
||||||
const corpInfoId = pick.id._monitoItems.data.corpInfoId
|
const corpInfoId = pick.id._monitoItems.data.corpInfoId
|
||||||
if (point_type === '标记点peoplePositionOne') {
|
if (point_type === '标记点peoplePositionOne') {
|
||||||
|
this.removeTrajectory()
|
||||||
this.addTrajectory(point_id, corpInfoId)
|
this.addTrajectory(point_id, corpInfoId)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1499,7 +1500,7 @@ export default {
|
||||||
corpId: corpInfoId
|
corpId: corpInfoId
|
||||||
}
|
}
|
||||||
).then((data) => {
|
).then((data) => {
|
||||||
console.log(data.list)
|
if (data.list) {
|
||||||
const positions = []
|
const positions = []
|
||||||
for (let i = 0; i < data.list.length; i++) {
|
for (let i = 0; i < data.list.length; i++) {
|
||||||
positions.push(Cesium.Cartesian3.fromDegrees(data.list[i].XAxis, data.list[i].YAxis))
|
positions.push(Cesium.Cartesian3.fromDegrees(data.list[i].XAxis, data.list[i].YAxis))
|
||||||
|
@ -1512,9 +1513,11 @@ export default {
|
||||||
collection.entities.add(entity)
|
collection.entities.add(entity)
|
||||||
viewer.dataSources.add(collection)
|
viewer.dataSources.add(collection)
|
||||||
this.trajectoryEntityCollection = collection
|
this.trajectoryEntityCollection = collection
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
removeTrajectory() {
|
removeTrajectory() {
|
||||||
|
if (Object.keys(this.trajectoryEntityCollection).length === 0) return
|
||||||
viewer.dataSources.remove(this.trajectoryEntityCollection)
|
viewer.dataSources.remove(this.trajectoryEntityCollection)
|
||||||
this.trajectoryEntityCollection = {}
|
this.trajectoryEntityCollection = {}
|
||||||
},
|
},
|
||||||
|
@ -2584,6 +2587,7 @@ export default {
|
||||||
},
|
},
|
||||||
mqttMessage(CORP_INFO_ID) {
|
mqttMessage(CORP_INFO_ID) {
|
||||||
this.client.on('message', (topic, message) => {
|
this.client.on('message', (topic, message) => {
|
||||||
|
if (topic.indexOf('UwbBQ') !== -1 && topic.indexOf('prop') !== -1) {
|
||||||
// created by liu jun mqtt返回的参数可能是一个数组
|
// created by liu jun mqtt返回的参数可能是一个数组
|
||||||
let peopleList = JSON.parse(message)
|
let peopleList = JSON.parse(message)
|
||||||
if (!Array.isArray(peopleList)) {
|
if (!Array.isArray(peopleList)) {
|
||||||
|
@ -2624,6 +2628,15 @@ export default {
|
||||||
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (topic.indexOf('alarm') !== -1) {
|
||||||
|
const formatMessage = JSON.parse(message)
|
||||||
|
this.$notify({
|
||||||
|
title: '报警信息',
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
message: `部门:${formatMessage.deptName}<br/>类型:${formatMessage.identifierName}`,
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
clearMqttPoint(prefix) {
|
clearMqttPoint(prefix) {
|
||||||
|
@ -2644,8 +2657,8 @@ export default {
|
||||||
},
|
},
|
||||||
// 订阅
|
// 订阅
|
||||||
doSubscribe() {
|
doSubscribe() {
|
||||||
const { topic, qos } = this.subscription
|
const { topic, topic1, qos } = this.subscription
|
||||||
this.client.subscribe(topic, { qos }, (error, res) => {
|
this.client.subscribe([topic, topic1], { qos }, (error, res) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.log('Subscribe to topics error', error)
|
console.log('Subscribe to topics error', error)
|
||||||
return
|
return
|
||||||
|
@ -2656,8 +2669,8 @@ export default {
|
||||||
},
|
},
|
||||||
// 取消订阅
|
// 取消订阅
|
||||||
doUnSubscribe() {
|
doUnSubscribe() {
|
||||||
const { topic } = this.subscription
|
const { topic, topic1 } = this.subscription
|
||||||
this.client.unsubscribe(topic, error => {
|
this.client.unsubscribe([topic, topic1], error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.log('Subscribe to topics error', error)
|
console.log('Subscribe to topics error', error)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue