任务切换或者单个病灶保存时前端缓存当前状态不刷新ecrf
continuous-integration/drone/push Build is passing Details

uat
caiyiling 2025-04-17 17:36:35 +08:00
parent 600abc3ce1
commit 11471525af
3 changed files with 113 additions and 61 deletions

View File

@ -318,20 +318,28 @@
</div>
<!-- 表单 -->
<div class="right-panel">
<mRecisit
v-if="lastViewportTaskId && citerionType === 7"
ref="ecrf"
:reading-task-state="currentVisitInfo.VisitTaskId === taskInfo.VisitTaskId ? readingTaskState : 2"
:last-viewport-task-id="lastViewportTaskId"
:visit-info="currentVisitInfo"
@removeAnnotation="removeAnnotation"
@getScreenshots="getScreenshots"
@setMarkName="setMarkName"
@imageLocation="imageLocation"
@resetAnnotations="resetAnnotations"
@getAnnotations="getAnnotations"
@setToolToTarget="setToolToTarget"
/>
<div
v-for="s in visitTaskList"
v-show="lastViewportTaskId === s.VisitTaskId"
:key="s.VisitTaskId"
style="height:100%;"
>
<mRecisit
v-if="lastViewportTaskId && citerionType === 7 && lastViewportTaskIds.includes(s.VisitTaskId)"
:ref="`ecrf_${s.VisitTaskId}`"
:reading-task-state="currentVisitInfo.VisitTaskId === taskInfo.VisitTaskId ? readingTaskState : 2"
:last-viewport-task-id="lastViewportTaskId"
:visit-info="s"
@removeAnnotation="removeAnnotation"
@getScreenshots="getScreenshots"
@setMarkName="setMarkName"
@imageLocation="imageLocation"
@resetAnnotations="resetAnnotations"
@getAnnotations="getAnnotations"
@setToolToTarget="setToolToTarget"
/>
</div>
</div>
<!-- 自定义调窗 -->
<el-dialog
@ -564,7 +572,8 @@ export default {
cdVisitTaskId: '',
lastViewportTaskId: '',
digitPlaces: 2,
instanceInfo: {}
instanceInfo: {},
lastViewportTaskIds: []
}
},
computed: {
@ -618,17 +627,33 @@ export default {
immediate: true,
handler(id) {
if (!id) return
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()
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) {

View File

@ -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()
},

View File

@ -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()