Browse Source

fix:bug修复

master
guoapeng 3 weeks ago
parent
commit
c18a2ccb77
  1. 4
      src/assets/running/incubating.svg
  2. 11
      src/pages/Index/Index.vue
  3. 96
      src/pages/Index/Regular/Emergency.vue
  4. 12
      src/pages/Index/Regular/Running.vue
  5. 2
      src/pages/Index/Settings/Network.vue
  6. 4
      src/pages/Index/components/Consumables/TabBar.vue
  7. 7
      src/store/modules/device.ts
  8. 2
      src/websocket/socket.ts

4
src/assets/running/incubating.svg

@ -4,8 +4,8 @@
<path d="M41 9C46.4791 9 50.9309 13.467 51 19C51 24.533 46.4791 29 41 29C39.6851 29.0022 38.3826 28.745 37.1675 28.2431C35.9524 27.7412 34.8485 27.0045 33.9193 26.0753C32.9901 25.1461 32.2539 24.0427 31.7529 22.8285C31.2519 21.6143 30.9961 20.3132 31 19C30.9961 17.6868 31.252 16.3857 31.7529 15.1715C32.2539 13.9573 32.9902 12.8539 33.9194 11.9247C34.8486 10.9955 35.9524 10.2588 37.1675 9.75692C38.3826 9.25501 39.6851 8.99779 41 9.00004V9ZM41 27.267C45.5209 27.267 49.2187 23.6 49.2187 19C49.2187 14.4 45.5209 10.733 41 10.733C36.411 10.733 32.7803 14.467 32.7803 19C32.7803 23.533 36.411 27.267 41 27.267H41ZM41.013 13V19H47.0208C47.0208 20.1867 46.6685 21.3467 46.0083 22.3334C45.3482 23.3201 44.4099 24.0892 43.3121 24.5433C42.2143 24.9974 41.0064 25.1162 39.841 24.8847C38.6756 24.6532 37.6051 24.0818 36.7649 23.2426C35.9247 22.4035 35.3525 21.3344 35.1207 20.1705C34.8889 19.0067 35.0078 17.8003 35.4625 16.7039C35.9173 15.6075 36.6873 14.6705 37.6753 14.0112C38.6633 13.3519 39.8248 13 41.013 13Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear_38_3947" x1="5.46874" y1="6.52593e-06" x2="67.6349" y2="53.1491" gradientUnits="userSpaceOnUse">
<stop stop-color="#EC9397"/>
<stop offset="1" stop-color="#E35958"/>
<stop stop-color="#6889F8"/>
<stop offset="1" stop-color="#355EF4"/>
</linearGradient>
</defs>
</svg>

11
src/pages/Index/Index.vue

