From 0cd33687ee350fc23983df45bc065c096a8b76a7 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Fri, 22 Mar 2024 13:26:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=AF=84=E4=BC=B0=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=97=B6=E9=AA=8C=E8=AF=81=E6=98=AF=E5=90=A6=E6=9C=89?= =?UTF-8?q?=E6=A0=87=E6=B3=A8=E6=B5=8B=E9=87=8F=E4=B8=BA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dicoms/components/Fusion/Questions.vue | 30 +++++++++++++++---- .../reading/dicoms/components/Questions.vue | 26 ++++++++++++++-- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Questions.vue b/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Questions.vue index fe8a227a..8dbf49ec 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Questions.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Questions.vue @@ -105,10 +105,11 @@ export default { this.resetSuvQuestions() }) FusionEvent.$on('addAnnotation', obj => { - this.$set(obj, 'SaveEnum', 0) + this.$set(obj, 'SaveEnum', 1) this.addAnnotation(obj) }) FusionEvent.$on('removeAnnotation', obj => { + this.$set(obj, 'SaveEnum', 0) this.removeAnnotation(obj) }) FusionEvent.$on('locateAnnotation', obj => { @@ -235,7 +236,12 @@ export default { handleSave() { this.$refs['questions'].validate((valid) => { if (!valid) return - + // 是否有标记未保存 + var existUnSave = this.checkAnnotationStatus(this.questions) + if (existUnSave) { + this.$alert(this.$t('trials:lugano:message:saveWarning1')) + return + } // 肝脏血池SUVmax const liverSUVmax = !isNaN(parseFloat(this.questionForm[this.liverSuvmaxId])) ? parseFloat(this.questionForm[this.liverSuvmaxId]) : 0 // 纵膈血池SUVmax @@ -295,6 +301,18 @@ export default { this.loading = false }) }, + checkAnnotationStatus(obj) { + for (let i = 0; i < obj.length; i++) { + if (obj[i].SaveEnum === 1) { + return true + } + if (obj[i].Childrens && obj[i].Childrens.length > 0) { + if (this.checkAnnotationStatus(obj[i].Childrens)) { + return true + } + } + } + }, addAnnotation(obj) { const { Id, QuestionType } = obj this.currentQsId = Id @@ -443,19 +461,19 @@ export default { } }, setQuestionStatus(obj, questionType) { - console.log(obj, questionType) for (let i = 0; i < obj.length; i++) { if (obj[i].QuestionType === questionType) { this.$set(obj[i], 'SaveEnum', 1) - break + return true } if (obj[i].Childrens && obj[i].Childrens.length > 0) { - this.setQuestionStatus(obj[i].Childrens, questionType) + if (this.setQuestionStatus(obj[i].Childrens, questionType)) { + return true + } } } }, setOutsideMeasuredData(measurement) { - console.log('setOutsideMeasuredData: ', measurement) if ((measurement.data.remark === 'Liver' && this.liverIsInsideVolume === false) || (measurement.data.remark === 'Mediastinum' && this.lungIsInsideVolume === false)) { return } diff --git a/src/views/trials/trials-panel/reading/dicoms/components/Questions.vue b/src/views/trials/trials-panel/reading/dicoms/components/Questions.vue index 6705149f..a3948634 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/Questions.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/Questions.vue @@ -119,6 +119,7 @@ export default { this.addAnnotation(obj) }) DicomEvent.$on('removeAnnotation', obj => { + this.$set(obj, 'SaveEnum', 0) this.removeAnnotation(obj) }) DicomEvent.$on('saveAnnotation', obj => { @@ -251,8 +252,15 @@ export default { handleSave() { this.$refs['questions'].validate(async(valid) => { if (!valid) return + // lugano标准校验脾脏状态是否符合要求 if (this.criterionType === 2 && this.groupClassify === 3) { + // 是否有标记未保存 + var existUnSave = this.checkAnnotationStatus(this.questions) + if (existUnSave) { + this.$alert(this.$t('trials:lugano:message:saveWarning')) + return + } var currentSpleenStatus = this.questionForm[this.spleenStatusId] var currentSpleenLength = this.questionForm[this.spleenLengthId] currentSpleenStatus = isNaN(parseInt(currentSpleenStatus)) ? null : parseInt(currentSpleenStatus) @@ -337,6 +345,18 @@ export default { this.loading = false }) }, + checkAnnotationStatus(obj) { + for (let i = 0; i < obj.length; i++) { + if (obj[i].SaveEnum === 1) { + return true + } + if (obj[i].Childrens && obj[i].Childrens.length > 0) { + if (this.checkAnnotationStatus(obj[i].Childrens)) { + return true + } + } + } + }, setSpleenCommentDisplay() { if (this.spleenCommentsId && this.spleenStatusId) { for (let i = 0; i < this.questions[0].Childrens.length; i++) { @@ -573,10 +593,12 @@ export default { for (let i = 0; i < obj.length; i++) { if (obj[i].QuestionType === questionType) { this.$set(obj[i], 'SaveEnum', 1) - break + return true } if (obj[i].Childrens && obj[i].Childrens.length > 0) { - this.setQuestionStatus(obj[i].Childrens, questionType) + if (this.setQuestionStatus(obj[i].Childrens, questionType)) { + return true + } } } },