|
@@ -1012,14 +1012,19 @@ export default {
|
|
|
|
|
|
if (this.mqttData) {
|
|
if (this.mqttData) {
|
|
this.mqttData.on("message", (topic, message) => {
|
|
this.mqttData.on("message", (topic, message) => {
|
|
- console.log("topic", topic, message);
|
|
|
|
- const match = topic.match(/^\/dev\/(.+)\/tracker_targets$/);
|
|
|
|
- if (!match) {
|
|
|
|
|
|
+ const dataMatch = topic.match(/^\/dev\/(.+)\/tracker_targets$/);
|
|
|
|
+ const cmdMatch = topic.match(/^\/mps\/wx_(.+)\/notice$/);
|
|
|
|
+ if (dataMatch) {
|
|
|
|
+ if (dataMatch[1] === clientId) {
|
|
|
|
+ this.handleMessage(topic, message, clientId);
|
|
|
|
+ } else {
|
|
|
|
+ console.log(
|
|
|
|
+ "非本页面 clientId 的点位消息,忽略:",
|
|
|
|
+ topic
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ } else if (cmdMatch) {
|
|
this.$refs.alarmModel.hanOtherMessage(topic, message);
|
|
this.$refs.alarmModel.hanOtherMessage(topic, message);
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (match[1] == clientId) {
|
|
|
|
- this.handleMessage(topic, message, clientId);
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|