From f1b816fd85433ba0d5127daab9dbb2566ce13d82 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Thu, 29 May 2025 17:04:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=98=85=E7=89=87?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reading/dicoms3D/components/ReadPage.vue | 34 +++++++++++++++++-- .../components/customize/QuestionFormItem.vue | 20 +++++------ .../components/customize/QuestionList.vue | 30 +++++++++++++--- 3 files changed, 67 insertions(+), 17 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 5c8cbd8b..78b24879 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -595,7 +595,7 @@ const { createCameraPositionSynchronizer, createVOISynchronizer } = synchronizer const newStyles = { global: { color: 'rgb(255, 0, 0)', - colorHighlighted: 'rgb(255, 0, 0)', + colorHighlighted: 'rgb(0, 255, 0)', colorSelected: 'rgb(255, 0, 0)', colorLocked: 'rgb(255, 0, 0)', lineWidth: '1', @@ -605,7 +605,7 @@ const newStyles = { textBoxFontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif', textBoxFontSize: '14px', textBoxColor: 'rgb(255, 0, 0)', - textBoxColorHighlighted: 'rgb(255, 0, 0)', + textBoxColorHighlighted: 'rgb(0, 255, 0)', textBoxColorSelected: 'rgb(255, 0, 0)', textBoxColorLocked: 'rgb(255, 0, 0)', textBoxBackground: '', @@ -1328,6 +1328,11 @@ export default { toolsEvents.ANNOTATION_REMOVED, this.criterionType === 0 ? this.customAnnotationRemovedListener : this.annotationRemovedListener ) + eventTarget.addEventListener( + toolsEvents.ANNOTATION_SELECTION_CHANGE, + this.criterionType === 0 ? this.customAnnotationSelectionChangeListener : this.annotationSelectionChangeListener + ) + // eventTarget.addEventListener( // toolsEvents.ANNOTATION_ADDED, // this.annotationAddedListener @@ -1427,8 +1432,9 @@ export default { annotation.data.text = markName } this.saveCustomAnnotation(annotation) + this.$refs[`ecrf_${series.TaskInfo.VisitTaskId}`][0].bindAnnotationToQuestion(annotation) } - this.$refs[`ecrf_${series.TaskInfo.VisitTaskId}`][0].bindAnnotationToQuestion(annotation) + } this.setToolsPassive() @@ -1485,6 +1491,14 @@ export default { // 临时标记 return } + if (annotation.visitTaskId === this.taskInfo.VisitTaskId) { + let isBound = this.$refs[`ecrf_${annotation.visitTaskId}`][0].verifyAnnotationIsBound(annotation) + if (isBound) { + this.$alert('该标记已与问题进行绑定,不允许删除!') + throw 'annotation Not allowed to operate' + } + } + if (annotation.visitTaskId === this.taskInfo.VisitTaskId && annotation.seriesId) { if (this.activeTool === 'Eraser') { await this.$confirm( @@ -1529,6 +1543,20 @@ export default { viewport.render() } }, + customAnnotationSelectionChangeListener(e) { + if (this.readingTaskState === 2) return + const {detail} = e + const annotations = cornerstoneTools.annotation.state.getAllAnnotations() + const i = annotations.findIndex(i => i.annotationUID === detail.selection[0]) + if (i > -1) { + if (annotations[i].visitTaskId !== this.taskInfo.VisitTaskId) { + return + } else { + this.$refs[`ecrf_${this.taskInfo.VisitTaskId}`][0].bindAnnotationToQuestion(annotations[i]) + } + } + }, + annotationSelectionChangeListener(e) {}, async getAnnotations(visitTaskId) { if (this.readingTaskState === 2) return const taskIdx = this.visitTaskList.findIndex(i => i.VisitTaskId === visitTaskId) diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue index 22c6e7b1..b6b2805d 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue @@ -241,43 +241,43 @@ - + - + - + - + - +