From 509f8f02b64d5fa0ec343ab24e0aaa1932cdd986 Mon Sep 17 00:00:00 2001
From: wangxiaoshuang <825034831@qq.com>
Date: Mon, 4 Aug 2025 14:51:34 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E9=98=85=E7=89=87=E5=90=8E=E9=98=85?=
=?UTF-8?q?=E7=89=87=E9=A1=B5=E9=9D=A2=E5=8F=AF=E6=B7=BB=E5=8A=A0=E4=B8=B4?=
=?UTF-8?q?=E6=97=B6=E6=A0=87=E8=AE=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../reading/dicoms3D/components/ReadPage.vue | 41 ++++++++----
.../visit-review/components/FileViewer.vue | 64 +++++++++++--------
2 files changed, 69 insertions(+), 36 deletions(-)
diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue
index 1f33dd0f..24302265 100644
--- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue
+++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue
@@ -280,11 +280,11 @@
>
-
+
@@ -1510,14 +1510,32 @@ export default {
this.setToolsPassive()
},
annotationRemovedListener(e) {
- if (this.readingTaskState === 2) return
const { annotation } = e.detail
- if (!annotation) return
- if (annotation.visitTaskId === this.taskInfo.VisitTaskId && annotation.seriesId) {
- const index = this.markedSeriesIds.indexOf(annotation.seriesId)
- if (index !== -1) {
- this.markedSeriesIds.splice(index, 1)
+ try{
+ if (!annotation) return
+ if (this. readingTaskState === 2 && !annotation.data.label) return false
+ if (this.readingTaskState === 2) {
+ const errorMsg = { message: 'annotation Not allowed to operate' }
+ throw errorMsg
}
+ if (annotation.visitTaskId === this.taskInfo.VisitTaskId && annotation.seriesId) {
+ const index = this.markedSeriesIds.indexOf(annotation.seriesId)
+ if (index !== -1) {
+ this.markedSeriesIds.splice(index, 1)
+ }
+ } else {
+ const errorMsg = { message: 'annotation Not allowed to operate' }
+ throw errorMsg
+ }
+ } catch (e) {
+ cornerstoneTools.annotation.state.addAnnotation(annotation)
+ const renderingEngine = getRenderingEngine(renderingEngineId)
+ for (let i = 0; i < this.cells.length; i++) {
+ const viewportId = `${this.viewportKey}-${i}`
+ const viewport = renderingEngine.getViewport(viewportId)
+ viewport.render()
+ }
+ console.log(e)
}
},
async customAnnotationCompletedListener(e) {
@@ -1637,6 +1655,7 @@ export default {
try {
// if ( this.resetAnnotation && this.isFusion ) return false
if (!annotation) return false
+ if (this.readingTaskState === 2 && !annotation.data.label) return false
if (this.readingTaskState === 2) {
const errorMsg = { message: 'annotation Not allowed to operate' }
throw errorMsg
@@ -1665,10 +1684,10 @@ export default {
)
if (annotation.markId) {
let res = await deleteCustomTag(annotation.markId)
- if (!res.IsSuccess) return false
+ if (!res.IsSuccess) throw ''
}else if (annotation.id) {
let res = await deleteCustomTag(annotation.id)
- if (!res.IsSuccess) return false
+ if (!res.IsSuccess) throw ''
}
}
const index = this.markedSeriesIds.indexOf(annotation.seriesId)
@@ -2093,7 +2112,7 @@ export default {
}
},
setMoreToolActive(toolName) {
- if (this.readingTaskState === 2) return
+ // if (this.readingTaskState === 2) return
this.setToolsPassive()
const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series
if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
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 4415e20f..1294a4c3 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
@@ -45,9 +45,8 @@
>
-->
-
-
+
@@ -69,10 +68,9 @@
-
-
+
+
@@ -855,7 +853,7 @@ export default {
// 激活标注工具
setAnnotateToolActive(toolName) {
// if (this.readingTaskState === 2) return
- if (this.readingTaskState === 2 && toolName === 'Lengthscale') return
+ if (this.readingTaskState === 2 && toolName === 'Lengthscale') return
const i = this.viewportInfos.findIndex(i => i.index === this.activeCanvasIndex)
if (i === -1) return
if (this.viewportInfos[i].taskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
@@ -922,25 +920,41 @@ export default {
)
},
async annotationRemovedListener(e) {
- if (this.readingTaskState === 2) return
const { annotation } = e.detail
- if (!annotation) return
- if (annotation.annotationId) {
- await deleteTrialFileType(annotation.annotationId)
- } else {
- cornerstoneTools.annotation.state.removeAnnotation(annotation.annotationUID)
- }
- const renderingEngine = getRenderingEngine(renderingEngineId)
- const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`)
- viewport.render()
- const i = this.viewportInfos.findIndex(i => i.index === this.activeCanvasIndex)
- const imageId = annotation.metadata.referencedImageId
- const path = imageId.split(`web:${this.OSSclientConfig.basePath}`)[1]
- const fileList = this.viewportInfos[i].fileList
- const fileIndex = fileList.findIndex(f => f.Path === path)
- if (annotation.metadata.toolName === 'Lengthscale') {
- this.$emit('setPS', { NoneDicomFileId: fileList[fileIndex].Id, Path: fileList[fileIndex].Path, PS: null })
+ try {
+ if (!annotation) return
+ if (this.readingTaskState === 2 && !annotation.annotationId) {
+ cornerstoneTools.annotation.state.removeAnnotation(annotation.annotationUID)
+ return false
+ }
+ if (this.readingTaskState === 2) {
+ const errorMsg = { message: 'annotation Not allowed to operate' }
+ throw errorMsg
+ }
+ if (annotation.annotationId) {
+ await deleteTrialFileType(annotation.annotationId)
+ } else {
+ cornerstoneTools.annotation.state.removeAnnotation(annotation.annotationUID)
+ }
+ const renderingEngine = getRenderingEngine(renderingEngineId)
+ const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`)
+ viewport.render()
+ const i = this.viewportInfos.findIndex(i => i.index === this.activeCanvasIndex)
+ const imageId = annotation.metadata.referencedImageId
+ const path = imageId.split(`web:${this.OSSclientConfig.basePath}`)[1]
+ const fileList = this.viewportInfos[i].fileList
+ const fileIndex = fileList.findIndex(f => f.Path === path)
+ if (annotation.metadata.toolName === 'Lengthscale') {
+ this.$emit('setPS', { NoneDicomFileId: fileList[fileIndex].Id, Path: fileList[fileIndex].Path, PS: null })
+ }
+ } catch (e) {
+ cornerstoneTools.annotation.state.addAnnotation(annotation)
+ const renderingEngine = getRenderingEngine(renderingEngineId)
+ const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`)
+ viewport.render()
+ console.log(e)
}
+
},
async annotationModifiedListener(e) {
console.log('Modified')