自定义阅片更改
continuous-integration/drone/push Build is passing Details

main
caiyiling 2025-05-29 17:04:00 +08:00
parent 43a221de00
commit f1b816fd85
3 changed files with 67 additions and 17 deletions

View File

@ -595,7 +595,7 @@ const { createCameraPositionSynchronizer, createVOISynchronizer } = synchronizer
const newStyles = { const newStyles = {
global: { global: {
color: 'rgb(255, 0, 0)', color: 'rgb(255, 0, 0)',
colorHighlighted: 'rgb(255, 0, 0)', colorHighlighted: 'rgb(0, 255, 0)',
colorSelected: 'rgb(255, 0, 0)', colorSelected: 'rgb(255, 0, 0)',
colorLocked: 'rgb(255, 0, 0)', colorLocked: 'rgb(255, 0, 0)',
lineWidth: '1', lineWidth: '1',
@ -605,7 +605,7 @@ const newStyles = {
textBoxFontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif', textBoxFontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif',
textBoxFontSize: '14px', textBoxFontSize: '14px',
textBoxColor: 'rgb(255, 0, 0)', textBoxColor: 'rgb(255, 0, 0)',
textBoxColorHighlighted: 'rgb(255, 0, 0)', textBoxColorHighlighted: 'rgb(0, 255, 0)',
textBoxColorSelected: 'rgb(255, 0, 0)', textBoxColorSelected: 'rgb(255, 0, 0)',
textBoxColorLocked: 'rgb(255, 0, 0)', textBoxColorLocked: 'rgb(255, 0, 0)',
textBoxBackground: '', textBoxBackground: '',
@ -1328,6 +1328,11 @@ export default {
toolsEvents.ANNOTATION_REMOVED, toolsEvents.ANNOTATION_REMOVED,
this.criterionType === 0 ? this.customAnnotationRemovedListener : this.annotationRemovedListener this.criterionType === 0 ? this.customAnnotationRemovedListener : this.annotationRemovedListener
) )
eventTarget.addEventListener(
toolsEvents.ANNOTATION_SELECTION_CHANGE,
this.criterionType === 0 ? this.customAnnotationSelectionChangeListener : this.annotationSelectionChangeListener
)
// eventTarget.addEventListener( // eventTarget.addEventListener(
// toolsEvents.ANNOTATION_ADDED, // toolsEvents.ANNOTATION_ADDED,
// this.annotationAddedListener // this.annotationAddedListener
@ -1427,8 +1432,9 @@ export default {
annotation.data.text = markName annotation.data.text = markName
} }
this.saveCustomAnnotation(annotation) this.saveCustomAnnotation(annotation)
this.$refs[`ecrf_${series.TaskInfo.VisitTaskId}`][0].bindAnnotationToQuestion(annotation)
} }
this.$refs[`ecrf_${series.TaskInfo.VisitTaskId}`][0].bindAnnotationToQuestion(annotation)
} }
this.setToolsPassive() this.setToolsPassive()
@ -1485,6 +1491,14 @@ export default {
// //
return 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 (annotation.visitTaskId === this.taskInfo.VisitTaskId && annotation.seriesId) {
if (this.activeTool === 'Eraser') { if (this.activeTool === 'Eraser') {
await this.$confirm( await this.$confirm(
@ -1529,6 +1543,20 @@ export default {
viewport.render() 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) { async getAnnotations(visitTaskId) {
if (this.readingTaskState === 2) return if (this.readingTaskState === 2) return
const taskIdx = this.visitTaskList.findIndex(i => i.VisitTaskId === visitTaskId) const taskIdx = this.visitTaskList.findIndex(i => i.VisitTaskId === visitTaskId)

View File

@ -241,43 +241,43 @@
</template> </template>
</el-input> </el-input>
<!-- 标记 --> <!-- 标记 -->
<!-- <el-button <el-button
v-if="readingTaskState < 2 && !questionsMarkStatus[question.Id]" v-if="readingTaskState < 2 && !questionsMarkStatus[question.Id]"
size="mini" size="mini"
type="text" type="text"
@click="operateImageMarker({operateStateEnum: 1, question})" @click="operateImageMarker({operateStateEnum: 1, question})"
> >
标记 标记
</el-button> --> </el-button>
<!-- 查看 --> <!-- 查看 -->
<!-- <el-button <el-button
v-if="questionsMarkStatus[question.Id]" v-if="questionsMarkStatus[question.Id]"
size="mini" size="mini"
type="text" type="text"
@click="operateImageMarker({operateStateEnum: 2, question})" @click="operateImageMarker({operateStateEnum: 2, question})"
> >
查看 查看
</el-button> --> </el-button>
<!-- 更改 --> <!-- 更改 -->
<!-- <el-button <el-button
v-if="readingTaskState < 2 && questionsMarkStatus[question.Id]" v-if="readingTaskState < 2 && questionsMarkStatus[question.Id]"
size="mini" size="mini"
type="text" type="text"
@click="operateImageMarker({operateStateEnum: 3, question})" @click="operateImageMarker({operateStateEnum: 3, question})"
> >
更改 更改
</el-button> --> </el-button>
<!-- 移除 --> <!-- 移除 -->
<!-- <el-button <el-button
v-if="readingTaskState < 2 && questionsMarkStatus[question.Id]" v-if="readingTaskState < 2 && questionsMarkStatus[question.Id]"
size="mini" size="mini"
type="text" type="text"
@click="operateImageMarker({operateStateEnum: 4, question})" @click="operateImageMarker({operateStateEnum: 4, question})"
> >
移除 移除
</el-button> --> </el-button>
<!-- 保存 --> <!-- 保存 -->
<!-- <el-button <el-button
v-if="readingTaskState < 2 && questionsMarkStatus[question.Id]" v-if="readingTaskState < 2 && questionsMarkStatus[question.Id]"
size="mini" size="mini"
type="text" type="text"
@ -287,7 +287,7 @@
<i class="el-icon-warning" style="color:red" /> <i class="el-icon-warning" style="color:red" />
</el-tooltip> </el-tooltip>
保存 保存
</el-button> --> </el-button>
</div> </div>
</template> </template>
<template v-else-if="question.Type === 'number'"> <template v-else-if="question.Type === 'number'">

View File

@ -347,6 +347,10 @@ export default {
} }
}) })
}, },
verifyAnnotationIsBound(annotation) {
let i = this.questionMarkInfoList.findIndex(i=>i.MeasureData && i.MeasureData.annotationUID === annotation.annotationUID)
return i > -1
},
async operateImageMarker(obj) { async operateImageMarker(obj) {
this.operateStateEnum = obj.operateStateEnum this.operateStateEnum = obj.operateStateEnum
this.operateQuestionId = obj.question.Id this.operateQuestionId = obj.question.Id
@ -363,7 +367,7 @@ export default {
} else if (obj.operateStateEnum === 3) { } else if (obj.operateStateEnum === 3) {
// //
this.$set(this.questionsMarkStatus, obj.question.Id, 1) // this.$set(this.questionsMarkStatus, obj.question.Id, 1)
} else if (obj.operateStateEnum === 4) { } else if (obj.operateStateEnum === 4) {
// //
this.$set(this.questionForm, obj.question.Id, '') this.$set(this.questionForm, obj.question.Id, '')
@ -402,9 +406,24 @@ export default {
} }
}, },
bindAnnotationToQuestion(annotation) { async bindAnnotationToQuestion(annotation) {
console.log('bindAnnotationToQuestion', annotation) try {
if (this.operateStateEnum === 1 && this.operateQuestionId) { if (!(this.operateStateEnum === 1 || this.operateStateEnum === 3)) return
if (!this.operateQuestionId) return
if (this.operateStateEnum === 3) {
if (!annotation.data.label) {
this.$alert('该标记不能与问题绑定!')
return
}
const confirm = await this.$confirm('是否确认更改?', {
type: 'warning',
distinguishCancelAndClose: true
})
if (confirm !== 'confirm') return
}
console.log('bindAnnotationToQuestion', annotation)
let i = this.questionMarkInfoList.findIndex(i=>i.QuestionId === this.operateQuestionId) let i = this.questionMarkInfoList.findIndex(i=>i.QuestionId === this.operateQuestionId)
if (i === -1) { if (i === -1) {
let markInfo = { let markInfo = {
@ -429,6 +448,9 @@ export default {
} }
this.setAnswerToQuestion(annotation, this.operateQuestionId) this.setAnswerToQuestion(annotation, this.operateQuestionId)
this.$set(this.questionsMarkStatus, this.operateQuestionId, 1) this.$set(this.questionsMarkStatus, this.operateQuestionId, 1)
} catch (e) {
console.log(e)
} }
}, },
updateAnnotationToQuestion(annotation) { updateAnnotationToQuestion(annotation) {