Compare commits

...

2 Commits

3 changed files with 70 additions and 26 deletions

View File

@ -783,6 +783,7 @@ export default {
loadingText: null, loadingText: null,
toolNames: ['Length', 'Bidirectional', 'RectangleROI', 'ArrowAnnotate', 'CircleROI', 'Eraser'], toolNames: ['Length', 'Bidirectional', 'RectangleROI', 'ArrowAnnotate', 'CircleROI', 'Eraser'],
// resetAnnotation: false , // 使 // resetAnnotation: false , // 使
saveCustomAnnotationTimer: null,
// //
downloadImageVisible: false, downloadImageVisible: false,
@ -1540,7 +1541,11 @@ export default {
if (this.isNumber(operateStateEnum)) { if (this.isNumber(operateStateEnum)) {
this.$refs[`ecrf_${series.TaskInfo.VisitTaskId}`][0].bindAnnotationToQuestion(annotation) this.$refs[`ecrf_${series.TaskInfo.VisitTaskId}`][0].bindAnnotationToQuestion(annotation)
} else { } else {
setTimeout(()=>{this.saveCustomAnnotation(annotation)},500) if (this.saveCustomAnnotationTimer) {
clearTimeout(this.saveCustomAnnotationTimer)
this.saveCustomAnnotationTimer = null
}
this.saveCustomAnnotationTimer = setTimeout(()=>{this.saveCustomAnnotation(annotation)},500)
} }
} }
} }
@ -1572,6 +1577,7 @@ export default {
params.Id = annotation.id ? annotation.id : '' params.Id = annotation.id ? annotation.id : ''
params.MeasureData = JSON.stringify(measureData) params.MeasureData = JSON.stringify(measureData)
params.NumberOfFrames = annotation.numberOfFrames params.NumberOfFrames = annotation.numberOfFrames
params.MarkId = annotation.annotationUID
const res = await submitCustomTag(params) const res = await submitCustomTag(params)
annotation.id = res.Result annotation.id = res.Result
}) })
@ -1600,7 +1606,11 @@ export default {
if (isBound || this.isNumber(operateStateEnum)) { if (isBound || this.isNumber(operateStateEnum)) {
this.$refs[`ecrf_${series.TaskInfo.VisitTaskId}`][0].updateAnnotationToQuestion(annotation) this.$refs[`ecrf_${series.TaskInfo.VisitTaskId}`][0].updateAnnotationToQuestion(annotation)
} else { } else {
this.saveCustomAnnotation(annotation) if (this.saveCustomAnnotationTimer) {
clearTimeout(this.saveCustomAnnotationTimer)
this.saveCustomAnnotationTimer = null
}
this.saveCustomAnnotationTimer = setTimeout(()=>{this.saveCustomAnnotation(annotation)},1000)
} }
} }
this.setToolsPassive() this.setToolsPassive()
@ -3216,6 +3226,10 @@ export default {
DicomEvent.$off('isCanActiveNoneDicomTool') DicomEvent.$off('isCanActiveNoneDicomTool')
DicomEvent.$off('removeNoneDicomMeasureData') DicomEvent.$off('removeNoneDicomMeasureData')
DicomEvent.$off('addNoneDicomMeasureData') DicomEvent.$off('addNoneDicomMeasureData')
if (this.saveCustomAnnotationTimer) {
clearTimeout(this.saveCustomAnnotationTimer)
this.saveCustomAnnotationTimer = null
}
} }
} }
</script> </script>

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 {