From 30fdd9176462204d7341945bfac75adc05eb0b85 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Mon, 29 Jun 2026 11:41:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9EDICOM=E9=98=85=E7=89=87=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visit-review/components/FileViewer.vue | 57 ++++++++----------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/src/views/trials/trials-panel/reading/visit-review/components/FileViewer.vue b/src/views/trials/trials-panel/reading/visit-review/components/FileViewer.vue index 1c327352..c996f5ef 100644 --- a/src/views/trials/trials-panel/reading/visit-review/components/FileViewer.vue +++ b/src/views/trials/trials-panel/reading/visit-review/components/FileViewer.vue @@ -32,13 +32,8 @@ - +
  • @@ -56,12 +51,8 @@
  • {{ $t('trials:reading:keyImage:noData') }}
  • -
  • +
  • @@ -117,13 +108,9 @@ :title="$t('trials:nondicom-show:scale')" @click.prevent="setAnnotateToolActive('Lengthscale')">
    - + -
    +
    @@ -131,8 +118,8 @@
    -
    +
    @@ -349,7 +336,7 @@ - + @@ -1448,7 +1435,7 @@ export default { this.saveCustomAnnotationTimer = null } this.saveCustomAnnotation(annotation) - } + } } else { // if (this.isNumber(operateStateEnum)) { // this.removeAnnotation(annotation) @@ -1943,7 +1930,7 @@ export default { if (currentViewport.fileType && currentViewport.fileType.includes('mp4')) { divForDownloadViewport = this.$refs[`grid-cell-${this.activeCanvasIndex}`][0] const videoEl = this.$refs[`videovideo-${this.activeCanvasIndex}`][0] - + if (videoEl) { // 将视频帧画到 canvas 上生成图片 const tempCanvas = document.createElement('canvas') @@ -1952,7 +1939,7 @@ export default { const containerHeight = videoEl.clientHeight tempCanvas.width = containerWidth tempCanvas.height = containerHeight - + const ctx = tempCanvas.getContext('2d') // 填充黑色背景 ctx.fillStyle = '#000' @@ -1961,7 +1948,7 @@ export default { // 计算视频保持比例的缩放尺寸和位置 (等同于 object-fit: contain) const videoWidth = videoEl.videoWidth || containerWidth const videoHeight = videoEl.videoHeight || containerHeight - + const scale = Math.min(containerWidth / videoWidth, containerHeight / videoHeight) const drawWidth = videoWidth * scale const drawHeight = videoHeight * scale @@ -1970,9 +1957,9 @@ export default { // 将视频帧居中绘制 ctx.drawImage(videoEl, offsetX, offsetY, drawWidth, drawHeight) - + const frameBase64 = tempCanvas.toDataURL('image/png') - + // 创建一个 img 标签遮盖在 video 上 tempImg = document.createElement('img') tempImg.src = frameBase64 @@ -1982,7 +1969,7 @@ export default { tempImg.style.width = '100%' tempImg.style.height = '100%' tempImg.style.zIndex = '99' - + const videoContainer = this.$refs[`video-content-main-${this.activeCanvasIndex}`][0] videoContainer.style.position = 'relative' videoContainer.appendChild(tempImg) @@ -1998,11 +1985,11 @@ export default { // 等待 DOM 更新 await this.$nextTick() - const canvas = await html2canvas(divForDownloadViewport, { + const canvas = await html2canvas(divForDownloadViewport, { useCORS: true, backgroundColor: '#000000' // 指定截图背景为黑色 }) - + // 截图后恢复 if (tempImg) { tempImg.remove() @@ -2010,7 +1997,7 @@ export default { const base64Str = canvas.toDataURL('image/png', 1) const downloadName = `${Date.now()}.png` - + const a = document.createElement('a') a.href = base64Str a.download = downloadName @@ -2588,11 +2575,13 @@ export default { } } } + .personal_config { ::v-deep .el-tabs__content { height: 450px; overflow-y: auto; } + ::v-deep .hot-keys-label { color: #dfdfdf !important; }