@@ -46,7 +38,8 @@
import { ref } from 'vue'
import { updateConsumables } from '../../../../services'
import { eventBus } from '../../../../eventBus'
-
+import { useDeviceStore } from '../../../../store/index'
+const deviceStore = useDeviceStore()
// 弹窗状态
const isOpen = ref(false)
const value = ref(0)
@@ -62,10 +55,12 @@ const query = ref({
const openDialog = (plate, index) => {
isOpen.value = true
value.value = Number(plate.num)
-
plateIndex.value = index
title.value = plate.projShortName || ''
dialogTitle.value = `请选择${title.value}数值`
+ query.value.group = `GROUP${plateIndex.value}`
+ query.value.num = value.value
+ console.log('🚀 ~ openDialog ~ query:', query.value)
}
defineExpose({
openDialog,
@@ -85,14 +80,16 @@ const handleMinus = () => {
// 处理确认按钮
const handleConfirm = async () => {
isOpen.value = false
- console.log('提交的值:', value.value)
-
- // 这里可以进行 API 调用等操作
- const res = await updateConsumables(query.value)
- eventBus.emit('confirm', {
- value: Number(value.value),
- index: plateIndex.value,
- })
+ if (deviceStore.status === 'IDLE') {
+ // 这里可以进行 API 调用等操作
+ const res = await updateConsumables(query.value)
+ eventBus.emit('confirm', {
+ value: Number(value.value),
+ index: plateIndex.value,
+ })
+ } else {
+ ElMessage.error('设备正在工作,无法修改数值')
+ }
}
@@ -146,32 +143,39 @@ const handleConfirm = async () => {
.modal-body {
width: 100%;
margin-bottom: 20px;
+
.input-box {
display: flex;
align-items: center;
+
/* Slider 样式 */
.slider {
width: 70%;
margin: 10px 0;
}
+
.change-num {
width: 30%;
border: 1px solid #ccc;
display: flex;
justify-content: space-around;
margin-left: 20px;
+
button {
width: 52px;
height: 46px;
background-color: #f5f7fa;
font-size: 26px;
}
+
.minus {
border-right: 1px solid #ccc;
}
+
.plus {
border-left: 1px solid #ccc;
}
+
.input {
width: 100px;
outline-color: #66b1ff;
@@ -188,6 +192,7 @@ const handleConfirm = async () => {
display: flex;
justify-content: flex-end;
width: 100%;
+
.footer-btn {
width: 100px;
height: 60px;
diff --git a/src/pages/Index/components/Consumables/MoveLiquidArea.vue b/src/pages/Index/components/Consumables/MoveLiquidArea.vue
index 2383cbe..52c2aac 100644
--- a/src/pages/Index/components/Consumables/MoveLiquidArea.vue
+++ b/src/pages/Index/components/Consumables/MoveLiquidArea.vue
@@ -102,9 +102,6 @@ import { ref, watch, reactive } from 'vue'
import { useRouter } from 'vue-router'
import { useEmergencyStore, useConsumablesStore } from '../../../../store'
import { Tube, LiquidState, BottleGroup } from '../../../../types/Index/index'
-// import {
-// wasteArea,
-// } from '../../../../services/index'
import wasteFullIcon from '@/assets/Index/waste-full.svg'
import wasteIcon from '@/assets/Index/waste.svg'
@@ -148,44 +145,6 @@ const handleIsUnload = () => {
const activeTab = ref(0)
// 废料区状态判断
const wasteStatus = ref(props.wasteStatus)
-//设置轮询时间间隔
-const pollInterVal = 3000
-//声明id接口
-// const fetchIdCardStatus = async () => {
-// try {
-// const res = await getMountedCardInfo()
-// if (res.data) {
-// IDCardStatus.value = true
-// // 调用接口保存芯片信息
-// await saveMountedCardInfo()
-// } else {
-// IDCardStatus.value = false
-// }
-// } catch (error) {
-// console.log('获取Id卡状态失败', error)
-// }
-// }
-// //声明废料区接口
-// const fetchWasteStatus = async () => {
-// try {
-// const res = await wasteArea()
-// wasteStatus.value = res.data.wasteBinFullFlag
-// } catch (error) {
-// console.log('获取废料区状态失败', error)
-// }
-// }
-
-// 轮询函数
-// const startPolling = () => {
-// const idCardPoll = setInterval(fetchIdCardStatus, pollInterVal)
-// const wastePoll = setInterval(fetchWasteStatus, pollInterVal)
-//组件卸载时清除轮询
-// onBeforeUnmount(() => {
-// console.log("清除轮询")
-// clearInterval(idCardPoll)
-// clearInterval(wastePoll)
-// })
-// }
const isActive = ref(false)
watch(
@@ -200,10 +159,7 @@ watch(
},
{ immediate: true }, // 确保初始化时会触发一次
)
-//挂载时启动轮询
-// onMounted(() => {
-// startPolling()
-// })
+
const emergencyInfo = reactive(emergencyStore.$state.emergencyInfo)
const router = useRouter()
// 跳转到添加急诊页面
diff --git a/src/pages/Index/components/Consumables/ProjectSelector.vue b/src/pages/Index/components/Consumables/ProjectSelector.vue
index 2743eb5..020446f 100644
--- a/src/pages/Index/components/Consumables/ProjectSelector.vue
+++ b/src/pages/Index/components/Consumables/ProjectSelector.vue
@@ -51,9 +51,11 @@
import { ref } from 'vue'
import type { ReactionPlate } from '../../../../types/Index'
import { nanoid } from 'nanoid'
-import { useConsumablesStore } from '../../../../store'
+import { useConsumablesStore, useSettingTestTubeStore } from '../../../../store'
+import { updateTubeConfig } from '../../../../services/Index/Test-tube/test-tube'
const consumables = useConsumablesStore()
+const settingTestTubeStore = useSettingTestTubeStore()
const emit = defineEmits<{
(e: 'confirm'): void
(e: 'cancel'): void
@@ -72,7 +74,7 @@ defineExpose({
const projects = ref
(consumables.$state.plates || [])
const bloodType = ref('')
-const selectedProjects = ref([]) // 选中项���的对象列表
+const selectedProjects = ref([]) // 选中项的对象列表
const bloodTypes = ref([
{
id: nanoid(),
@@ -123,9 +125,15 @@ const toggleAutoProject = () => {
}
// 按钮逻辑
const handleConfirm = () => {
- // 发送更新事件
- emitUpdate()
- // 触发确认事件
+ // 对每个选中的试管单独更新
+ props.selectedSampleIds.forEach(async (tubeIndex) => {
+ settingTestTubeStore.updateTubeSetting(props.uuid, {
+ tubeIndex,
+ projId: selectedProjects.value,
+ bloodType: bloodType.value
+ })
+ })
+
emit('confirm')
}
@@ -160,6 +168,11 @@ const emitUpdate = () => {
bloodType: bloodType.value,
})
}
+
+const props = defineProps<{
+ uuid: string
+ selectedSampleIds: number[]
+}>()
diff --git a/src/pages/Index/components/History/HistoryTable.vue b/src/pages/Index/components/History/HistoryTable.vue
index bc346f4..0f5963c 100644
--- a/src/pages/Index/components/History/HistoryTable.vue
+++ b/src/pages/Index/components/History/HistoryTable.vue
@@ -1,35 +1,21 @@