diff --git a/src/views/trials/trials-panel/reading/dicoms/components/Fusion/PetCt.vue b/src/views/trials/trials-panel/reading/dicoms/components/Fusion/PetCt.vue index e1e5d6f2..8dea8a6d 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/Fusion/PetCt.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/Fusion/PetCt.vue @@ -628,11 +628,7 @@ export default { const routeData = this.$router.resolve({ path }) this.screenshotWindow = window.open(routeData.href, '_blank') }) - window.addEventListener('beforeunload', () => { - if (this.screenshotWindow) { - this.screenshotWindow.close() - } - }) + window.addEventListener('beforeunload', e => { this.beforeUnloadHandler(e) }) }, beforeDestroy() { if (this.screenshotWindow) { @@ -649,7 +645,7 @@ export default { FusionEvent.$off('removeAnnotation') FusionEvent.$off('imageLocation') FusionEvent.$off('getScreenshots') - window.removeEventListener('beforeunload') + window.removeEventListener('beforeunload', e => { this.beforeUnloadHandler(e) }) }, methods: { @@ -699,6 +695,11 @@ export default { var ptseriesId = this.$route.query.ptseriesId this.petSeries = await this.getSeriesInfo(ptseriesId) + + const maxCount = Math.max(this.ctSeries.imageIds.length, this.petSeries.imageIds.length) + this.$set(this.ctSeries, 'imageMaxLength', maxCount) + this.$set(this.petSeries, 'imageMaxLength', maxCount) + await this.getImages() // 设置viewport @@ -2133,6 +2134,11 @@ export default { historyRecord() { this.fusion.visible = true }, + beforeUnloadHandler() { + if (this.screenshotWindow) { + this.screenshotWindow.close() + } + }, async receiveMsg(event) { if (event.data.type === 'readingPageUpdate') { // this.$refs['questions'].initList() diff --git a/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Viewport.vue b/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Viewport.vue index 93d92891..423eb519 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Viewport.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Viewport.vue @@ -17,7 +17,7 @@
Series: #{{ seriesInfo.seriesNumber }}
-
Image: #{{ `${seriesInfo.imageIdIndex + 1} / ${seriesInfo.imageIds.length}` }}
+
Image: #{{ `${seriesInfo.imageIdIndex + 1} / ${seriesInfo.imageMaxLength}` }}
{{ seriesInfo.modality }}
@@ -247,7 +247,7 @@ export default { this.imageInfo.size = `${imagePlaneModule.columns}*${imagePlaneModule.rows}` this.imageInfo.location = imagePlaneModule.sliceLocation this.getOrientationMarker() - this.sliderBoxHeight = imageIndex * 100 / (this.seriesInfo.imageIds.length - 1) + this.sliderBoxHeight = imageIndex * 100 / (this.seriesInfo.imageMaxLength - 1) } var properties = viewport.getProperties() @@ -376,7 +376,7 @@ export default { goViewer(e) { var height = e.offsetY * 100 / this.$refs['sliderBox'].clientHeight this.sliderBoxHeight = height - var index = Math.trunc(this.seriesInfo.imageIds.length * this.sliderBoxHeight / 100) + var index = Math.trunc(this.seriesInfo.imageMaxLength * this.sliderBoxHeight / 100) if (this.seriesInfo.imageIdIndex !== index) { this.scroll(index) } @@ -399,8 +399,8 @@ export default { if (PX < 0) return if (PX > boxHeight) return const height = PX * 100 / boxHeight - var index = Math.trunc(this.seriesInfo.imageIds.length * height / 100) - index = index > this.seriesInfo.imageIds.length ? this.seriesInfo.imageIds.length : index < 0 ? 0 : index + var index = Math.trunc(this.seriesInfo.imageMaxLength * height / 100) + index = index > this.seriesInfo.imageMaxLength ? this.seriesInfo.imageMaxLength : index < 0 ? 0 : index this.sliderBoxHeight = height if (this.seriesInfo.imageIdIndex !== index) { this.scroll(index)