|
@ -1,11 +1,10 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="graphite_home component-page overflow-auto" id="heatArea"> |
|
|
<div class="graphite_home component-page overflow-auto" id="heatArea"> |
|
|
<div class="heat_area"> |
|
|
|
|
|
|
|
|
<div class="heat_area" v-if="heatList && heatList.length"> |
|
|
<div v-for="(item, index) in heatList" :key="item.id"> |
|
|
<div v-for="(item, index) in heatList" :key="item.id"> |
|
|
<HeatPosition |
|
|
<HeatPosition |
|
|
:heatInfo="{ ...item, index }" |
|
|
:heatInfo="{ ...item, index }" |
|
|
:tubeIndex="index + 1" |
|
|
:tubeIndex="index + 1" |
|
|
:heatAearStatusList="heatAearStatusList" |
|
|
|
|
|
@onSelectedTray="onSelectedTray" |
|
|
@onSelectedTray="onSelectedTray" |
|
|
@onSetHeatAreaTemp="onSetHeatAreaTemp" |
|
|
@onSetHeatAreaTemp="onSetHeatAreaTemp" |
|
|
@onSelectCraft=" |
|
|
@onSelectCraft=" |
|
@ -16,6 +15,9 @@ |
|
|
</div> |
|
|
</div> |
|
|
<!--执行中状态的遮罩层--> |
|
|
<!--执行中状态的遮罩层--> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div v-else class="heat_area"> |
|
|
|
|
|
正在加载 |
|
|
|
|
|
</div> |
|
|
<!--拍照区--> |
|
|
<!--拍照区--> |
|
|
<div class="picture_area"> |
|
|
<div class="picture_area"> |
|
|
<!--加液区和拍照区可切换--> |
|
|
<!--加液区和拍照区可切换--> |
|
@ -50,11 +52,11 @@ |
|
|
<van-button size="large" class="btn_size op_up_tray" @click="onUpTray">抬起托盘</van-button> |
|
|
<van-button size="large" class="btn_size op_up_tray" @click="onUpTray">抬起托盘</van-button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<van-overlay :show="liquidVisible" v-if="liquidVisible" style="z-index: 9999"> |
|
|
|
|
|
|
|
|
<van-overlay :show="liquidVisible" v-if="liquidVisible"> |
|
|
<div class="liquid"> |
|
|
<div class="liquid"> |
|
|
<div class="addLiquid"> |
|
|
<div class="addLiquid"> |
|
|
<AddLiquid |
|
|
<AddLiquid |
|
|
:currentSelectedTube="tubeRack" |
|
|
|
|
|
|
|
|
:currentSelectedTube="JSON.parse(JSON.stringify(tubeRack))" |
|
|
:liquidArea="liquidArea" |
|
|
:liquidArea="liquidArea" |
|
|
@cancel="liquidVisible = false" |
|
|
@cancel="liquidVisible = false" |
|
|
@onAddSolution="onAddSolution"></AddLiquid> |
|
|
@onAddSolution="onAddSolution"></AddLiquid> |
|
@ -87,7 +89,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { ref, onMounted, onUnmounted, watch } from "vue"; |
|
|
|
|
|
|
|
|
import { ref, onMounted, onUnmounted, watch, shallowRef } from "vue"; |
|
|
//@ts-ignore |
|
|
//@ts-ignore |
|
|
import { ElMessage, ElMessageBox } from "element-plus"; |
|
|
import { ElMessage, ElMessageBox } from "element-plus"; |
|
|
import { createWebSocket, sharedWsUrl } from "@/services/socket"; |
|
|
import { createWebSocket, sharedWsUrl } from "@/services/socket"; |
|
@ -137,15 +139,14 @@ watch( |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
watch(()=>statusStore.status,(newVal, oldValue)=>{ |
|
|
|
|
|
|
|
|
watch(()=>settingStore.heatAreaConfig,(newVal, oldValue)=>{ |
|
|
if(newVal){ |
|
|
if(newVal){ |
|
|
heatAearStatusList.value = newVal.heatArea |
|
|
|
|
|
updateHeatList() |
|
|
|
|
|
|
|
|
initHeatList() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const heatAearStatusList = ref(statusStore.status?.heatArea || []); |
|
|
const heatAearStatusList = ref(statusStore.status?.heatArea || []); |
|
|
const heatList: any = ref([]); |
|
|
|
|
|
|
|
|
const heatList = shallowRef<any>([]); |
|
|
const craftVisible = ref(false); |
|
|
const craftVisible = ref(false); |
|
|
let tubeList:any = []; |
|
|
let tubeList:any = []; |
|
|
const selectedColor = "#4F85FB"; |
|
|
const selectedColor = "#4F85FB"; |
|
@ -176,11 +177,10 @@ onMounted(() => { |
|
|
const command:any = cmdInfo.command; |
|
|
const command:any = cmdInfo.command; |
|
|
//@ts-ignore |
|
|
//@ts-ignore |
|
|
const cmdName = CmdDescMap[command]; |
|
|
const cmdName = CmdDescMap[command]; |
|
|
|
|
|
updateHeatList(command) |
|
|
if(command == 'moveToHeatArea'){//移至加热完成 |
|
|
if(command == 'moveToHeatArea'){//移至加热完成 |
|
|
console.log('tubeRack---', tubeRack) |
|
|
|
|
|
//更新页面UI |
|
|
|
|
|
updateHeatList() |
|
|
|
|
|
//清除加液区的数据 |
|
|
//清除加液区的数据 |
|
|
|
|
|
setTubeToActionArea(null) |
|
|
} |
|
|
} |
|
|
const result = data.data.success |
|
|
const result = data.data.success |
|
|
? "执行完毕" |
|
|
? "执行完毕" |
|
@ -211,6 +211,7 @@ onMounted(() => { |
|
|
const selectedTrayList = ref<any>([]); |
|
|
const selectedTrayList = ref<any>([]); |
|
|
const selectedTrayObj: any = {}; |
|
|
const selectedTrayObj: any = {}; |
|
|
const onSelectedTray = (heatAreaItem: any, type: string) => { |
|
|
const onSelectedTray = (heatAreaItem: any, type: string) => { |
|
|
|
|
|
//此处发生变化后,不需要更新组件 |
|
|
heatList.value[heatAreaItem.index] = heatAreaItem; |
|
|
heatList.value[heatAreaItem.index] = heatAreaItem; |
|
|
//取消选中,已经存在selectedTrayList中 |
|
|
//取消选中,已经存在selectedTrayList中 |
|
|
let ids = selectedTrayList.value.map((tube: any) => tube.id); |
|
|
let ids = selectedTrayList.value.map((tube: any) => tube.id); |
|
@ -226,12 +227,15 @@ 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 |
|
|
|
|
|
console.log('settingStore.heatAreaConfig---', settingStore.heatAreaConfig) |
|
|
heatList.value = settingStore.heatAreaConfig.map((item:any) => { |
|
|
heatList.value = settingStore.heatAreaConfig.map((item:any) => { |
|
|
heatAearStatusList.value.forEach((areaItem:any) => { |
|
|
|
|
|
|
|
|
heatAearStatusList.forEach((areaItem:any) => { |
|
|
if(areaItem.hardwareId == item.hardwareId){ |
|
|
if(areaItem.hardwareId == item.hardwareId){ |
|
|
item = { |
|
|
item = { |
|
|
...item, |
|
|
...item, |
|
@ -241,23 +245,27 @@ const initHeatList = () => { |
|
|
}) |
|
|
}) |
|
|
return item; |
|
|
return item; |
|
|
}); |
|
|
}); |
|
|
|
|
|
console.log('初始化加温区数据:==========', heatList.value) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const updateHeatList = () => { |
|
|
|
|
|
|
|
|
const updateHeatList = (command:any) => { |
|
|
const list = [...heatList.value] |
|
|
const list = [...heatList.value] |
|
|
|
|
|
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.value.forEach((areaItem:any) => { |
|
|
|
|
|
|
|
|
heatAearStatusList.forEach((areaItem:any) => { |
|
|
if(areaItem.hardwareId == item.hardwareId){ |
|
|
if(areaItem.hardwareId == item.hardwareId){ |
|
|
item = { |
|
|
item = { |
|
|
...item, |
|
|
...item, |
|
|
heatAearStatus:areaItem, |
|
|
heatAearStatus:areaItem, |
|
|
tubeList:tubeRack.tubeList |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if(selectedIds.includes(item.id)){ |
|
|
if(selectedIds.includes(item.id)){ |
|
|
item.isSelect = true; |
|
|
item.isSelect = true; |
|
|
|
|
|
if(command == 'moveToHeatArea'){ |
|
|
|
|
|
item.tubeList = tubeRack.tubeList; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
return item; |
|
|
return item; |
|
|
}); |
|
|
}); |
|
@ -456,9 +464,9 @@ const onMoveToHeat = () => { |
|
|
let selectedDataItem = selectedTrayList.value[0]; |
|
|
let selectedDataItem = selectedTrayList.value[0]; |
|
|
//2、判断选择的加热区是否已经有了试管架, 加热区是否有试管是通过设备上报的数据获取的 |
|
|
//2、判断选择的加热区是否已经有了试管架, 加热区是否有试管是通过设备上报的数据获取的 |
|
|
let hardwareId = selectedDataItem.hardwareId; |
|
|
let hardwareId = selectedDataItem.hardwareId; |
|
|
// let trayStatus = heatAearStatusList.value[selectedDataItem.index].trayStatus; |
|
|
|
|
|
|
|
|
let heatAearStatusList = statusStore.status.heatArea |
|
|
let trayStatus; |
|
|
let trayStatus; |
|
|
heatAearStatusList.value.forEach((item: any) => { |
|
|
|
|
|
|
|
|
heatAearStatusList.forEach((item: any) => { |
|
|
if (hardwareId == item.hardwareId) { |
|
|
if (hardwareId == item.hardwareId) { |
|
|
trayStatus = item.trayStatus; |
|
|
trayStatus = item.trayStatus; |
|
|
} |
|
|
} |
|
@ -683,10 +691,10 @@ const onStartHeat = () => { |
|
|
let existTubeRack = true; |
|
|
let existTubeRack = true; |
|
|
//加热区是否设置了加热温度 |
|
|
//加热区是否设置了加热温度 |
|
|
let hasSetTemp = true; |
|
|
let hasSetTemp = true; |
|
|
selectedTrayList.value.forEach((item: any) => { |
|
|
|
|
|
let tubeList = item.tubeList; |
|
|
|
|
|
if (!tubeList || !tubeList.length) { |
|
|
|
|
|
existTubeRack = false; |
|
|
|
|
|
|
|
|
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) { |
|
|
if (!item.temperature) { |
|
|
hasSetTemp = false; |
|
|
hasSetTemp = false; |
|
@ -869,7 +877,6 @@ const onSendCmd = (command: OperationCmd, params: any) => { |
|
|
height: 18rem; |
|
|
height: 18rem; |
|
|
background: rgb(230, 230, 230); |
|
|
background: rgb(230, 230, 230); |
|
|
opacity: 0.5; |
|
|
opacity: 0.5; |
|
|
z-index: 9999; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|