任务切换或者单个病灶保存时前端缓存当前状态不刷新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>
<!-- 表单 --> <!-- 表单 -->
<div class="right-panel"> <div class="right-panel">
<mRecisit <div
v-if="lastViewportTaskId && citerionType === 7" v-for="s in visitTaskList"
ref="ecrf" v-show="lastViewportTaskId === s.VisitTaskId"
:reading-task-state="currentVisitInfo.VisitTaskId === taskInfo.VisitTaskId ? readingTaskState : 2" :key="s.VisitTaskId"
:last-viewport-task-id="lastViewportTaskId" style="height:100%;"
:visit-info="currentVisitInfo" >
@removeAnnotation="removeAnnotation" <mRecisit
@getScreenshots="getScreenshots" v-if="lastViewportTaskId && citerionType === 7 && lastViewportTaskIds.includes(s.VisitTaskId)"
@setMarkName="setMarkName" :ref="`ecrf_${s.VisitTaskId}`"
@imageLocation="imageLocation" :reading-task-state="currentVisitInfo.VisitTaskId === taskInfo.VisitTaskId ? readingTaskState : 2"
@resetAnnotations="resetAnnotations" :last-viewport-task-id="lastViewportTaskId"
@getAnnotations="getAnnotations" :visit-info="s"
@setToolToTarget="setToolToTarget" @removeAnnotation="removeAnnotation"
/> @getScreenshots="getScreenshots"
@setMarkName="setMarkName"
@imageLocation="imageLocation"
@resetAnnotations="resetAnnotations"
@getAnnotations="getAnnotations"
@setToolToTarget="setToolToTarget"
/>
</div>
</div> </div>
<!-- 自定义调窗 --> <!-- 自定义调窗 -->
<el-dialog <el-dialog
@ -564,7 +572,8 @@ export default {
cdVisitTaskId: '', cdVisitTaskId: '',
lastViewportTaskId: '', lastViewportTaskId: '',
digitPlaces: 2, digitPlaces: 2,
instanceInfo: {} instanceInfo: {},
lastViewportTaskIds: []
} }
}, },
computed: { computed: {
@ -618,17 +627,33 @@ export default {
immediate: true, immediate: true,
handler(id) { handler(id) {
if (!id) return if (!id) return
if (this.readingTaskState === 2) return if (!this.lastViewportTaskIds.includes(id)) {
if (id !== this.taskInfo.VisitTaskId) { this.lastViewportTaskIds.push(id)
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.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 => { keyImages.forEach(instance => {
if (instance.KeyFramesList.length > 0) { if (instance.KeyFramesList.length > 0) {
instance.KeyFramesList.map(i => { 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 { } 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 res1.Result[keyStudyIndex].SeriesList[keySeriesIndex].ImageIds = keyImageIds
@ -1105,7 +1130,9 @@ export default {
annotation.sliceThickness = series.SliceThickness annotation.sliceThickness = series.SliceThickness
annotation.numberOfFrames = isNaN(parseInt(params.frame)) ? null : parseInt(params.frame) annotation.numberOfFrames = isNaN(parseInt(params.frame)) ? null : parseInt(params.frame)
annotation.markTool = annotation.metadata.toolName 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() this.setToolsPassive()
}, },
@ -1117,7 +1144,8 @@ export default {
if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return
const series = this.$refs[`viewport-${this.activeViewportIndex}`][0].series const series = this.$refs[`viewport-${this.activeViewportIndex}`][0].series
if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) { 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() this.setToolsPassive()
}, },
@ -1164,7 +1192,7 @@ export default {
} }
return i return i
}) })
this.$set(this.visitTaskList[taskIdx], 'annotations', annotations) this.$set(this.visitTaskList[taskIdx], 'Annotations', annotations)
// //
const arr = cornerstoneTools.annotation.state.getAllAnnotations() const arr = cornerstoneTools.annotation.state.getAllAnnotations()
arr.map(i => { arr.map(i => {
@ -1371,7 +1399,8 @@ export default {
this.setToolEnabled() this.setToolEnabled()
} }
} else { } 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 this.tools[i].disabledReason = obj.reason
if (!obj.isCanActiveTool) { if (!obj.isCanActiveTool) {
if (this.activeTool === toolName) { if (this.activeTool === toolName) {

View File

@ -257,27 +257,30 @@ export default {
...mapGetters(['language']) ...mapGetters(['language'])
}, },
watch: { watch: {
lastViewportTaskId: { // lastViewportTaskId: {
immediate: true, // immediate: true,
handler(id) { // handler(id) {
if (!id) return // if (!id) return
this.visitTaskId = id // this.visitTaskId = id
this.$nextTick(() => { // this.$nextTick(() => {
this.activeName = '' // this.activeName = ''
this.getOuterQuestions() // this.getOuterQuestions()
this.getTableQuestions() // this.getTableQuestions()
}) // })
} // }
} // }
}, },
mounted() { mounted() {
this.trialId = this.$route.query.trialId this.trialId = this.$route.query.trialId
this.visitTaskId = this.visitInfo.VisitTaskId
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo')) this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
this.isBaseLineTask = this.taskInfo.IsBaseLine this.isBaseLineTask = this.taskInfo.IsBaseLine
this.criterionType = this.taskInfo.CriterionType this.criterionType = this.taskInfo.CriterionType
const digitPlaces = Number(localStorage.getItem('digitPlaces')) const digitPlaces = Number(localStorage.getItem('digitPlaces'))
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
this.getOrganList() this.getOrganList()
this.getOuterQuestions()
this.getTableQuestions()
}, },
methods: { 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}` this.activeName = `${tableInfo.Id}_${answer.RowIndex}`
}, },
// //
@ -1247,8 +1254,12 @@ export default {
if (res.IsSuccess) { if (res.IsSuccess) {
// //
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$message.success(this.$t('common:message:savedSuccessfully'))
this.getTableQuestions() // this.getTableQuestions()
this.$emit('getAnnotations', this.visitTaskId) // 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() loading.close()
}, },

View File

@ -257,27 +257,30 @@ export default {
...mapGetters(['language']) ...mapGetters(['language'])
}, },
watch: { watch: {
lastViewportTaskId: { // lastViewportTaskId: {
immediate: true, // immediate: true,
handler(id) { // handler(id) {
if (!id) return // if (!id) return
this.visitTaskId = id // this.visitTaskId = id
this.$nextTick(() => { // this.$nextTick(() => {
this.activeName = '' // this.activeName = ''
this.getOuterQuestions() // this.getOuterQuestions()
this.getTableQuestions() // this.getTableQuestions()
}) // })
} // }
} // }
}, },
mounted() { mounted() {
this.trialId = this.$route.query.trialId this.trialId = this.$route.query.trialId
this.visitTaskId = this.visitInfo.VisitTaskId
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo')) this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
this.isBaseLineTask = this.taskInfo.IsBaseLine this.isBaseLineTask = this.taskInfo.IsBaseLine
this.criterionType = this.taskInfo.CriterionType this.criterionType = this.taskInfo.CriterionType
const digitPlaces = Number(localStorage.getItem('digitPlaces')) const digitPlaces = Number(localStorage.getItem('digitPlaces'))
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
this.getOrganList() this.getOrganList()
this.getOuterQuestions()
this.getTableQuestions()
}, },
methods: { 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}` this.activeName = `${tableInfo.Id}_${answer.RowIndex}`
}, },
// //
@ -1295,8 +1302,13 @@ export default {
if (res.IsSuccess) { if (res.IsSuccess) {
// //
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$message.success(this.$t('common:message:savedSuccessfully'))
this.getTableQuestions() // this.getTableQuestions()
this.$emit('getAnnotations', this.visitTaskId) // 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 = '' this.activeName = ''
} }
loading.close() loading.close()