From fb9af9476939742177ac3026341b215acd39ac91 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Mon, 29 Jan 2024 13:21:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BDbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reading/dicoms/components/StudyList.vue | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/views/trials/trials-panel/reading/dicoms/components/StudyList.vue b/src/views/trials/trials-panel/reading/dicoms/components/StudyList.vue index c0713dc6..fcae4c2c 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/StudyList.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/StudyList.vue @@ -251,7 +251,6 @@ export default { res.map((item) => { this.loadInitialImage(item) }) - console.log(res) var i = res.findIndex(s => s.isCurrentTask) if (i > -1) { var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId) @@ -268,11 +267,11 @@ export default { // study.SeriesList.map((series, seriesIndex) => { // if (series.modality !== 'SR') { // series.imageIds.map(image => { - // var p = null + // var p = priority - seriesIndex // if (series.seriesId === res[i].seriesId) { // p = priority // } else { - // p = priority - seriesIndex + // --p // } // this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority: p }) // }) @@ -339,7 +338,9 @@ export default { var p = parseInt(new Date().getTime()) var imageId = seriesInfo.imageIds[seriesInfo.imageIdIndex] requestPoolManager.loadAndCacheImagePlus(imageId, seriesInfo.seriesId, p * 100).then(res => { - this.imageLoaded({ studyIndex: seriesInfo.studyIndex, seriesIndex: seriesInfo.seriesIndex, imageId: res.imageId }) + if (seriesInfo.isCurrentTask) { + this.imageLoaded({ studyIndex: seriesInfo.studyIndex, seriesIndex: seriesInfo.seriesIndex, imageId: res.imageId }, res.data.string('x0020000e')) + } }) }, getStudyList() { @@ -717,7 +718,7 @@ export default { // requestPoolManager.startTaskTimer() this.imageList.map(image => { requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => { - this.imageLoaded(image) + this.imageLoaded(image, res.data.string('x0020000e')) }) }) requestPoolManager.sortTaskPool() @@ -758,18 +759,24 @@ export default { requestPoolManager.removeTask(series.seriesId) this.$set(this.studyList[studyIndex].SeriesList[seriesIndex], 'isLoading', false) }, - async imageLoaded(image) { + async imageLoaded(image, seriesUid) { // await store.dispatch('reading/updateStudyList', { visitTaskId: image.visitTaskId, imageId: image.imageId, seriesUid }) // console.log(this.studyList[image.studyIndex].SeriesList[image.seriesIndex]) - if (this.studyList[image.studyIndex].SeriesList[image.seriesIndex].imageloadedArr.indexOf(image.imageId) < 0) { - this.studyList[image.studyIndex].SeriesList[image.seriesIndex].imageloadedArr.push(image.imageId) - var count = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount - this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount = count + 1 - } else { - this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].instanceCount - // 设置当前序列状态为已下载完成 - this.studyList[image.studyIndex].SeriesList[image.seriesIndex].loadStatus = true + if (image.studyIndex > -1 && image.seriesIndex > -1) { + var prefetchInstanceCount = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount + var instanceCount = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].instanceCount + if (this.studyList[image.studyIndex].SeriesList[image.seriesIndex].imageloadedArr.indexOf(image.imageId) < 0) { + this.studyList[image.studyIndex].SeriesList[image.seriesIndex].imageloadedArr.push(image.imageId) + prefetchInstanceCount = prefetchInstanceCount + 1 + this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount = prefetchInstanceCount + } + if (prefetchInstanceCount >= instanceCount) { + this.studyList[image.studyIndex].SeriesList[image.seriesIndex].prefetchInstanceCount = this.studyList[image.studyIndex].SeriesList[image.seriesIndex].instanceCount + // 设置当前序列状态为已下载完成 + this.studyList[image.studyIndex].SeriesList[image.seriesIndex].loadStatus = true + } } + // store.dispatch('reading/updateSeriesList', { visitTaskindex: this.visitTaskIdx, studyIndex: image.studyIndex, seriesIndex: image.seriesIndex, imageId: image.imageId }) }, // instance下载成功回调