Browse Source

完善运行功能

feature/history-20250108
XinYuan 7 months ago
parent
commit
b0f65f786c
  1. 32
      et --hard f8b9d15
  2. 449
      src/pages/Index/Regular/Running.vue
  3. 6
      src/utils/getServerInfo.ts

32
et --hard f8b9d15

@ -0,0 +1,32 @@
8effb07 (HEAD -> feature/history-20250108, origin/dev, dev) HEAD@{0}: reset: moving to HEAD
8effb07 (HEAD -> feature/history-20250108, origin/dev, dev) HEAD@{1}: merge dev: Fast-forward
7e95792 HEAD@{2}: checkout: moving from dev to feature/history-20250108
8effb07 (HEAD -> feature/history-20250108, origin/dev, dev) HEAD@{3}: pull: Fast-forward
7e95792 HEAD@{4}: reset: moving to HEAD
7e95792 HEAD@{5}: checkout: moving from feature/history-20250108 to dev
7e95792 HEAD@{6}: checkout: moving from dev to feature/history-20250108
7e95792 HEAD@{7}: checkout: moving from feature/history-20050107 to dev
499e249 (feature/history-20050107) HEAD@{8}: commit: 废
585533d HEAD@{9}: merge dev: Merge made by the 'ort' strategy.
f8b9d15 HEAD@{10}: checkout: moving from dev to feature/history-20050107
7e95792 HEAD@{11}: pull: Fast-forward
77385c2 HEAD@{12}: checkout: moving from feature/history-20050107 to dev
f8b9d15 HEAD@{13}: commit: 优化
a50e614 HEAD@{14}: checkout: moving from dev to feature/history-20050107
77385c2 HEAD@{15}: checkout: moving from feature/history-20050107 to dev
a50e614 HEAD@{16}: commit: 1
473a047 (origin/feature/history-20050107) HEAD@{17}: checkout: moving from dev to feature/history-20050107
77385c2 HEAD@{18}: reset: moving to HEAD
77385c2 HEAD@{19}: pull (finish): returning to refs/heads/dev
77385c2 HEAD@{20}: pull (pick): 1
1576814 HEAD@{21}: pull (start): checkout 15768147d6d39bda22ee227a10ab86898c061d6d
764b4a2 HEAD@{22}: commit: 1
00e8c1c HEAD@{23}: checkout: moving from feature/history-20050107 to dev
473a047 (origin/feature/history-20050107) HEAD@{24}: reset: moving to HEAD
473a047 (origin/feature/history-20050107) HEAD@{25}: commit: 优化
566dd9d HEAD@{26}: commit: 11
9bd6f34 HEAD@{27}: commit: 修该配置文件
00e8c1c HEAD@{28}: checkout: moving from dev to feature/history-20050107
00e8c1c HEAD@{29}: pull: Fast-forward
7447c92 HEAD@{30}: checkout: moving from master to dev
88c9c2f (origin/master, origin/HEAD, master) HEAD@{31}: clone: from http://192.168.1.3:3000/project_boditech_vidas_a8000_v3/A8000.git

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

