diff --git a/src/constant/index.ts b/src/constant/index.ts index 365a944..1ffcea5 100644 --- a/src/constant/index.ts +++ b/src/constant/index.ts @@ -1,7 +1,7 @@ // 开发选项 export const devOptions = { - // 小瓶缓冲液对象的isUsed属性 - enable_LittleBottle_isUsed: false, + // 小瓶缓冲液对象的isInstall属性 +// enable_LittleBottle_isInstall: false, } export const DICT = {} diff --git a/src/mock/Index/Consumables.ts b/src/mock/Index/Consumables.ts index 2602020..da79ded 100644 --- a/src/mock/Index/Consumables.ts +++ b/src/mock/Index/Consumables.ts @@ -214,7 +214,7 @@ const consumablesScanResultData: ConsumablesScanResultData = Mock.mock({ lotId: '', color: '', num: 0, - isUse: false, + isInstall: false, }, { projId: 2, @@ -223,13 +223,13 @@ const consumablesScanResultData: ConsumablesScanResultData = Mock.mock({ lotId: 'FA020000', color: '#DC143C', num: 25, - isUse: true, + isInstall: true, }, { lotId: '', color: '', num: 0, - isUse: false, + isInstall: false, }, { projId: 4, @@ -238,7 +238,7 @@ const consumablesScanResultData: ConsumablesScanResultData = Mock.mock({ lotId: 'FA040000', color: '#FF69B4', num: 25, - isUse: true, + isInstall: true, }, { projId: 5, @@ -247,7 +247,7 @@ const consumablesScanResultData: ConsumablesScanResultData = Mock.mock({ lotId: 'FA050000', color: '#FF1493', num: 25, - isUse: true, + isInstall: true, }, { projId: 6, @@ -256,7 +256,7 @@ const consumablesScanResultData: ConsumablesScanResultData = Mock.mock({ lotId: 'FA060000', color: '#C71585', num: 25, - isUse: true, + isInstall: true, }, ], }, @@ -405,7 +405,7 @@ const consumableOneChannelData: ConsumablesOneChannel = Mock.mock({ lotId: '', color: '', num: 0, - isUse: false, + isInstall: false, }, { projId: 2, @@ -414,13 +414,13 @@ const consumableOneChannelData: ConsumablesOneChannel = Mock.mock({ lotId: 'FA020000', color: '#DC143C', num: 25, - isUse: true, + isInstall: true, }, { lotId: '', color: '', num: 0, - isUse: false, + isInstall: false, }, { projId: 4, @@ -429,7 +429,7 @@ const consumableOneChannelData: ConsumablesOneChannel = Mock.mock({ lotId: 'FA040000', color: '#FF69B4', num: 25, - isUse: true, + isInstall: true, }, { projId: 5, @@ -438,7 +438,7 @@ const consumableOneChannelData: ConsumablesOneChannel = Mock.mock({ lotId: 'FA050000', color: '#FF1493', num: 25, - isUse: true, + isInstall: true, }, { projId: 6, @@ -447,7 +447,7 @@ const consumableOneChannelData: ConsumablesOneChannel = Mock.mock({ lotId: 'FA060000', color: '#C71585', num: 25, - isUse: true, + isInstall: true, }, ], }, diff --git a/src/pages/Index/Regular/Consumables.vue b/src/pages/Index/Regular/Consumables.vue index 91b8291..973fc07 100644 --- a/src/pages/Index/Regular/Consumables.vue +++ b/src/pages/Index/Regular/Consumables.vue @@ -87,7 +87,7 @@ gridWidth="240px" gridHeight="240px" :activeColor="item.color" - :inUse="item.isUsed" + :inUse="item.isInstall" /> @@ -177,7 +177,7 @@ interface BufferLittle { type?: string projId?: number projName?: string - isUsed?: boolean + isInstall?: boolean } const bufferLittles = ref([ { @@ -260,12 +260,7 @@ const handleConsumablesState = (data: ConsumablesStateMessage['data']) => { moveLiquids.value = data.tips tempTipNum.value = [...moveLiquids.value.map((liquid) => liquid.tipNum)] plates.value = data.reactionPlateGroup as ReactionPlate[] - if (!devOptions.enable_LittleBottle_isUsed) { - //@ts-ignore - bufferLittles.value = R.map(R.omit(['isUsed']) ,data.littBottleGroup) - } else { - bufferLittles.value = data.littBottleGroup as BufferLittle[] - } + bufferLittles.value = data.littBottleGroup as BufferLittle[] bufferBig.value = data.larBottleGroup as BottleGroup[] } else { console.log('正在拖动,不更新耗材') @@ -293,7 +288,7 @@ const updatePlatesAndBuffers = ({ bufferLittles.value[index].num = value } if (type === 'BigBuf' && bufferBig.value && bufferBig.value[index]) { - bufferBig.value[index].isUse = value > 0 + bufferBig.value[index].isInstall = value > 0 } } onMounted(() => { @@ -423,7 +418,7 @@ const handleIsUnload = () => { color: '#4caf50', }, ] - bufferBig.value = Array.from({ length: 6 }, () => ({ num: 0, isUse: false })) + bufferBig.value = Array.from({ length: 6 }, () => ({ num: 0, isInstall: false })) } const isDragging = ref(false) @@ -437,6 +432,7 @@ const updateTipNum = async ({ tipNum: number sync: boolean }) => { + if (tipNum < 0) { return } if (deviceStore.status === 'IDLE') { tempTipNum.value[index] = tipNum //调用接口 diff --git a/src/pages/Index/components/Consumables/BallGrid.vue b/src/pages/Index/components/Consumables/BallGrid.vue index 6805f96..28bc1e1 100644 --- a/src/pages/Index/components/Consumables/BallGrid.vue +++ b/src/pages/Index/components/Consumables/BallGrid.vue @@ -73,7 +73,7 @@ const ballStyle = (index) => { // 动态计算内部小球的颜色变化 const innerCircleStyle = (index) => { const ball = props.data[index] || {} - const isActive = !!ball.isUse + const isActive = !!ball.isInstall return { height: `${ball.num/25.0*100}%`, backgroundColor: isActive ? ball.color : props.innerColor, diff --git a/src/pages/Index/components/Consumables/SpttingPlates.vue b/src/pages/Index/components/Consumables/SpttingPlates.vue index a71a426..cb15c64 100644 --- a/src/pages/Index/components/Consumables/SpttingPlates.vue +++ b/src/pages/Index/components/Consumables/SpttingPlates.vue @@ -92,7 +92,7 @@ watch( }, ) const updateSliderVal = async (plate, order) => { - if (deviceStore.status === 'IDLE') { + if (deviceStore.status === 'IDLE' && plate >= 0) { isDragging.value = true // eventBus.emit('confirm', { // type: 'Plate', @@ -107,7 +107,7 @@ const updateSliderVal = async (plate, order) => { const updateSliderEndVal = async (plate, order) => { isDragging.value = false - if (deviceStore.status === 'IDLE') { + if (deviceStore.status === 'IDLE' && plate >= 0) { try { const res = await updateConsumables({ group: `CG${order}`, num: plate }) if (res.success) { diff --git a/src/types/Index/Consumables.ts b/src/types/Index/Consumables.ts index 768d3e5..f6671e8 100644 --- a/src/types/Index/Consumables.ts +++ b/src/types/Index/Consumables.ts @@ -41,7 +41,7 @@ export interface BottleGroup { lotId?: string color?: string num: number - isUse?: boolean // 仅 larBottleGroup 中存在的字段 + isInstall?: boolean } // 耗材 接口 diff --git a/src/websocket/socket.ts b/src/websocket/socket.ts index 6ab368b..cc815a1 100644 --- a/src/websocket/socket.ts +++ b/src/websocket/socket.ts @@ -187,7 +187,7 @@ interface LittleBottleGroup extends ConsumableGroupBase { // 大缓冲液接口 interface LargeBottleGroup extends ConsumableGroupBase { - isUse: boolean + isInstall: boolean } // Tips信息接口