mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-24 04:54:58 +08:00
This commit is contained in:
parent
f268349edf
commit
02b8a38337
|
@ -62,24 +62,26 @@ import { onMounted, onBeforeUnmount, reactive, ref, toRefs, watch } from 'vue'
|
||||||
import type { RemoteItem, PatientInfoItem, RemoteLogItem } from '@/utils/public-interface'
|
import type { RemoteItem, PatientInfoItem, RemoteLogItem } from '@/utils/public-interface'
|
||||||
import { useRemoteStore } from '@/stores/remote-info-store'
|
import { useRemoteStore } from '@/stores/remote-info-store'
|
||||||
import { dateFormater } from '@/utils/date-util'
|
import { dateFormater } from '@/utils/date-util'
|
||||||
import { getDataAlarmState } from '@/static-data/core'
|
import { setRemoteLog } from '@/static-data/core'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
remoteTask: RemoteItem
|
index: number
|
||||||
}
|
}
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
remoteTask: () => ({} as RemoteItem)
|
index: () => 0
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['addLogAfter'])
|
const emit = defineEmits(['addLogAfter'])
|
||||||
|
|
||||||
|
const remoteStore = useRemoteStore()
|
||||||
|
const remoteTask = remoteStore.remoteTasks[props.index]
|
||||||
let timer = 0
|
let timer = 0
|
||||||
const patientInfo = ref({} as PatientInfoItem)
|
const patientInfo = ref({} as PatientInfoItem)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
// 连接成功执行查询
|
// 连接成功执行查询
|
||||||
if (props.remoteTask.isRemote) {
|
if (remoteTask.isRemote) {
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
initData()
|
initData()
|
||||||
}, 2000)
|
}, 2000)
|
||||||
|
@ -87,13 +89,13 @@ onMounted(() => {
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
// 页面卸载后清楚定时器
|
// 页面卸载后清楚定时器
|
||||||
console.log('~~~~~~~~~~~~~~~')
|
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
})
|
})
|
||||||
|
|
||||||
function initData() {
|
function initData() {
|
||||||
|
remoteTask.dataAlarm = false
|
||||||
const obj = {
|
const obj = {
|
||||||
name: props.remoteTask.patientName,
|
name: remoteTask.patientName,
|
||||||
code: '',
|
code: '',
|
||||||
time: new Date(),
|
time: new Date(),
|
||||||
state: false,
|
state: false,
|
||||||
|
@ -104,33 +106,17 @@ function initData() {
|
||||||
HR: Number((Math.random() * 100).toFixed(2)),
|
HR: Number((Math.random() * 100).toFixed(2)),
|
||||||
TEMP: Number((Math.random() * 100).toFixed(2))
|
TEMP: Number((Math.random() * 100).toFixed(2))
|
||||||
}
|
}
|
||||||
const alarms = {
|
setRemoteLog(obj, (title: string, size: string) => {
|
||||||
BIS: getDataAlarmState(obj.BIS, 'BIS'),
|
|
||||||
SBP: getDataAlarmState(obj.SBP, 'SBP'),
|
|
||||||
SPO2: getDataAlarmState(obj.SPO2, 'SPO2'),
|
|
||||||
DBP: getDataAlarmState(obj.DBP, 'DBP'),
|
|
||||||
HR: getDataAlarmState(obj.HR, 'HR'),
|
|
||||||
TEMP: getDataAlarmState(obj.TEMP, 'TEMP')
|
|
||||||
}
|
|
||||||
|
|
||||||
if (alarms.BIS) addLog('脑电双频指数')
|
|
||||||
if (alarms.SBP) addLog('收缩率')
|
|
||||||
if (alarms.SPO2) addLog('氧饱和度')
|
|
||||||
if (alarms.DBP) addLog('舒张压')
|
|
||||||
if (alarms.HR) addLog('心率')
|
|
||||||
if (alarms.TEMP) addLog('体温')
|
|
||||||
|
|
||||||
patientInfo.value = obj
|
|
||||||
|
|
||||||
function addLog(title: string) {
|
|
||||||
obj.state = true
|
obj.state = true
|
||||||
useRemoteStore().setRemoteLog({
|
remoteTask.dataAlarm = true
|
||||||
|
remoteStore.setRemoteLog({
|
||||||
time: new Date(),
|
time: new Date(),
|
||||||
title,
|
title,
|
||||||
state: '异常'
|
state: '异常'
|
||||||
}, props.remoteTask.index)
|
}, props.index)
|
||||||
emit('addLogAfter', props.remoteTask.index)
|
})
|
||||||
}
|
Object.assign(patientInfo.value, obj)
|
||||||
|
emit('addLogAfter', props.index)
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -158,6 +158,7 @@ function initData(e?: RemoteItem) {
|
||||||
function getData() {
|
function getData() {
|
||||||
remoteItem.value.dataAlarm = false
|
remoteItem.value.dataAlarm = false
|
||||||
const obj = {
|
const obj = {
|
||||||
|
state: false,
|
||||||
BIS: Math.ceil(Math.random() * 100),
|
BIS: Math.ceil(Math.random() * 100),
|
||||||
SBP: Math.ceil(Math.random() * 100),
|
SBP: Math.ceil(Math.random() * 100),
|
||||||
SPO2: Math.ceil(Math.random() * 100),
|
SPO2: Math.ceil(Math.random() * 100),
|
||||||
|
|
|
@ -35,6 +35,7 @@ import RemotePart from './part/remote-part.vue'
|
||||||
import MessagePart from './part/message-part.vue'
|
import MessagePart from './part/message-part.vue'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const remoteStore = useRemoteStore()
|
||||||
|
|
||||||
const remotePartRef = ref()
|
const remotePartRef = ref()
|
||||||
const messagePartRef = ref()
|
const messagePartRef = ref()
|
||||||
|
@ -55,7 +56,7 @@ function resetRemoteTaskItem(e: RemoteItem) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function initRemoteTask() {
|
function initRemoteTask() {
|
||||||
remoteTask.value = useRemoteStore().remoteTasks
|
remoteTask.value = remoteStore.remoteTasks
|
||||||
if (remoteTask.value.length < 1) {
|
if (remoteTask.value.length < 1) {
|
||||||
while (remoteTask.value.length < 10) {
|
while (remoteTask.value.length < 10) {
|
||||||
const obj = {
|
const obj = {
|
||||||
|
@ -77,10 +78,9 @@ function initRemoteTask() {
|
||||||
if (remoteTask.value.length == 1) obj.dataAlarm = true
|
if (remoteTask.value.length == 1) obj.dataAlarm = true
|
||||||
remoteTask.value.push(obj)
|
remoteTask.value.push(obj)
|
||||||
}
|
}
|
||||||
useRemoteStore().setRemoteTasks(remoteTask.value)
|
remoteStore.setRemoteTasks(remoteTask.value)
|
||||||
const remoteStore = useRemoteStore().currentRemote
|
if (!remoteStore.currentRemote.index) {
|
||||||
if (!remoteStore.index) {
|
remoteStore.$patch({ currentRemote: remoteTask.value[0] })
|
||||||
useRemoteStore().$patch({ currentRemote: remoteTask.value[0] })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
<div class="remote-thumbnail-page">
|
<div class="remote-thumbnail-page">
|
||||||
<div class="remote-box row1">
|
<div class="remote-box row1">
|
||||||
<div class="remote-item" v-for="item in remoteTask.slice(0, 4)" :key="item.title" @click="openRemote(item)">
|
<div class="remote-item" v-for="item in remoteTask.slice(0, 4)" :key="item.title" @click="openRemote(item)">
|
||||||
<RemoteItemPart :ref="'remoteItemPartRef' + item.index" :remoteTask="item" @addLogAfter="addLogAfter"></RemoteItemPart>
|
<RemoteItemPart :ref="'remoteItemPartRef' + item.index" :index="item.index" @addLogAfter="addLogAfter"></RemoteItemPart>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="remote-box row2">
|
<div class="remote-box row2">
|
||||||
<div class="left-box">
|
<div class="left-box">
|
||||||
<div class="remote-item" v-for="item in remoteTask.slice(4)" :key="item.title" @click="openRemote(item)">
|
<div class="remote-item" v-for="item in remoteTask.slice(4)" :key="item.title" @click="openRemote(item)">
|
||||||
<RemoteItemPart :ref="'remoteItemPartRef' + item.index" :remoteTask="item" @addLogAfter="addLogAfter"></RemoteItemPart>
|
<RemoteItemPart :ref="'remoteItemPartRef' + item.index" :index="item.index" @addLogAfter="addLogAfter"></RemoteItemPart>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-box">
|
<div class="right-box">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user