已阅片后阅片页面可添加临时标记
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-08-04 14:51:34 +08:00
parent 9cc1962b3b
commit 509f8f02b6
2 changed files with 69 additions and 36 deletions

View File

@ -280,11 +280,11 @@
>
<svg-icon icon-class="refresh" class="svg-icon" />
</div>
<!-- 更多 -->
<!-- 更多 :class="['tool-item', readingTaskState === 2 ? 'tool-disabled' : '']" -->
<div
v-if="criterionType === 0"
:title="$t('trials:reading:button:more')"
:class="['tool-item', readingTaskState === 2 ? 'tool-disabled' : '']"
:class="['tool-item']"
@click.stop="showPanel($event)"
@mouseleave="toolMouseout"
>
@ -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) {

View File

@ -45,9 +45,8 @@
>
<svg-icon icon-class="polygon" class="svg-icon" />
</div> -->
<div
:class="['tool-item', readingTaskState === 2 ? 'tool-disabled' : '', activeTool === 'Eraser' ? 'tool-item-active' : '']"
<!--readingTaskState === 2 ? 'tool-disabled' : '',-->
<div :class="['tool-item', activeTool === 'Eraser' ? 'tool-item-active' : '']"
:title="$t('trials:dicom-show:Eraser')" @click.prevent="setAnnotateToolActive('Eraser')">
<svg-icon icon-class="clear" class="svg-icon" />
</div>
@ -69,10 +68,9 @@
<div class="tool-item" :title="$t('trials:reading:button:reset')" @click.prevent="resetViewport">
<svg-icon icon-class="refresh" class="svg-icon" />
</div>
<!-- 更多 -->
<div v-if="criterionType === 0" :title="$t('trials:reading:button:more')"
:class="['tool-item', readingTaskState === 2 ? 'tool-disabled' : '']" @click.stop="showPanel($event)"
@mouseleave="toolMouseout">
<!-- 更多:class="['tool-item', readingTaskState === 2 ? 'tool-disabled' : '']" -->
<div v-if="criterionType === 0" :title="$t('trials:reading:button:more')" :class="['tool-item']"
@click.stop="showPanel($event)" @mouseleave="toolMouseout">
<div class="dropdown">
<div class="icon" data-tool="more">
<svg-icon icon-class="more" class="svg-icon" />
@ -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')