外层问题数据同步保存
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-07-17 14:07:44 +08:00
parent 13cfcb0935
commit d3a4842504
2 changed files with 22 additions and 5 deletions

View File

@ -472,6 +472,12 @@ export default {
} }
} }
}) })
DicomEvent.$on('operateImageMarker', (data) => {
let { operateStateEnum, QuestionId, picturePath } = data
if (this.question.Id === QuestionId) {
this.operateImageMarker({ operateStateEnum, question: this.question, picturePath })
}
})
}, },
methods: { methods: {
numberInput(id) { numberInput(id) {

View File

@ -577,7 +577,6 @@ export default {
try { try {
const answers = [{ id: obj.question.Id, answer: this.questionForm[obj.question.Id] }] const answers = [{ id: obj.question.Id, answer: this.questionForm[obj.question.Id] }]
const markInfo = [] const markInfo = []
console.log(this.questionMarkInfoList, 'this.questionMarkInfoList')
const index = this.questionMarkInfoList.findIndex( const index = this.questionMarkInfoList.findIndex(
item => item.QuestionId === this.operateQuestionId item => item.QuestionId === this.operateQuestionId
) )
@ -594,14 +593,16 @@ export default {
} }
annotation = this.getAnnotationByRow(obj.question.Id, false) annotation = this.getAnnotationByRow(obj.question.Id, false)
// //
let picturePath = '' let picturePath = obj.picturePath
if (annotation) { if (annotation) {
const base64Str = await this.getScreenshots({ const base64Str = await this.getScreenshots({
visitTaskId: this.visitTaskId, visitTaskId: this.visitTaskId,
annotation annotation
}) })
const pictureObj = await this.uploadScreenshots(`${Date.now()}`, base64Str) if (!picturePath) {
picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : '' const pictureObj = await this.uploadScreenshots(`${Date.now()}`, base64Str)
picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
}
markInfo[0].PicturePath = picturePath markInfo[0].PicturePath = picturePath
} }
markInfo[0].MarkId = annotation ? annotation.annotationUID : null markInfo[0].MarkId = annotation ? annotation.annotationUID : null
@ -615,6 +616,17 @@ export default {
isSaved: true, isSaved: true,
OrderMarkName: this.questionMarkInfoList[index].OrderMarkName OrderMarkName: this.questionMarkInfoList[index].OrderMarkName
}) })
if (annotation) {
for (let i = 0; i < this.questionMarkInfoList.length; i++) {
const item = this.questionMarkInfoList[i]
if (!item.MeasureData || item.MeasureData.annotationUID !== annotation.annotationUID) continue
const isTableMode = item.TableQuestionId
if (!isTableMode && this.questionsMarkStatus[item.QuestionId] && !this.questionsMarkStatus[item.QuestionId].isSaved && this.questionsMarkStatus[item.QuestionId].isMarked) {
DicomEvent.$emit('operateImageMarker', { QuestionId: item.QuestionId, operateStateEnum: 5, picturePath })
break
}
}
}
} catch (e) { } catch (e) {
console.error('保存失败:', e) console.error('保存失败:', e)
} finally { } finally {
@ -721,7 +733,6 @@ export default {
return index > -1 ? this.questionMarkInfoList[index].MeasureData : null return index > -1 ? this.questionMarkInfoList[index].MeasureData : null
}, },
async bindAnnotationToQuestion(annotation) { async bindAnnotationToQuestion(annotation) {
console.log(this.operateStateEnum, 'bindAnnotationToQuestion')
try { try {
const VALID_STATES = [null, 0, 1, 3] const VALID_STATES = [null, 0, 1, 3]
const currentState = this.operateStateEnum const currentState = this.operateStateEnum