From 653d953ff8c878a26cdffd5b0f291d137e0adb5b Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Mon, 29 Jan 2024 15:57:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD=E5=8D=95?= =?UTF-8?q?=E4=B8=AA=E6=A3=80=E6=9F=A5=E4=B8=8B=E7=9A=84=E5=BD=B1=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dicom-show/dicom-study.vue | 124 +++++++++++---------------- 1 file changed, 49 insertions(+), 75 deletions(-) diff --git a/src/views/dicom-show/dicom-study.vue b/src/views/dicom-show/dicom-study.vue index 7a991e1f..2426b687 100644 --- a/src/views/dicom-show/dicom-study.vue +++ b/src/views/dicom-show/dicom-study.vue @@ -156,7 +156,7 @@ export default { showSeriesList: [] } }, - created() { + created: function() { this.type = this.$router.currentRoute.query.type ? this.$router.currentRoute.query.type : '' this.visitNum = this.$router.currentRoute.query.visitNum ? parseInt(this.$router.currentRoute.query.visitNum) : 0 @@ -176,28 +176,6 @@ export default { this.loadStudy() } else if (this.type === 'Share') { this.loadStudy() - try { - this.type = this.$route.query.type ? this.$route.query.type : '' - this.visitNum = this.$router.currentRoute.query.visitNum ? parseInt(this.$router.currentRoute.query.visitNum) : 0 - cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded) - // cornerstone.events.addEventListener('datasetscachechanged', this.datasetsCacheChanged) - if (this.$router.currentRoute.query.TokenKey) { - store.dispatch('user/setToken', this.$router.currentRoute.query.TokenKey) - changeURLStatic('TokenKey', '') - } - this.studyId = this.$router.currentRoute.query.studyId - if (this.type === 'Series') { - // this.initStudy() - this.showDelete = parseInt(this.$router.currentRoute.query.showDelete) - this.initSeries() - } else if (this.type === 'Study') { - this.showDelete = parseInt(this.$router.currentRoute.query.showDelete) - this.loadStudy() - } else if (this.type === 'Share') { - this.loadStudy() - } - } catch (e) { - console.log(e) } }, beforeDestroy() { @@ -270,59 +248,55 @@ export default { }) }, initSeries() { - try { - console.log(0) - var scope = this - this.studyCode = this.$router.currentRoute.query.studyCode - this.modality = this.$router.currentRoute.query.modality - this.seriesCount = 1 - this.description = this.$router.currentRoute.query.description - var seriesId = this.$router.currentRoute.query.seriesId - var seriesNumber = this.$router.currentRoute.query.seriesNumber - var subjectVisitId = this.$router.currentRoute.query.subjectVisitId - var studyId = this.$router.currentRoute.query.studyId - var trialId = this.$router.currentRoute.query.trialId - console.log(1) - getInstanceList(seriesId).then(res => { - if (!res.Result || (res.Result && res.Result.length === 0)) return - var seriesInstanceUid = res.Result[0].SeriesInstanceUid - var sliceLocation = res.Result[0].SliceLocation - var isReading = res.Result[0].IsReading - var isDeleted = res.Result[0].IsDeleted - var seriesList = [] - var imageIds = [] - res.Result.forEach(instance => { - imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instance.Path}`) - }) - seriesList.push({ - trialId, - subjectVisitId, - studyId, - imageIds: imageIds, - seriesId: seriesId, - seriesUid: seriesInstanceUid, - seriesNumber: seriesNumber, - sliceThickness: sliceLocation, - modality: this.modality, - description: this.description, - isReading, - isDeleted, - previewImageUrl: res.OtherInfo.ImageResizePath ? scope.OSSclientConfig.basePath + res.OtherInfo.ImageResizePath : res.OtherInfo.ImageResizePath, - instanceCount: res.Result.length, - prefetchInstanceCount: 0, - loadStatus: false, - imageloadedArr: [] - }) - this.seriesList = seriesList - if (this.seriesList.length > 0) { - this.$nextTick(() => { - this.loadAllImages() - this.$refs.dicomViewer.loadImageStack(this.seriesList[0]) - this.firstInstanceId = this.seriesList[0].imageIds[0] - }) - } + var scope = this + this.studyCode = this.$router.currentRoute.query.studyCode + this.modality = this.$router.currentRoute.query.modality + this.seriesCount = 1 + this.description = this.$router.currentRoute.query.description + var seriesId = this.$router.currentRoute.query.seriesId + var seriesNumber = this.$router.currentRoute.query.seriesNumber + var subjectVisitId = this.$router.currentRoute.query.subjectVisitId + var studyId = this.$router.currentRoute.query.studyId + var trialId = this.$router.currentRoute.query.trialId + getInstanceList(seriesId).then(res => { + if (!res.Result || (res.Result && res.Result.length === 0)) return + var seriesInstanceUid = res.Result[0].SeriesInstanceUid + var sliceLocation = res.Result[0].SliceLocation + var isReading = res.Result[0].IsReading + var isDeleted = res.Result[0].IsDeleted + var seriesList = [] + var imageIds = [] + res.Result.forEach(instance => { + imageIds.push(`wadouri:${localStorage.getItem('location') !== 'USA' ? this.OSSclientConfig.basePath : this.OSSclientConfig.basePath}${instance.Path}`) }) - } catch (e) {console.log(e)} + seriesList.push({ + trialId, + subjectVisitId, + studyId, + imageIds: imageIds, + seriesId: seriesId, + seriesUid: seriesInstanceUid, + seriesNumber: seriesNumber, + sliceThickness: sliceLocation, + modality: this.modality, + description: this.description, + isReading, + isDeleted, + previewImageUrl: res.OtherInfo.ImageResizePath ? scope.OSSclientConfig.basePath + res.OtherInfo.ImageResizePath : res.OtherInfo.ImageResizePath, + instanceCount: res.Result.length, + prefetchInstanceCount: 0, + loadStatus: false, + imageloadedArr: [] + }) + this.seriesList = seriesList + if (this.seriesList.length > 0) { + this.$nextTick(() => { + this.loadAllImages() + this.$refs.dicomViewer.loadImageStack(this.seriesList[0]) + this.firstInstanceId = this.seriesList[0].imageIds[0] + }) + } + }) }, showSeriesImage(e, seriesIndex, series) { // if (seriesIndex === this.currentSeriesIndex) return