123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <template>
- <router-view/>
- <soctet-dialog v-if="socketErrDialog"/>
- <progress-bar/>
- <JsDialogComp/>
- </template>
- <script setup lang="jsx">
- 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 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 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";
- const progressBarStore = useProgressBarStore()
- const systemStore = useSystemStore()
- progressBarStore.initialize({
- title: '数据上传',
- isOpen: false,
- abnormalClosing: false,
- })
- const emrChannelFunc = {
- "firstPageOfMedicalRecord": (val) => {
- router.push({
- name: 'fillCaseFrontSheet',
- query: {
- patNo: val.inpatientNo,
- deptCode: val.smallDept,
- },
- })
- },
- "medicalAdvice": (val) => {
- router.push({
- name: 'yiZhuLuRu',
- params: {
- inpatientNo: val.inpatientNo
- },
- query: {
- pattern: 'all'
- }
- })
- }
- }
- const createChannel = () => {
- let homePage = new BroadcastChannel('emrChannel')
- homePage.addEventListener('message', async (e) => {
- if (!router.currentRoute.value.path.includes('/myEmrEditor')) {
- await router.push('/blank')
- let data = JSON.parse(e.data)
- emrChannelFunc[data.name](data.data)
- }
- })
- }
- function avatarNotification(data) {
- const message = (
- <div>
- <div>
- 科室: {data.deptName}
- </div>
- <div>
- {data.msg}
- </div>
- </div>
- )
- ElNotification({
- 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}) {
- const message = (
- <table style="width: 100%">
- <tbody>
- <tr>
- <td style="padding-right: 8px">患者:</td>
- <td>{data.patientName}</td>
- </tr>
- <tr>
- <td style="padding-right: 8px">检查名称:</td>
- <td>{data.reqName}</td>
- </tr>
- <tr>
- <td style="padding-right: 8px"> 报告时间:</td>
- <td>{formatDateToStr(data.reportTime)}</td>
- </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>
- </td>
- </tr>
- </tbody>
- </table>
- )
- ElNotification({
- title: isAdd ? '检查结果返回' : '修改检查结果',
- message: message,
- dangerouslyUseHTMLString: true,
- type: 'success',
- position: 'bottom-right',
- duration: 0
- })
- }
- function systemNotification(data) {
- console.log(data)
- if (data.count) {
- systemStore.addUnreadMessageCount(data.count)
- }
- if (data.refreshDelay) {
- sleep(data.refreshDelay).then(() => {
- location.reload();
- })
- }
- if (data?.donTDisplay) {
- return
- }
- ElNotification({
- title: typeof data.title === 'undefined' ? '新消息' : data.title,
- message: h('pre', {
- class: 'message_pre'
- }, data.message),
- dangerouslyUseHTMLString: true,
- type: typeof data.type === 'undefined' ? 'warning' : data.type,
- duration: 0,
- })
- }
- onMounted(() => {
- createChannel()
- 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: '患者危急值',
- message: data.message,
- type: 'error',
- confirmButtonText: '前往处理',
- cancelButtonText: '关闭'
- }).then(res => {
- router.push(`/inpatient/zhuYuanYiSheng/criticalValue?id=${data.id}`)
- }).catch(() => {
- })
- })
- setCallback('systemNotification', systemNotification)
- setCallback('checkTheCallbacks', checkTheCallbacks)
- setCallback('avatarNotification', avatarNotification);
- })
- </script>
- <style lang="scss">
- .message_pre {
- font-weight: normal;
- margin: 0;
- font-size: 14px;
- line-height: 1;
- }
- </style>
|