From c8f4b33c04905541341bed3403ac810091a387f1 Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Mon, 13 Jan 2025 10:24:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Index/Regular/Consumables.vue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pages/Index/Regular/Consumables.vue b/src/pages/Index/Regular/Consumables.vue index dd28196..138c346 100644 --- a/src/pages/Index/Regular/Consumables.vue +++ b/src/pages/Index/Regular/Consumables.vue @@ -103,19 +103,19 @@ import { getInitState, scanConsumables, updateTipsNum, -} from '../../../services/Index/index' -import { useConsumablesStore, useEmergencyStore } from '../../../store' -import { useDeviceStore } from '../../../store/index' -import { ConsumeType, eventBus } from '../../../eventBus' -import { ReactionPlate, BottleGroup, LiquidState } from '../../../types/Index' -import { createWebSocket } from '../../../websocket/socket' +} from '@/services/Index/index' +import { useConsumablesStore, useEmergencyStore } from '@/store' +import { useDeviceStore } from '@/store/index' +import { ConsumeType, eventBus } from '@/eventBus' +import { ReactionPlate, BottleGroup, LiquidState } from '@/types/Index' +import { createWebSocket } from '@/websocket/socket' import type { ConsumablesStateMessage, SensorStateMessage, EmergencyPosStateMessage, -} from '../../../websocket/socket' -import { getServerInfo } from '../../../utils/getServerInfo' -import { formatScanReports } from '../../../utils/errorHandler' +} from '@/websocket/socket' +import { getServerInfo } from '@/utils/getServerInfo' +import { formatScanReports } from '@/utils/errorHandler' import { ElMessage } from 'element-plus' const { wsUrl } = getServerInfo('/api/v1/app/ws/state') const socket = createWebSocket(wsUrl) From 5e7d3415b0a1eba8dddd5daa4562175bef2b6387 Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Tue, 14 Jan 2025 09:13:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Index/Regular/Consumables.vue | 25 ++++++------ src/pages/Index/Regular/Emergency.vue | 6 +-- src/pages/Index/Regular/Running.vue | 44 +++++++++++++++++----- .../components/Consumables/MoveLiquidArea.vue | 11 +++++- .../components/Consumables/ProjectSelector.vue | 8 ++-- .../Index/components/Running/PlateDisplay.vue | 4 +- src/store/modules/consumables.ts | 3 +- src/websocket/socket.ts | 7 ++-- tsconfig.app.tsbuildinfo | 2 +- 9 files changed, 72 insertions(+), 38 deletions(-) diff --git a/src/pages/Index/Regular/Consumables.vue b/src/pages/Index/Regular/Consumables.vue index 1e4cdaf..e7194bc 100644 --- a/src/pages/Index/Regular/Consumables.vue +++ b/src/pages/Index/Regular/Consumables.vue @@ -198,23 +198,24 @@ const handleSensorState = (data: SensorStateMessage['data']) => { } //所有的耗材是否都有,如果有一项没有则为false +//@ts-ignore let hasAllConsumables = ref(false) //处理耗材状态 const handleConsumablesState = (data: ConsumablesStateMessage['data']) => { if (!isDragging.value) { consumableStore.setConsumablesData(data) - if( - (data.tips && data.tips.length ) && - (data.reactionPlateGroup && data.reactionPlateGroup.length) && - (data.littBottleGroup && data.littBottleGroup.length) && - (data.larBottleGroup && data.larBottleGroup.length) - ){ - hasAllConsumables.value = true; - }else{ - hasAllConsumables.value = false; - } - //放入全局story 中 - consumableStore.hasAllConsumables = hasAllConsumables.value + // if( + // (data.tips && data.tips.length ) && + // (data.reactionPlateGroup && data.reactionPlateGroup.length) && + // (data.littBottleGroup && data.littBottleGroup.length) && + // (data.larBottleGroup && data.larBottleGroup.length) + // ){ + // hasAllConsumables.value = true; + // }else{ + // hasAllConsumables.value = false; + // } + // //放入全局story 中 + // consumableStore.hasAllConsumables = hasAllConsumables.value } else { console.log('正在拖动,不更新耗材') } diff --git a/src/pages/Index/Regular/Emergency.vue b/src/pages/Index/Regular/Emergency.vue index 52ea129..78cc624 100644 --- a/src/pages/Index/Regular/Emergency.vue +++ b/src/pages/Index/Regular/Emergency.vue @@ -125,7 +125,6 @@ const ws = createWebSocket(getServerInfo().wsUrl); const consumableStore = useConsumablesStore(); const emergencyStore = useEmergencyStore(); const deviceStore = useDeviceStore(); -console.log('deviceStore---', deviceStore) // 急诊位开启/关闭状态 const isEmergencyEnabled = ref(true);//设置表单是否可输入 @@ -133,8 +132,9 @@ const isEmergencyEnabled = ref(true);//设置表单是否可输入 const projects = ref([]); onMounted(() => { // 延迟加载 projects,确保数据从持久化存储中加载完成 - if (consumableStore.plates.length > 0) { - projects.value = consumableStore.plates as ReactionPlate[]; + //@ts-ignore + if (consumableStore.consumableData.reactionPlateGroup && consumableStore.consumableData.reactionPlateGroup.length > 0) { + projects.value = consumableStore.consumableData.reactionPlateGroup as ReactionPlate[]; } //过滤projId为null的数据 projects.value = projects.value.filter(item => item.projId) diff --git a/src/pages/Index/Regular/Running.vue b/src/pages/Index/Regular/Running.vue index 161f47b..901e7af 100644 --- a/src/pages/Index/Regular/Running.vue +++ b/src/pages/Index/Regular/Running.vue @@ -106,15 +106,15 @@ -
{{ index + 1 }}
-
+ -->
- +
- +
- {{ consumablesStore.moveLiquids[0].tipNum }}/120 + {{ consumablesStore.consumableData.tips[0].tipNum }}/120
@@ -747,6 +747,29 @@ const handleIncubationPlateStateMessage = ( errors: [], }, ] + if(incubationPlates.value.length != 20){ + let len = 20 - incubationPlates.value.length + for(let i = 0; i { processedTubeSettings.value = processTubeSettings( tubeSettings, + //@ts-ignore plateData, getBloodTypeLabel, ) @@ -1007,7 +1031,7 @@ const toggleSelectItem = (item: Subtank, index: number) => { } //反应板数据 -const plates = ref(consumablesStore.plates) +const plates = ref(consumablesStore.consumableData.reactionPlateGroup) //样本数据 const processedTubeSettings = ref() diff --git a/src/pages/Index/components/Consumables/MoveLiquidArea.vue b/src/pages/Index/components/Consumables/MoveLiquidArea.vue index db50b62..3fe927f 100644 --- a/src/pages/Index/components/Consumables/MoveLiquidArea.vue +++ b/src/pages/Index/components/Consumables/MoveLiquidArea.vue @@ -335,8 +335,15 @@ const router = useRouter() // 跳转到添加急诊页面 let showEmergencyModal = ref(false) const addEmergency = () => { - //检查是否有耗材,没有耗材时禁止操作 - if(!consumableStore.hasAllConsumables){ + //未返回 反应板夹 数组时,直接提示 + if(!consumableStore.consumableData.reactionPlateGroup){ + showEmergencyModal.value = true; + return + } + //有反应板夹数据,但无项目时 也要给出提示信息 + const clonereactionList = [...consumableStore.consumableData.reactionPlateGroup] + const hasRactionPlatGroup = clonereactionList.every(item => !item.projId) + if(hasRactionPlatGroup){ showEmergencyModal.value = true; return } diff --git a/src/pages/Index/components/Consumables/ProjectSelector.vue b/src/pages/Index/components/Consumables/ProjectSelector.vue index e994c99..e96ae0a 100644 --- a/src/pages/Index/components/Consumables/ProjectSelector.vue +++ b/src/pages/Index/components/Consumables/ProjectSelector.vue @@ -55,7 +55,7 @@