|
@ -119,22 +119,22 @@ const liquidArea = ref() |
|
|
watch( |
|
|
watch( |
|
|
() => craftStore.craftInfo, |
|
|
() => craftStore.craftInfo, |
|
|
(newVal) => { |
|
|
(newVal) => { |
|
|
if(newVal){ |
|
|
|
|
|
heatList.value.forEach((item:any) => { |
|
|
|
|
|
if(item.id == newVal?.heatId && item.craftInfo){ |
|
|
|
|
|
item.craftInfo.status = newVal?.status |
|
|
|
|
|
if(newVal?.status == 3){//停止执行 |
|
|
|
|
|
|
|
|
if(newVal){ |
|
|
|
|
|
for(const item of heatList.value){ |
|
|
|
|
|
if(item.id == newVal?.heatId && item.craftInfo){ |
|
|
|
|
|
item.craftInfo.status = newVal?.status |
|
|
|
|
|
if(newVal?.status == 3){//停止执行 |
|
|
item.executing_craft = false; |
|
|
item.executing_craft = false; |
|
|
craftName.value = "选择工艺"; |
|
|
craftName.value = "选择工艺"; |
|
|
exeCraftName.value = "执行工艺"; |
|
|
exeCraftName.value = "执行工艺"; |
|
|
}else if(item.executing_craft){//正在执行 |
|
|
|
|
|
|
|
|
}else if(item.executing_craft){//正在执行 |
|
|
if (newVal?.status == 1 && item.isSelect) { |
|
|
if (newVal?.status == 1 && item.isSelect) { |
|
|
craftName.value = "暂停工艺"; |
|
|
craftName.value = "暂停工艺"; |
|
|
exeCraftName.value = "停止工艺"; |
|
|
exeCraftName.value = "停止工艺"; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
@ -145,12 +145,9 @@ watch(()=>settingStore.heatAreaConfig,(newVal, oldValue)=>{ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const heatAearStatusList = ref(statusStore.status?.heatArea || []); |
|
|
|
|
|
const heatList = shallowRef<any>([]); |
|
|
const heatList = shallowRef<any>([]); |
|
|
const craftVisible = ref(false); |
|
|
const craftVisible = ref(false); |
|
|
let tubeList:any = []; |
|
|
let tubeList:any = []; |
|
|
const selectedColor = "#4F85FB"; |
|
|
|
|
|
const emptyColor = "#FFFFFF"; |
|
|
|
|
|
const taskName = ref(""); |
|
|
const taskName = ref(""); |
|
|
let deviceData = <any>{} |
|
|
let deviceData = <any>{} |
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
@ -160,7 +157,7 @@ onMounted(() => { |
|
|
tubeBaseConfig(); |
|
|
tubeBaseConfig(); |
|
|
//连接socket |
|
|
//连接socket |
|
|
const wsClient = createWebSocket(sharedWsUrl); |
|
|
const wsClient = createWebSocket(sharedWsUrl); |
|
|
const subscription = wsClient.dataOb.subscribe((data) => { |
|
|
|
|
|
|
|
|
const subscription = wsClient.dataOb.subscribe((data) => { |
|
|
if (data.type === "cmd") { |
|
|
if (data.type === "cmd") { |
|
|
const cmdInfo = getTxnRecord(data.data.commandId, "task"); |
|
|
const cmdInfo = getTxnRecord(data.data.commandId, "task"); |
|
|
if (cmdInfo) { |
|
|
if (cmdInfo) { |
|
@ -227,13 +224,11 @@ const onSelectedTray = (heatAreaItem: any, type: string) => { |
|
|
} else {//点击操作区指令时,加热区选中的状态不能变 |
|
|
} else {//点击操作区指令时,加热区选中的状态不能变 |
|
|
heatAreaItem.isSelect = true; |
|
|
heatAreaItem.isSelect = true; |
|
|
} |
|
|
} |
|
|
console.log('selectedTrayList.value---', selectedTrayList.value) |
|
|
|
|
|
tubeList = heatAreaItem.tubeList; |
|
|
tubeList = heatAreaItem.tubeList; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const initHeatList = () => { |
|
|
const initHeatList = () => { |
|
|
let heatAearStatusList = statusStore.status.heatArea |
|
|
let heatAearStatusList = statusStore.status.heatArea |
|
|
console.log('settingStore.heatAreaConfig---', settingStore.heatAreaConfig) |
|
|
|
|
|
heatList.value = settingStore.heatAreaConfig.map((item:any) => { |
|
|
heatList.value = settingStore.heatAreaConfig.map((item:any) => { |
|
|
heatAearStatusList.forEach((areaItem:any) => { |
|
|
heatAearStatusList.forEach((areaItem:any) => { |
|
|
if(areaItem.hardwareId == item.hardwareId){ |
|
|
if(areaItem.hardwareId == item.hardwareId){ |
|
@ -253,14 +248,15 @@ const updateHeatList = (command:any) => { |
|
|
let heatAearStatusList = statusStore.status.heatArea |
|
|
let heatAearStatusList = statusStore.status.heatArea |
|
|
const selectedIds = selectedTrayList.value.map((item: any) => item.id); |
|
|
const selectedIds = selectedTrayList.value.map((item: any) => item.id); |
|
|
heatList.value = list.map((item:any) => { |
|
|
heatList.value = list.map((item:any) => { |
|
|
heatAearStatusList.forEach((areaItem:any) => { |
|
|
|
|
|
if(areaItem.hardwareId == item.hardwareId){ |
|
|
|
|
|
item = { |
|
|
|
|
|
...item, |
|
|
|
|
|
heatAearStatus:areaItem, |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
for(const areaItem of heatAearStatusList){ |
|
|
|
|
|
if(areaItem.hardwareId == item.hardwareId){ |
|
|
|
|
|
item = { |
|
|
|
|
|
...item, |
|
|
|
|
|
heatAearStatus:areaItem, |
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if(selectedIds.includes(item.id)){ |
|
|
if(selectedIds.includes(item.id)){ |
|
|
item.isSelect = true; |
|
|
item.isSelect = true; |
|
|
if(command == 'moveToHeatArea'){ |
|
|
if(command == 'moveToHeatArea'){ |
|
@ -687,31 +683,23 @@ const onStartHeat = () => { |
|
|
ElMessage.error("请选择目标加热区"); |
|
|
ElMessage.error("请选择目标加热区"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const selectedIds = selectedTrayList.value.map((item: any) => item.id); |
|
|
//判断选中的加热区是否有试管架 |
|
|
//判断选中的加热区是否有试管架 |
|
|
let existTubeRack = true; |
|
|
|
|
|
|
|
|
let existTubeRack = heatList.value.some((item:any)=>selectedIds.includes(item.id) && item.heatAearStatus.trayStatus == 0) |
|
|
//加热区是否设置了加热温度 |
|
|
//加热区是否设置了加热温度 |
|
|
let hasSetTemp = true; |
|
|
|
|
|
const selectedIds = selectedTrayList.value.map((item: any) => item.id); |
|
|
|
|
|
heatList.value.forEach((item: any) => { |
|
|
|
|
|
if (selectedIds.includes(item.id) && item.heatAearStatus.trayStatus == 0) { |
|
|
|
|
|
existTubeRack = true; |
|
|
|
|
|
} |
|
|
|
|
|
if (!item.temperature) { |
|
|
|
|
|
hasSetTemp = false; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
let hasSetTemp = heatList.value.some((item:any)=>!item.temperature) |
|
|
|
|
|
|
|
|
if (!existTubeRack) { |
|
|
|
|
|
|
|
|
if (existTubeRack) { |
|
|
ElMessage.error("选择的加热区未放置试管架,请重新选择"); |
|
|
ElMessage.error("选择的加热区未放置试管架,请重新选择"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (!hasSetTemp) { |
|
|
|
|
|
|
|
|
if (hasSetTemp) { |
|
|
ElMessage.error("选择的加热区未设置温度,请设置温度"); |
|
|
ElMessage.error("选择的加热区未设置温度,请设置温度"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//后台批量发送指令 |
|
|
//后台批量发送指令 |
|
|
const cmdList: any = []; |
|
|
|
|
|
selectedTrayList.value.forEach((heatArea: any) => { |
|
|
selectedTrayList.value.forEach((heatArea: any) => { |
|
|
const params = { |
|
|
const params = { |
|
|
heatId: heatArea.id, |
|
|
heatId: heatArea.id, |
|
@ -719,14 +707,12 @@ const onStartHeat = () => { |
|
|
}; |
|
|
}; |
|
|
taskCmd({ command: "startHeat", params }).then(res => { |
|
|
taskCmd({ command: "startHeat", params }).then(res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
// ElMessage.success("指令已发送,请稍等"); |
|
|
|
|
|
isHeating.value = true; |
|
|
isHeating.value = true; |
|
|
} else { |
|
|
} else { |
|
|
ElMessage.error(res.msg); |
|
|
ElMessage.error(res.msg); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
// onSendCmd("startHeat", cmdList) |
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
//停止加热 |
|
|
//停止加热 |
|
@ -742,7 +728,6 @@ const onStopHeat = () => { |
|
|
}; |
|
|
}; |
|
|
taskCmd({ command: "stopHeat", params }).then(res => { |
|
|
taskCmd({ command: "stopHeat", params }).then(res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
// ElMessage.success("指令已发送,请稍等"); |
|
|
|
|
|
isHeating.value = false; |
|
|
isHeating.value = false; |
|
|
} else { |
|
|
} else { |
|
|
ElMessage.error(res.msg); |
|
|
ElMessage.error(res.msg); |
|
@ -757,7 +742,6 @@ const onStartShakingTube = () => { |
|
|
const params = {}; |
|
|
const params = {}; |
|
|
taskCmd({ command: "startShakeUp", params }).then(res => { |
|
|
taskCmd({ command: "startShakeUp", params }).then(res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
// ElMessage.success("指令已发送,请稍等"); |
|
|
|
|
|
isSharking.value = true; |
|
|
isSharking.value = true; |
|
|
setOnGoingStatus("shaking"); |
|
|
setOnGoingStatus("shaking"); |
|
|
} else { |
|
|
} else { |
|
@ -771,7 +755,6 @@ const onStopShakingTube = () => { |
|
|
const params = {}; |
|
|
const params = {}; |
|
|
taskCmd({ command: "stopShakeUp", params }).then(res => { |
|
|
taskCmd({ command: "stopShakeUp", params }).then(res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
// ElMessage.success("指令已发送,请稍等"); |
|
|
|
|
|
isSharking.value = false; |
|
|
isSharking.value = false; |
|
|
} else { |
|
|
} else { |
|
|
ElMessage.error(res.msg); |
|
|
ElMessage.error(res.msg); |
|
@ -805,7 +788,6 @@ const onSendCmd = (command: OperationCmd, params: any) => { |
|
|
//发送加热指令 |
|
|
//发送加热指令 |
|
|
taskCmd({ command, params }).then(res => { |
|
|
taskCmd({ command, params }).then(res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
// ElMessage.success("指令已发送,请稍等"); |
|
|
|
|
|
setOnGoingStatus("movingToAct"); |
|
|
setOnGoingStatus("movingToAct"); |
|
|
} else { |
|
|
} else { |
|
|
ElMessage.error(res.msg); |
|
|
ElMessage.error(res.msg); |
|
|