Browse Source

属性名称变动:isUse->isInstall,修改tipNum时不能小于0

dev
zhangjiming 7 months ago
parent
commit
1ff9396b8a
  1. 4
      src/constant/index.ts
  2. 24
      src/mock/Index/Consumables.ts
  3. 14
      src/pages/Index/Regular/Consumables.vue
  4. 2
      src/pages/Index/components/Consumables/BallGrid.vue
  5. 4
      src/pages/Index/components/Consumables/SpttingPlates.vue
  6. 2
      src/types/Index/Consumables.ts
  7. 2
      src/websocket/socket.ts

4
src/constant/index.ts

@ -1,7 +1,7 @@
// 开发选项 // 开发选项
export const devOptions = { export const devOptions = {
// 小瓶缓冲液对象的isUsed属性
enable_LittleBottle_isUsed: false,
// 小瓶缓冲液对象的isInstall属性
// enable_LittleBottle_isInstall: false,
} }
export const DICT = {} export const DICT = {}

24
src/mock/Index/Consumables.ts

@ -214,7 +214,7 @@ const consumablesScanResultData: ConsumablesScanResultData = Mock.mock({
lotId: '', lotId: '',
color: '', color: '',
num: 0, num: 0,
isUse: false,
isInstall: false,
}, },
{ {
projId: 2, projId: 2,
@ -223,13 +223,13 @@ const consumablesScanResultData: ConsumablesScanResultData = Mock.mock({
lotId: 'FA020000', lotId: 'FA020000',
color: '#DC143C', color: '#DC143C',
num: 25, num: 25,
isUse: true,
isInstall: true,
}, },
{ {
lotId: '', lotId: '',
color: '', color: '',
num: 0, num: 0,
isUse: false,
isInstall: false,
}, },
{ {
projId: 4, projId: 4,
@ -238,7 +238,7 @@ const consumablesScanResultData: ConsumablesScanResultData = Mock.mock({
lotId: 'FA040000', lotId: 'FA040000',
color: '#FF69B4', color: '#FF69B4',
num: 25, num: 25,
isUse: true,
isInstall: true,
}, },
{ {
projId: 5, projId: 5,
@ -247,7 +247,7 @@ const consumablesScanResultData: ConsumablesScanResultData = Mock.mock({
lotId: 'FA050000', lotId: 'FA050000',
color: '#FF1493', color: '#FF1493',
num: 25, num: 25,
isUse: true,
isInstall: true,
}, },
{ {
projId: 6, projId: 6,
@ -256,7 +256,7 @@ const consumablesScanResultData: ConsumablesScanResultData = Mock.mock({
lotId: 'FA060000', lotId: 'FA060000',
color: '#C71585', color: '#C71585',
num: 25, num: 25,
isUse: true,
isInstall: true,
}, },
], ],
}, },
@ -405,7 +405,7 @@ const consumableOneChannelData: ConsumablesOneChannel = Mock.mock({
lotId: '', lotId: '',
color: '', color: '',
num: 0, num: 0,
isUse: false,
isInstall: false,
}, },
{ {
projId: 2, projId: 2,
@ -414,13 +414,13 @@ const consumableOneChannelData: ConsumablesOneChannel = Mock.mock({
lotId: 'FA020000', lotId: 'FA020000',
color: '#DC143C', color: '#DC143C',
num: 25, num: 25,
isUse: true,
isInstall: true,
}, },
{ {
lotId: '', lotId: '',
color: '', color: '',
num: 0, num: 0,
isUse: false,
isInstall: false,
}, },
{ {
projId: 4, projId: 4,
@ -429,7 +429,7 @@ const consumableOneChannelData: ConsumablesOneChannel = Mock.mock({
lotId: 'FA040000', lotId: 'FA040000',
color: '#FF69B4', color: '#FF69B4',
num: 25, num: 25,
isUse: true,
isInstall: true,
}, },
{ {
projId: 5, projId: 5,
@ -438,7 +438,7 @@ const consumableOneChannelData: ConsumablesOneChannel = Mock.mock({
lotId: 'FA050000', lotId: 'FA050000',
color: '#FF1493', color: '#FF1493',
num: 25, num: 25,
isUse: true,
isInstall: true,
}, },
{ {
projId: 6, projId: 6,
@ -447,7 +447,7 @@ const consumableOneChannelData: ConsumablesOneChannel = Mock.mock({
lotId: 'FA060000', lotId: 'FA060000',
color: '#C71585', color: '#C71585',
num: 25, num: 25,
isUse: true,
isInstall: true,
}, },
], ],
}, },

14
src/pages/Index/Regular/Consumables.vue

@ -87,7 +87,7 @@
gridWidth="240px" gridWidth="240px"
gridHeight="240px" gridHeight="240px"
:activeColor="item.color" :activeColor="item.color"
:inUse="item.isUsed"
:inUse="item.isInstall"
/> />
</div> </div>
</div> </div>
@ -177,7 +177,7 @@ interface BufferLittle {
type?: string type?: string
projId?: number projId?: number
projName?: string projName?: string
isUsed?: boolean
isInstall?: boolean
} }
const bufferLittles = ref<BufferLittle[]>([ const bufferLittles = ref<BufferLittle[]>([
{ {
@ -260,12 +260,7 @@ const handleConsumablesState = (data: ConsumablesStateMessage['data']) => {
moveLiquids.value = data.tips moveLiquids.value = data.tips
tempTipNum.value = [...moveLiquids.value.map((liquid) => liquid.tipNum)] tempTipNum.value = [...moveLiquids.value.map((liquid) => liquid.tipNum)]
plates.value = data.reactionPlateGroup as ReactionPlate[] 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[] bufferBig.value = data.larBottleGroup as BottleGroup[]
} else { } else {
console.log('正在拖动,不更新耗材') console.log('正在拖动,不更新耗材')
@ -293,7 +288,7 @@ const updatePlatesAndBuffers = ({
bufferLittles.value[index].num = value bufferLittles.value[index].num = value
} }
if (type === 'BigBuf' && bufferBig.value && bufferBig.value[index]) { if (type === 'BigBuf' && bufferBig.value && bufferBig.value[index]) {
bufferBig.value[index].isUse = value > 0
bufferBig.value[index].isInstall = value > 0
} }
} }
onMounted(() => { onMounted(() => {
@ -423,7 +418,7 @@ const handleIsUnload = () => {
color: '#4caf50', 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) const isDragging = ref(false)
@ -437,6 +432,7 @@ const updateTipNum = async ({
tipNum: number tipNum: number
sync: boolean sync: boolean
}) => { }) => {
if (tipNum < 0) { return }
if (deviceStore.status === 'IDLE') { if (deviceStore.status === 'IDLE') {
tempTipNum.value[index] = tipNum tempTipNum.value[index] = tipNum
// //

2
src/pages/Index/components/Consumables/BallGrid.vue

@ -73,7 +73,7 @@ const ballStyle = (index) => {
// //
const innerCircleStyle = (index) => { const innerCircleStyle = (index) => {
const ball = props.data[index] || {} const ball = props.data[index] || {}
const isActive = !!ball.isUse
const isActive = !!ball.isInstall
return { return {
height: `${ball.num/25.0*100}%`, height: `${ball.num/25.0*100}%`,
backgroundColor: isActive ? ball.color : props.innerColor, backgroundColor: isActive ? ball.color : props.innerColor,

4
src/pages/Index/components/Consumables/SpttingPlates.vue

@ -92,7 +92,7 @@ watch(
}, },
) )
const updateSliderVal = async (plate, order) => { const updateSliderVal = async (plate, order) => {
if (deviceStore.status === 'IDLE') {
if (deviceStore.status === 'IDLE' && plate >= 0) {
isDragging.value = true isDragging.value = true
// eventBus.emit('confirm', { // eventBus.emit('confirm', {
// type: 'Plate', // type: 'Plate',
@ -107,7 +107,7 @@ const updateSliderVal = async (plate, order) => {
const updateSliderEndVal = async (plate, order) => { const updateSliderEndVal = async (plate, order) => {
isDragging.value = false isDragging.value = false
if (deviceStore.status === 'IDLE') {
if (deviceStore.status === 'IDLE' && plate >= 0) {
try { try {
const res = await updateConsumables({ group: `CG${order}`, num: plate }) const res = await updateConsumables({ group: `CG${order}`, num: plate })
if (res.success) { if (res.success) {

2
src/types/Index/Consumables.ts

@ -41,7 +41,7 @@ export interface BottleGroup {
lotId?: string lotId?: string
color?: string color?: string
num: number num: number
isUse?: boolean // 仅 larBottleGroup 中存在的字段
isInstall?: boolean
} }
// 耗材 接口 // 耗材 接口

2
src/websocket/socket.ts

@ -187,7 +187,7 @@ interface LittleBottleGroup extends ConsumableGroupBase {
// 大缓冲液接口 // 大缓冲液接口
interface LargeBottleGroup extends ConsumableGroupBase { interface LargeBottleGroup extends ConsumableGroupBase {
isUse: boolean
isInstall: boolean
} }
// Tips信息接口 // Tips信息接口

Loading…
Cancel
Save