|
@@ -1,65 +1,66 @@
|
|
|
<template>
|
|
|
- <router-view/>
|
|
|
- <soctet-dialog v-if="socketErrDialog"/>
|
|
|
- <progress-bar/>
|
|
|
- <JsDialogComp/>
|
|
|
- <CyDialogV2/>
|
|
|
+ <router-view />
|
|
|
+ <SocketDialog v-if="socketErrDialog" />
|
|
|
+ <progress-bar />
|
|
|
+ <JsDialogComp />
|
|
|
+ <CyDialogV2 />
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="jsx">
|
|
|
-import {setCallback, socketErrDialog} from "@/utils/websocket";
|
|
|
-import {ElMessageBox, ElNotification} from "element-plus";
|
|
|
+import { setCallback, socketErrDialog } from "@/utils/websocket";
|
|
|
+import { ElMessageBox, ElNotification } from "element-plus";
|
|
|
import sleep from "@/utils/sleep";
|
|
|
-import SoctetDialog from "@/components/xiao-chan/websocket/SoctetDialog.vue";
|
|
|
+import SocketDialog from "@/components/xiao-chan/websocket/SocketDialog.vue";
|
|
|
import router from "@/router";
|
|
|
import ProgressBar from "@/components/xiao-chan/progress-bar/ProgressBar.vue";
|
|
|
-import {formatDateToStr} from '@/utils/moment-utils'
|
|
|
-import {ElLink} from 'element-plus'
|
|
|
+import { formatDateToStr } from "@/utils/moment-utils";
|
|
|
+import { ElLink } from "element-plus";
|
|
|
import JsDialogComp from "@/components/js-dialog-comp/JsDialogComp.vue";
|
|
|
-import {CyMessageBox} from "@/components/cy/message-box";
|
|
|
-import {useProgressBarStore} from "@/pinia/progress-bar-store";
|
|
|
-import {useUserStore} from "@/pinia/user-store";
|
|
|
-import {useSystemStore} from "@/pinia/system-store";
|
|
|
+import { CyMessageBox } from "@/components/cy/message-box";
|
|
|
+import { useProgressBarStore } from "@/pinia/progress-bar-store";
|
|
|
+import { useUserStore } from "@/pinia/user-store";
|
|
|
+import { useSystemStore } from "@/pinia/system-store";
|
|
|
import useChangeToken from "@/utils/cy-use/useChangeToken";
|
|
|
import CyDialogV2 from "@/components/cy/CyDialog/index.vue";
|
|
|
|
|
|
-const progressBarStore = useProgressBarStore()
|
|
|
-const systemStore = useSystemStore()
|
|
|
+const progressBarStore = useProgressBarStore();
|
|
|
+const systemStore = useSystemStore();
|
|
|
|
|
|
-useChangeToken()
|
|
|
+useChangeToken();
|
|
|
|
|
|
progressBarStore.initialize({
|
|
|
- title: '数据上传',
|
|
|
+ title: "数据上传",
|
|
|
isOpen: false,
|
|
|
abnormalClosing: false,
|
|
|
-})
|
|
|
+});
|
|
|
|
|
|
function avatarNotification(data) {
|
|
|
const message = (
|
|
|
- <div>
|
|
|
- <div>
|
|
|
- 科室: {data.deptName}
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {data.msg}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- )
|
|
|
+ <div>
|
|
|
+ <div>科室: {data.deptName}</div>
|
|
|
+ <div>{data.msg}</div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
|
|
|
ElNotification({
|
|
|
- icon: <img src={data.avatar} style={{width: '32px', height: "32px", borderRadius: '16px'}} alt=""/>,
|
|
|
+ icon: (
|
|
|
+ <img
|
|
|
+ src={data.avatar}
|
|
|
+ style={{ width: "32px", height: "32px", borderRadius: "16px" }}
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ ),
|
|
|
title: data.title,
|
|
|
message: message,
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
duration: 0,
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-function checkTheCallbacks({data, isAdd}) {
|
|
|
+function checkTheCallbacks({ data, isAdd }) {
|
|
|
const message = (
|
|
|
- <table style="width: 100%">
|
|
|
- <tbody>
|
|
|
+ <table style="width: 100%">
|
|
|
+ <tbody>
|
|
|
<tr>
|
|
|
<td style="padding-right: 8px">患者:</td>
|
|
|
<td>{data.patientName}</td>
|
|
@@ -74,82 +75,94 @@ function checkTheCallbacks({data, isAdd}) {
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td colspan="2" style="text-ali">
|
|
|
- <ElLink type="primary" target="_blank"
|
|
|
- href={`http://172.16.32.122:8099/mReport?REQUISITIONID=${data.reqNo}`}>
|
|
|
+ <ElLink
|
|
|
+ type="primary"
|
|
|
+ target="_blank"
|
|
|
+ href={`http://172.16.32.122:8099/mReport?REQUISITIONID=${data.reqNo}`}
|
|
|
+ >
|
|
|
查看图像
|
|
|
</ElLink>
|
|
|
</td>
|
|
|
</tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- )
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ );
|
|
|
|
|
|
ElNotification({
|
|
|
- title: isAdd ? '检查结果返回' : '修改检查结果',
|
|
|
+ title: isAdd ? "检查结果返回" : "修改检查结果",
|
|
|
message: message,
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
- type: 'success',
|
|
|
- position: 'bottom-right',
|
|
|
- duration: 0
|
|
|
- })
|
|
|
+ type: "success",
|
|
|
+ position: "bottom-right",
|
|
|
+ duration: 0,
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
function systemNotification(data) {
|
|
|
if (data.count) {
|
|
|
- systemStore.addUnreadMessageCount(data.count)
|
|
|
+ systemStore.addUnreadMessageCount(data.count);
|
|
|
}
|
|
|
|
|
|
if (data.refreshDelay) {
|
|
|
sleep(data.refreshDelay).then(() => {
|
|
|
location.reload();
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
if (data?.donTDisplay) {
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
ElNotification({
|
|
|
- title: data.title ?? '新消息',
|
|
|
- message: h('pre', {
|
|
|
- class: 'message_pre'
|
|
|
- }, data.message),
|
|
|
+ title: data.title ?? "新消息",
|
|
|
+ message: h(
|
|
|
+ "pre",
|
|
|
+ {
|
|
|
+ class: "message_pre",
|
|
|
+ },
|
|
|
+ data.message
|
|
|
+ ),
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
- type: data.title ?? 'warning',
|
|
|
+ type: data.title ?? "warning",
|
|
|
duration: 0,
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- setCallback('refreshToken', (data) => {
|
|
|
- useUserStore().setToken(data.token)
|
|
|
- })
|
|
|
-
|
|
|
- setCallback('sidSingle', async () => {
|
|
|
- localStorage.clear()
|
|
|
- await router.push('/login')
|
|
|
- await ElMessageBox.alert('您的账号已在其他地方登陆,如需修改密码请在个人中心中修改。', '提示', {
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- setCallback('criticalValue', (data) => {
|
|
|
+ setCallback("refreshToken", data => {
|
|
|
+ useUserStore().setToken(data.token);
|
|
|
+ });
|
|
|
+
|
|
|
+ setCallback("sidSingle", async () => {
|
|
|
+ localStorage.clear();
|
|
|
+ await router.push("/login");
|
|
|
+ await ElMessageBox.alert(
|
|
|
+ "您的账号已在其他地方登陆,如需修改密码请在个人中心中修改。",
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+
|
|
|
+ setCallback("criticalValue", data => {
|
|
|
CyMessageBox({
|
|
|
- title: '患者危急值',
|
|
|
+ title: "患者危急值",
|
|
|
message: data.message,
|
|
|
- type: 'error',
|
|
|
- confirmButtonText: '前往处理',
|
|
|
- cancelButtonText: '关闭'
|
|
|
- }).then(() => {
|
|
|
- router.push(`/inpatient/zhuYuanYiSheng/criticalValue?id=${data.id}`)
|
|
|
- }).catch(() => {
|
|
|
+ type: "error",
|
|
|
+ confirmButtonText: "前往处理",
|
|
|
+ cancelButtonText: "关闭",
|
|
|
})
|
|
|
- })
|
|
|
-
|
|
|
- setCallback('systemNotification', systemNotification)
|
|
|
- setCallback('checkTheCallbacks', checkTheCallbacks)
|
|
|
- setCallback('avatarNotification', avatarNotification);
|
|
|
-})
|
|
|
+ .then(() => {
|
|
|
+ router.push(`/inpatient/zhuYuanYiSheng/criticalValue?id=${data.id}`);
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ });
|
|
|
+
|
|
|
+ setCallback("systemNotification", systemNotification);
|
|
|
+ setCallback("checkTheCallbacks", checkTheCallbacks);
|
|
|
+ setCallback("avatarNotification", avatarNotification);
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|