LiLongLong 7 months ago
parent
commit
5e7d3415b0
  1. 25
      src/pages/Index/Regular/Consumables.vue
  2. 6
      src/pages/Index/Regular/Emergency.vue
  3. 44
      src/pages/Index/Regular/Running.vue
  4. 11
      src/pages/Index/components/Consumables/MoveLiquidArea.vue
  5. 8
      src/pages/Index/components/Consumables/ProjectSelector.vue
  6. 4
      src/pages/Index/components/Running/PlateDisplay.vue
  7. 3
      src/store/modules/consumables.ts
  8. 7
      src/websocket/socket.ts
  9. 2
      tsconfig.app.tsbuildinfo

25
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('正在拖动,不更新耗材')
}

6
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<ReactionPlate[]>([]);
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[];
}
//projIdnull
projects.value = projects.value.filter(item => item.projId)

44
src/pages/Index/Regular/Running.vue

@ -106,15 +106,15 @@
</div>
</div>
<div
v-for="index in 20"
<!-- <div
v-for="(item, index) in incubationPlates"
:key="index"
class="rectangular-item"
:style="getRotationStyle(index, index)"
:style="getRotationStyle(item, index)"
>
{{ index + 1 }}
<div></div>
</div>
</div> -->
<div
v-for="(item, index) in incubationPlates"
:key="item.sampleId"
@ -213,21 +213,21 @@
<div class="row-second">
<!-- 反应板区域 -->
<div class="plates-area">
<PlateDisplay :projects="consumablesStore.plates" />
<PlateDisplay :projects="consumablesStore.consumableData.reactionPlateGroup" />
</div>
<!-- 小缓冲液区域 -->
<div class="little-buffer-liquid">
<LittleBufferDisplay :bufferData="consumablesStore.bufferLittles" />
<LittleBufferDisplay :bufferData="consumablesStore.consumableData.littBottleGroup" />
</div>
<!-- tips 大缓冲液区域 -->
<div class="tips-and-big-buffer">
<div class="tips-item">
<div
class="tip-fill"
:style="getFillStyle(consumablesStore.moveLiquids[0])"
:style="getFillStyle(consumablesStore.consumableData.tips[0])"
></div>
<div class="tip-text">
{{ consumablesStore.moveLiquids[0].tipNum }}/120
{{ consumablesStore.consumableData.tips[0].tipNum }}/120
</div>
</div>
<BallGrid
@ -235,7 +235,7 @@
:customColors="true"
width="160px"
height="110px"
:data="consumablesStore.bufferBig"
:data="consumablesStore.consumableData.larBottleGroup"
:columns="3"
class="buffer-grid"
/>
@ -747,6 +747,29 @@ const handleIncubationPlateStateMessage = (
errors: [],
},
]
if(incubationPlates.value.length != 20){
let len = 20 - incubationPlates.value.length
for(let i = 0; i<len; i++){
incubationPlates.value.push({
pos: '',
state: '',
bloodType: '',
sampleBarcode: '',
userid: '',
projInfo: {
projId: 0,
projName: '',
projShortName: '',
color: 'white',
},
sampleId: '',
projId: 0,
startIncubatedTime: 0,
incubatedTimeSec: 0,
errors: [],
})
}
}
}
//
@ -889,6 +912,7 @@ const updateProcessedTubeSettings = () => {
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()

11
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
}

8
src/pages/Index/components/Consumables/ProjectSelector.vue

@ -55,7 +55,7 @@
<script setup lang="ts">
import { ref } from 'vue'
import type { ConsumableGroupBase } from '../../../../websocket/socket'
import type { ReactionPlateGroup } from '../../../../websocket/socket'
import { nanoid } from 'nanoid'
import { useConsumablesStore, useSettingTestTubeStore } from '../../../../store'
@ -78,7 +78,7 @@ defineExpose({
clearSelection,
})
const projects = ref<ConsumableGroupBase[]>(consumables.$state.plates || [])
const projects = ref<ReactionPlateGroup[]>(consumables.consumableData.reactionPlateGroup || [])
const bloodType = ref('')
const selectedProjects = ref<number[]>([]) //
const bloodTypes = ref([
@ -95,7 +95,7 @@ const bloodTypes = ref([
])
//
const getStyle = (item: ConsumableGroupBase) => ({
const getStyle = (item: ReactionPlateGroup) => ({
backgroundColor: item.color,
})
@ -104,7 +104,7 @@ const isSelected = (projId: number) =>
selectedProjects.value.some((item) => item === projId)
//
const toggleProject = (project: ConsumableGroupBase) => {
const toggleProject = (project: ReactionPlateGroup) => {
if (isSelected(0)) {
selectedProjects.value = selectedProjects.value.filter((item) => item == 0)
}

4
src/pages/Index/components/Running/PlateDisplay.vue

@ -18,10 +18,10 @@
</template>
<script setup lang="ts">
import type { ConsumableGroupBase } from '../../../../websocket/socket'
import type { ReactionPlateGroup } from '@/websocket/socket'
defineProps<{
projects: ConsumableGroupBase[]
projects: ReactionPlateGroup[]
}>()
const getPercentage = (num: number) => {

3
src/store/modules/consumables.ts

@ -18,6 +18,7 @@ export const useConsumablesStore = defineStore(
// const plates = ref<ConsumableGroupBase[]>([])
// const bufferLittles = ref<LittleBottleGroup[]>([])
// const bufferBig = ref<LargeBottleGroup[]>([])
// @ts-ignore
const consumableData = ref<ConsumablesStateMessage['data']>({
tips: [{ tipNum: 0 }, { tipNum: 0 }, { tipNum: 0 }],
reactionPlateGroup: Array.from({length: 6},() => ({num: 0, isInstall: false})),
@ -64,7 +65,7 @@ export const useConsumablesStore = defineStore(
updateWasteStatus,
wasteStatus,
hasAllConsumables
hasAllConsumables,
}
},
// {

7
src/websocket/socket.ts

@ -179,7 +179,8 @@ interface ConsumableGroupBase {
color: string
num: number
isInstall: boolean
reserveNum: number
reserveNum: number,
}
export interface ReactionPlateGroup extends Partial<ConsumableGroupBase> {}
@ -196,7 +197,7 @@ interface TipInfo {
totalNum?: number
}
// 耗材状态消息接口
// 耗材状态消息接口 consumableStore
interface ConsumablesStateMessage extends BaseMessage {
type: 'ConsumablesState'
messageType: 'Report'
@ -205,7 +206,7 @@ interface ConsumablesStateMessage extends BaseMessage {
tips: TipInfo[]
reactionPlateGroup: ReactionPlateGroup[]
littBottleGroup: LittleBottleGroup[]
larBottleGroup: LargeBottleGroup[]
larBottleGroup: LargeBottleGroup[],
}
timestamp: number
}

2
tsconfig.app.tsbuildinfo
File diff suppressed because it is too large
View File

Loading…
Cancel
Save