mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-24 13:04:57 +08:00
This commit is contained in:
parent
cfaca9d1f9
commit
f268349edf
|
@ -91,7 +91,8 @@ export const getFormTypes = () => {
|
||||||
]
|
]
|
||||||
return types
|
return types
|
||||||
}
|
}
|
||||||
export const getDataAlarmState = (value: number, key: string) => {
|
export const getDataAlarmState = (value: number | undefined, key: string) => {
|
||||||
|
if (value === undefined) return
|
||||||
const alarms: any = {
|
const alarms: any = {
|
||||||
BIS: { min: 40, max: 60 },
|
BIS: { min: 40, max: 60 },
|
||||||
HR: { min: 50, max: 80 },
|
HR: { min: 50, max: 80 },
|
||||||
|
@ -108,3 +109,20 @@ export const getDataAlarmState = (value: number, key: string) => {
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const setRemoteLog = (obj: any, callback: (title: string, size: string) => void) => {
|
||||||
|
const alarms = {
|
||||||
|
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) callback('脑电双频指数', alarms.BIS)
|
||||||
|
if (alarms.SBP) callback('收缩率', alarms.SBP)
|
||||||
|
if (alarms.SPO2) callback('氧饱和度', alarms.SPO2)
|
||||||
|
if (alarms.DBP) callback('舒张压', alarms.DBP)
|
||||||
|
if (alarms.HR) callback('心率', alarms.HR)
|
||||||
|
if (alarms.TEMP) callback('体温', alarms.TEMP)
|
||||||
|
}
|
|
@ -25,6 +25,11 @@ export const useRemoteStore = defineStore('remote', {
|
||||||
this.remoteTasks[index].log.push(obj)
|
this.remoteTasks[index].log.push(obj)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
setRemoteDataAlarm(bol: boolean, index: number) {
|
||||||
|
if(this.remoteTasks[index]) {
|
||||||
|
this.remoteTasks[index].dataAlarm = bol
|
||||||
|
}
|
||||||
|
},
|
||||||
getCurrentRemote() {
|
getCurrentRemote() {
|
||||||
return this.currentRemote
|
return this.currentRemote
|
||||||
},
|
},
|
||||||
|
|
|
@ -40,10 +40,12 @@ remoteTasks.value = useRemoteStore().remoteTasks
|
||||||
// })
|
// })
|
||||||
|
|
||||||
function scrollToBottom() {
|
function scrollToBottom() {
|
||||||
|
setTimeout(() => {
|
||||||
listRef.value.scrollTo({
|
listRef.value.scrollTo({
|
||||||
top: listRef.value.scrollHeight,
|
top: listRef.value.scrollHeight,
|
||||||
behavior: 'smooth'
|
behavior: 'smooth'
|
||||||
});
|
})
|
||||||
|
}, 0)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<span>消息通知</span>
|
<span>消息通知</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div ref="listRef" class="content">
|
||||||
<el-timeline>
|
<el-timeline>
|
||||||
<el-timeline-item v-for="(item, index) in currentRemote.log || []" :key="index"
|
<el-timeline-item v-for="(item, index) in remoteStore.currentRemote.log || []" :key="index"
|
||||||
:timestamp="dateFormater('yyyy-MM-dd HH:mm:ss', item.time)"
|
:timestamp="dateFormater('yyyy-MM-dd HH:mm:ss', item.time)"
|
||||||
:class="{ 'alarm': item.state === '连接失败' || item.state === '异常' }">
|
:class="{ 'alarm': item.state === '连接失败' || item.state === '异常' }">
|
||||||
{{ item.title + ' ' + item.state }}
|
{{ item.title + ' ' + item.state }}
|
||||||
|
@ -24,17 +24,25 @@ import { dateFormater } from '@/utils/date-util'
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
setData,
|
setData,
|
||||||
|
scrollToBottom
|
||||||
})
|
})
|
||||||
|
|
||||||
const remoteStore = useRemoteStore()
|
const remoteStore = useRemoteStore()
|
||||||
const currentRemote = ref({} as RemoteItem)
|
const listRef = ref()
|
||||||
currentRemote.value = useRemoteStore().currentRemote
|
|
||||||
|
|
||||||
function setData(e: RemoteLogItem, index: number) {
|
function setData(e: RemoteLogItem, index: number) {
|
||||||
remoteStore.setRemoteLog(e, index)
|
remoteStore.setRemoteLog(e, index)
|
||||||
remoteStore.setCurrentRemoteLog(e)
|
|
||||||
remoteStore.$patch({currentRemote: remoteStore.remoteTasks[index]})
|
remoteStore.$patch({currentRemote: remoteStore.remoteTasks[index]})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function scrollToBottom() {
|
||||||
|
setTimeout(() => {
|
||||||
|
listRef.value.scrollTo({
|
||||||
|
top: listRef.value.scrollHeight,
|
||||||
|
behavior: 'smooth'
|
||||||
|
})
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
<style lang='scss' scoped>
|
||||||
|
|
|
@ -117,15 +117,17 @@ import { onMounted, onBeforeUnmount, reactive, ref, toRefs, watch } from 'vue'
|
||||||
import { dateFormater } from '@/utils/date-util'
|
import { dateFormater } from '@/utils/date-util'
|
||||||
import { useRemoteStore } from '@/stores/remote-info-store';
|
import { useRemoteStore } from '@/stores/remote-info-store';
|
||||||
import type { RemoteItem, PatientInfoItem } from '@/utils/public-interface'
|
import type { RemoteItem, PatientInfoItem } from '@/utils/public-interface'
|
||||||
|
import { setRemoteLog } from '@/static-data/core'
|
||||||
|
|
||||||
const emit = defineEmits(['breakRemote'])
|
const emit = defineEmits(['addLogAfter', 'breakRemote'])
|
||||||
|
|
||||||
|
const remoteStore = useRemoteStore()
|
||||||
let timer = 0
|
let timer = 0
|
||||||
const mediaMini800 = ref(false)
|
const mediaMini800 = ref(false)
|
||||||
const remoteItem = ref<RemoteItem>({} as RemoteItem)
|
const remoteItem = ref<RemoteItem>({} as RemoteItem)
|
||||||
const patientInfo = ref({} as PatientInfoItem)
|
const patientInfo = ref({} as PatientInfoItem)
|
||||||
|
|
||||||
initData(useRemoteStore().getCurrentRemote())
|
initData(remoteStore.currentRemote)
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
initData
|
initData
|
||||||
|
@ -133,7 +135,6 @@ defineExpose({
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
// 页面卸载后清楚定时器
|
// 页面卸载后清楚定时器
|
||||||
console.log('~~~~~~~~~~~~~~~')
|
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -141,26 +142,43 @@ window.addEventListener('resize', () => {
|
||||||
mediaMini800.value = Boolean(window.innerWidth < 801)
|
mediaMini800.value = Boolean(window.innerWidth < 801)
|
||||||
});
|
});
|
||||||
|
|
||||||
function initData(e?: any) {
|
function initData(e?: RemoteItem) {
|
||||||
if(e) remoteItem.value = e
|
const obj = e || {} as RemoteItem
|
||||||
const obj = e || {}
|
remoteItem.value = obj
|
||||||
patientInfo.value.state = obj.dataAlarm
|
patientInfo.value.state = obj.dataAlarm
|
||||||
patientInfo.value.name = obj.patientName || ''
|
patientInfo.value.name = obj.patientName || ''
|
||||||
patientInfo.value.code = 'XXXXXX'
|
patientInfo.value.code = 'XXXXXX'
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
|
if(!patientInfo.value.name) return
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
getData()
|
getData()
|
||||||
}, 2000)
|
}, 2000)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getData() {
|
function getData() {
|
||||||
|
remoteItem.value.dataAlarm = false
|
||||||
|
const obj = {
|
||||||
|
BIS: Math.ceil(Math.random() * 100),
|
||||||
|
SBP: Math.ceil(Math.random() * 100),
|
||||||
|
SPO2: Math.ceil(Math.random() * 100),
|
||||||
|
DBP: Math.ceil(Math.random() * 100),
|
||||||
|
HR: Math.ceil(Math.random() * 100),
|
||||||
|
TEMP: Math.ceil(Math.random() * 100),
|
||||||
|
} as PatientInfoItem
|
||||||
patientInfo.value.time = new Date()
|
patientInfo.value.time = new Date()
|
||||||
patientInfo.value.BIS = Math.ceil(Math.random() * 100)
|
setRemoteLog(obj, (title: string, size: string) => {
|
||||||
patientInfo.value.SBP = Math.ceil(Math.random() * 100)
|
obj.state = true
|
||||||
patientInfo.value.SPO2 = Math.ceil(Math.random() * 100)
|
remoteItem.value.dataAlarm = true
|
||||||
patientInfo.value.DBP = Math.ceil(Math.random() * 100)
|
remoteStore.setRemoteLog({
|
||||||
patientInfo.value.HR = Math.ceil(Math.random() * 100)
|
time: new Date(),
|
||||||
patientInfo.value.TEMP = Math.ceil(Math.random() * 100)
|
title,
|
||||||
|
state: '异常'
|
||||||
|
}, remoteItem.value.index)
|
||||||
|
})
|
||||||
|
remoteStore.setRemoteDataAlarm(remoteItem.value.dataAlarm, remoteItem.value.index)
|
||||||
|
remoteStore.$patch({currentRemote: remoteStore.remoteTasks[remoteItem.value.index]})
|
||||||
|
Object.assign(patientInfo.value, obj)
|
||||||
|
emit('addLogAfter')
|
||||||
}
|
}
|
||||||
|
|
||||||
const breakRemote = () => {
|
const breakRemote = () => {
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
<div class="remote-manage-page">
|
<div class="remote-manage-page">
|
||||||
<div class="header-box">
|
<div class="header-box">
|
||||||
<div class="thumbnail" @click="viewThumbnail">
|
<div class="thumbnail" @click="viewThumbnail">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon>
|
||||||
|
<Menu />
|
||||||
|
</el-icon>
|
||||||
<span>缩略图</span>
|
<span>缩略图</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="task-btn-item" v-for="(item, index) in remoteTask" :key="'task-' + index"
|
<div class="task-btn-item" v-for="(item, index) in remoteTask" :key="'task-' + index"
|
||||||
|
@ -13,7 +15,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="content-box">
|
<div class="content-box">
|
||||||
<div class="remote-box">
|
<div class="remote-box">
|
||||||
<RemotePart ref="remotePartRef" @breakRemote="breakRemote" />
|
<RemotePart ref="remotePartRef" @addLogAfter="addLogAfter" @breakRemote="breakRemote" />
|
||||||
</div>
|
</div>
|
||||||
<div class="message-box">
|
<div class="message-box">
|
||||||
<MessagePart ref="messagePartRef" />
|
<MessagePart ref="messagePartRef" />
|
||||||
|
@ -42,7 +44,7 @@ const remoteTask = ref([] as Array<RemoteItem>)
|
||||||
initRemoteTask()
|
initRemoteTask()
|
||||||
|
|
||||||
function resetRemoteTaskItem(e: RemoteItem) {
|
function resetRemoteTaskItem(e: RemoteItem) {
|
||||||
remoteTask.value[e.index] = {
|
Object.assign(remoteTask.value[e.index], {
|
||||||
isRemote: false,
|
isRemote: false,
|
||||||
dataAlarm: false,
|
dataAlarm: false,
|
||||||
title: '',
|
title: '',
|
||||||
|
@ -50,8 +52,7 @@ function resetRemoteTaskItem(e: RemoteItem) {
|
||||||
patientName: '',
|
patientName: '',
|
||||||
patientCode: '',
|
patientCode: '',
|
||||||
index: e.index,
|
index: e.index,
|
||||||
log: []
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function initRemoteTask() {
|
function initRemoteTask() {
|
||||||
remoteTask.value = useRemoteStore().remoteTasks
|
remoteTask.value = useRemoteStore().remoteTasks
|
||||||
|
@ -136,6 +137,9 @@ const breakRemote = (e: RemoteItem) => {
|
||||||
state: '断开连接'
|
state: '断开连接'
|
||||||
}, e.index)
|
}, e.index)
|
||||||
}
|
}
|
||||||
|
const addLogAfter = () => {
|
||||||
|
messagePartRef.value.scrollToBottom()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
<style lang='scss' scoped>
|
||||||
|
@ -145,6 +149,7 @@ const breakRemote = (e: RemoteItem) => {
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|
||||||
.header-box {
|
.header-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -153,6 +158,7 @@ const breakRemote = (e: RemoteItem) => {
|
||||||
padding: 0 30px;
|
padding: 0 30px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.thumbnail {
|
.thumbnail {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -170,23 +176,28 @@ const breakRemote = (e: RemoteItem) => {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: white;
|
color: white;
|
||||||
transition: all .1s;
|
transition: all .1s;
|
||||||
|
|
||||||
.el-icon {
|
.el-icon {
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
&>span {
|
&>span {
|
||||||
display: none;
|
display: none;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
width: 160px;
|
width: 160px;
|
||||||
transition: all .3s;
|
transition: all .3s;
|
||||||
|
|
||||||
&>span {
|
&>span {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.task-btn-item {
|
.task-btn-item {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
@ -251,5 +262,4 @@ const breakRemote = (e: RemoteItem) => {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}</style>
|
||||||
</style>
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user