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 43baf5c3..329acb0b 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 @@ -1331,7 +1331,8 @@ export default { const { annotation } = e.detail if (!annotation.highlighted) return if (!annotation) return - // if (!annotation.annotationId) return + const savedAnnotationId = annotation.id || annotation.annotationId + if (!savedAnnotationId && annotation.metadata.toolName !== 'Lengthscale') return let i = this.tools.findIndex(i => i.toolName === annotation.metadata.toolName) if (i === -1 && annotation.metadata.toolName !== 'Lengthscale') { this.setToolsPassive() @@ -1447,7 +1448,7 @@ export default { this.saveCustomAnnotationTimer = null } this.saveCustomAnnotationTimer = setTimeout(() => { this.saveCustomAnnotation(annotation) }, 500) - } + } } else { // if (this.isNumber(operateStateEnum)) { // this.removeAnnotation(annotation) @@ -1482,6 +1483,7 @@ export default { try { const measureData = Object.assign({}, annotation) const params = {} + const savedAnnotationId = annotation.id || annotation.annotationId const i = this.viewportInfos.findIndex(i => i.index === this.activeCanvasIndex) this.loading = true await this.getScreenshots({ @@ -1491,7 +1493,7 @@ export default { this.loading = false const pictureObj = await this.uploadScreenshots(`${Date.now()}`, base64Str) let picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : '' - if (annotation.id) params.Id = annotation.id + if (savedAnnotationId) params.Id = savedAnnotationId if (!isNaN(parseFloat(ps))) params.Proportion = ps params.PicturePath = picturePath params.Path = annotation.path || '' @@ -1505,6 +1507,7 @@ export default { const res = await addNoneDicomMark(params) annotation.markId = params.MarkId annotation.id = res.Result + annotation.annotationId = res.Result if (!isNaN(parseFloat(ps))) this.$emit('getEcrf', { type: "changePlottingScaleChangeAnswer", VisitTaskId: this.taskInfo.VisitTaskId, noneDicomFileId: annotation.noneDicomFileId, path: annotation.path || '', picturePath, psArr: this.psArr, isRemovePlottingScale: ps < 0 ? true : false }) this.$emit('getMarkedFileIds', { type: "add", visitTaskId: this.taskInfo.VisitTaskId, fileId: annotation.noneDicomFileId }) @@ -2154,6 +2157,14 @@ export default { if (i === -1) return if (this.curOperation.type === 'Modified') { let annotation = this.curOperation.annotation + const savedAnnotationId = annotation.id || annotation.annotationId + if (!savedAnnotationId && annotation.metadata.toolName !== 'Lengthscale') { + this.curOperation = { + type: '', + annotation: null + } + return + } if (annotation.metadata.toolName === 'Lengthscale') { this.$emit('getEcrf', { type: "verifyFileIsBound", VisitTaskId: this.taskInfo.VisitTaskId, annotation }) this.$nextTick(() => { @@ -2176,6 +2187,9 @@ export default { } }) } else { + if ((annotation.metadata.toolName === 'ArrowAnnotate' && annotation.data.label === 'Annotation') || annotation.data.label === '') { + return + } this.saveCustomAnnotation(annotation) } } diff --git a/src/views/trials/trials-panel/reading/visit-review/components/ReadPage.vue b/src/views/trials/trials-panel/reading/visit-review/components/ReadPage.vue index 74d6da2e..cc82cdbc 100644 --- a/src/views/trials/trials-panel/reading/visit-review/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/visit-review/components/ReadPage.vue @@ -236,6 +236,7 @@ export default { return i }) this.$set(this.visitTaskList[taskIdx], 'Annotations', annotations) + this.$refs[visitTaskId][0].initCurrentMaredFiles() this.$refs.fileViewer.resetAnnotations({ annotations, visitTaskId }) }, setReadingTaskState(state) { diff --git a/src/views/trials/trials-panel/reading/visit-review/components/StudyList.vue b/src/views/trials/trials-panel/reading/visit-review/components/StudyList.vue index 27bc7441..98f51513 100644 --- a/src/views/trials/trials-panel/reading/visit-review/components/StudyList.vue +++ b/src/views/trials/trials-panel/reading/visit-review/components/StudyList.vue @@ -192,6 +192,7 @@ export default { } }, initCurrentMaredFiles() { + this.currentMarkedFiles = {} this.visitTaskInfo.Annotations.map(i => { if (!Object.hasOwn(this.currentMarkedFiles, i.NoneDicomFileId)) { this.$set(this.currentMarkedFiles, i.NoneDicomFileId, { count: 1 })