表格问题编辑标记问题未保存不可关闭弹框、外层问题标记不可绑定到表格问题、拖拽表格问题标记打开对应表格问题弹框
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-07-14 10:30:42 +08:00
parent dab5a44f2d
commit 1483a8c670
2 changed files with 54 additions and 24 deletions

View File

@ -288,6 +288,7 @@ import QuestionTableFormItem from './QuestionTableFormItem'
import BaseModel from '@/components/BaseModel'
import PreviewFile from '@/components/PreviewFile/index'
import { mapGetters } from 'vuex'
import DicomEvent from '@/views/trials/trials-panel/reading/dicoms/components/DicomEvent'
export default {
name: 'QuestionFormItem',
components: { QuestionTableFormItem, BaseModel, PreviewFile },
@ -461,6 +462,16 @@ export default {
})
}
}
DicomEvent.$on('openAddTableCol', (data) => {
let { RowId } = data
if (this.questionForm[this.question.Id] && Array.isArray(this.questionForm[this.question.Id]) && this.questionForm[this.question.Id].length > 0) {
let index = this.questionForm[this.question.Id].findIndex(item => item.RowId === RowId)
if (!!~index) {
this.openAddTableCol(this.question, index)
}
}
})
},
methods: {
numberInput(id) {
@ -694,7 +705,7 @@ export default {
}
}
if (isExistUnSaved) {
if (this.addOrEdit.type = 'add') {
if (this.addOrEdit.type === 'add') {
//
const confirm = await this.$confirm(this.$t("dicom3D:CustomizeQuestionFormItem:confirm:markNoSaveAndclose"), {
type: 'warning',
@ -1193,7 +1204,7 @@ export default {
}
}
if (isExistUnSaved) {
if (this.addOrEdit.type = 'add') {
if (this.addOrEdit.type === 'add') {
//
const confirm = await this.$confirm(this.$t("dicom3D:CustomizeQuestionFormItem:confirm:markNoSaveAndclose"), {
type: 'warning',

View File

@ -577,7 +577,7 @@ export default {
try {
const answers = [{ id: obj.question.Id, answer: this.questionForm[obj.question.Id] }]
const markInfo = []
console.log(this.questionMarkInfoList, 'this.questionMarkInfoList')
const index = this.questionMarkInfoList.findIndex(
item => item.QuestionId === this.operateQuestionId
)
@ -604,6 +604,7 @@ export default {
picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
markInfo[0].PicturePath = picturePath
}
markInfo[0].MarkId = annotation ? annotation.annotationUID : null
await saveTaskQuestion(-10, {
visitTaskId: this.visitTaskId,
answers,
@ -665,11 +666,12 @@ export default {
QuestionType: 0,
RowId: this.operateRowId,
TableQuestionId: this.operateQuestionId,
RowIndex: obj.rowIndex
RowIndex: obj.rowIndex,
MarkId: annotation ? annotation.annotationUID : null
}, -10)
this.$set(this.questionsMarkStatus,
`${this.operateRowId}_${this.operateQuestionId}`,
{ isMarked: !!annotation, isSaved: true, OrderMarkName: annotation.data.label }
{ isMarked: !!annotation, isSaved: true, OrderMarkName: annotation ? annotation.data.label : '' }
)
this.resetOperateState()
} catch (e) {
@ -719,6 +721,7 @@ export default {
return index > -1 ? this.questionMarkInfoList[index].MeasureData : null
},
async bindAnnotationToQuestion(annotation) {
console.log(this.operateStateEnum, 'bindAnnotationToQuestion')
try {
const VALID_STATES = [null, 0, 1, 3]
const currentState = this.operateStateEnum
@ -729,32 +732,45 @@ export default {
return this.handleNullState(annotation)
}
if (!this.operateQuestionId) return
if ([0, 3].includes(currentState)) {
if ([0, 1, 3].includes(currentState)) {
//
if (!annotation.data.label || annotation.markTool !== this.imageTool) {
let message = this.$t("dicom3D:CustomizeQuestionList:alert:markNoSaveToQuestion").replace("xxx", this.$t(`dicom3D:mark:${this.imageTool}`))
this.$alert(message)
return
}
if (currentState === 3) {
const conflictIndex = this.questionMarkInfoList.findIndex(
item => item.MeasureData.annotationUID === annotation.annotationUID
&& item.RowId !== this.operateRowId && this.operateRowId
)
if (conflictIndex > -1) {
//
this.$alert(this.$t("dicom3D:CustomizeQuestionList:alert:markIsbind"))
return
}
// if (currentState === 3) {
let conflictIndex = this.questionMarkInfoList.findIndex(
item => item.MeasureData.annotationUID === annotation.annotationUID
&& item.RowId !== this.operateRowId && item.RowId
)
// && this.operateRowId
console.log(conflictIndex)
if (conflictIndex > -1) {
//
this.$alert(this.$t("dicom3D:CustomizeQuestionList:alert:markIsbind"))
return
}
conflictIndex = this.questionMarkInfoList.findIndex(
item => item.MeasureData.annotationUID === annotation.annotationUID
&& !item.TableQuestionId && this.isTableQuestion
)
if (conflictIndex > -1) {
//
this.$alert(this.$t("dicom3D:CustomizeQuestionList:alert:markIsbind2"))
return
}
// }
//
const message = currentState === 0 ? this.$t("dicom3D:CustomizeQuestionList:confirm:bindYesOrNo") : this.$t("dicom3D:CustomizeQuestionList:confirm:updateYesOrNo")
const result = await this.$confirm(message, {
type: 'warning',
distinguishCancelAndClose: true
})
const isConfirmed = result === 'confirm'
if (!isConfirmed) return
const message = currentState === 0 ? this.$t("dicom3D:CustomizeQuestionList:confirm:bindYesOrNo") : currentState === 3 ? this.$t("dicom3D:CustomizeQuestionList:confirm:updateYesOrNo") : null
if (message) {
const result = await this.$confirm(message, {
type: 'warning',
distinguishCancelAndClose: true
})
const isConfirmed = result === 'confirm'
if (!isConfirmed) return
}
}
const targetIndex = this.findTargetIndex()
if (targetIndex === -1) {
@ -885,6 +901,9 @@ export default {
qsArr.push({ ...item })
const keyId = item.RowId ? `${item.RowId}_${item.TableQuestionId}` : item.TableQuestionId;
this.$set(this.questionsMarkStatus, keyId, questionMarkInfo);
if (item.RowId) {
DicomEvent.$emit('openAddTableCol', { RowId: item.RowId })
}
}
if (qsArr.length > 0) {
store.dispatch('dicom3d/setOperateInfo', qsArr);
@ -926,7 +945,7 @@ export default {
if ((TableQuestionId && QuestionId === questionId && markTableQuestions.includes(TableQuestionId)) && !RowId) {
if (questionsMarkStatus && questionsMarkStatus[TableQuestionId]) {
delete questionsMarkStatus[TableQuestionId]
}else {
} else {
return item
}
} else {