Browse Source

优化设备正在初始化中的状态

master
LiLongLong 4 months ago
parent
commit
218b72c66e
  1. 34
      src/pages/Index/Regular/TestTube.vue
  2. 7
      src/pages/Login/Login.vue
  3. 10
      src/services/Index/init.ts
  4. 2
      src/utils/getServerInfo.ts
  5. 2
      tsconfig.app.tsbuildinfo

34
src/pages/Index/Regular/TestTube.vue

@ -153,7 +153,7 @@ const clickBloodTypeItem = (type) => {
} }
const projIdCntMap = computed(() => { const projIdCntMap = computed(() => {
return R.reduce(
let projMap = R.reduce(
(acc, curr) => { (acc, curr) => {
const projIdCntRack = R.reduce( const projIdCntRack = R.reduce(
(ac, cur) => { (ac, cur) => {
@ -174,6 +174,8 @@ const projIdCntMap = computed(() => {
{}, {},
testTubeStore.tubeRacks, testTubeStore.tubeRacks,
) )
console.log('projMap===', projMap)
return projMap;
}) })
// //
@ -277,22 +279,26 @@ const updateTubeSettings = async (rackIdx: number, tubeIdx: number) => {
return return
} }
console.log('rack.tubeSettings---', rack.tubeSettings)
//
// if(consumablesStore.consumableData && consumablesStore.consumableData.reactionPlateGroup){
// let reactionPlateGroup = consumablesStore.consumableData.reactionPlateGroup
// let list:reactionPlateGroupItem[] = []
// reactionPlateGroup.forEach((item:any) => {
// if(item.projId && selectedProjIds.value.includes(item.projId) && item.num <=0){
// list.push(item.projName)
// console.log('tubeRack---', testTubeStore.tubeRacks)
// console.log('rack---', rack.tubeSettings)
// let hasExistProject = existValidProject(rack)
// if(!hasExistProject){
// //
// if(consumablesStore.consumableData && consumablesStore.consumableData.reactionPlateGroup){
// let reactionPlateGroup = consumablesStore.consumableData.reactionPlateGroup
// let list:reactionPlateGroupItem[] = []
// reactionPlateGroup.forEach((item:any) => {
// if(item.projId && selectedProjIds.value.includes(item.projId) && item.num <=0){
// list.push(item.projName)
// }
// })
// if(list.length){
// eMessage.error(`${list.join(',')}`)
// return;
// } // }
// })
// if(list.length){
// eMessage.error(`${list.join(',')}`)
// return;
// } // }
// } // }
// //
// if(consumablesStore.projectsAvailable){ // if(consumablesStore.projectsAvailable){

7
src/pages/Login/Login.vue

@ -47,10 +47,12 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, onUnmounted, ref, watch } from 'vue' import { onMounted, onUnmounted, ref, watch } from 'vue'
import { login, getUserList } from '../../services/index' import { login, getUserList } from '../../services/index'
import { isBoardParamInited } from '../../services/Index/init'
import type { User } from '../../types/Index' import type { User } from '../../types/Index'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { getServerInfo } from '@/utils/getServerInfo' import { getServerInfo } from '@/utils/getServerInfo'
import { createWebSocket, DeviceContextStateMessage } from '@/websocket/socket' import { createWebSocket, DeviceContextStateMessage } from '@/websocket/socket'
import message from 'element-plus/es/components/message/index.mjs'
const router = useRouter() const router = useRouter()
const stateUrl = getServerInfo('/api/v1/app/ws/state') const stateUrl = getServerInfo('/api/v1/app/ws/state')
@ -130,6 +132,11 @@ const clearPin = () => {
// PIN // PIN
// PIN // PIN
const submitPin = async () => { const submitPin = async () => {
let resData = await isBoardParamInited()
if(!resData.data){//
message.warning('设备正在初始化,请稍候...')
return;
}
if (selectedUser.value === null) { if (selectedUser.value === null) {
loginStatus.value = '请选择用户' loginStatus.value = '请选择用户'
return return

10
src/services/Index/init.ts

@ -34,3 +34,13 @@ export const confirmPromptInfo = async (eventId: string) => {
console.log('获取初始化状态接口出错', error) console.log('获取初始化状态接口出错', error)
} }
} }
//系统是否正在初始化中
export const isBoardParamInited = async () => {
try {
const res = await apiClient.post('/api/v1/app/deviceInit/isBoardParamInited')
return res.data
} catch (error) {
}
}

2
src/utils/getServerInfo.ts

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

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

Loading…
Cancel
Save