.
This commit is contained in:
parent
56f17f651d
commit
12f2d45ee4
@ -3,5 +3,5 @@ VITE_BASE_API = 'http://39.105.121.219'
|
|||||||
#VITE_BASE_API = 'http://127.0.0.1'
|
#VITE_BASE_API = 'http://127.0.0.1'
|
||||||
#VITE_BASE_API = 'http://api.jsyzhineng.com'
|
#VITE_BASE_API = 'http://api.jsyzhineng.com'
|
||||||
|
|
||||||
VITE_BASE_MQTT = 'mqtt://39.105.121.219:8083/mqtt'
|
VITE_BASE_MQTT = '39.105.121.219:8083/mqtt'
|
||||||
#VITE_BASE_MQTT = 'mqtt://8.130.77.146:8083/mqtt'
|
#VITE_BASE_MQTT = '8.130.77.146:8083/mqtt'
|
@ -1,5 +1,5 @@
|
|||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
VITE_BASE_API = 'http://api.jsyzhineng.com'
|
VITE_BASE_API = 'http://api.jsyzhineng.com'
|
||||||
|
|
||||||
VITE_BASE_MQTT = 'ws://39.105.121.219:8083/mqtt'
|
#VITE_BASE_MQTT = '39.105.121.219:8083/mqtt'
|
||||||
#VITE_BASE_MQTT = 'ws://8.130.77.146:8083/mqtt'
|
VITE_BASE_MQTT = '8.130.77.146:8083/mqtt'
|
32
App.vue
32
App.vue
@ -36,36 +36,35 @@
|
|||||||
methods: {
|
methods: {
|
||||||
//监听indexData的回调
|
//监听indexData的回调
|
||||||
indexDataHandler(e, data) {
|
indexDataHandler(e, data) {
|
||||||
// console.error("indexDataHandler_1:", {
|
|
||||||
// e: e,
|
|
||||||
// data: data
|
|
||||||
// });
|
|
||||||
if (e == this.indexData.eventType.land) {
|
if (e == this.indexData.eventType.land) {
|
||||||
// console.error("地块更新通知:", this.indexData.selectItem)
|
// console.error("地块更新通知:", this.indexData.selectItem)
|
||||||
|
|
||||||
this.dc.setLandItem(this.indexData.selectItem, null);
|
this.dc.setLandItem(this.indexData.selectItem, null);
|
||||||
}
|
}
|
||||||
if (e == this.indexData.eventType.device) {
|
if (e == this.indexData.eventType.device) {
|
||||||
// console.error("设备更新通知:", this.indexData.device)
|
// console.error("设备更新通知:", this.indexData.device)
|
||||||
|
|
||||||
this.dc.setStations(this.indexData.device.stations);
|
this.dc.setStations(this.indexData.device.stations);
|
||||||
this.dc.setFlapValves(this.indexData.device.flapValves);
|
this.dc.setFlapValves(this.indexData.device.flapValves);
|
||||||
this.dc.setValves(this.indexData.selectItem.id, this.indexData.device.waterOutlets);
|
this.dc.setValves(this.indexData.selectItem.id, this.indexData.device.waterOutlets);
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
console.error("indexDataHandler_2:", {
|
// console.error("indexDataHandler_2:", {
|
||||||
indexData: this.indexData,
|
// e: e,
|
||||||
dc: this.dc,
|
// data: data,
|
||||||
})
|
// indexData: this.indexData,
|
||||||
|
// dc: this.dc,
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
//Mqtt连接
|
//Mqtt连接
|
||||||
mqttLink(userId) {
|
mqttLink(userId) {
|
||||||
console.error("mqttLink");
|
|
||||||
this.mqtt.link(userId);
|
this.mqtt.link(userId);
|
||||||
},
|
},
|
||||||
//Mqtt断开连接
|
//Mqtt连接
|
||||||
mqttEnd() {
|
mqttSubscribes(topics) {
|
||||||
this.mqtt.over();
|
this.mqtt.subscribes(topics);
|
||||||
|
},
|
||||||
|
//Mqtt连接
|
||||||
|
mqttUnsubscribes(topics) {
|
||||||
|
this.mqtt.unsubscribes(topics);
|
||||||
},
|
},
|
||||||
//Mqtt消息回调
|
//Mqtt消息回调
|
||||||
mqttMsgHandler(topic, data) {
|
mqttMsgHandler(topic, data) {
|
||||||
@ -74,6 +73,11 @@
|
|||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//Mqtt断开连接
|
||||||
|
mqttEnd() {
|
||||||
|
this.mqtt.over();
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -25,9 +25,6 @@ class MqttUtil {
|
|||||||
static client;
|
static client;
|
||||||
static connected = false;
|
static connected = false;
|
||||||
static reconnectCount = 0;
|
static reconnectCount = 0;
|
||||||
onCallback = (data) => {
|
|
||||||
console.error("onCallback:", data)
|
|
||||||
};
|
|
||||||
|
|
||||||
//接收创建来的数据
|
//接收创建来的数据
|
||||||
constructor(eventHandler) {
|
constructor(eventHandler) {
|
||||||
|
Loading…
Reference in New Issue
Block a user