mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2026-06-16 16:51:49 +08:00
parent
54054c4bcc
commit
ca4faa9b61
|
|
@ -22,7 +22,7 @@ export function getMonthlyLogCount(startTime: string, endTime: string) {
|
|||
})
|
||||
}
|
||||
|
||||
export function getPage(current: number, size: number, condition: {timeInterval: string, logType: string}) {
|
||||
export function getPage(current: number, size: number, condition?: {timeInterval: string, logType: string}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request.get(getPageUrl, {
|
||||
params: {
|
||||
|
|
|
|||
|
|
@ -1,159 +0,0 @@
|
|||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
<script setup lang="ts" name="global-websocket">
|
||||
import { ElNotification } from 'element-plus';
|
||||
import { Session } from '/@/utils/storage';
|
||||
|
||||
const emit = defineEmits(['rollback']);
|
||||
|
||||
const props = defineProps({
|
||||
uri: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
const state = reactive({
|
||||
webSocket: ref(), // webSocket实例
|
||||
lockReconnect: false, // 重连锁,避免多次重连
|
||||
maxReconnect: 6, // 最大重连次数, -1 标识无限重连
|
||||
reconnectTime: 0, // 重连尝试次数
|
||||
heartbeat: {
|
||||
interval: 30 * 1000, // 心跳间隔时间
|
||||
timeout: 10 * 1000, // 响应超时时间
|
||||
pingTimeoutObj: ref(), // 延时发送心跳的定时器
|
||||
pongTimeoutObj: ref(), // 接收心跳响应的定时器
|
||||
pingMessage: JSON.stringify({ type: 'ping' }), // 心跳请求信息
|
||||
},
|
||||
});
|
||||
|
||||
const token = computed(() => {
|
||||
return Session.getToken();
|
||||
});
|
||||
|
||||
const tenant = computed(() => {
|
||||
return Session.getTenant();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
initWebSocket();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
state.webSocket.close();
|
||||
clearTimeoutObj(state.heartbeat);
|
||||
});
|
||||
|
||||
const initWebSocket = () => {
|
||||
// ws地址
|
||||
let host = window.location.host;
|
||||
// baseURL
|
||||
let baseURL = import.meta.env.VITE_API_URL;
|
||||
let wsUri = `ws://${host}${baseURL}${props.uri}?access_token=${token.value}&TENANT-ID=${tenant.value}`;
|
||||
// 建立连接
|
||||
state.webSocket = new WebSocket(wsUri);
|
||||
// 连接成功
|
||||
state.webSocket.onopen = onOpen;
|
||||
// 连接错误
|
||||
state.webSocket.onerror = onError;
|
||||
// 接收信息
|
||||
state.webSocket.onmessage = onMessage;
|
||||
// 连接关闭
|
||||
state.webSocket.onclose = onClose;
|
||||
};
|
||||
|
||||
const reconnect = () => {
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
if (state.lockReconnect || (state.maxReconnect !== -1 && state.reconnectTime > state.maxReconnect)) {
|
||||
return;
|
||||
}
|
||||
state.lockReconnect = true;
|
||||
setTimeout(() => {
|
||||
state.reconnectTime++;
|
||||
// 建立新连接
|
||||
initWebSocket();
|
||||
state.lockReconnect = false;
|
||||
}, 5000);
|
||||
};
|
||||
/**
|
||||
* 清空定时器
|
||||
*/
|
||||
const clearTimeoutObj = (heartbeat: any) => {
|
||||
heartbeat.pingTimeoutObj && clearTimeout(heartbeat.pingTimeoutObj);
|
||||
heartbeat.pongTimeoutObj && clearTimeout(heartbeat.pongTimeoutObj);
|
||||
};
|
||||
/**
|
||||
* 开启心跳
|
||||
*/
|
||||
const startHeartbeat = () => {
|
||||
const webSocket = state.webSocket;
|
||||
const heartbeat = state.heartbeat;
|
||||
// 清空定时器
|
||||
clearTimeoutObj(heartbeat);
|
||||
// 延时发送下一次心跳
|
||||
heartbeat.pingTimeoutObj = setTimeout(() => {
|
||||
// 如果连接正常
|
||||
if (webSocket.readyState === 1) {
|
||||
//这里发送一个心跳,后端收到后,返回一个心跳消息,
|
||||
webSocket.send(heartbeat.pingMessage);
|
||||
// 心跳发送后,如果服务器超时未响应则断开,如果响应了会被重置心跳定时器
|
||||
heartbeat.pongTimeoutObj = setTimeout(() => {
|
||||
webSocket.close();
|
||||
}, heartbeat.timeout);
|
||||
} else {
|
||||
// 否则重连
|
||||
reconnect();
|
||||
}
|
||||
}, heartbeat.interval);
|
||||
};
|
||||
|
||||
/**
|
||||
* 连接成功事件
|
||||
*/
|
||||
const onOpen = () => {
|
||||
//开启心跳
|
||||
startHeartbeat();
|
||||
state.reconnectTime = 0;
|
||||
};
|
||||
/**
|
||||
* 连接失败事件
|
||||
* @param e
|
||||
*/
|
||||
const onError = () => {
|
||||
//重连
|
||||
reconnect();
|
||||
};
|
||||
|
||||
/**
|
||||
* 连接关闭事件
|
||||
* @param e
|
||||
*/
|
||||
const onClose = () => {
|
||||
//重连
|
||||
reconnect();
|
||||
};
|
||||
/**
|
||||
* 接收服务器推送的信息
|
||||
* @param msgEvent
|
||||
*/
|
||||
const onMessage = (msgEvent: any) => {
|
||||
//收到服务器信息,心跳重置并发送
|
||||
startHeartbeat();
|
||||
const text = msgEvent.data;
|
||||
|
||||
if (text.indexOf('pong') > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
ElNotification.warning({
|
||||
title: '消息提醒',
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: text + '请及时处理',
|
||||
offset: 60,
|
||||
});
|
||||
|
||||
emit('rollback', text);
|
||||
};
|
||||
</script>
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
import {defineStore} from "pinia";
|
||||
import {Session} from "@/utils/storage";
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
const vitalUrl = "ws://localhost:5173/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken()
|
||||
const medicineUrl = "ws://localhost:5173/socket.io/admin/rax/addMedicine?token=" + Session.getToken()
|
||||
const chatUrl = "ws://localhost:5173/socket.io/admin/rax/chatRoom?token=" + Session.getToken()
|
||||
const vitalUrl = "ws://" + window.location.host + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken()
|
||||
const medicineUrl = "ws://" + window.location.host + "/socket.io/admin/rax/addMedicine?token=" + Session.getToken()
|
||||
const chatUrl = "ws://" + window.location.host + "/socket.io/admin/rax/chatRoom?token=" + Session.getToken()
|
||||
|
||||
export const useRemoteWsStore = defineStore("remoteWs", {
|
||||
state: () => {
|
||||
|
|
@ -19,10 +20,43 @@ export const useRemoteWsStore = defineStore("remoteWs", {
|
|||
"BIS_except": "脑电双频指数异常", "DBP_except": "舒张压异常", "EtCO2_except": "呼气末二氧化碳异常",
|
||||
"HR_except": "心率异常", "SBP_except": "收缩压异常", "ST_except": "ST异常"
|
||||
} as any,
|
||||
exceptions: {} as any,
|
||||
closeStatus: {} as any
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setCurrentTaskIndex(i: number) {
|
||||
this.currentTaskIndex = i
|
||||
Session.set("currentTaskIndex", i)
|
||||
},
|
||||
getCurrentTaskIndex() {
|
||||
if (Session.get("currentTaskIndex") && Session.get("currentTaskIndex") > -1) {
|
||||
this.currentTaskIndex = Session.get("currentTaskIndex")
|
||||
}
|
||||
return this.currentTaskIndex
|
||||
},
|
||||
setExceptions(i: number, e: any) {
|
||||
this.exceptions[i] = e
|
||||
},
|
||||
getExceptions() {
|
||||
return this.exceptions
|
||||
},
|
||||
getCloseStatus() {
|
||||
return this.closeStatus
|
||||
},
|
||||
setRemoteTask() {
|
||||
Session.set("remoteTasks", this.remoteTasks)
|
||||
},
|
||||
getRemoteTask() {
|
||||
if (Session.get("remoteTasks") && !this.remoteTasks) {
|
||||
this.remoteTasks = Session.get("remoteTasks")
|
||||
}
|
||||
return this.remoteTasks
|
||||
},
|
||||
initRemoteTask() {
|
||||
if (Session.get("remoteTasks") && !this.remoteTasks) {
|
||||
this.remoteTasks = Session.get("remoteTasks")
|
||||
}
|
||||
if (this.remoteTasks.length <= 0) {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
this.remoteTasks.push({
|
||||
|
|
@ -57,62 +91,74 @@ export const useRemoteWsStore = defineStore("remoteWs", {
|
|||
index: i,
|
||||
message: []
|
||||
})
|
||||
Session.set("remoteTasks", this.remoteTasks)
|
||||
},
|
||||
getActiveRemoteTask() {
|
||||
let index = 0
|
||||
for (let i = 0; i < this.remoteTasks.length; i++) {
|
||||
if (this.remoteTasks[i].isRemote) return i
|
||||
if (this.remoteTasks[i].isRemote) index = i
|
||||
}
|
||||
return index
|
||||
},
|
||||
setRemoteLog(log: any, i: number) {
|
||||
this.remoteTasks[i].log.push(log)
|
||||
},
|
||||
createConnect(name: string, id: string, date: string) {
|
||||
if (!this.patient[name + id + date]) {
|
||||
const vitalWS = new WebSocket(vitalUrl)
|
||||
const medicineWS = new WebSocket(medicineUrl)
|
||||
const chatWS = new WebSocket(chatUrl)
|
||||
vitalWS.onopen = function () {
|
||||
vitalWS.send(JSON.stringify({
|
||||
patientName: name,
|
||||
idNum: id,
|
||||
date: date
|
||||
}))
|
||||
}
|
||||
medicineWS.onopen = function () {
|
||||
medicineWS.send(JSON.stringify({
|
||||
patientName: name,
|
||||
idNum: id,
|
||||
date: date
|
||||
}))
|
||||
}
|
||||
chatWS.onopen = function () {
|
||||
chatWS.send(JSON.stringify({
|
||||
patientName: name,
|
||||
idNum: id,
|
||||
date: date
|
||||
}))
|
||||
}
|
||||
this.patient[name + id + date] = {
|
||||
vitalWS,
|
||||
medicineWS,
|
||||
chatWS
|
||||
}
|
||||
}
|
||||
},
|
||||
disconnect(name: string, id: string, date: string) {
|
||||
const patient: any = this.patient[name + id + date]
|
||||
if (patient) {
|
||||
patient.vitalWS.close()
|
||||
patient.medicineWS.close()
|
||||
patient.chatWS.close()
|
||||
this.disconnectVital(name, id, date)
|
||||
this.disconnectChat(name, id, date)
|
||||
this.disconnectMedicine(name, id, date)
|
||||
delete this.patient[name + id + date]
|
||||
},
|
||||
createVitalConnect(name: string, id: string, date: string) {
|
||||
if (!this.patient[name + id + date]) this.patient[name + id + date] = {}
|
||||
const patient = this.patient[name + id + date]
|
||||
if (!patient['vitalWS']) {
|
||||
patient['vitalWS'] = new WebSocket(vitalUrl)
|
||||
patient.vitalWS.onopen = () => {
|
||||
patient.vitalWS.send(JSON.stringify({
|
||||
patientName: name,
|
||||
idNum: id,
|
||||
date: date,
|
||||
msgType: "msg"
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
subscribeVital(name: string, id: string, date: string, cb: any) {
|
||||
const patient: any = this.patient[name + id + date]
|
||||
if (patient) {
|
||||
patient.vitalWS.onmessage = cb
|
||||
patient.vitalCB = cb
|
||||
const patient = this.patient[name + id + date]
|
||||
if (patient.vitalWS) {
|
||||
patient.vitalWS.onmessage = (e: any) => {
|
||||
if (e && e.data) {
|
||||
const data = JSON.parse(e.data);
|
||||
if (data.msgType == "msg") {
|
||||
cb(e)
|
||||
} else {
|
||||
patient.vitalWS.send(JSON.stringify({msgType: "heartbeat"}))
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cb({
|
||||
status: 1,
|
||||
msg: "已断开连接"
|
||||
})
|
||||
}
|
||||
},
|
||||
vitalOnclose(name: string, id: string, date: string, cb: any) {
|
||||
const patient = this.patient[name + id + date]
|
||||
if (patient.vitalWS) {
|
||||
patient.vitalWS.onclose = cb
|
||||
} else {
|
||||
cb({
|
||||
status: 1,
|
||||
msg: "已断开连接"
|
||||
})
|
||||
}
|
||||
},
|
||||
vitalOnerror(name: string, id: string, date: string, cb: any) {
|
||||
const patient = this.patient[name + id + date]
|
||||
if (patient.vitalWS) {
|
||||
patient.vitalWS.onerror = cb
|
||||
} else {
|
||||
cb({
|
||||
status: 1,
|
||||
|
|
@ -121,10 +167,85 @@ export const useRemoteWsStore = defineStore("remoteWs", {
|
|||
}
|
||||
},
|
||||
unsubscribeVital(name: string, id: string, date: string) {
|
||||
const patient: any = this.patient[name + id + date]
|
||||
if (patient) {
|
||||
patient.vitalWS.onmessage = undefined
|
||||
patient.vitalWS.onclose = undefined
|
||||
patient.vitalWS.onerror = undefined
|
||||
}
|
||||
},
|
||||
disconnectVital(name: string, id: string, date: string) {
|
||||
const patient: any = this.patient[name + id + date]
|
||||
if (patient && patient.vitalWS) {
|
||||
patient.vitalWS.onmessage = undefined;
|
||||
patient.vitalCB = undefined;
|
||||
this.closeStatus[name + id + date + 'vitalWS'] = true
|
||||
patient.vitalWS.close()
|
||||
delete patient['vitalWS']
|
||||
delete this.closeStatus[name + id + date + 'vitalWS']
|
||||
}
|
||||
},
|
||||
createChatConnect(name: string, id: string, date: string) {
|
||||
if (!this.patient[name + id + date]) this.patient[name + id + date] = {}
|
||||
const patient = this.patient[name + id + date]
|
||||
if (!patient['chatWS']) {
|
||||
patient['chatWS'] = new WebSocket(chatUrl)
|
||||
patient.chatWS.onopen = function () {
|
||||
patient.chatWS.send(JSON.stringify({
|
||||
patientName: name,
|
||||
idNum: id,
|
||||
date: date,
|
||||
msgType: "msg"
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
subscribeChat(name: string, id: string, date: string, cb: any) {
|
||||
const patient = this.patient[name + id + date]
|
||||
if (patient.chatWS) {
|
||||
patient.chatWS.onmessage = (e: any) => {
|
||||
if (e && e.data) {
|
||||
const data = JSON.parse(e.data);
|
||||
if (data.msgType == "msg") {
|
||||
cb(e)
|
||||
} else {
|
||||
patient.chatWS.send(JSON.stringify({msgType: "heartbeat"}))
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cb({
|
||||
status: 1,
|
||||
msg: "已断开连接"
|
||||
})
|
||||
}
|
||||
},
|
||||
chatOnclose(name: string, id: string, date: string, cb: any) {
|
||||
const patient = this.patient[name + id + date]
|
||||
if (patient.chatWS) {
|
||||
patient.chatWS.onclose = cb
|
||||
} else {
|
||||
cb({
|
||||
status: 1,
|
||||
msg: "已断开连接"
|
||||
})
|
||||
}
|
||||
},
|
||||
chatOnerror(name: string, id: string, date: string, cb: any) {
|
||||
const patient = this.patient[name + id + date]
|
||||
if (patient.chatWS) {
|
||||
patient.chatWS.onerror = cb
|
||||
} else {
|
||||
cb({
|
||||
status: 1,
|
||||
msg: "已断开连接"
|
||||
})
|
||||
}
|
||||
},
|
||||
unsubscribeChat(name: string, id: string, date: string) {
|
||||
const patient: any = this.patient[name + id + date]
|
||||
if (patient) {
|
||||
patient.chatWS.onmessage = undefined
|
||||
patient.chatWS.onclose = undefined
|
||||
patient.chatWS.onerror = undefined
|
||||
}
|
||||
},
|
||||
sendMsg(name: string, id: string, date: string, msg: string, cb: any) {
|
||||
|
|
@ -147,11 +268,43 @@ export const useRemoteWsStore = defineStore("remoteWs", {
|
|||
})
|
||||
}
|
||||
},
|
||||
subscribeChat(name: string, id: string, date: string, cb: any) {
|
||||
disconnectChat(name: string, id: string, date: string) {
|
||||
const patient: any = this.patient[name + id + date]
|
||||
if (patient && patient.chatWS) {
|
||||
this.closeStatus[name + id + date + 'chatWS'] = true
|
||||
patient.chatWS.close()
|
||||
delete patient['chatWS']
|
||||
delete this.closeStatus[name + id + date + 'chatWS']
|
||||
}
|
||||
},
|
||||
createMedicineConnect(name: string, id: string, date: string) {
|
||||
if (!this.patient[name + id + date]) this.patient[name + id + date] = {}
|
||||
const patient = this.patient[name + id + date]
|
||||
if (!patient['medicineWS']) {
|
||||
patient['medicineWS'] = new WebSocket(medicineUrl)
|
||||
patient.medicineWS.onopen = function () {
|
||||
patient.medicineWS.send(JSON.stringify({
|
||||
patientName: name,
|
||||
idNum: id,
|
||||
date: date,
|
||||
msgType: "msg"
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
subscribeMedicine(name: string, id: string, date: string, cb: any) {
|
||||
const patient = this.patient[name + id + date]
|
||||
if (patient) {
|
||||
patient.chatCB = cb
|
||||
patient.chatWS.onmessage = cb
|
||||
patient.medicineWS.onmessage = (e: any) => {
|
||||
if (e && e.data) {
|
||||
const data = JSON.parse(e.data);
|
||||
if (data.msgType == "msg") {
|
||||
cb(e)
|
||||
} else {
|
||||
patient.medicineWS.send(JSON.stringify({msgType: "heartbeat"}))
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cb({
|
||||
status: 1,
|
||||
|
|
@ -159,10 +312,35 @@ export const useRemoteWsStore = defineStore("remoteWs", {
|
|||
})
|
||||
}
|
||||
},
|
||||
unsubscribeChat(name: string, id: string, date: string) {
|
||||
medicineOnclose(name: string, id: string, date: string, cb: any) {
|
||||
const patient = this.patient[name + id + date]
|
||||
if (patient.medicineWS) {
|
||||
patient.medicineWS.onclose = cb
|
||||
} else {
|
||||
cb({
|
||||
status: 1,
|
||||
msg: "已断开连接"
|
||||
})
|
||||
}
|
||||
},
|
||||
medicineOnerror(name: string, id: string, date: string, cb: any) {
|
||||
const patient = this.patient[name + id + date]
|
||||
if (patient.medicineWS) {
|
||||
patient.medicineWS.onerror = cb
|
||||
} else {
|
||||
cb({
|
||||
status: 1,
|
||||
msg: "已断开连接"
|
||||
})
|
||||
}
|
||||
},
|
||||
unsubscribeMedicine(name: string, id: string, date: string) {
|
||||
const patient: any = this.patient[name + id + date]
|
||||
patient.chatCB = undefined;
|
||||
patient.chatWS.onmessage = undefined;
|
||||
if (patient) {
|
||||
patient.medicineWS.onmessage = undefined
|
||||
patient.medicineWS.onclose = undefined
|
||||
patient.medicineWS.onerror = undefined
|
||||
}
|
||||
},
|
||||
sendMedicine(args: {
|
||||
name: string,
|
||||
|
|
@ -193,22 +371,14 @@ export const useRemoteWsStore = defineStore("remoteWs", {
|
|||
})
|
||||
}
|
||||
},
|
||||
subscribeMedicine(name: string, id: string, date: string, cb: any) {
|
||||
const patient = this.patient[name + id + date]
|
||||
if (patient) {
|
||||
patient.medicineCB = cb
|
||||
patient.medicineWS.onmessage = cb
|
||||
} else {
|
||||
cb({
|
||||
status: 1,
|
||||
msg: "已断开连接"
|
||||
})
|
||||
disconnectMedicine(name: string, id: string, date: string) {
|
||||
const patient: any = this.patient[name + id + date]
|
||||
if (patient && patient.medicineWS) {
|
||||
this.closeStatus[name + id + date + 'medicineWS'] = true
|
||||
patient.medicineWS.close()
|
||||
delete patient['medicineWS']
|
||||
delete this.closeStatus[name + id + date + 'medicineWS']
|
||||
}
|
||||
},
|
||||
unsubscribeMedicine(name: string, id: string, date: string) {
|
||||
const patient: any = this.patient[name + id + date]
|
||||
patient.medicineCB = undefined;
|
||||
patient.medicineWS.onmessage = undefined;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -79,7 +79,7 @@ function handleResponse(response: any) {
|
|||
|
||||
axiosInstance.interceptors.response.use(handleResponse, error => {
|
||||
const code = error.response.status || 200
|
||||
if (code == 424 || code == 401) {
|
||||
if (code == 424) {
|
||||
ElMessageBox.confirm('令牌状态已过期,请点击重新登录', "系统提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
</div>
|
||||
<div class="header-box">
|
||||
<div class="header-item">
|
||||
<span class="main-color f20" style="font-weight: 600;">{{ userInfo.name }}</span>
|
||||
<span class="text2-color f14">{{ userInfo.roleName }}</span>
|
||||
<span class="main-color f20" style="font-weight: 600;">{{ userInfo?.name }}</span>
|
||||
<span class="text2-color f14">{{ userInfo?.roleName }}</span>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<el-icon class="text1-color" style="font-size: 26px;margin-right: 20px;">
|
||||
|
|
@ -55,39 +55,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-drawer
|
||||
class="message-drawer-box"
|
||||
v-model="userStore.showHomeMsg"
|
||||
title="通知消息"
|
||||
>
|
||||
<div class="body">
|
||||
<el-card style="margin-top: 10px;" v-for="(item, index) in messageTable">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>{{ item.category }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<p class="text item">{{ item.message }}</p>
|
||||
<template #footer>
|
||||
<span>{{ item.creatorName }}</span>
|
||||
<span style="float: inline-end;">{{ item.createTime }}</span>
|
||||
</template>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<el-pagination
|
||||
v-model:page-size="size"
|
||||
v-model:current-page="current"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
background
|
||||
layout="prev, pager, next, jumper, sizes"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:total="total"
|
||||
/>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -110,10 +77,6 @@ const userStore = useUserStore();
|
|||
const userInfo = userStore.getlogin()
|
||||
const showLogMod = ref(false)
|
||||
const messages = ref([] as any)
|
||||
const messageTable = ref([] as any)
|
||||
const current = ref(1);
|
||||
const size = ref(10);
|
||||
const total = ref(0);
|
||||
const todoTotal = ref(0) // 日历添加的记录提醒统计
|
||||
|
||||
onMounted(() => {
|
||||
|
|
@ -131,9 +94,6 @@ function init() {
|
|||
});
|
||||
getTodoCount();
|
||||
messages.value = [];
|
||||
messageTable.value = [];
|
||||
current.value = 1
|
||||
total.value = 0
|
||||
loadMsg();
|
||||
}
|
||||
|
||||
|
|
@ -145,25 +105,11 @@ function getTodoCount() {
|
|||
});
|
||||
}
|
||||
|
||||
function handleSizeChange() {
|
||||
messageTable.value = [];
|
||||
loadMsg()
|
||||
}
|
||||
|
||||
function handleCurrentChange() {
|
||||
messageTable.value = [];
|
||||
loadMsg()
|
||||
}
|
||||
|
||||
async function loadMsg() {
|
||||
const res = await msgApi.page(current.value, size.value)
|
||||
const res = await msgApi.page(0, 10)
|
||||
if (res.code == 0) {
|
||||
total.value = res.data.total
|
||||
res.data.records.forEach((row: any) => {
|
||||
if (current.value == 1) {
|
||||
messages.value.push(row)
|
||||
}
|
||||
messageTable.value.push(row)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
<!-- 超级管理员可切换医院 -->
|
||||
<el-select class="select-hospital" style="width: 150px;"
|
||||
v-model="hospital" size="small" @change="selectHospital">
|
||||
<el-option v-for="item in hospitals" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
<el-option v-for="(item, index) in hospitals" :key="index" :label="item.name"
|
||||
:value="item.id ? item.id : ''"/>
|
||||
</el-select>
|
||||
<!-- <el-button text>
|
||||
<el-icon>
|
||||
|
|
@ -36,7 +37,7 @@
|
|||
</el-button>
|
||||
<el-dropdown trigger="click" @command="userCommand">
|
||||
<span class="el-dropdown-link">
|
||||
{{ userInfo.name }}
|
||||
{{ userInfo?.name }}
|
||||
<el-icon class="el-icon--right">
|
||||
<arrow-down/>
|
||||
</el-icon>
|
||||
|
|
@ -56,6 +57,39 @@
|
|||
<el-drawer v-model="isShowUserInfoDrawer" size="35%" :with-header="false">
|
||||
<userInfoForm @close="isShowUserInfoDrawer = false"/>
|
||||
</el-drawer>
|
||||
<el-drawer
|
||||
class="message-drawer-box"
|
||||
v-model="userStore.showHomeMsg"
|
||||
title="通知消息"
|
||||
>
|
||||
<div class="body">
|
||||
<el-card style="margin-top: 10px;" v-for="(item, index) in messageTable">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>{{ item.category }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<p class="text item">{{ item.message }}</p>
|
||||
<template #footer>
|
||||
<span>{{ item.creatorName }}</span>
|
||||
<span style="float: inline-end;">{{ item.createTime }}</span>
|
||||
</template>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<el-pagination
|
||||
v-model:page-size="size"
|
||||
v-model:current-page="current"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
background
|
||||
layout="prev, pager, next, jumper, sizes"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:total="total"
|
||||
/>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -67,6 +101,7 @@ import {useUserStore} from '@/stores/user-info-store'
|
|||
import userInfoForm from '@/components/user-info.vue'
|
||||
import {logout} from "@/api/login";
|
||||
import * as hospitalApi from "@/api/hospital";
|
||||
import * as msgApi from "@/api/sys-message";
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
|
@ -78,6 +113,10 @@ const hospitals = ref([] as any)
|
|||
const menus = ref([] as any)
|
||||
const isShowUserInfoDrawer = ref(false)
|
||||
const menuActive = ref('/')
|
||||
const messageTable = ref([] as any)
|
||||
const current = ref(1);
|
||||
const size = ref(10);
|
||||
const total = ref(0);
|
||||
|
||||
router.isReady().then(() => {
|
||||
menuActive.value = route.path
|
||||
|
|
@ -94,6 +133,9 @@ onMounted(() => {
|
|||
function init() {
|
||||
getHospitalList();
|
||||
handleMenu();
|
||||
messageTable.value = [];
|
||||
current.value = 1
|
||||
total.value = 0
|
||||
}
|
||||
|
||||
function handleMenu() {
|
||||
|
|
@ -102,9 +144,29 @@ function handleMenu() {
|
|||
});
|
||||
}
|
||||
|
||||
function handleSizeChange() {
|
||||
messageTable.value = [];
|
||||
loadMsg()
|
||||
}
|
||||
|
||||
function handleCurrentChange() {
|
||||
messageTable.value = [];
|
||||
loadMsg()
|
||||
}
|
||||
|
||||
async function loadMsg() {
|
||||
const res = await msgApi.page(current.value, size.value)
|
||||
if (res.code == 0) {
|
||||
total.value = res.data.total
|
||||
res.data.records.forEach((row: any) => {
|
||||
messageTable.value.push(row)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const menuToPath = (e: any) => {
|
||||
menuActive.value = e.path
|
||||
router.push(e.path)
|
||||
router.push(e.children.length > 0 ? (e.children[0].path ? e.children[0].path : e.path) : e.path)
|
||||
}
|
||||
|
||||
async function getHospitalList() {
|
||||
|
|
@ -113,7 +175,7 @@ async function getHospitalList() {
|
|||
hospitals.value = [];
|
||||
if (res.code == 0 && res.data.length > 0) {
|
||||
hospitals.value = res.data;
|
||||
if (data.data) {
|
||||
if (data.data && data.data != 'null') {
|
||||
hospital.value = data.data;
|
||||
}
|
||||
preHospital.value = hospital.value
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {dateFormater} from '@/utils/date-util';
|
|||
import {useRemoteWsStore} from "@/stores/remote-ws-store";
|
||||
|
||||
const chartDom = ref();
|
||||
const props = withDefaults(defineProps<{ names?: string[] }>(), {
|
||||
const props = withDefaults(defineProps<{ names?: any }>(), {
|
||||
names: ['CH1', 'CH2']
|
||||
});
|
||||
defineExpose({
|
||||
|
|
@ -67,7 +67,7 @@ function chartInit() {
|
|||
formatter: (params: any) => {
|
||||
let str = params[0].axisValue;
|
||||
str += `<br>`;
|
||||
props.names.forEach((item, index) => {
|
||||
props.names.forEach((item: any, index: any) => {
|
||||
str += params[index].marker;
|
||||
str += params[index].seriesName + ' ';
|
||||
str += `${params[index].value} HZ`;
|
||||
|
|
@ -124,8 +124,8 @@ function getXData() {
|
|||
}
|
||||
|
||||
function getSeries() {
|
||||
props.names.forEach((name, index) => {
|
||||
const serie = {
|
||||
props.names.forEach((name: any, index: any) => {
|
||||
const serie: any = {
|
||||
name,
|
||||
type: 'line',
|
||||
symbol: 'none',
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import {useRemoteWsStore} from "@/stores/remote-ws-store";
|
|||
|
||||
const chartDom = ref();
|
||||
const props = withDefaults(defineProps<{
|
||||
names: string[]
|
||||
names: any
|
||||
}>(), {
|
||||
names: ['BIS', 'HR']
|
||||
});
|
||||
|
|
@ -41,7 +41,7 @@ function updateChartData(data: any) {
|
|||
}
|
||||
xData.shift();
|
||||
xData.push(dateFormater("HH:mm:ss", data.Time ? data.Time - 8 * 60 * 60 * 1000 : ''));
|
||||
series.forEach(serie => {
|
||||
series.forEach((serie: any) => {
|
||||
serie.data.shift();
|
||||
serie.data.push(data[serie.name]);
|
||||
if (data[serie.name + '_except']) {
|
||||
|
|
@ -71,7 +71,7 @@ function chartInit() {
|
|||
let str = '';
|
||||
str += params[0].axisValue;
|
||||
str += '<br>';
|
||||
props.names.forEach((item, index) => {
|
||||
props.names.forEach((item: any, index: any) => {
|
||||
str += params[index].marker;
|
||||
str += params[index].seriesName + ' ';
|
||||
switch (item) {
|
||||
|
|
@ -116,7 +116,7 @@ function chartInit() {
|
|||
lineHeight: 30,
|
||||
},
|
||||
formatter: (params: string) => {
|
||||
const index = props.names.findIndex((item) => item === params);
|
||||
const index = props.names.findIndex((item: any) => item === params);
|
||||
let str = params + ' ';
|
||||
switch (params) {
|
||||
case 'BIS':
|
||||
|
|
@ -181,7 +181,7 @@ function chartInit() {
|
|||
}
|
||||
|
||||
function getSeries() {
|
||||
props.names.forEach(name => {
|
||||
props.names.forEach((name: any) => {
|
||||
const serie = {
|
||||
name,
|
||||
type: 'line',
|
||||
|
|
@ -203,7 +203,7 @@ function getXData() {
|
|||
}
|
||||
|
||||
function getLegendData() {
|
||||
props.names.forEach((name, index) => {
|
||||
props.names.forEach((name: any, index: any) => {
|
||||
legendData.push({
|
||||
name,
|
||||
textStyle: {color: colors[index]},
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
||||
import {onMounted} from 'vue'
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {useUserStore} from "@/stores/user-info-store";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="message-item-part">
|
||||
<div class="tag-index">{{ index + 1 }}</div>
|
||||
<ul ref="listRef">
|
||||
<li v-for="(item, i) in remoteWsStore.remoteTasks[index]?.log || []" :key="i">
|
||||
<li v-for="(item, i) in remoteWsStore.getRemoteTask()[index]?.log || []" :key="i">
|
||||
<span>{{ dateFormater('yyyy-MM-dd HH:mm:ss', item.time) }}</span>
|
||||
<span>{{ item.taskName }}</span>
|
||||
<span>{{ item.state }}</span>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
</div>
|
||||
<div ref="listRef" class="content">
|
||||
<el-timeline>
|
||||
<el-timeline-item v-for="(item, index) in remoteWsStore.remoteTasks[remoteWsStore.currentTaskIndex]?.log || []" :key="index"
|
||||
<el-timeline-item v-for="(item, index) in remoteWsStore.getRemoteTask()[remoteWsStore.getCurrentTaskIndex()]?.log || []" :key="index"
|
||||
:timestamp="dateFormater('yyyy-MM-dd HH:mm:ss', item.time)"
|
||||
:class="{ 'alarm': item.state === '连接失败' || item.state === '异常' }">
|
||||
{{ item.taskName + ' ' + item.state }}
|
||||
|
|
@ -20,7 +20,6 @@ import {ref} from 'vue'
|
|||
import {dateFormater} from '@/utils/date-util'
|
||||
import {useRemoteWsStore} from "@/stores/remote-ws-store";
|
||||
|
||||
|
||||
defineExpose({
|
||||
setData,
|
||||
scrollToBottom
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ defineExpose({
|
|||
})
|
||||
|
||||
function open(i: number) {
|
||||
patientInfo.value = remoteWsStore.remoteTasks[i];
|
||||
patientInfo.value = remoteWsStore.getRemoteTask()[i]
|
||||
patientInfo.value.date = new Date();
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
|
|
@ -65,14 +65,14 @@ const confirmRemote = () => {
|
|||
patientInfo.value.isRemote = true
|
||||
patientInfo.value.taskName = '远程控制' + (patientInfo.value.index + 1)
|
||||
patientInfo.value.date = dateFormater("yyyyMMdd", patientInfo.value.date)
|
||||
unsubscribeLastTask();
|
||||
remoteWsStore.$patch({currentTaskIndex: patientInfo.value.index})
|
||||
unsubscribeLastTask()
|
||||
remoteWsStore.setCurrentTaskIndex(patientInfo.value.index)
|
||||
remoteWsStore.setRemoteLog({
|
||||
time: new Date(),
|
||||
taskName: patientInfo.value.taskName,
|
||||
state: '连接成功',
|
||||
type: "normal"
|
||||
}, remoteWsStore.currentTaskIndex)
|
||||
}, remoteWsStore.getCurrentTaskIndex())
|
||||
emit('confirmRemote', patientInfo.value)
|
||||
close()
|
||||
} else {
|
||||
|
|
@ -92,8 +92,8 @@ const breakRemote = () => {
|
|||
}
|
||||
|
||||
const unsubscribeLastTask = () => {
|
||||
const lastTaskIndex = remoteWsStore.currentTaskIndex;
|
||||
const lastTask: any = remoteWsStore.remoteTasks[lastTaskIndex];
|
||||
const lastTaskIndex = remoteWsStore.getCurrentTaskIndex();
|
||||
const lastTask: any = remoteWsStore.getRemoteTask()[lastTaskIndex];
|
||||
if (lastTask) {
|
||||
remoteWsStore.unsubscribeVital(lastTask.patient, lastTask.patientId, lastTask.date);
|
||||
}
|
||||
|
|
@ -107,34 +107,42 @@ const unsubscribeLastTask = () => {
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
&>img {
|
||||
|
||||
& > img {
|
||||
width: 260px;
|
||||
border: 1px solid #C77000;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: calc(100% - 290px);
|
||||
color: $main-color;
|
||||
line-height: 2;
|
||||
font-weight: 600;
|
||||
|
||||
h3 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.input-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&>span {
|
||||
& > span {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
:deep(.el-input) {
|
||||
border-bottom: 1px solid $text3-color;
|
||||
|
||||
.el-input__wrapper {
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
|
||||
input {
|
||||
height: 20px;
|
||||
font-size: 15px;
|
||||
|
|
@ -151,6 +159,7 @@ const unsubscribeLastTask = () => {
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 50px;
|
||||
|
||||
.el-button {
|
||||
font-weight: 600;
|
||||
padding: 15px 50px;
|
||||
|
|
|
|||
|
|
@ -61,13 +61,14 @@
|
|||
<script lang='ts' setup>
|
||||
import {onMounted, onUnmounted, ref} from 'vue'
|
||||
import {useRemoteWsStore} from "@/stores/remote-ws-store";
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
const props = withDefaults(defineProps<{ index: number }>(), {
|
||||
index: () => 0
|
||||
})
|
||||
const emit = defineEmits(['addLogAfter'])
|
||||
const remoteWsStore = useRemoteWsStore();
|
||||
const remoteTask = ref(remoteWsStore.remoteTasks[props.index]);
|
||||
const remoteTask = ref(remoteWsStore.getRemoteTask()[props.index]);
|
||||
const patientInfo = ref({} as any)
|
||||
|
||||
onMounted(() => {
|
||||
|
|
@ -81,7 +82,8 @@ onUnmounted(() => {
|
|||
})
|
||||
|
||||
function initData() {
|
||||
subscribeVital();
|
||||
onClose()
|
||||
subscribeVital()
|
||||
}
|
||||
|
||||
function subscribeVital() {
|
||||
|
|
@ -97,18 +99,33 @@ function subscribeVital() {
|
|||
})
|
||||
}
|
||||
|
||||
const onClose = () => {
|
||||
remoteWsStore.vitalOnclose(remoteTask.value.patient, remoteTask.value.patientId, remoteTask.value.date, () => {
|
||||
ElMessage.info('远程' + props.index + '已断开!')
|
||||
const status = remoteWsStore.getCloseStatus()
|
||||
if (!status[remoteTask.value.patient + remoteTask.value.patientId + remoteTask.value.date + 'vitalWS']) {
|
||||
setTimeout(() => {
|
||||
initData()
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function setLog(data: any, index: number) {
|
||||
if (remoteWsStore.getExceptions()[index]?.Time != data.Time) {
|
||||
remoteWsStore.setExceptions(index, data)
|
||||
remoteWsStore.exceptionType.forEach((item: any) => {
|
||||
if (data[item]) {
|
||||
const msg: any = remoteWsStore.exceptionMsg[item];
|
||||
remoteWsStore.setRemoteLog({
|
||||
state: msg,
|
||||
taskName: remoteTask.value.taskName,
|
||||
time: new Date(),
|
||||
time: item.Time,
|
||||
type: "exception"
|
||||
}, index);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -122,6 +139,7 @@ $size: 20px;
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid $border-color;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
|
|
@ -133,6 +151,7 @@ $size: 20px;
|
|||
transition: all .6s;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&::after {
|
||||
background-color: rgba(black, .1);
|
||||
|
|
@ -223,7 +242,7 @@ $size: 20px;
|
|||
}
|
||||
|
||||
.label {
|
||||
width: calc(50% - $size*0.5);
|
||||
width: calc(50% - $size * 0.5);
|
||||
}
|
||||
|
||||
.value {
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@
|
|||
<script lang='ts' setup>
|
||||
import {onUnmounted, ref} from 'vue'
|
||||
import {useRemoteWsStore} from "@/stores/remote-ws-store";
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
const emit = defineEmits(['addLogAfter', 'breakRemote'])
|
||||
const mediaMini800 = ref(false)
|
||||
|
|
@ -135,59 +136,80 @@ window.addEventListener('resize', () => {
|
|||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
remoteWsStore.unsubscribeVital(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date);
|
||||
remoteWsStore.unsubscribeVital(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date)
|
||||
})
|
||||
|
||||
function showData(i: any) {
|
||||
const lastTaskIndex = remoteWsStore.currentTaskIndex;
|
||||
const lastTask: any = remoteWsStore.remoteTasks[lastTaskIndex];
|
||||
const lastTaskIndex = remoteWsStore.getCurrentTaskIndex();
|
||||
const lastTask: any = remoteWsStore.getRemoteTask()[lastTaskIndex];
|
||||
if (lastTask) {
|
||||
remoteWsStore.unsubscribeVital(lastTask.patient, lastTask.patientId, lastTask.date);
|
||||
remoteWsStore.unsubscribeVital(lastTask.patient, lastTask.patientId, lastTask.date)
|
||||
}
|
||||
remoteWsStore.currentTaskIndex = i
|
||||
remoteItem.value = remoteWsStore.remoteTasks[remoteWsStore.currentTaskIndex]
|
||||
remoteWsStore.setCurrentTaskIndex(i)
|
||||
remoteItem.value = remoteWsStore.getRemoteTask()[remoteWsStore.getCurrentTaskIndex()]
|
||||
onClose()
|
||||
getData()
|
||||
}
|
||||
|
||||
function initData() {
|
||||
remoteItem.value = remoteWsStore.remoteTasks[remoteWsStore.currentTaskIndex]
|
||||
remoteWsStore.createConnect(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date)
|
||||
remoteItem.value = remoteWsStore.getRemoteTask()[remoteWsStore.getCurrentTaskIndex()]
|
||||
if (remoteItem.value.patient && remoteItem.value.patientId && remoteItem.value.date) {
|
||||
remoteWsStore.createVitalConnect(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date)
|
||||
onClose()
|
||||
getData()
|
||||
}
|
||||
}
|
||||
|
||||
const onClose = () => {
|
||||
remoteWsStore.vitalOnclose(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date, () => {
|
||||
ElMessage.info('远程' + remoteWsStore.getCurrentTaskIndex() + '已断开!')
|
||||
const status = remoteWsStore.getCloseStatus()
|
||||
if (!status[remoteItem.value.patient + remoteItem.value.patientId + remoteItem.value.date + 'vitalWS']) {
|
||||
setTimeout(() => {
|
||||
initData()
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getData() {
|
||||
remoteWsStore.unsubscribeVital(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date);
|
||||
remoteWsStore.unsubscribeVital(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date)
|
||||
remoteWsStore.subscribeVital(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date, (res: any) => {
|
||||
if (res && res.data) {
|
||||
const data = JSON.parse(res.data);
|
||||
const data = JSON.parse(res.data)
|
||||
if (data.vitalSignsList && data.vitalSignsList.length > 0) {
|
||||
Object.assign(patientInfo.value, data.vitalSignsList[0]);
|
||||
patientInfo.value.state = (patientInfo.value.BIS_except || patientInfo.value.SBP_except ||
|
||||
patientInfo.value.DBP_except || patientInfo.value.HR_except);
|
||||
patientInfo.value.DBP_except || patientInfo.value.HR_except)
|
||||
setLog(patientInfo.value)
|
||||
emit('addLogAfter')
|
||||
} else if (data.code == 1) {
|
||||
ElMessage.error(data.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function setLog(data: any) {
|
||||
if (remoteWsStore.getExceptions()[remoteWsStore.getCurrentTaskIndex()]?.Time != data.Time) {
|
||||
remoteWsStore.setExceptions(remoteWsStore.getCurrentTaskIndex(), data)
|
||||
remoteWsStore.exceptionType.forEach((item: any) => {
|
||||
if (data[item]) {
|
||||
const msg: any = remoteWsStore.exceptionMsg[item];
|
||||
const msg: any = remoteWsStore.exceptionMsg[item]
|
||||
remoteWsStore.setRemoteLog({
|
||||
state: msg,
|
||||
taskName: remoteItem.value.taskName,
|
||||
time: new Date(),
|
||||
time: item.Time,
|
||||
type: "exception"
|
||||
}, remoteWsStore.currentTaskIndex);
|
||||
}, remoteWsStore.getCurrentTaskIndex())
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const breakRemote = () => {
|
||||
remoteWsStore.disconnect(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date)
|
||||
remoteWsStore.resetRemoteTask(remoteWsStore.currentTaskIndex)
|
||||
remoteWsStore.resetRemoteTask(remoteWsStore.getCurrentTaskIndex())
|
||||
if (remoteWsStore.getActiveRemoteTask()) {
|
||||
showData(remoteWsStore.getActiveRemoteTask())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@
|
|||
<div class="body-box">
|
||||
<div class="body-img">
|
||||
<img src="@/assets/imgs/main_body.png" style="width: 100%;height: 100%;"/>
|
||||
<img class="lung-img" :class="{ 'shake_1': lungAlarm }" :src="lungAlarm ? imgLungAlarm : imgLung">
|
||||
<img class="lung-img" :class="{ 'shake_1': lungAlarm }"
|
||||
:src="lungAlarm ? imgLungAlarm : imgLung">
|
||||
<img class="heart-img" :class="{ 'shake_1': heartAlarm }"
|
||||
:src="heartAlarm ? imgHeartAlarm : imgHeart">
|
||||
</div>
|
||||
|
|
@ -101,7 +102,8 @@
|
|||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="速度(ug/kg/min)">速度(ug/kg/min)</el-dropdown-item>
|
||||
<el-dropdown-item command="速度(ug/kg/min)">速度(ug/kg/min)
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="速度(ml/h)">速度(ml/h)</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
|
|
@ -128,7 +130,8 @@
|
|||
</el-button>
|
||||
<!-- <el-button size="small" color="#006080" @click="tableItemConfirm(scope)"
|
||||
:disabled="tableDataStore[scope.$index].speed === scope.row.speed">确定-->
|
||||
<el-button size="small" color="#006080" @click="tableItemConfirm(scope, varTableData)">确定
|
||||
<el-button size="small" color="#006080"
|
||||
@click="tableItemConfirm(scope, varTableData)">确定
|
||||
</el-button>
|
||||
<el-button size="small" color="#006080" @click="tableItemCancel(scope)">取消
|
||||
</el-button>
|
||||
|
|
@ -161,7 +164,8 @@
|
|||
<Minus/>
|
||||
</el-icon>
|
||||
</el-button>
|
||||
<el-button size="small" color="#006080" @click="tableItemConfirm(scope, fixedTableData)">确定
|
||||
<el-button size="small" color="#006080"
|
||||
@click="tableItemConfirm(scope, fixedTableData)">确定
|
||||
</el-button>
|
||||
<el-button size="small" color="#006080" @click="tableItemCancel(scope)">取消
|
||||
</el-button>
|
||||
|
|
@ -221,7 +225,7 @@ const medicineCustom: any[] = [
|
|||
{name: '罗库溴铵', plus: 0.1, total: 10}
|
||||
]
|
||||
const remoteWsStore = useRemoteWsStore()
|
||||
const currentRemote = ref(remoteWsStore.remoteTasks[remoteWsStore.currentTaskIndex])
|
||||
const currentRemote = ref(remoteWsStore.getRemoteTask()[remoteWsStore.getCurrentTaskIndex()])
|
||||
const userInfo = useUserStore()
|
||||
|
||||
const chartDom1 = ref(),
|
||||
|
|
@ -261,21 +265,41 @@ onMounted(() => {
|
|||
router.replace('/remote-manage/remote-manage');
|
||||
return;
|
||||
}
|
||||
msgLogScrollBottom();
|
||||
initScale();
|
||||
subscribeWS();
|
||||
// setTableData();
|
||||
msgLogScrollBottom()
|
||||
initScale()
|
||||
createConnect()
|
||||
onVitalClose()
|
||||
onChatClose()
|
||||
onMedicineClose()
|
||||
subscribeWS()
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
remoteWsStore.unsubscribeChat(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date);
|
||||
remoteWsStore.unsubscribeMedicine(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date);
|
||||
remoteWsStore.unsubscribeVital(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date);
|
||||
disconnect()
|
||||
})
|
||||
|
||||
function createConnect() {
|
||||
remoteWsStore.createChatConnect(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date)
|
||||
remoteWsStore.createMedicineConnect(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date)
|
||||
}
|
||||
|
||||
function disconnect() {
|
||||
remoteWsStore.disconnectMedicine(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date)
|
||||
remoteWsStore.disconnectChat(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date)
|
||||
}
|
||||
|
||||
function subscribeWS() {
|
||||
subscribeVital()
|
||||
subscribeChat()
|
||||
subscribeMedicine()
|
||||
}
|
||||
|
||||
const subscribeVital = () => {
|
||||
remoteWsStore.subscribeVital(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date,
|
||||
function (res: any) {
|
||||
(res: any) => {
|
||||
const data = JSON.parse(res.data);
|
||||
chartDom1.value.updateChartData(data.vitalSignsList[0]);
|
||||
chartDom2.value.updateChartData(data.vitalSignsList[0]);
|
||||
|
|
@ -283,14 +307,18 @@ function subscribeWS() {
|
|||
chartDom4.value.updateChartData(data.vitalSignsList[0]);
|
||||
updateMedicineTable(data.aiMedicineList[0], data.docMedicineList[0]);
|
||||
})
|
||||
}
|
||||
|
||||
const subscribeChat = () => {
|
||||
remoteWsStore.subscribeChat(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date,
|
||||
function (res: any) {
|
||||
(res: any) => {
|
||||
mssageList.value.push(JSON.parse(res.data));
|
||||
})
|
||||
}
|
||||
|
||||
const subscribeMedicine = () => {
|
||||
remoteWsStore.subscribeMedicine(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date,
|
||||
function (res: any) {
|
||||
(res: any) => {
|
||||
const data = JSON.parse(res.data);
|
||||
if (data.status != 1) {
|
||||
if (data.medicine) {
|
||||
|
|
@ -303,6 +331,45 @@ function subscribeWS() {
|
|||
})
|
||||
}
|
||||
|
||||
const onVitalClose = () => {
|
||||
remoteWsStore.vitalOnclose(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, () => {
|
||||
ElMessage.info('远程已断开!')
|
||||
const status = remoteWsStore.getCloseStatus()
|
||||
if (!status[currentRemote.value.patient + currentRemote.value.patientId + currentRemote.value.date + 'vitalWS']) {
|
||||
setTimeout(() => {
|
||||
remoteWsStore.createVitalConnect(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date)
|
||||
subscribeVital()
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const onChatClose = () => {
|
||||
remoteWsStore.chatOnclose(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, () => {
|
||||
ElMessage.info('通讯已断开!')
|
||||
const status = remoteWsStore.getCloseStatus()
|
||||
if (!status[currentRemote.value.patient + currentRemote.value.patientId + currentRemote.value.date + 'chatWS']) {
|
||||
setTimeout(() => {
|
||||
remoteWsStore.createChatConnect(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date)
|
||||
subscribeChat()
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const onMedicineClose = () => {
|
||||
remoteWsStore.medicineOnclose(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, () => {
|
||||
ElMessage.info('给药已断开!')
|
||||
const status = remoteWsStore.getCloseStatus()
|
||||
if (!status[currentRemote.value.patient + currentRemote.value.patientId + currentRemote.value.date + 'medicineWS']) {
|
||||
setTimeout(() => {
|
||||
remoteWsStore.createMedicineConnect(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date)
|
||||
subscribeMedicine()
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function initData() {
|
||||
lungAlarm.value = false;
|
||||
heartAlarm.value = false;
|
||||
|
|
@ -458,7 +525,6 @@ const setDatabase = () => {
|
|||
const viewPatientInfo = () => {
|
||||
getPatientInfo(currentRemote.value.patient, currentRemote.value.patientId,
|
||||
currentRemote.value.date).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
isPatientDialog.value = true;
|
||||
setTimeout(() => {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ onMounted(() => {
|
|||
|
||||
function initRemoteTask() {
|
||||
remoteTask.value = remoteWsStore.initRemoteTask()
|
||||
remotePartRef.value.showData(remoteWsStore.currentTaskIndex);
|
||||
remotePartRef.value.initData()
|
||||
}
|
||||
|
||||
const viewThumbnail = () => {
|
||||
|
|
@ -69,6 +69,7 @@ const editTask = (item: any) => {
|
|||
const toRemoteControl = (item: any) => {
|
||||
// 如果当前任务是已连接状态则跳转,否则打开弹窗
|
||||
if (item.isRemote) {
|
||||
remoteWsStore.setCurrentTaskIndex(item.index)
|
||||
router.push('/remote-manage/remote-control')
|
||||
} else {
|
||||
remoteDialogRef.value.open(item.index)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const remoteTask = ref([] as any);
|
|||
const remoteWsStore = useRemoteWsStore();
|
||||
|
||||
onMounted(() => {
|
||||
remoteTask.value = remoteWsStore.remoteTasks;
|
||||
remoteTask.value = remoteWsStore.getRemoteTask();
|
||||
})
|
||||
|
||||
const openRemote = (params: any) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user