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 //false
//@ts-ignore
let hasAllConsumables = ref(false) let hasAllConsumables = ref(false)
// //
const handleConsumablesState = (data: ConsumablesStateMessage['data']) => { const handleConsumablesState = (data: ConsumablesStateMessage['data']) => {
if (!isDragging.value) { if (!isDragging.value) {
consumableStore.setConsumablesData(data) 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 { } else {
console.log('正在拖动,不更新耗材') console.log('正在拖动,不更新耗材')
} }

6
src/pages/Index/Regular/Emergency.vue

@ -125,7 +125,6 @@ const ws = createWebSocket(getServerInfo().wsUrl);
const consumableStore = useConsumablesStore(); const consumableStore = useConsumablesStore();
const emergencyStore = useEmergencyStore(); const emergencyStore = useEmergencyStore();
const deviceStore = useDeviceStore(); const deviceStore = useDeviceStore();
console.log('deviceStore---', deviceStore)
// / // /
const isEmergencyEnabled = ref(true);// const isEmergencyEnabled = ref(true);//
@ -133,8 +132,9 @@ const isEmergencyEnabled = ref(true);//设置表单是否可输入
const projects = ref<ReactionPlate[]>([]); const projects = ref<ReactionPlate[]>([]);
onMounted(() => { onMounted(() => {
// projects // 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 //projIdnull
projects.value = projects.value.filter(item => item.projId) projects.value = projects.value.filter(item => item.projId)

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

@ -106,15 +106,15 @@
</div> </div>
</div> </div>
<div
v-for="index in 20"
<!-- <div
v-for="(item, index) in incubationPlates"
:key="index" :key="index"
class="rectangular-item" class="rectangular-item"
:style="getRotationStyle(index, index)"
:style="getRotationStyle(item, index)"
> >
{{ index + 1 }} {{ index + 1 }}
<div></div> <div></div>
</div>
</div> -->
<div <div
v-for="(item, index) in incubationPlates" v-for="(item, index) in incubationPlates"
:key="item.sampleId" :key="item.sampleId"
@ -213,21 +213,21 @@
<div class="row-second"> <div class="row-second">
<!-- 反应板区域 --> <!-- 反应板区域 -->
<div class="plates-area"> <div class="plates-area">
<PlateDisplay :projects="consumablesStore.plates" />
<PlateDisplay :projects="consumablesStore.consumableData.reactionPlateGroup" />
</div> </div>
<!-- 小缓冲液区域 --> <!-- 小缓冲液区域 -->
<div class="little-buffer-liquid"> <div class="little-buffer-liquid">
<LittleBufferDisplay :bufferData="consumablesStore.bufferLittles" />
<LittleBufferDisplay :bufferData="consumablesStore.consumableData.littBottleGroup" />
</div> </div>
<!-- tips 大缓冲液区域 --> <!-- tips 大缓冲液区域 -->
<div class="tips-and-big-buffer"> <div class="tips-and-big-buffer">
<div class="tips-item"> <div class="tips-item">
<div <div
class="tip-fill" class="tip-fill"
:style="getFillStyle(consumablesStore.moveLiquids[0])"
:style="getFillStyle(consumablesStore.consumableData.tips[0])"
></div> ></div>
<div class="tip-text"> <div class="tip-text">
{{ consumablesStore.moveLiquids[0].tipNum }}/120
{{ consumablesStore.consumableData.tips[0].tipNum }}/120
</div> </div>
</div> </div>
<BallGrid <BallGrid
@ -235,7 +235,7 @@
:customColors="true" :customColors="true"
width="160px" width="160px"
height="110px" height="110px"
:data="consumablesStore.bufferBig"
:data="consumablesStore.consumableData.larBottleGroup"
:columns="3" :columns="3"
class="buffer-grid" class="buffer-grid"
/> />
@ -747,6 +747,29 @@ const handleIncubationPlateStateMessage = (
errors: [], 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( processedTubeSettings.value = processTubeSettings(
tubeSettings, tubeSettings,
//@ts-ignore
plateData, plateData,
getBloodTypeLabel, 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() const processedTubeSettings = ref()

11
src/pages/Index/components/Consumables/MoveLiquidArea.vue

@ -335,8 +335,15 @@ const router = useRouter()
// //
let showEmergencyModal = ref(false) let showEmergencyModal = ref(false)
const addEmergency = () => { 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; showEmergencyModal.value = true;
return return
} }

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

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

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

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

3
src/store/modules/consumables.ts

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

7
src/websocket/socket.ts

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

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

Loading…
Cancel
Save