From 4e1911223d2874d9d0a4bb2ada650cdcb0f74dd6 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Tue, 28 Jul 2026 09:17:40 +0800 Subject: [PATCH] 1 --- .../dicoms/components/IVUS/QuestionList.vue | 20 ++++++++++++++----- .../dicoms/components/OCT/QuestionList.vue | 17 ++++++++++++++-- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue b/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue index f345ff2a..32f6fdcc 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue @@ -289,7 +289,7 @@ export default { sRoiDistanceId: '', rowSaveLoadingMap: {}, dialogSaveLoading: false, - openWindow: null + childWindows: [] } }, computed: { @@ -329,11 +329,13 @@ export default { DicomEvent.$on('refreshQuestions', _ => { this.refreshQuestions() }) + window.addEventListener('beforeunload', this.closeAllChildWindows) }, beforeDestroy() { DicomEvent.$off('setCollapseActive') DicomEvent.$off('getUnSaveTarget') DicomEvent.$off('refreshQuestions') + window.removeEventListener('beforeunload', this.closeAllChildWindows) }, methods: { handleReadingChart(e) { @@ -745,14 +747,22 @@ export default { this.addOrEdit.lesionType = row.LesionType }, handleView(item) { - if (this.openWindow) { - this.openWindow.close() - } localStorage.setItem('taskBlindName', this.taskBlindName) localStorage.setItem('isReadingShowSubjectInfo', this.isReadingShowSubjectInfo) let token = getToken() let routeData = this.$router.resolve({ path: `/ecrfList?trialId=${this.$route.query.trialId}&visitTaskId=${this.visitTaskId}&questionId=${item.Id}&TokenKey=${token}` }) - this.openWindow = window.open(routeData.href, "_blank") + const win = window.open(routeData.href, '_blank') + if (win) { + this.childWindows.push(win) + } + }, + closeAllChildWindows() { + this.childWindows.forEach(win => { + if (win && !win.closed) { + win.close() + } + }) + this.childWindows = [] }, async saveFormData() { if (this.dialogSaveLoading) return diff --git a/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionList.vue b/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionList.vue index e6a0bfc3..617cfaf2 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionList.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/OCT/QuestionList.vue @@ -290,7 +290,7 @@ export default { sRoiDistanceId: '', rowSaveLoadingMap: {}, dialogSaveLoading: false, - openWindow: null + childWindows: [] } }, computed: { @@ -330,11 +330,13 @@ export default { DicomEvent.$on('refreshQuestions', _ => { this.refreshQuestions() }) + window.addEventListener('beforeunload', this.closeAllChildWindows) }, beforeDestroy() { DicomEvent.$off('setCollapseActive') DicomEvent.$off('getUnSaveTarget') DicomEvent.$off('refreshQuestions') + window.removeEventListener('beforeunload', this.closeAllChildWindows) }, methods: { handleReadingChart(e) { @@ -768,7 +770,18 @@ export default { localStorage.setItem('isReadingShowSubjectInfo', this.isReadingShowSubjectInfo) let token = getToken() let routeData = this.$router.resolve({ path: `/ecrfList?trialId=${this.$route.query.trialId}&visitTaskId=${this.visitTaskId}&questionId=${item.Id}&TokenKey=${token}` }) - this.openWindow = window.open(routeData.href, "_blank") + const win = window.open(routeData.href, '_blank') + if (win) { + this.childWindows.push(win) + } + }, + closeAllChildWindows() { + this.childWindows.forEach(win => { + if (win && !win.closed) { + win.close() + } + }) + this.childWindows = [] }, async saveFormData() { if (this.dialogSaveLoading) return