|
|
@ -142,45 +142,47 @@ const emptyColor = "#FFFFFF"; |
|
|
|
const taskName = ref(""); |
|
|
|
let globeStatus: any = 0; |
|
|
|
onMounted(() => { |
|
|
|
//6个加热区数据 |
|
|
|
heatList.value = settingStore.heatAreaConfig.map((item: any) => { |
|
|
|
//添加一个字段,默认为未选中 |
|
|
|
item.isSelect = false; |
|
|
|
heatAearStatusList.value.forEach((areaItem: any) => { |
|
|
|
if (areaItem.hardwareId == item.hardwareId) { |
|
|
|
item = { |
|
|
|
...item, |
|
|
|
heatAearStatus: areaItem, |
|
|
|
}; |
|
|
|
} |
|
|
|
}); |
|
|
|
return item; |
|
|
|
}); |
|
|
|
//设备16个试管的基础数据 |
|
|
|
tubeBaseConfig(); |
|
|
|
//连接socket |
|
|
|
const wsClient = createWebSocket(sharedWsUrl); |
|
|
|
const subscription = wsClient.dataOb.subscribe(data => { |
|
|
|
if (!globeStatus) { |
|
|
|
//为了只输入一行,不想后台一直打印此处日志 TODO |
|
|
|
console.log("globeStatus====", data); |
|
|
|
} |
|
|
|
globeStatus = 1; |
|
|
|
if (data.type === "cmd") { |
|
|
|
const cmdInfo = getTxnRecord(data.data.commandId, "task"); |
|
|
|
if (cmdInfo) { |
|
|
|
const command: any = cmdInfo.command; |
|
|
|
//@ts-ignore |
|
|
|
const cmdName = CmdDescMap[command]; |
|
|
|
const result = data.data.success ? "执行完毕" : `执行失败 ${data.data.message}`; |
|
|
|
ElMessage({ |
|
|
|
message: `${cmdName} ${result}`, |
|
|
|
type: data.data.success ? "success" : "error", |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
wsClient.connect(); |
|
|
|
//6个加热区数据 |
|
|
|
heatList.value = settingStore.heatAreaConfig.map((item:any) => { |
|
|
|
//添加一个字段,默认为未选中 |
|
|
|
item.isSelect = false; |
|
|
|
heatAearStatusList.value.forEach((areaItem:any) => { |
|
|
|
if(areaItem.hardwareId == item.hardwareId){ |
|
|
|
item = { |
|
|
|
...item, |
|
|
|
heatAearStatus:areaItem |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
return item; |
|
|
|
}); |
|
|
|
//设备16个试管的基础数据 |
|
|
|
tubeBaseConfig(); |
|
|
|
//连接socket |
|
|
|
const wsClient = createWebSocket(sharedWsUrl); |
|
|
|
const subscription = wsClient.dataOb.subscribe((data) => { |
|
|
|
if(!globeStatus){//为了只输入一行,不想后台一直打印此处日志 TODO |
|
|
|
console.log('globeStatus====', data) |
|
|
|
} |
|
|
|
globeStatus = 1; |
|
|
|
if (data.type === "cmd") { |
|
|
|
const cmdInfo = getTxnRecord(data.data.commandId, "task"); |
|
|
|
if (cmdInfo) { |
|
|
|
const command:any = cmdInfo.command; |
|
|
|
//@ts-ignore |
|
|
|
const cmdName = CmdDescMap[command]; |
|
|
|
console.log('data.data--', data.data) |
|
|
|
const result = data.data.success |
|
|
|
? "执行完毕" |
|
|
|
: `执行失败 ${data.data.message}`; |
|
|
|
ElMessage({ |
|
|
|
message: `${cmdName} ${result}`, |
|
|
|
type: data.data.success ? "success" : "error", |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
wsClient.connect(); |
|
|
|
|
|
|
|
onUnmounted(() => { |
|
|
|
subscription.unsubscribe(); |
|
|
|