@ -809,6 +809,7 @@ const handleAppWarningFlagState = (data: AppFlagStateListMessage['data']) => {
if (data && data.states && data.states.length) {
// showWarnModal
isTriggerAlarm.value = true
deviceStore.setAlarmNum(data.warningAndErrorFlagTriggerNum || 0)
deviceStore.setAlarmList(data.states)
deviceStore.updatealarmFlagState(data)
}
@ -969,6 +970,11 @@ const startTest = async () => {
//
const pauseTest = async () => {
await ElMessageBox.confirm('是否暂停测试?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
deviceWaitingModelInfo.value = {
title: '设备正在响应中',
message: '请不要有任何手动操作!',
@ -985,6 +991,11 @@ const pauseTest = async () => {
//
const stopTest = async () => {
await ElMessageBox.confirm('是否停止测试?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
deviceWaitingModelInfo.value = {
title: '设备正在响应中',
message: '请不要有任何手动操作!',

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

@ -15,7 +15,7 @@
<input
type="text"
placeholder="请输入样本条形码信息"
@focus="showKeyboard('sampleBarcode')"
@focus="openKeyboard('sampleBarcode')"
style="width: 400px"
:value="emergencyPosition.sampleBarcode"
readonly
@ -30,7 +30,7 @@
<input
type="text"
placeholder="请输入患者ID信息"
@focus="showKeyboard('userid')"
@focus="openKeyboard('userid')"
:value="emergencyPosition.userid"
style="width: 400px"
readonly
@ -59,7 +59,7 @@
</div>
<div class="project-title">
<span>血液类型</span>
<span>样本类型</span>
</div>
<div class="type-list">
<div
@ -81,20 +81,23 @@
</div>
<!-- 键盘 -->
<transition name="slide-up">
<div class="keyboard" v-if="keyboardVisible">
<SimpleKeyboard
:input="currentInputValue"
@onChange="handleKeyboardInput"
@onKeyPress="handleKeyPress"
<SoftKeyboard
ref="softKeyboardRef"
v-model="inputValue"
:is-visible="keyboardVisible"
:keyboard-type="keyboardType"
@update-keyboard-visible="(visible) => keyboardVisible = visible"
@confirm="()=>{}"
@close="keyboardVisible = false"
/>
</div>
</transition>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, onUnmounted } from 'vue'
import { ref, onMounted, onUnmounted, watch } from 'vue'
import { useRouter } from 'vue-router'
import { insertEmergency } from '@/services/Index/index'
import {
@ -111,6 +114,34 @@ defineOptions({
name: 'EmergencyForm',
})
const inputValue = ref('')
const keyboardType = ref<'text' | 'number'>('text')
const softKeyboardRef = ref()
const currentFocusType = ref('')
const openKeyboard = (type: 'sampleBarcode' | 'userid') => {
inputValue.value = type === 'sampleBarcode' ? emergencyPosition.value.sampleBarcode : emergencyPosition.value.userid
keyboardVisible.value = true
setTimeout(() => { keyboardVisible.value = true}, 100)
currentFocusType.value = type
}
watch(inputValue, (newVal: string) => {
handleKeyboardInput(newVal)
})
//
const handleKeyboardInput = (value: string) => {
//
inputValue.value = value
//
if (currentFocusType.value === 'sampleBarcode') {
emergencyPosition.value.sampleBarcode = value
} else {
emergencyPosition.value.userid = value
}
}
const consumableStore = useConsumablesStore()
const emergencyStore = useEmergencyStore()
const deviceStore = useDeviceStore()
@ -206,54 +237,13 @@ onMounted(() => {
})
//
const keyboardVisible = ref(false)
const currentInputValue = ref('')
const currentInputField = ref<'sampleBarcode' | 'userid' | ''>('')
//
const showKeyboard = (field: 'sampleBarcode' | 'userid') => {
//
if (field == 'sampleBarcode') {
currentInputValue.value = emergencyPosition.value.sampleBarcode
}
if (field == 'userid') {
currentInputValue.value = emergencyPosition.value.userid
}
currentInputField.value = field
keyboardVisible.value = true
}
//
const handleKeyboardInput = (value: string) => {
if (!currentInputField.value) return
//
currentInputValue.value = value
//
if (currentInputField.value === 'sampleBarcode') {
emergencyPosition.value.sampleBarcode = value
} else {
emergencyPosition.value.userid = value
}
}
//
const handleKeyPress = (button: string) => {
if (button === '{enter}') {
hideKeyboard()
} else if (button === '{bksp}') {
// 退
const value = currentInputValue.value
if (value.length > 0) {
const newValue = value.slice(0, -1)
handleKeyboardInput(newValue)
}
}
}
//
const hideKeyboard = () => {
keyboardVisible.value = false
currentInputField.value = ''
currentInputValue.value = ''
inputValue.value = ''
currentFocusType.value = ''
}
//

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

@ -16,11 +16,11 @@
</span>
</span>
</div>
<div class="alarm" @click="onShowAlarmModal" :style="`background-color:${hasAlarm ? '#ffe2d1' : '#b7edb8'}`">
<span class="alarm-info" :style="`color:${hasAlarm ? '#fd985f' : '#71d088'}`"> 状态列表 </span>
<span class="alarm-info-value" :style="`background-color:${hasAlarm ? '#fd985f' : '#71d088'}`">
<div class="alarm" @click="onShowAlarmModal" :style="`background-color:${hasAlarm=== 'Error' ? '#f19d9d' : hasAlarm=== 'Warn' ? '#ffe2d1' : '#b7edb8'}`">
<span class="alarm-info" :style="`color:${hasAlarm=== 'Error' ? '#F56C6C' : hasAlarm=== 'Warn' ? '#fd985f' : '#71d088'}`"> 状态列表 </span>
<span class="alarm-info-value" :style="`background-color:${hasAlarm=== 'Error' ? '#F56C6C' : hasAlarm=== 'Warn' ? '#fd985f' : '#71d088'}`">
<span style="font-size: 22px">
{{ alarmList.length }}
{{ deviceStore.alarmNum }}
<!-- {{ deviceStore.sensorState?.incubateBoxTemperature || 0 }} -->
</span>
</span>
@ -273,7 +273,7 @@ const router = useRouter()
const alarmList = ref<WarningState[]>(deviceStore.alarmList)
const alarmVisible = ref(false)
const alarmStatusVisible = ref(false)
const hasAlarm = ref(false)
const hasAlarm = ref('Normal')
const alarmRecordVisible = ref(false)
const emergencyInfo = ref(emergencyStore.emergencyInfo)
const statusList = ref(systemStore.statusList)
@ -283,7 +283,7 @@ watchEffect(() => {
alarmList.value = deviceStore.alarmList
statusList.value = systemStore.statusList
if(deviceStore.alarmFlagState){
hasAlarm.value = deviceStore.alarmFlagState.hasWarningTriggerFlag || deviceStore.alarmFlagState.hasErrorTriggerFlag
hasAlarm.value = deviceStore.alarmFlagState.notificationState
}
emergencyInfo.value = emergencyStore.emergencyInfo
})

2
src/pages/Index/Settings/Network.vue

@ -140,7 +140,7 @@
<span class="label">{{ index === 0 ? 'DNS' : '' }}</span>
<div class="dns-input">
<span class="dns-title">
{{ index === 0 ? '首' : '备选' }}
{{ index === 0 ? '首' : '备选' }}
</span>
<el-input
v-if="isEdit"

4
src/pages/Index/components/Consumables/TabBar.vue

@ -4,8 +4,8 @@
@click="onTabClick(index)">
<img class="tab-icon" :src="currentTab.path === tab.url ? tab.activeIcon : tab.icon"></img>
<span class="tab-label">{{ tab.label }}</span>
<span v-if="(tab.url).indexOf('running')>-1 && alarmFlagState && alarmFlagState.hasWarningTriggerFlag" style="padding-top: 5px;" title="耗材报警">
<el-icon class="warning-icon" :style="`color:${alarmFlagState.hasWarningTriggerFlag ? 'orange' : 'red'}`"><WarningFilled /></el-icon>
<span v-if="(tab.url).indexOf('running')>-1 && ['Error', 'Warn'].includes(deviceStore.alarmFlagState?.notificationState || '') " style="padding-top: 5px;" title="耗材报警">
<el-icon class="warning-icon" :style="`color:${deviceStore.alarmFlagState?.notificationState === 'Error' ? '#F56C6C' : '#fd985f' }`"><WarningFilled /></el-icon>
</span>
</div>
</div>

7
src/store/modules/device.ts

@ -18,6 +18,7 @@ export const useDeviceStore = defineStore('device', () => {
} as DeviceWorkStateMessage['data'])
const alarmList = ref<WarningState[]>([])
const alarmNum = ref<number>(0)
const alarmFlagState = ref<AppFlagStateList>()
const alarmItem = ref<WarningState>()
@ -26,6 +27,9 @@ export const useDeviceStore = defineStore('device', () => {
deviceState.value = data
}
}
const setAlarmNum = (num: number) => {
alarmNum.value = num
}
const sensorState = ref<Record<string, any>>({
pboxTemperature: 20,
@ -93,6 +97,9 @@ export const useDeviceStore = defineStore('device', () => {
contextState,
setContextState,
alarmNum,
setAlarmNum,
alarmList,
setAlarmList,

2
src/websocket/socket.ts

@ -622,6 +622,8 @@ export type WarningState = {
export type AppFlagStateList = {
hasErrorTriggerFlag: boolean
hasWarningTriggerFlag: boolean
warningAndErrorFlagTriggerNum: number
notificationState: 'Normal'|'Warn'|'Error'
states: WarningState[]
}

Loading…
Cancel
Save