|
@@ -1,21 +1,25 @@
|
|
|
<template>
|
|
|
<div ref="dualScreenRef"
|
|
|
class="dual-screen">
|
|
|
+ <div class="close" @click="isOpenDualScreen = false">
|
|
|
+ X
|
|
|
+ </div>
|
|
|
+
|
|
|
<iframe
|
|
|
:src="dualScreenSrc"
|
|
|
height="100%"
|
|
|
width="100%"
|
|
|
- ref="emrRef"
|
|
|
- />
|
|
|
+ ref="emrRef"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup name='EmrDualScreen'>
|
|
|
-import {dualScreenSrc} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
|
|
|
+import {dualScreenSrc, isOpenDualScreen} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
|
|
|
+import router from "@/router";
|
|
|
+import {watch} from "vue";
|
|
|
|
|
|
const dualScreenRef = ref(null)
|
|
|
const emrRef = ref(null)
|
|
|
-const zIndex = ref(0)
|
|
|
let iframeWindow = null; //iframe的window对象
|
|
|
|
|
|
|
|
@@ -33,12 +37,18 @@ onMounted(async () => {
|
|
|
} else {
|
|
|
body.appendChild(dualScreenRef.value);
|
|
|
}
|
|
|
- zIndex.value = [...document.all].reduce((r, e) => Math.max(r, +window.getComputedStyle(e).zIndex || 0), 0)
|
|
|
await nextTick();
|
|
|
window.addEventListener("message", handleMessage)
|
|
|
iframeWindow = emrRef.value.contentWindow;
|
|
|
})
|
|
|
|
|
|
+watch(() => router.currentRoute.value.path, () => {
|
|
|
+ let path = router.currentRoute.value.path
|
|
|
+ if (path === '/login') {
|
|
|
+ isOpenDualScreen.value = false
|
|
|
+ }
|
|
|
+}, {deep: true})
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
@@ -50,5 +60,19 @@ onMounted(async () => {
|
|
|
height: 100%;
|
|
|
background-color: white;
|
|
|
z-index: 99;
|
|
|
+
|
|
|
+ .close {
|
|
|
+ text-align: center;
|
|
|
+ position: absolute;
|
|
|
+ border-radius: 5px;
|
|
|
+ height: 20px;
|
|
|
+ width: 20px;
|
|
|
+ right: 0;
|
|
|
+ background-color: red;
|
|
|
+ box-shadow: var(--el-box-shadow-light);
|
|
|
+ cursor: pointer;
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
</style>
|