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 117d0ddd..87ab7a31 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -318,20 +318,28 @@
- +
+ +
+
i.VisitTaskId === this.taskInfo.VisitTaskId) - const annotationUIDs = this.visitTaskList[taskIdx].AnnotationUIDs - const annotations = cornerstoneTools.annotation.state.getAllAnnotations() - annotations.forEach(i => { - if (!(annotationUIDs.includes(i.annotationUID)) && i.visitTaskId === this.taskInfo.VisitTaskId) { - cornerstoneTools.annotation.state.removeAnnotation(i.annotationUID) - } - }) + if (!this.lastViewportTaskIds.includes(id)) { + this.lastViewportTaskIds.push(id) } + // if (this.readingTaskState === 2) return + // if (id !== this.taskInfo.VisitTaskId) { + // const taskIdx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.taskInfo.VisitTaskId) + // // const annotationUIDs = this.visitTaskList[taskIdx].AnnotationUIDs + // const annotations = cornerstoneTools.annotation.state.getAllAnnotations() + // // const annotations = this.visitTaskList[taskIdx].Annotations + // annotations.forEach(i => { + // if (i.visitTaskId === this.taskInfo.VisitTaskId) { + // cornerstoneTools.annotation.state.removeAnnotation(i.annotationUID) + // let idx = this.visitTaskList[taskIdx].Annotations.findIndex(v=>v.MeasureData && v.MeasureData.annotationUID === i.annotationUID) + // console.log('123',idx) + // if (idx > -1) { + // cornerstoneTools.annotation.state.addAnnotation(this.visitTaskList[taskIdx].Annotations[idx].MeasureData) + // } + + // } + // }) + // // const annotations = cornerstoneTools.annotation.state.getAllAnnotations() + // // annotations.forEach(i => { + // // if (!(annotationUIDs.includes(i.annotationUID)) && i.visitTaskId === this.taskInfo.VisitTaskId) { + // // cornerstoneTools.annotation.state.removeAnnotation(i.annotationUID) + // // } + // // }) + // } } } }, @@ -763,10 +788,10 @@ export default { keyImages.forEach(instance => { if (instance.KeyFramesList.length > 0) { instance.KeyFramesList.map(i => { - keyImageIds.push(`wadouri:${this.OSSclientConfig.basePath}${instance.Path}?frame=${i}&instanceId=${instance.Id}&visitTaskId=${taskId}`) + keyImageIds.push(`wadouri:${this.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}&visitTaskId=${taskId}&frame=${i}`) }) } else { - keyImageIds.push(`wadouri:${this.OSSclientConfig.basePath}${instance.Path}?frame=0&instanceId=${instance.Id}&visitTaskId=${taskId}`) + keyImageIds.push(`wadouri:${this.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}&visitTaskId=${taskId}`) } }) res1.Result[keyStudyIndex].SeriesList[keySeriesIndex].ImageIds = keyImageIds @@ -1105,7 +1130,9 @@ export default { annotation.sliceThickness = series.SliceThickness annotation.numberOfFrames = isNaN(parseInt(params.frame)) ? null : parseInt(params.frame) annotation.markTool = annotation.metadata.toolName - this.$refs['ecrf'].setAnnotation({ annotation, toolName: annotation.metadata.toolName }) + // this.$refs['ecrf'].setAnnotation({ annotation, toolName: annotation.metadata.toolName }) + this.$refs[`ecrf_${this.lastViewportTaskId}`][0].setAnnotation({ annotation, toolName: annotation.metadata.toolName }) + } this.setToolsPassive() }, @@ -1117,7 +1144,8 @@ export default { if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return const series = this.$refs[`viewport-${this.activeViewportIndex}`][0].series if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) { - this.$refs['ecrf'].modifyAnnotation({ annotation, toolName: annotation.metadata.toolName }) + // this.$refs['ecrf'].modifyAnnotation({ annotation, toolName: annotation.metadata.toolName }) + this.$refs[`ecrf_${this.lastViewportTaskId}`][0].modifyAnnotation({ annotation, toolName: annotation.metadata.toolName }) } this.setToolsPassive() }, @@ -1164,7 +1192,7 @@ export default { } return i }) - this.$set(this.visitTaskList[taskIdx], 'annotations', annotations) + this.$set(this.visitTaskList[taskIdx], 'Annotations', annotations) // 移除病灶 const arr = cornerstoneTools.annotation.state.getAllAnnotations() arr.map(i => { @@ -1371,7 +1399,8 @@ export default { this.setToolEnabled() } } else { - const obj = this.$refs['ecrf'].validTool(toolName, true) + // const obj = this.$refs['ecrf'].validTool(toolName, true) + const obj = this.$refs[`ecrf_${this.lastViewportTaskId}`][0].validTool(toolName, true) this.tools[i].disabledReason = obj.reason if (!obj.isCanActiveTool) { if (this.activeTool === toolName) { diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/Recist/QuestionList.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/Recist/QuestionList.vue index c6accb1b..c807af9e 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/Recist/QuestionList.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/Recist/QuestionList.vue @@ -257,27 +257,30 @@ export default { ...mapGetters(['language']) }, watch: { - lastViewportTaskId: { - immediate: true, - handler(id) { - if (!id) return - this.visitTaskId = id - this.$nextTick(() => { - this.activeName = '' - this.getOuterQuestions() - this.getTableQuestions() - }) - } - } + // lastViewportTaskId: { + // immediate: true, + // handler(id) { + // if (!id) return + // this.visitTaskId = id + // this.$nextTick(() => { + // this.activeName = '' + // this.getOuterQuestions() + // this.getTableQuestions() + // }) + // } + // } }, mounted() { this.trialId = this.$route.query.trialId + this.visitTaskId = this.visitInfo.VisitTaskId this.taskInfo = JSON.parse(localStorage.getItem('taskInfo')) this.isBaseLineTask = this.taskInfo.IsBaseLine this.criterionType = this.taskInfo.CriterionType const digitPlaces = Number(localStorage.getItem('digitPlaces')) this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces this.getOrganList() + this.getOuterQuestions() + this.getTableQuestions() }, methods: { // 获取器官信息 @@ -654,7 +657,11 @@ export default { } ) } - this.innerFormData[`${tableInfo.Id}_${answer.RowIndex}`] = answer + this.$set(this.innerFormData, `${tableInfo.Id}_${answer.RowIndex}`, {}) + for (const key in answer) { + this.$set(this.innerFormData[`${tableInfo.Id}_${answer.RowIndex}`], key, answer[key]) + } + // this.innerFormData[`${tableInfo.Id}_${answer.RowIndex}`] = answer this.activeName = `${tableInfo.Id}_${answer.RowIndex}` }, // 创建靶病灶 @@ -1247,8 +1254,12 @@ export default { if (res.IsSuccess) { // 保存成功! this.$message.success(this.$t('common:message:savedSuccessfully')) - this.getTableQuestions() - this.$emit('getAnnotations', this.visitTaskId) + // this.getTableQuestions() + // this.$emit('getAnnotations', this.visitTaskId) + if (!this.innerFormData[`${table.Id}_${rowIndex}`].RowId) { + this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], 'RowId', res.Result.RowId) + } + this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], 'SaveTypeEnum', 2) } loading.close() }, diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/mRecist/QuestionList.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/mRecist/QuestionList.vue index 39fdcba9..967f02f9 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/mRecist/QuestionList.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/mRecist/QuestionList.vue @@ -257,27 +257,30 @@ export default { ...mapGetters(['language']) }, watch: { - lastViewportTaskId: { - immediate: true, - handler(id) { - if (!id) return - this.visitTaskId = id - this.$nextTick(() => { - this.activeName = '' - this.getOuterQuestions() - this.getTableQuestions() - }) - } - } + // lastViewportTaskId: { + // immediate: true, + // handler(id) { + // if (!id) return + // this.visitTaskId = id + // this.$nextTick(() => { + // this.activeName = '' + // this.getOuterQuestions() + // this.getTableQuestions() + // }) + // } + // } }, mounted() { this.trialId = this.$route.query.trialId + this.visitTaskId = this.visitInfo.VisitTaskId this.taskInfo = JSON.parse(localStorage.getItem('taskInfo')) this.isBaseLineTask = this.taskInfo.IsBaseLine this.criterionType = this.taskInfo.CriterionType const digitPlaces = Number(localStorage.getItem('digitPlaces')) this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces this.getOrganList() + this.getOuterQuestions() + this.getTableQuestions() }, methods: { // 获取器官信息 @@ -669,7 +672,11 @@ export default { } ) } - this.innerFormData[`${tableInfo.Id}_${answer.RowIndex}`] = answer + this.$set(this.innerFormData, `${tableInfo.Id}_${answer.RowIndex}`, {}) + for (const key in answer) { + this.$set(this.innerFormData[`${tableInfo.Id}_${answer.RowIndex}`], key, answer[key]) + } + // this.innerFormData[`${tableInfo.Id}_${answer.RowIndex}`] = answer this.activeName = `${tableInfo.Id}_${answer.RowIndex}` }, // 创建靶病灶 @@ -1295,8 +1302,13 @@ export default { if (res.IsSuccess) { // 保存成功! this.$message.success(this.$t('common:message:savedSuccessfully')) - this.getTableQuestions() - this.$emit('getAnnotations', this.visitTaskId) + // this.getTableQuestions() + // this.$emit('getAnnotations', this.visitTaskId) + if (!this.innerFormData[`${table.Id}_${rowIndex}`].RowId) { + this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], 'RowId', res.Result.RowId) + } + this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], 'SaveTypeEnum', 2) + this.activeName = '' } loading.close()