表格问题编辑标记问题未保存不可关闭弹框、外层问题标记不可绑定到表格问题、拖拽表格问题标记打开对应表格问题弹框
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 BaseModel from '@/components/BaseModel'
import PreviewFile from '@/components/PreviewFile/index' import PreviewFile from '@/components/PreviewFile/index'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import DicomEvent from '@/views/trials/trials-panel/reading/dicoms/components/DicomEvent'
export default { export default {
name: 'QuestionFormItem', name: 'QuestionFormItem',
components: { QuestionTableFormItem, BaseModel, PreviewFile }, 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: { methods: {
numberInput(id) { numberInput(id) {
@ -694,7 +705,7 @@ export default {
} }
} }
if (isExistUnSaved) { if (isExistUnSaved) {
if (this.addOrEdit.type = 'add') { if (this.addOrEdit.type === 'add') {
// //
const confirm = await this.$confirm(this.$t("dicom3D:CustomizeQuestionFormItem:confirm:markNoSaveAndclose"), { const confirm = await this.$confirm(this.$t("dicom3D:CustomizeQuestionFormItem:confirm:markNoSaveAndclose"), {
type: 'warning', type: 'warning',
@ -1193,7 +1204,7 @@ export default {
} }
} }
if (isExistUnSaved) { if (isExistUnSaved) {
if (this.addOrEdit.type = 'add') { if (this.addOrEdit.type === 'add') {
// //
const confirm = await this.$confirm(this.$t("dicom3D:CustomizeQuestionFormItem:confirm:markNoSaveAndclose"), { const confirm = await this.$confirm(this.$t("dicom3D:CustomizeQuestionFormItem:confirm:markNoSaveAndclose"), {
type: 'warning', type: 'warning',

View File

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