diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue index c722c647..8d438874 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -614,8 +614,6 @@ import * as cornerstoneTools from '@cornerstonejs/tools' import initLibraries from '@/views/trials/trials-panel/reading/dicoms/components/Fusion/js/initLibraries' import html2canvas from 'html2canvas' import { getTools, getCustomizeStandardsTools, config } from './toolConfig' -import { mapGetters } from 'vuex' -import store from '@/store' import StudyList from './StudyList' import Viewport from './Viewport' import PetCtViewport from './PetCtViewport' @@ -623,6 +621,7 @@ import mRecisit from './mRecist/QuestionList' import recisit from './Recist/QuestionList' import customizeQuestionList from './customize/QuestionList' import CustomWwwcForm from '@/views/trials/trials-panel/reading/dicoms/components/CustomWwwcForm' +import DicomEvent from '@/views/trials/trials-panel/reading/dicoms/components/DicomEvent' import Manuals from '@/views/trials/trials-panel/reading/dicoms/components/Manuals' import Hotkeys from '@/views/trials/trials-panel/reading/dicoms/components/Hotkeys' import WL from '@/views/trials/trials-panel/reading/dicoms/components/WL' @@ -897,8 +896,16 @@ export default { this.loadRelatedTasks() this.initLoader() this.getWwcTpl() - this.getHotKeys() - this.getTrialCriterion() + }) + + DicomEvent.$on('isCanActiveNoneDicomTool', data => { + this.open.postMessage({ type: 'isCanActiveNoneDicomTool', data: data }, window.location) + }) + DicomEvent.$on('removeNoneDicomMeasureData', data => { + this.open.postMessage({ type: 'removeNoneDicomMeasureData', data: data }, window.location) + }) + DicomEvent.$on('addNoneDicomMeasureData', data => { + this.open.postMessage({ type: 'addNoneDicomMeasureData', data: data }, window.location) }) }, methods: { @@ -3159,6 +3166,11 @@ export default { this.uploadStatus = status this[`${status}ImageVisible`] = true }, + }, + beforeDestroy() { + DicomEvent.$off('isCanActiveNoneDicomTool') + DicomEvent.$off('removeNoneDicomMeasureData') + DicomEvent.$off('addNoneDicomMeasureData') } } diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionList.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionList.vue index cfaf0ae8..56311c96 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionList.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionList.vue @@ -61,6 +61,7 @@ import const_ from '@/const/sign-code' import QuestionFormItem from './QuestionFormItem' import SignForm from '@/views/trials/components/newSignForm' import store from '@/store' +import DicomEvent from '@/views/trials/trials-panel/reading/dicoms/components/DicomEvent' export default { name: 'EcrfList', components: { @@ -105,10 +106,12 @@ export default { imageToolAttribute: '', questionsMarkStatus: {}, digitPlaces: 2, - questionImageToolAttributeInfo: {} + questionImageToolAttributeInfo: {}, + unSaveTargets: [] } }, mounted() { + window.addEventListener('message', this.receiveMsg) this.trialId = this.$route.query.trialId this.visitTaskId = this.visitInfo.VisitTaskId this.taskInfo = JSON.parse(localStorage.getItem('taskInfo')) @@ -973,6 +976,74 @@ export default { loading.close() console.log(e) } + }, + receiveMsg(event) { + if (event.data.type === 'isCanActiveNoneDicomTool') { + let obj = { isCanActiveTool: true, lesionName: '', reason: '', toolName: event.data.toolName } + // this.getUnSaveTarget() + // var obj = {} + // if (this.unSaveTargets.length > 0) { + // var rowIndex = String(this.unSaveTargets[0].rowIndex) + // var questionId = this.unSaveTargets[0].questionId + // const refName = `${this.activeItem.activeCollapseId}_${this.activeItem.activeRowIndex}` + // if (rowIndex === this.activeItem.activeRowIndex && questionId === this.activeItem.activeCollapseId && !this.$refs[refName][0].questionForm.MeasureData) { + // // 判断是否是靶病灶 + // // questions.findIndex(i => i.QuestionMark === questionMark) + // var lesionType = this.$refs[refName][0].questionForm.LesionType + // if (lesionType === 0) { + // // '当前病灶为靶病灶,不允许添加标记!' + // obj = { isCanActiveTool: false, lesionName: '', reason: this.$t('trials:reading:warnning:msg18') } + // } else { + // obj = { isCanActiveTool: true, lesionName: this.$refs[refName][0].lesionMark, reason: '', toolName: event.data.toolName } + // } + // } else { + // let msg = this.$t('trials:reading:warnning:msg5') + // msg = msg.replace('xxx', this.unSaveTargets[0].lessionName) + // obj = { isCanActiveTool: false, lesionName: '', reason: msg } + // } + // } else { + // if (this.activeItem.activeCollapseId) { + // // 判断是否是靶病灶 + // const refName = `${this.activeItem.activeCollapseId}_${this.activeItem.activeRowIndex}` + // // obj = { isCanActiveTool: true, lesionName: this.$refs[refName][0].lesionMark, reason: '' } + // const lesionType = this.$refs[refName][0].questionForm.LesionType + // if (lesionType === 0) { + // // 当前病灶为靶病灶,不允许添加标记! + // obj = { isCanActiveTool: false, lesionName: '', reason: this.$t('trials:reading:warnning:msg18') } + // } else { + // obj = { isCanActiveTool: true, lesionName: this.$refs[refName][0].lesionMark, reason: '', toolName: event.data.toolName } + // } + // } else { + // // 获取非靶病灶/新病灶的长度及标识 + // var qsObj = null + // var lesionName = '' + // if (this.isBaseLineTask) { + // const idx = this.tableQuestions.findIndex(item => item.LesionType === 1) + // if (idx > -1) { + // qsObj = this.tableQuestions[idx] + // } + // } else { + // const idx = this.tableQuestions.findIndex(item => item.LesionType === 2) + // if (idx > -1) { + // qsObj = this.tableQuestions[idx] + // } + // } + + // // var questions = qsObj.TableQuestions.Questions.find(item => item.QuestionMark === 3) + // // if (questions) { + // // var maxIndex = this.getMaxRowIndex(qsObj.TableQuestions.Answers) + // // lesionName = `${qsObj.OrderMark}${String(maxIndex + 1).padStart(2, '0')}` + // // } + // var maxIndex = this.getMaxRowIndex(qsObj.TableQuestions.Answers) + // lesionName = `${qsObj.OrderMark}${String(maxIndex + 1).padStart(2, '0')}` + // obj = { isCanActiveTool: true, lesionName: lesionName, reason: '', toolName: event.data.toolName } + // } + // } + + DicomEvent.$emit('isCanActiveNoneDicomTool', obj) + } else if (event.data.type === 'setMeasurement') { + // this.setMeasuredData(event.data.data) + } } } }