1
continuous-integration/drone/push Build is passing Details

main
caiyiling 2025-06-13 18:02:55 +08:00
parent fbb23065e5
commit ae808679a0
2 changed files with 18 additions and 6 deletions

View File

@ -590,6 +590,7 @@ export default {
//
this.setAnswerToQuestion(v)
} else {
console.log(v)
if (v.length === 1) {
const { parentQsId, rowId } = v[0]
if (!parentQsId && !rowId) return

View File

@ -129,6 +129,7 @@ export default {
imageToolAttribute: '',
questionsMarkStatus: {},
digitPlaces: 2,
questionImageToolAttributeInfo: {}
}
},
mounted() {
@ -165,6 +166,9 @@ export default {
}
if (v.Type === 'number') {
this.$set(this.questionForm, v.Id, v.Answer === '' ? '' : parseFloat(v.Answer).toFixed(this.digitPlaces))
if (v.ImageToolAttribute) {
this.$set(this.questionImageToolAttributeInfo, v.Id, v.ImageToolAttribute)
}
}
if (v.Childrens.length > 0) {
this.setChild(v.Childrens)
@ -213,6 +217,9 @@ export default {
}
if (i.Type === 'number') {
this.$set(this.questionForm, i.Id, i.Answer === '' ? '' : parseFloat(i.Answer).toFixed(this.digitPlaces))
if (i.ImageToolAttribute) {
this.$set(this.questionImageToolAttributeInfo, i.Id, i.ImageToolAttribute)
}
}
if (i.Childrens && i.Childrens.length > 0) {
this.setChild(i.Childrens)
@ -627,11 +634,10 @@ export default {
try {
let annotation = null
if (!this.operateRowId && obj.rowId && obj.question.ParentQsId) {
this.operateRowId = obj.rowId
this.updateQuestionsMarkStatus(obj)
annotation = this.getAnnotationByRow(obj.rowId)
} else if (this.operateRowId && this.operateQuestionId) {
annotation = this.getAnnotationByRow(this.operateRowId)
}
annotation = this.getAnnotationByRow(this.operateRowId)
//
let picturePath = ''
if (annotation) {
@ -684,7 +690,6 @@ export default {
return this.questionMarkInfoList.findIndex(i => i.QuestionId === Id)
},
updateQuestionsMarkStatus(obj) {
this.operateRowId = obj.rowId
this.questionMarkInfoList.forEach(item => {
if (item.QuestionId === obj.question.ParentQsId && !item.RowId) {
item.RowId = obj.rowId
@ -872,11 +877,17 @@ export default {
},
setAnswerToQuestion(annotation, questionId) {
if (!questionId || !annotation) return
let val = this.getAnnotationProp(annotation, this.imageToolAttribute)
let prop = ''
if (!this.imageToolAttribute) {
prop = this.questionImageToolAttributeInfo[questionId]
} else {
prop = this.imageToolAttribute
}
let val = this.getAnnotationProp(annotation, prop)
this.$set(this.questionForm, questionId, val)
},
getAnnotationProp(annotation, prop) {
if (!annotation) return
if (!annotation || !prop) return
const referencedImageId = annotation?.metadata?.referencedImageId
if (!referencedImageId) return null
const cacheKey = `imageId:${referencedImageId}`