|
@ -4,6 +4,7 @@ import FtStream from 'components/common/FTStream/index.vue' |
|
|
import Check from 'components/home/Check/index.vue' |
|
|
import Check from 'components/home/Check/index.vue' |
|
|
import Stop from 'components/home/stop/index.vue' |
|
|
import Stop from 'components/home/stop/index.vue' |
|
|
import { ElMessageBox } from 'element-plus' |
|
|
import { ElMessageBox } from 'element-plus' |
|
|
|
|
|
import { FtMessage } from 'libs/message' |
|
|
import { isClose, socket } from 'libs/socket' |
|
|
import { isClose, socket } from 'libs/socket' |
|
|
import { sendControl } from 'libs/utils' |
|
|
import { sendControl } from 'libs/utils' |
|
|
import { useSystemStore } from 'stores/useSystemStore' // 引入 systemStore |
|
|
import { useSystemStore } from 'stores/useSystemStore' // 引入 systemStore |
|
@ -50,9 +51,17 @@ const statusMessage = (data: any) => { |
|
|
systemStore.updateSystemStatus(data) |
|
|
systemStore.updateSystemStatus(data) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const sensorMessage = (data: any) => { |
|
|
|
|
|
|
|
|
const sensorMessage = async (data: any) => { |
|
|
// 更新 systemStore 的 systemInfo |
|
|
// 更新 systemStore 的 systemInfo |
|
|
systemStore.updateSystemSensor(data) |
|
|
systemStore.updateSystemSensor(data) |
|
|
|
|
|
if (systemStore.systemStatus.dehumidifierRunning && systemStore.systemSensor.humidity <= systemStore.targetHumidity) { |
|
|
|
|
|
const params = { |
|
|
|
|
|
cmdCode: 'dehumidifier_stop', |
|
|
|
|
|
cmdId: '', |
|
|
|
|
|
} |
|
|
|
|
|
await sendControl(params) |
|
|
|
|
|
FtMessage.success('当前湿度已达目标湿度,除湿已完成') |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
socket.init(statusMessage, 'device_status_change') |
|
|
socket.init(statusMessage, 'device_status_change') |
|
|