ECG打印预览

This commit is contained in:
旺仔 2024-12-09 00:02:12 +08:00
parent 657c7ae427
commit 3a3af0e218
2 changed files with 38 additions and 32 deletions

View File

@ -191,7 +191,7 @@
plain plain
@click="opencomparediag" @click="opencomparediag"
> >
<el-icon><Reading /></el-icon> <el-icon><Reading /></el-icon>
</el-button> </el-button>
<span style="font-size: 15px; margin-bottom: 10px">对比</span> <span style="font-size: 15px; margin-bottom: 10px">对比</span>
</div> </div>
@ -515,7 +515,7 @@
<div id="printMe_ecg"> <div id="printMe_ecg">
<div class="page-item-ecg"> <div class="page-item-ecg">
<ReportInfoECG <ReportInfoECG
style="height: 99.88%" style="height: 99.888%"
:extraInfo="queryParams" :extraInfo="queryParams"
:jsonurl="queryParams.ecgJsonDataFilePath" :jsonurl="queryParams.ecgJsonDataFilePath"
:lineratio="0.025" :lineratio="0.025"
@ -608,7 +608,7 @@ const ECGDialog = ref() //危急值消息弹窗
const isshowwjz = ref(false) const isshowwjz = ref(false)
const isshowysb = ref(false) const isshowysb = ref(false)
const ECGReportDialog = ref() // const ECGReportDialog = ref() //
const ECGCompare=ref()// const ECGCompare = ref() //
// //
const treeDefaultProps = { const treeDefaultProps = {
children: 'children', children: 'children',
@ -794,7 +794,7 @@ function openreprotdiag() {
} }
// //
function opencomparediag() { function opencomparediag() {
ECGCompare.value.opencomparediag( rowinfo.value) ECGCompare.value.opencomparediag(rowinfo.value)
} }
// //
function iscorrect() { function iscorrect() {
@ -994,9 +994,9 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/* 打印(报告单) */ /* 打印(报告单) */
.page-item-ecg { .page-item-ecg {
padding: 1mm 0.8mm 1mm 2mm; padding: 1mm 0.8mm 1mm 0.6mm;
max-width: 1400px; max-width: 1184px;
margin: 0 auto; margin: 6vh auto 0 auto;
border: 2px solid #ccc; border: 2px solid #ccc;
border-radius: 8px; border-radius: 8px;
} }
@ -1012,8 +1012,8 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
page-break-after: always; page-break-after: always;
padding: 0; padding: 0;
max-width: none; max-width: none;
width: calc(100% - 4.2mm); width: calc(100% - 3mm);
margin: 0 0 0 2.6mm; margin: 0 0 0 1.2mm;
} }
} }
</style> </style>

View File

@ -49,58 +49,58 @@
alt="" alt=""
fit="fill" fit="fill"
loading="eager" loading="eager"
style="width: 100%; height: 148mm" style="width: 100%"
:src="reportimage" :src="reportimage"
crossorigin="anonymous" crossorigin="anonymous"
v-if="true" v-if="true"
/> />
<el-scrollbar v-show="false"> <el-scrollbar v-show="false">
<div id="ecg-substance" style="width: 1760px"> <div id="ecg-substance" style="width: 1162px">
<div class="ecg-container" style="height: 872px"> <div class="ecg-container" style="height: 632px">
<div id="canvas-container-l" style="height: 872px"> <div id="canvas-container-l" style="height: 632px">
<canvas <canvas
crossorigin="anonymous" crossorigin="anonymous"
ref="leftCanvas" ref="leftCanvas"
id="leftCanvas" id="leftCanvas"
width="21" width="21"
height="861" height="621"
></canvas> ></canvas>
<canvas <canvas
crossorigin="anonymous" crossorigin="anonymous"
ref="bottomCanvasL" ref="bottomCanvasL"
id="bottomCanvas-l" id="bottomCanvas-l"
width="1700" width="3700"
height="861" height="621"
></canvas> ></canvas>
<canvas <canvas
crossorigin="anonymous" crossorigin="anonymous"
ref="topCanvasL" ref="topCanvasL"
id="topCanvas-l" id="topCanvas-l"
width="1700" width="3700"
height="861" height="621"
></canvas> ></canvas>
</div> </div>
<div id="canvas-container-r" style="height: 872px"> <div id="canvas-container-r" style="height: 632px">
<canvas <canvas
crossorigin="anonymous" crossorigin="anonymous"
ref="rightCanvas" ref="rightCanvas"
id="rightCanvas" id="rightCanvas"
width="21" width="21"
height="861" height="621"
></canvas> ></canvas>
<canvas <canvas
crossorigin="anonymous" crossorigin="anonymous"
ref="bottomCanvasR" ref="bottomCanvasR"
id="bottomCanvas-r" id="bottomCanvas-r"
width="1700" width="3700"
height="861" height="621"
></canvas> ></canvas>
<canvas <canvas
crossorigin="anonymous" crossorigin="anonymous"
ref="topCanvasR" ref="topCanvasR"
id="topCanvas-r" id="topCanvas-r"
width="1700" width="3700"
height="861" height="621"
></canvas> ></canvas>
</div> </div>
</div> </div>
@ -518,8 +518,8 @@ const fetchData = async () => {
//ecgCenter.offsetWidth //ecgCenter.offsetWidth
//ecgCenter.offsetHeight //ecgCenter.offsetHeight
let targetWidth = 1760 let targetWidth = 1164
let targetHeight = 862 let targetHeight = 624
let options = { let options = {
allowTaint: false, allowTaint: false,
taintTest: false, taintTest: false,
@ -528,7 +528,7 @@ const fetchData = async () => {
width: targetWidth, width: targetWidth,
height: targetHeight, height: targetHeight,
dpi: 300, //DPI dpi: 300, //DPI
scale: 1.14 // scale: 1.2 //
} as any } as any
const canvas = await html2canvas(ecgCenter, options) const canvas = await html2canvas(ecgCenter, options)
if (canvas) { if (canvas) {
@ -602,7 +602,7 @@ const createImage = async () => {
/** 钩子方法 **/ /** 钩子方法 **/
onMounted(async () => { onMounted(async () => {
//heightoff.value = (leftCanvas.value.height - 100) / 6 //heightoff.value = (leftCanvas.value.height - 100) / 6
heightoff.value = (821 - 0) / 6 heightoff.value = (618 - 0) / 6
await fetchData() await fetchData()
}) })
@ -623,13 +623,13 @@ defineExpose({ ecg_loading })
margin: 1px; margin: 1px;
padding: 1px; padding: 1px;
position: relative; position: relative;
width: 99.2%; width: 99.888%;
min-height: 204mm; min-height: 204mm;
} }
.ecg-main { .ecg-main {
margin-top: 8px; margin-top: 4px;
margin-bottom: 26px; margin-bottom: 30px;
} }
/*** ecg核心 ***/ /*** ecg核心 ***/
@ -648,8 +648,14 @@ defineExpose({ ecg_loading })
position: relative; position: relative;
overflow-x: hidden; overflow-x: hidden;
overflow-y: hidden; overflow-y: hidden;
}
#canvas-container-l {
width: calc(50% - 1px);
}
#canvas-container-r {
width: 50%; width: 50%;
margin-right: 0;
} }
#leftCanvas, #leftCanvas,