@ -19,7 +19,7 @@
<!-- 外圈的矩形元素 --> <!-- 外圈的矩形元素 -->
<div v-for="(item, index) in incubationPlates" :key="item.sampleId" class="rectangular-item" <div v-for="(item, index) in incubationPlates" :key="item.sampleId" class="rectangular-item"
:style="[getRotationStyle(item, index), getItemStyle(item)]" :style="[getRotationStyle(item, index), getItemStyle(item)]"
@click="!item.isPlaceholder && toggleSelectItem(item)">
@click="!item.isPlaceholder && toggleSelectItem(item,index)">
<template v-if="item.isPlaceholder"> <template v-if="item.isPlaceholder">
<!-- 占位符 --> <!-- 占位符 -->
<span class="placeholder-text">空位</span> <span class="placeholder-text">空位</span>
@ -34,7 +34,9 @@
</div> </div>
<span class="time">{{ getRemainingTime(item) }}</span> <span class="time">{{ getRemainingTime(item) }}</span>
</template> </template>
<div v-show="currentIndex == index" :style="`margin-top:${item.pos=='EMERGENCY'?'20px':'75px'}`" class="quan">{{ index +1 }}</div>
</div> </div>
</div> </div>
<div class="consumables-container"> <div class="consumables-container">
<!-- 第一行 --> <!-- 第一行 -->
@ -46,12 +48,26 @@
<!-- 试管架区域 --> <!-- 试管架区域 -->
<div class="test-tube-rack-area"> <div class="test-tube-rack-area">
<div class="tube-project-tab"> <div class="tube-project-tab">
<span>{{ tubeHolderState.tubeHolderType === 'BloodTube' ? tubeHolderState.tubeHolderType : 'Epp.1.5'
}}</span>
<tube-item
:tube="sampleTube"
:index="0"
:projects="sampleProjects"
:bloodTypes="sampleBloodTypes"
/>
</div> </div>
<div class="tube-items"> <div class="tube-items">
<SampleDisplay :samples="tubeHolderState.tubes" :selectedSamples="selectedSamples"
@updateSelectedSamples="updateSelectedSamples" />
<!-- <SampleDisplay :samples="tubeHolderState.tubes" :selectedSamples="selectedSamples"
@updateSelectedSamples="updateSelectedSamples" /> -->
<div class="tube-container">
<template v-for="(tube, index) in tubes" :key="index">
<tube-item
:tube="tube"
:index="index"
:projects="projects"
:bloodTypes="bloodTypes"
/>
</template>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -123,6 +139,7 @@ import {
LittleBufferDisplay, LittleBufferDisplay,
EmergencyResultDialog, EmergencyResultDialog,
} from '../Components' } from '../Components'
import tubeItem from '../components/TestTube/Tube.vue'
import BallGrid from '../Components/Consumables/BallGrid.vue' import BallGrid from '../Components/Consumables/BallGrid.vue'
import { wasteArea, getTubeRackState } from '../../../services/index' import { wasteArea, getTubeRackState } from '../../../services/index'
import type { Subtank, TubeRackInfo } from '../../../types/Index' import type { Subtank, TubeRackInfo } from '../../../types/Index'
@ -145,6 +162,55 @@ const tubeRack = ref<TubeRackInfo>({
state: 'IDLE', state: 'IDLE',
hasTubeToBeProcessed: false, hasTubeToBeProcessed: false,
}) })
// 10
// 10
const tubes = [
{ userid: 'user1', projId: [1], bloodType: 'A' },
{ userid: 'user2', projId: [2], bloodType: 'B' },
{ userid: 'user3', projId: [1, 2], bloodType: 'AB' },
{ userid: 'user4', projId: [], bloodType: 'O' },
{ userid: 'user5', projId: [3], bloodType: 'A' },
{ userid: 'user6', projId: [4], bloodType: 'B' },
{ userid: 'user7', projId: [3, 4], bloodType: 'AB' },
{ userid: 'user8', projId: [], bloodType: 'O' },
{ userid: 'user9', projId: [5], bloodType: 'A' },
{ userid: 'user10', projId: [6], bloodType: 'B' }
]
//
const projects = [
{ projId: 1, projName: 'Project Alpha', color: 'red' },
{ projId: 2, projName: 'Project Beta', color: 'blue' },
{ projId: 3, projName: 'Project Gamma', color: 'green' },
{ projId: 4, projName: 'Project Delta', color: 'yellow' },
{ projId: 5, projName: 'Project Epsilon', color: 'purple' },
{ projId: 6, projName: 'Project Zeta', color: 'orange' }
]
//
const bloodTypes = [
{ key: 'A', name: 'Type A' },
{ key: 'B', name: 'Type B' },
{ key: 'AB', name: 'Type AB' },
{ key: 'O', name: 'Type O' }
]
//
const sampleTube = {
userid: 'user123',
projId: [1, 2],
bloodType: 'A'
}
const sampleProjects = [
{ projId: 1, projName: 'Project One', color: 'red' },
{ projId: 2, projName: 'Project Two', color: 'blue' }
]
const sampleBloodTypes = [
{ key: 'A', name: 'Type A' },
{ key: 'B', name: 'Type B' }
]
// //
interface TubeHolderState { interface TubeHolderState {
@ -179,7 +245,333 @@ const handleTubeHolderStateMessage = (data: TubeHolderStateMessage['data']) => {
// //
const handleIncubationPlateStateMessage = (data: IncubationPlateStateMessage['data']) => { const handleIncubationPlateStateMessage = (data: IncubationPlateStateMessage['data']) => {
console.log('孵育盘状态:', data) console.log('孵育盘状态:', data)
incubationPlates.value = data.subtanks
// incubationPlates.value = data.subtanks
incubationPlates.value =[
{
pos: "A1",
state: "REACTED",
bloodType: "WHOLE_BLOOD",
sampleBarcode: "BC001",
userid: "U001",
projInfo: {
projId: 1,
projName: "血液疾病检测项目",
projShortName: "项目1",
color: "red"
},
sampleId: "S001",
projId: 1,
startIncubatedTime: 1612345678,
incubatedTimeSec: 1800,
errors: []
},
{
pos: "A2",
state: "REACTED",
bloodType: "PLASMA",
sampleBarcode: "BC002",
userid: "U002",
projInfo: {
projId: 1,
projName: "血液疾病检测项目",
projShortName: "项目1",
color: "red"
},
sampleId: "S002",
projId: 1,
startIncubatedTime: 1612345778,
incubatedTimeSec: 2100,
errors: []
},
{
pos: "A3",
state: "PARTIAL_REACTION",
bloodType: "SERUM",
sampleBarcode: "BC003",
userid: "U003",
projInfo: {
projId: 1,
projName: "血液疾病检测项目",
projShortName: "项目1",
color: "red"
},
sampleId: "S003",
projId: 1,
startIncubatedTime: 1612345878,
incubatedTimeSec: 1900,
errors: []
},
{
pos: "B1",
state: "REACTED",
bloodType: "WHOLE_BLOOD",
sampleBarcode: "BC004",
userid: "U004",
projInfo: {
projId: 2,
projName: "血液成分分析项目",
projShortName: "项目2",
color: "blue"
},
sampleId: "S004",
projId: 2,
startIncubatedTime: 1612345978,
incubatedTimeSec: 2200,
errors: []
},
{
pos: "B2",
state: "NO_REACTION",
bloodType: "PLASMA",
sampleBarcode: "BC005",
userid: "U005",
projInfo: {
projId: 2,
projName: "血液成分分析项目",
projShortName: "项目2",
color: "blue"
},
sampleId: "S005",
projId: 2,
startIncubatedTime: 1612346078,
incubatedTimeSec: 2000,
errors: []
},
{
pos: "B3",
state: "REACTED",
bloodType: "SERUM",
sampleBarcode: "BC006",
userid: "U006",
projInfo: {
projId: 2,
projName: "血液成分分析项目",
projShortName: "项目2",
color: "blue"
},
sampleId: "S006",
projId: 2,
startIncubatedTime: 1612346178,
incubatedTimeSec: 2300,
errors: []
},
{
pos: "C1",
state: "PARTIAL_REACTION",
bloodType: "WHOLE_BLOOD",
sampleBarcode: "BC007",
userid: "U007",
projInfo: {
projId: 3,
projName: "特殊血液指标检测项目",
projShortName: "项目3",
color: "green"
},
sampleId: "S007",
projId: 3,
startIncubatedTime: 1612346278,
incubatedTimeSec: 1950,
errors: []
},
{
pos: "C2",
state: "REACTED",
bloodType: "PLASMA",
sampleBarcode: "BC008",
userid: "U008",
projInfo: {
projId: 3,
projName: "特殊血液指标检测项目",
projShortName: "项目3",
color: "green"
},
sampleId: "S008",
projId: 3,
startIncubatedTime: 1612346378,
incubatedTimeSec: 2150,
errors: []
},
{
pos: "C3",
state: "NO_REACTION",
bloodType: "SERUM",
sampleBarcode: "BC009",
userid: "U009",
projInfo: {
projId: 3,
projName: "特殊血液指标检测项目",
projShortName: "项目3",
color: "green"
},
sampleId: "S009",
projId: 3,
startIncubatedTime: 1612346478,
incubatedTimeSec: 2050,
errors: []
},
{
pos: "D1",
state: "REACTED",
bloodType: "WHOLE_BLOOD",
sampleBarcode: "BC010",
userid: "U010",
projInfo: {
projId: 1,
projName: "血液疾病检测项目",
projShortName: "项目1",
color: "red"
},
sampleId: "S010",
projId: 1,
startIncubatedTime: 1612346578,
incubatedTimeSec: 2250,
errors: []
},
{
pos: "D2",
state: "PARTIAL_REACTION",
bloodType: "PLASMA",
sampleBarcode: "BC011",
userid: "U011",
projInfo: {
projId: 1,
projName: "血液疾病检测项目",
projShortName: "项目1",
color: "red"
},
sampleId: "S011",
projId: 1,
startIncubatedTime: 1612346678,
incubatedTimeSec: 1850,
errors: []
},
{
pos: "D3",
state: "NO_REACTION",
bloodType: "SERUM",
sampleBarcode: "BC012",
userid: "U012",
projInfo: {
projId: 1,
projName: "血液疾病检测项目",
projShortName: "项目1",
color: "red"
},
sampleId: "S012",
projId: 1,
startIncubatedTime: 1612346778,
incubatedTimeSec: 2000,
errors: []
},
{
pos: "E1",
state: "REACTED",
bloodType: "WHOLE_BLOOD",
sampleBarcode: "BC013",
userid: "U013",
projInfo: {
projId: 2,
projName: "血液成分分析项目",
projShortName: "项目2",
color: "blue"
},
sampleId: "S013",
projId: 2,
startIncubatedTime: 1612346878,
incubatedTimeSec: 2350,
errors: []
},
{
pos: "E2",
state: "PARTIAL_REACTION",
bloodType: "PLASMA",
sampleBarcode: "BC014",
userid: "U014",
projInfo: {
projId: 2,
projName: "血液成分分析项目",
projShortName: "项目2",
color: "blue"
},
sampleId: "S014",
projId: 2,
startIncubatedTime: 1612346978,
incubatedTimeSec: 1900,
errors: []
},
{
pos: "E3",
state: "NO_REACTION",
bloodType: "SERUM",
sampleBarcode: "BC015",
userid: "U015",
projInfo: {
projId: 2,
projName: "血液成分分析项目",
projShortName: "项目2",
color: "blue"
},
sampleId: "S015",
projId: 2,
startIncubatedTime: 1612347078,
incubatedTimeSec: 2100,
errors: []
},
{
pos: "F1",
state: "REACTED",
bloodType: "WHOLE_BLOOD",
sampleBarcode: "BC016",
userid: "U016",
projInfo: {
projId: 3,
projName: "特殊血液指标检测项目",
projShortName: "项目3",
color: "green"
},
sampleId: "S016",
projId: 3,
startIncubatedTime: 1612347178,
incubatedTimeSec: 2200,
errors: []
},
{
pos: "F2",
state: "PARTIAL_REACTION",
bloodType: "PLASMA",
sampleBarcode: "BC017",
userid: "U017",
projInfo: {
projId: 3,
projName: "特殊血液指标检测项目",
projShortName: "项目3",
color: "green"
},
sampleId: "S017",
projId: 3,
startIncubatedTime: 1612347278,
incubatedTimeSec: 1950,
errors: []
},
{
pos: "F3",
state: "NO_REACTION",
bloodType: "SERUM",
sampleBarcode: "BC018",
userid: "U018",
projInfo: {
projId: 3,
projName: "特殊血液指标检测项目",
projShortName: "项目3",
color: "green"
},
sampleId: "S018",
projId: 3,
startIncubatedTime: 1612347378,
incubatedTimeSec: 2050,
errors: []
}
]
} }
// //
@ -268,7 +660,7 @@ watch(
isEmergency: true isEmergency: true
} }
// //
incubationPlates.value.push(subtank)
// incubationPlates.value.push(subtank)
}) })
} }
fetchEmergencyData() fetchEmergencyData()
@ -372,7 +764,7 @@ const getItemStyle = (item: Subtank) => {
const remainingTime = getRemainingTime(item) const remainingTime = getRemainingTime(item)
return { return {
backgroundColor: item.pos === 'EMERGENCY' ? '#ffeded' : '#ffffff', //
backgroundColor: item.pos === 'EMERGENCY' ? '#ffeded' : item.projInfo.color, //
borderColor: borderColor:
selectedItemId.value === item.sampleId selectedItemId.value === item.sampleId
? 'blue' ? 'blue'
@ -387,7 +779,8 @@ const getItemStyle = (item: Subtank) => {
} }
// //
const toggleSelectItem = (item: Subtank) => {
let currentIndex = ref(0)
const toggleSelectItem = (item: Subtank,index: number) => {
// //
if (selectedItemId.value === item.sampleId) { if (selectedItemId.value === item.sampleId) {
selectedItem.value = null selectedItem.value = null
@ -396,6 +789,7 @@ const toggleSelectItem = (item: Subtank) => {
// //
selectedItem.value = item selectedItem.value = item
selectedItemId.value = item.sampleId selectedItemId.value = item.sampleId
currentIndex.value = index
} }
} }
@ -516,7 +910,7 @@ const fetchIncubationData = async () => {
} }
// `incubationPlates` // `incubationPlates`
incubationPlates.value = filledData
// incubationPlates.value = filledData
// //
updateStartTimes() updateStartTimes()
@ -545,7 +939,7 @@ const fetchIncubationData = async () => {
isPlaceholder: true, isPlaceholder: true,
}) })
} }
incubationPlates.value = filledData
// incubationPlates.value = filledData
} }
} }
@ -748,7 +1142,7 @@ onUnmounted(() => {
height: 170px; height: 170px;
transform-origin: center -110px; // transform-origin: center -110px; //
border-radius: 12px; border-radius: 12px;
background-color: #ffffff;
background-color: #721616;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -856,28 +1250,20 @@ onUnmounted(() => {
gap: 20px; gap: 20px;
.tube-project-tab { .tube-project-tab {
width: 100px;
height: 50px;
background: linear-gradient(to right, #e3f2fd, #bbdefb);
border-radius: 12px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 24px;
font-weight: bold; font-weight: bold;
color: #1976d2; color: #1976d2;
position: relative; position: relative;
box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1); box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
&::after { &::after {
content: ''; content: '';
width: 3px; width: 3px;
height: 120px; height: 120px;
background: linear-gradient(to bottom, #1976d2, #64b5f6);
background: linear-gradient(to bottom, #e0341d, #fa4f0b);
position: absolute; position: absolute;
top: -35px;
right: -15px;
border-radius: 3px;
right: -30px;
} }
} }
} }
@ -1097,4 +1483,23 @@ onUnmounted(() => {
transform: scale(1); transform: scale(1);
} }
} }
.quan {
width: 18px;
height: 18px;
line-height: 18px;
text-align: center;
border-radius: 50%;
border: 2px solid red;
font-size: 13px;
}
.tube-container {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-around;
align-items: center;
height: auto;
padding: 20px;
width: 100%;
}
</style> </style>

6
src/utils/getServerInfo.ts

@ -3,8 +3,10 @@ export function getServerInfo(wsPath: string = '/api/v1/app/ws/state') {
const url = new URL(window.location.href) const url = new URL(window.location.href)
// 获取主机名(IP 或域名)和端口号 // 获取主机名(IP 或域名)和端口号
const host = url.hostname // 例如: "192.168.1.100" 或 "localhost"
const port = '8082' // 使用固定的后端端口;由于本地开发时,8080被占用导致ws连接失败,所以使用8082
// const host = url.hostname // 例如: "192.168.1.100" 或 "localhost"
const host = '192.168.1.119' // 使用固定的后端IP地址
// const port = '8082' // 使用固定的后端端口;由于本地开发时,8080被占用导致ws连接失败,所以使用8082
const port = '80' // 使用固定的后端端口;由于本地开发时,8080被占用导致ws连接失败,所以使用8082
// 构建 WebSocket URL // 构建 WebSocket URL
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:' const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'

Loading…
Cancel
Save