This commit is contained in:
guanj
2026-06-05 09:15:18 +08:00
parent b678083e87
commit 51db8d0370
3 changed files with 28 additions and 16 deletions

View File

@@ -699,13 +699,15 @@ const setMqtt = async () => {
// 设置消息接收回调
mqttClient.value.onMessage((subscribe: string, message: any) => {
const msg: any = uint8ArrayToObject(message)
console.log('🚀 ~ setMqtt ~ msg:', msg)
// console.log('🚀 ~ setMqtt ~ msg:', msg)
if (subscribe.split('/')[2] === 'rtData') {
// 指标数据
// await setImportJson(savedExportJson.value)
const list = [
...new Set(msg.filter((item: any) => item.devStatus === 1).map((item: any) => item.lineId))
]
setTimeout(() => {
if (done_json.value) {
done_json.value?.forEach(item => {
@@ -718,6 +720,12 @@ const setMqtt = async () => {
) //'B相负载电流-CP95:31'
}
})
list.forEach((listValue: any) => {
if (listValue == item.lineId && item.type == 'svg') {
item.props.fill.val = '#ff0000'
// item.common_animations.val = 'flash'
}
})
})
}
}, 500)
@@ -771,7 +779,7 @@ const singlePublish = async (id: string) => {
}
}
const publish = async (list: any) => {
console.log('🚀 ~ publish ~ list:', JSON.parse(list.path).canvasCfg.lineList)
// console.log('🚀 ~ publish ~ list:', JSON.parse(list.path).canvasCfg.lineList)
if (mqttClient.value) {
// 发送消息
await mqttClient.value.publish(