From 197f17fc995c53e762faf4558ea48aaf944780ff Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Fri, 8 May 2026 15:28:10 +0800 Subject: [PATCH] 1 --- .../reading/dicoms/components/DicomViewer.vue | 53 +------------------ 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/src/views/trials/trials-panel/reading/dicoms/components/DicomViewer.vue b/src/views/trials/trials-panel/reading/dicoms/components/DicomViewer.vue index 94f84f8c..aabe0c54 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/DicomViewer.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/DicomViewer.vue @@ -915,13 +915,7 @@ export default { fullScreenWidth: window.innerWidth - 570 + 'px', fullScreenHeight: window.innerHeight - 130 + 'px', - ManualsClose: false, - screenshotCache: { - key: '', - at: 0, - base64: '' - }, - screenshotInFlight: null + ManualsClose: false } }, @@ -1066,8 +1060,7 @@ export default { callback() return } - const cacheKey = this.getScreenshotCacheKey(measuredData) - const base64Str = await this.getOrCaptureScreenshot(cacheKey) + const base64Str = await this.captureActiveViewportScreenshot() callback(base64Str) }) DicomEvent.$on('imageLocation', async (measuredData) => { @@ -1730,48 +1723,6 @@ export default { } return false }, - getScreenshotCacheKey(measuredData) { - const currentCanvas = this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`] && this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0] - const currentStack = currentCanvas && currentCanvas.stack ? currentCanvas.stack : {} - return [ - this.currentDicomCanvasIndex, - currentStack.visitTaskId || '', - currentStack.seriesId || '', - typeof currentStack.currentImageIdIndex === 'number' ? currentStack.currentImageIdIndex : '', - measuredData.visitTaskId || '', - measuredData.questionId || '', - measuredData.rowIndex || '', - measuredData.lesionName || '', - measuredData.isMarked ? 1 : 0 - ].join('|') - }, - async getOrCaptureScreenshot(cacheKey) { - const now = Date.now() - if (this.screenshotCache.key === cacheKey && - this.screenshotCache.base64 && - now - this.screenshotCache.at < 1500) { - return this.screenshotCache.base64 - } - if (this.screenshotInFlight && this.screenshotInFlight.key === cacheKey) { - return this.screenshotInFlight.promise - } - const promise = this.captureActiveViewportScreenshot() - .then((base64) => { - this.screenshotCache = { - key: cacheKey, - at: Date.now(), - base64: base64 || '' - } - return base64 - }) - .finally(() => { - if (this.screenshotInFlight && this.screenshotInFlight.key === cacheKey) { - this.screenshotInFlight = null - } - }) - this.screenshotInFlight = { key: cacheKey, promise } - return promise - }, async captureActiveViewportScreenshot() { // const currentCanvas = this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`] && this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0] await this.$nextTick()