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..2508f272 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -132,7 +132,7 @@
@@ -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) + // // } + // // }) + // } } } }, @@ -741,14 +766,14 @@ export default { } else { // 多帧 for (let i = 0; i < nFrames; i++) { - const newImageId = `wadouri:${this.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}&visitTaskId=${taskId}&frame=${i + 1}`; - imageIds.push(newImageId); + const newImageId = `wadouri:${this.OSSclientConfig.basePath}${instance.Path}?instanceId=${instance.Id}&visitTaskId=${taskId}&frame=${i + 1}` + imageIds.push(newImageId) } } this.instanceInfo[instance.Id] = { taskIndex, studyIndex, seriesIndex } } }) - + series.ImageIds = imageIds series.SliceIndex = 0 series.LoadedImageCount = 0 @@ -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 @@ -1012,7 +1037,7 @@ export default { ++loadedImageCount this.$set(series, 'LoadedImageCount', loadedImageCount) } - let newLoadedImageProgress = series.LoadedImageProgress - this.instanceInfo[instanceId].percentComplete + percentComplete + const newLoadedImageProgress = series.LoadedImageProgress - this.instanceInfo[instanceId].percentComplete + percentComplete this.instanceInfo[instanceId].percentComplete = percentComplete this.$set(series, 'LoadedImageProgress', newLoadedImageProgress) }, @@ -1048,7 +1073,6 @@ export default { } } }) - }, addAnnotationListeners() { console.log(toolsEvents) @@ -1077,7 +1101,6 @@ export default { // toolsEvents.TOOL_MODE_CHANGED, // this.toolModeChanged // ) - }, toolModeChanged(e) { console.log(e) @@ -1105,7 +1128,8 @@ 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 +1141,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 +1189,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 => { @@ -1188,7 +1213,7 @@ export default { } else { annotations[idx].data.label = obj.name } - + const renderingEngine = getRenderingEngine(renderingEngineId) const viewportId = `viewport-${this.activeViewportIndex}` const viewport = renderingEngine.getViewport(viewportId) @@ -1371,7 +1396,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) { @@ -1424,6 +1450,8 @@ export default { const viewport = renderingEngine.getViewport(viewportId) this.$refs[`viewport-${this.activeViewportIndex}`][0].resetOrientationMarkers() viewport.resetCamera({ resetPan: true, resetZoom: true, resetToCenter: true }) + viewport.resetProperties() + viewport.render() renderingEngine.render() }, // 更改视图布局 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..9b54d8e3 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: { // 获取器官信息 @@ -482,22 +485,24 @@ export default { ) if (typeof targetTable !== 'object') return this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'MeasureData', annotation) + let length = null + let short = null if (obj.toolName === 'Length') { const referencedImageId = annotation.metadata.referencedImageId - let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length + length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length length = length ? parseFloat(length).toFixed(this.digitPlaces) : length const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length) } else if (obj.toolName === 'Bidirectional') { const referencedImageId = annotation.metadata.referencedImageId - let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length + length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length length = length ? parseFloat(length).toFixed(this.digitPlaces) : length const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length) - let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width + short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width short = short ? parseFloat(short).toFixed(this.digitPlaces) : short const shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionShort', short) @@ -510,6 +515,24 @@ export default { this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) } + if (!(innerForm.IsCurrentTaskAdd === 'True')) { + // 非基线时,非淋巴结病灶长径>=10mm,自动给“存在”状态,如果淋巴结病灶短径>=10mm,自动给“存在”状态。 + if (!this.isBaseLineTask && ((obj.toolName === 'Length' && length >= 10) || (obj.toolName === 'Bidirectional' && short >= 10))) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) + } + // 非基线时,非淋巴结病灶长径<10mm,自动给“存在”状态,如果淋巴结病灶短径<10mm,自动给“消失”状态。 + if (!this.isBaseLineTask && ((obj.toolName === 'Length' && length < 10) || (obj.toolName === 'Bidirectional' && short < 10))) { + const stateId = this.getQuestionId(7) + if (innerForm.IsLymphNodes) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 3) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 3) + } else if (innerForm.IsLymphNodes === 0) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) + } + } + } this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'SaveTypeEnum', innerForm.RowId ? 1 : 0) this.$emit('setMarkName', { annotationUID: annotation.annotationUID, @@ -546,22 +569,24 @@ export default { ) if (typeof targetTable !== 'object') return this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'MeasureData', annotation) + let length = null + let short = null if (toolName === 'Length') { const referencedImageId = annotation.metadata.referencedImageId - let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length + length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length length = length ? parseFloat(length).toFixed(this.digitPlaces) : length const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length) } else if (toolName === 'Bidirectional') { const referencedImageId = annotation.metadata.referencedImageId - let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length + length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length length = length ? parseFloat(length).toFixed(this.digitPlaces) : length const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length) - let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width + short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width short = short ? parseFloat(short).toFixed(this.digitPlaces) : short const shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionShort', short) @@ -574,6 +599,26 @@ export default { this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) } + const isCurrentTaskAdd = this.innerFormData[`${tableId}_${rowIndex}`].IsCurrentTaskAdd + const isLymphNodes = this.innerFormData[`${tableId}_${rowIndex}`].IsLymphNodes + if (!(isCurrentTaskAdd === 'True')) { + // 非基线时,非淋巴结病灶长径>=10mm,自动给“存在”状态,如果淋巴结病灶短径>=10mm,自动给“存在”状态。 + if (!this.isBaseLineTask && ((toolName === 'Length' && length >= 10) || (toolName === 'Bidirectional' && short >= 10))) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) + } + // 非基线时,非淋巴结病灶长径<10mm,自动给“存在”状态,如果淋巴结病灶短径<10mm,自动给“消失”状态。 + if (!this.isBaseLineTask && ((toolName === 'Length' && length < 10) || (toolName === 'Bidirectional' && short < 10))) { + const stateId = this.getQuestionId(7) + if (isLymphNodes) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 3) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 3) + } else if (isLymphNodes === 0) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) + } + } + } this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'SaveTypeEnum', formData.RowId ? 1 : 0) this.activeName = `${tableId}_${rowIndex}` }, @@ -654,7 +699,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}` }, // 创建靶病灶 @@ -774,7 +823,7 @@ export default { let lesionShort = innerForm.LesionShort const lymphNodes = innerForm.IsLymphNodes const lesionType = table.LesionType - const lesionPart = innerForm.LesionPart + // const lesionPart = innerForm.LesionPart if (this.isBaseLineTask) { // 基线 // 靶病灶且状态为存在(0) @@ -1247,8 +1296,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/ReportPage.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/ReportPage.vue index 14ced706..6b87086b 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReportPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReportPage.vue @@ -275,7 +275,7 @@ import { getAutoCutNextTask } from '@/api/user' import const_ from '@/const/sign-code' import SignForm from '@/views/trials/components/newSignForm' import { getToken } from '@/utils/auth' -import store from '@/store' +// import store from '@/store' import { mapGetters } from 'vuex' import { changeURLStatic } from '@/utils/history.js' import AdditionalAssessment from '@/views/trials/trials-panel/reading/dicoms/components/AdditionalAssessment' @@ -422,7 +422,6 @@ export default { } else { this.expandedRows.push(item.Id) } - } else { this.expandedRows.push(item.Id) } @@ -518,10 +517,10 @@ export default { var liverSegmentIdx = item.Childrens.findIndex(i => i.QuestionMark === 1106) if (liverSegmentIdx > -1) { if (item.Childrens[liverSegmentIdx].Answer.length > 0) { - let v = item.Childrens[liverSegmentIdx].Answer[0].Answer + const v = item.Childrens[liverSegmentIdx].Answer[0].Answer obj.QuestionName = this.$fd(item.Childrens[liverSegmentIdx].DictionaryCode, parseInt(v)) - let Answers = {} - let mean = item.Childrens.findIndex(i => i.QuestionMark === 1104) + const Answers = {} + const mean = item.Childrens.findIndex(i => i.QuestionMark === 1104) if (mean > -1) { this.visitTaskList.forEach(v => { const o = item.Childrens[mean].Answer.find(v1 => { 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..4852a2e6 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: { // 获取器官信息 @@ -487,22 +490,24 @@ export default { ) if (typeof targetTable !== 'object') return this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'MeasureData', annotation) + let length = null + let short = null if (obj.toolName === 'Length') { const referencedImageId = annotation.metadata.referencedImageId - let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length + length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length length = length ? parseFloat(length).toFixed(this.digitPlaces) : length const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length) } else if (obj.toolName === 'Bidirectional') { const referencedImageId = annotation.metadata.referencedImageId - let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length + length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length length = length ? parseFloat(length).toFixed(this.digitPlaces) : length const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length) - let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width + short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width short = short ? parseFloat(short).toFixed(this.digitPlaces) : short const shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionShort', short) @@ -520,6 +525,25 @@ export default { this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) } + + if (!(innerForm.IsCurrentTaskAdd === 'True')) { + // 非基线时,非淋巴结病灶长径>=10mm,自动给“存在”状态,如果淋巴结病灶短径>=10mm,自动给“存在”状态。 + if (!this.isBaseLineTask && ((obj.toolName === 'Length' && length >= 10) || (obj.toolName === 'Bidirectional' && short >= 10))) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) + } + // 非基线时,非淋巴结病灶长径<10mm,自动给“存在”状态,如果淋巴结病灶短径<10mm,自动给“消失”状态。 + if (!this.isBaseLineTask && ((obj.toolName === 'Length' && length < 10) || (obj.toolName === 'Bidirectional' && short < 10))) { + const stateId = this.getQuestionId(7) + if (innerForm.IsLymphNodes) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 3) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 3) + } else if (innerForm.IsLymphNodes === 0) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) + } + } + } this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'SaveTypeEnum', innerForm.RowId ? 1 : 0) this.$emit('setMarkName', { annotationUID: annotation.annotationUID, @@ -557,22 +581,24 @@ export default { ) if (typeof targetTable !== 'object') return this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'MeasureData', annotation) + let length = null + let short = null if (toolName === 'Length') { const referencedImageId = annotation.metadata.referencedImageId - let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length + length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length length = length ? parseFloat(length).toFixed(this.digitPlaces) : length const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length) } else if (toolName === 'Bidirectional') { const referencedImageId = annotation.metadata.referencedImageId - let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length + length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length length = length ? parseFloat(length).toFixed(this.digitPlaces) : length const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length) - let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width + short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width short = short ? parseFloat(short).toFixed(this.digitPlaces) : short const shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionShort', short) @@ -589,6 +615,26 @@ export default { this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) } + const isCurrentTaskAdd = this.innerFormData[`${tableId}_${rowIndex}`].IsCurrentTaskAdd + const isLymphNodes = this.innerFormData[`${tableId}_${rowIndex}`].IsLymphNodes + if (!(isCurrentTaskAdd === 'True')) { + // 非基线时,非淋巴结病灶长径>=10mm,自动给“存在”状态,如果淋巴结病灶短径>=10mm,自动给“存在”状态。 + if (!this.isBaseLineTask && ((toolName === 'Length' && length >= 10) || (toolName === 'Bidirectional' && short >= 10))) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) + } + // 非基线时,非淋巴结病灶长径<10mm,自动给“存在”状态,如果淋巴结病灶短径<10mm,自动给“消失”状态。 + if (!this.isBaseLineTask && ((toolName === 'Length' && length < 10) || (toolName === 'Bidirectional' && short < 10))) { + const stateId = this.getQuestionId(7) + if (isLymphNodes) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 3) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 3) + } else if (isLymphNodes === 0) { + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0) + this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0) + } + } + } this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'SaveTypeEnum', formData.RowId ? 1 : 0) this.activeName = `${tableId}_${rowIndex}` }, @@ -669,7 +715,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,12 +1345,17 @@ 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() - } catch(e) { + } catch (e) { console.log(e) loading.close() }