|
|
@ -41,10 +41,22 @@ |
|
|
|
|
|
|
|
<!-- 底部操作信息 --> |
|
|
|
<el-footer class="footer-info"> |
|
|
|
<div class="user-card"> |
|
|
|
<img class="user-logo" src="@/assets/Index/user.svg"></img> |
|
|
|
<div class="user-name">操作人:{{ username || "未登录" }}</div> |
|
|
|
</div> |
|
|
|
<el-dropdown placement="top-start"> |
|
|
|
<div class="user-card"> |
|
|
|
<img class="user-logo" src="@/assets/Index/user.svg"></img> |
|
|
|
<div class="user-name">操作人:{{ username || "未登录" }}</div> |
|
|
|
</div> |
|
|
|
<template #dropdown> |
|
|
|
<el-dropdown-menu > |
|
|
|
<el-dropdown-item> |
|
|
|
<img class="user-logo" src="@/assets/Index/user.svg" height="30"></img> |
|
|
|
<button class="logout" @click="onLogout">注销</button> |
|
|
|
</el-dropdown-item> |
|
|
|
</el-dropdown-menu> |
|
|
|
</template> |
|
|
|
|
|
|
|
</el-dropdown> |
|
|
|
|
|
|
|
<div class="equipment-status"> |
|
|
|
<div class="status-text">系统:{{ EventText }}</div> |
|
|
|
</div> |
|
|
@ -81,15 +93,17 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
import { ref, onMounted, onBeforeUnmount } from 'vue'; |
|
|
|
import { Time, InitWarn, LoadingModal } from './components/Consumables'; |
|
|
|
import { startWork, pauseWork, continueWork, stopWork, getInitState, initDevice, saveMountedCardInfo, openBuzzer, closeBuzzer } from '../../services/index'; |
|
|
|
import { CheckItem, User } from '../../types/Index'; |
|
|
|
import { User } from '../../types/Index'; |
|
|
|
import { useConsumablesStore } from '../../store'; |
|
|
|
import { createWebSocket } from '../../websocket/socket'; |
|
|
|
import type { AppEventMessage } from '../../websocket/socket'; |
|
|
|
import { getServerInfo } from '../../utils/getServerInfo'; |
|
|
|
import { eventBus } from '../../eventBus'; |
|
|
|
import { logout } from '@/services/Login/login'; |
|
|
|
const selectedTab = ref(sessionStorage.getItem('selectedTab') || '常规'); |
|
|
|
const lineWidth = ref(0); |
|
|
|
const lineLeft = ref(0); |
|
|
@ -97,8 +111,8 @@ const showModal = ref(false); |
|
|
|
const showLoadingModal = ref(false); |
|
|
|
const showAlreadyModal = ref(false); |
|
|
|
const showFailModal = ref(false); |
|
|
|
const checkData = ref<CheckItem[]>([]); |
|
|
|
const failItems = ref<CheckItem[]>([]); |
|
|
|
// const checkData = ref<CheckItem[]>([]); |
|
|
|
// const failItems = ref<CheckItem[]>([]); |
|
|
|
const consumableStore = useConsumablesStore(); |
|
|
|
// 新增的变量 |
|
|
|
const user = ref<User>(JSON.parse(sessionStorage.getItem('token') || '{}') as unknown as User) |
|
|
@ -152,6 +166,17 @@ const handleAppEvent = (data: AppEventMessage['data']) => { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
//注销用户 |
|
|
|
const router = useRouter(); |
|
|
|
const onLogout = ()=> { |
|
|
|
logout().then(() => { |
|
|
|
router.push({ |
|
|
|
path: "/login", |
|
|
|
}); |
|
|
|
sessionStorage.setItem('token', '') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//确认错误事件 |
|
|
|
const confirmError = async () => { |
|
|
|
showErrorModal.value = false |
|
|
@ -186,11 +211,11 @@ onBeforeUnmount(() => { |
|
|
|
ws.disconnect(); |
|
|
|
}); |
|
|
|
// 动态生成错误信息 |
|
|
|
const generateErrorMessages = (data: CheckItem[]): string[] => { |
|
|
|
return data |
|
|
|
.filter(item => !item.pass) |
|
|
|
.map(item => `错误:${item.typechinfo} 检测未通过,请检查设备状态。`); |
|
|
|
}; |
|
|
|
// const generateErrorMessages = (data: CheckItem[]): string[] => { |
|
|
|
// return data |
|
|
|
// .filter(item => !item.pass) |
|
|
|
// .map(item => `错误:${item.typechinfo} 检测未通过,请检查设备状态。`); |
|
|
|
// }; |
|
|
|
|
|
|
|
// 开始测试 |
|
|
|
const startTest = async () => { |
|
|
@ -262,7 +287,7 @@ const pollingInitState = async () => { |
|
|
|
} |
|
|
|
else { |
|
|
|
const infos = res.data.promopt.detailInfos |
|
|
|
failMessage.value= infos && infos.length > 0 ? infos.map(d => d.name).join('\n') : res.data.promopt.info |
|
|
|
failMessage.value= infos && infos.length > 0 ? infos.map((d:any) => d.name).join('\n') : res.data.promopt.info |
|
|
|
showFailModal.value = true; // 显示失败弹窗 |
|
|
|
} |
|
|
|
} |
|
|
@ -307,14 +332,14 @@ const pollingInitState = async () => { |
|
|
|
// } |
|
|
|
// }; |
|
|
|
|
|
|
|
const isTestTubeSlotReady = ref(false); // 试管槽状态标记 |
|
|
|
// const isTestTubeSlotReady = ref(false); // 试管槽状态标记 |
|
|
|
|
|
|
|
// 在获取检测数据后,判断试管槽状态 |
|
|
|
const checkTestTubeSlotStatus = (data: CheckItem[]) => { |
|
|
|
const slotCheck = data.find(item => item.type === 'CHECK_TEST_TUBE_SLOT_READY'); |
|
|
|
isTestTubeSlotReady.value = slotCheck?.pass ?? false; |
|
|
|
console.log('试管槽状态:', isTestTubeSlotReady.value ? '准备就绪' : '未准备好'); |
|
|
|
}; |
|
|
|
// const checkTestTubeSlotStatus = (data: CheckItem[]) => { |
|
|
|
// const slotCheck = data.find(item => item.type === 'CHECK_TEST_TUBE_SLOT_READY'); |
|
|
|
// isTestTubeSlotReady.value = slotCheck?.pass ?? false; |
|
|
|
// console.log('试管槽状态:', isTestTubeSlotReady.value ? '准备就绪' : '未准备好'); |
|
|
|
// }; |
|
|
|
|
|
|
|
const handleAlreadyConfirm = () => { |
|
|
|
console.log('用户确认操作'); |
|
|
@ -503,6 +528,12 @@ onMounted(() => { |
|
|
|
font-size: 26px; |
|
|
|
} |
|
|
|
} |
|
|
|
.logout{ |
|
|
|
width: 70px; |
|
|
|
text-align: center; |
|
|
|
font-size: 20px; |
|
|
|
margin: auto; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.main-content { |
|
|
|