697 lines
		
	
	
		
			24 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			697 lines
		
	
	
		
			24 KiB
		
	
	
	
		
			Plaintext
		
	
	
/* eslint-disable vue/this-in-template */
 | 
						|
<template>
 | 
						|
  <div class="viewerContainer">
 | 
						|
    <!-- <div class="viewerBanner" /> -->
 | 
						|
    <div class="viewerContentWrapper">
 | 
						|
      <div class="viewerLeftSidePanel">
 | 
						|
        <div id="listWrapper" class="sidePanelBody">
 | 
						|
          <div class="sidePanelThumbs">
 | 
						|
            <el-tabs v-model="activeName" type="border-card">
 | 
						|
              <el-tab-pane label="当前检查" name="first">
 | 
						|
                <div class="studyDesc">
 | 
						|
                  {{ studyCode }}
 | 
						|
                </div>
 | 
						|
                <div class="studyDesc">
 | 
						|
                  {{ description }}
 | 
						|
                </div>
 | 
						|
                <div v-if="seriesCount" class="studyDesc">
 | 
						|
                  {{ modality }} : {{ seriesCount }} Series
 | 
						|
                </div>
 | 
						|
                <div class="viewerSidethumbs ps" style="position: relative;">
 | 
						|
                  <div class="viewerSidethumbinner">
 | 
						|
                    <div
 | 
						|
                      v-for="(item, index) in seriesList"
 | 
						|
 | 
						|
                      :key="index"
 | 
						|
                      class="viewernavigatorwrapper"
 | 
						|
                      :class="{'viewerSideActive': index==0}"
 | 
						|
                      style="position: relative;"
 | 
						|
                      series-type="current"
 | 
						|
                      @click="showSeriesImage($event,index)"
 | 
						|
                    >
 | 
						|
                      <el-image
 | 
						|
                        class="image-preview"
 | 
						|
                        style="height:72px;width:72px;"
 | 
						|
                        :src="item.previewImageUrl"
 | 
						|
                        fit="fill"
 | 
						|
                        @load="previewImageLoad"
 | 
						|
                        @error="previewImageLoadError"
 | 
						|
                      />
 | 
						|
                      <div class="viewernavitextwrapper">
 | 
						|
                        <div v-if="item.keySeries" style="padding: 1px;color:red">
 | 
						|
                          Key Images
 | 
						|
                        </div>
 | 
						|
                        <div v-else style="padding: 1px;">
 | 
						|
                          #{{ item.seriesNumber }}
 | 
						|
                        </div>
 | 
						|
                        <div v-show="item.instanceCount" style="padding: 1px;">
 | 
						|
                          {{ item.modality }}: {{ item.instanceCount }} image
 | 
						|
                        </div>
 | 
						|
                        <div v-show="!item.keySeries && item.sliceThickness" style="padding: 1px;">
 | 
						|
                          T: {{ item.sliceThickness }}
 | 
						|
                        </div>
 | 
						|
                        <div v-show="!item.keySeries &&item.description" style="padding: 1x;">
 | 
						|
                          {{ item.description }}
 | 
						|
                        </div>
 | 
						|
                        <div v-if="!item.keySeries" style="padding: 1px;">
 | 
						|
                          {{ item.prefetchInstanceCount }}/{{ item.instanceCount }}
 | 
						|
                        </div>
 | 
						|
 | 
						|
                      </div>
 | 
						|
 | 
						|
                      <div v-if="arr.indexOf(item.seriesId) !== -1 || item.hasLabel" class="viewerlabelwrapper">
 | 
						|
                        <i v-if="!item.keySeries" style="color: #FF5722;font-size:16px;" class="el-icon-star-on" />
 | 
						|
                      </div>
 | 
						|
                      <div v-if="!item.keySeries" style="position: absolute;bottom: -10px;left: 0;width: 100%;">
 | 
						|
                        <el-progress v-if="item.prefetchInstanceCount>0 && item.prefetchInstanceCount<item.instanceCount" :percentage="Number(item.prefetchInstanceCount/item.instanceCount)*100" />
 | 
						|
                      </div>
 | 
						|
 | 
						|
                    </div>
 | 
						|
                  </div>
 | 
						|
                </div>
 | 
						|
              </el-tab-pane>
 | 
						|
            </el-tabs>
 | 
						|
          </div>
 | 
						|
        </div>
 | 
						|
      </div>
 | 
						|
      <div class="viewerContent">
 | 
						|
        <dicom-viewer id="dicomViewer" ref="dicomViewer" style="height:100%" />
 | 
						|
      </div>
 | 
						|
      <!-- <div class="viewerRightSidePanel">
 | 
						|
        <dicom-tools />
 | 
						|
      </div> -->
 | 
						|
 | 
						|
    </div>
 | 
						|
 | 
						|
  </div>
 | 
						|
</template>
 | 
						|
 | 
						|
<script>
 | 
						|
import * as dicomParser from 'dicom-parser'
 | 
						|
import * as cornerstone from 'cornerstone-core'
 | 
						|
import * as cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'
 | 
						|
import dicomViewer from '@/components/Dicom/DicomViewer'
 | 
						|
import { getStudyInfo, getSeriesList, getRelationVisitList, getAllRelationStudyList } from '@/api/reading'
 | 
						|
import requestPoolManager from '@/utils/request-pool'
 | 
						|
import store from '@/store'
 | 
						|
import { changeURLStatic } from '@/utils/history.js'
 | 
						|
cornerstoneWADOImageLoader.external.dicomParser = dicomParser
 | 
						|
cornerstoneWADOImageLoader.external.cornerstone = cornerstone
 | 
						|
cornerstoneWADOImageLoader.webWorkerManager.initialize({
 | 
						|
  webWorkerPath: './webWorker.js',
 | 
						|
  taskConfiguration: {
 | 
						|
    'decodeTask': {
 | 
						|
      codecsPath: './dicomCodecs.js'
 | 
						|
    }
 | 
						|
  }
 | 
						|
})
 | 
						|
// import * as OfflinePluginRuntime from 'offline-plugin/runtime'
 | 
						|
 | 
						|
// OfflinePluginRuntime.install({
 | 
						|
//   onUpdateReady: function() {
 | 
						|
//     OfflinePluginRuntime.applyUpdate()
 | 
						|
//   },
 | 
						|
//   onUpdated: function() {
 | 
						|
//     location.reload()
 | 
						|
//   }
 | 
						|
// })
 | 
						|
const maximumSizeInBytes = 1024 * 1024 * 1024 // 1 GB
 | 
						|
export default {
 | 
						|
  components: {
 | 
						|
    'dicom-viewer': dicomViewer
 | 
						|
  },
 | 
						|
 | 
						|
  data: function() {
 | 
						|
    return {
 | 
						|
      trialId: '',
 | 
						|
      studyId: '',
 | 
						|
      tpCode: '',
 | 
						|
      baseLine: null,
 | 
						|
      studyCode: '',
 | 
						|
      modality: '',
 | 
						|
      description: '',
 | 
						|
      seriesCount: 0,
 | 
						|
      seriesList: [],
 | 
						|
      currentSeriesIndex: -1,
 | 
						|
      arr: [],
 | 
						|
      activeName: 'first',
 | 
						|
      tpList: [],
 | 
						|
      visitNum: 0,
 | 
						|
      labels: {},
 | 
						|
      type: '',
 | 
						|
      currentRelationIndex: [],
 | 
						|
      cachedImages: [],
 | 
						|
      isLoadedAll: false,
 | 
						|
      studyList: {},
 | 
						|
      currentStudy: '',
 | 
						|
      previewImageCount: 0,
 | 
						|
      relationStudyList: []
 | 
						|
    }
 | 
						|
  },
 | 
						|
  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
 | 
						|
    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()
 | 
						|
    } else if (this.type === 'Study') {
 | 
						|
      this.loadStudy()
 | 
						|
    } else if (this.type === 'Share') {
 | 
						|
      this.loadStudy()
 | 
						|
    }
 | 
						|
  },
 | 
						|
 | 
						|
  methods: {
 | 
						|
    loadStudy() {
 | 
						|
      var scope = this
 | 
						|
      getStudyInfo(scope.studyId).then(data => {
 | 
						|
        if (data.IsSuccess) {
 | 
						|
          scope.studyCode = data.Result.StudyCode
 | 
						|
          scope.modality = data.Result.Modalities
 | 
						|
          scope.seriesCount = data.Result.SeriesCount
 | 
						|
          scope.description = data.Result.Description
 | 
						|
          var url = `/series/list/${scope.studyId}`
 | 
						|
          scope.getSeriesList(url)
 | 
						|
        }
 | 
						|
      })
 | 
						|
    },
 | 
						|
    getSeriesList(url) {
 | 
						|
      var scope = this
 | 
						|
      getSeriesList(url).then(data => {
 | 
						|
        if (data.IsSuccess) {
 | 
						|
          const { Result } = data
 | 
						|
          var seriesList = []
 | 
						|
          Result.forEach(function(item) {
 | 
						|
            const imageIds = []
 | 
						|
            item.InstanceList.forEach(function(id) {
 | 
						|
              imageIds.push(`wadouri:/api/instance/content/${id}`)
 | 
						|
            })
 | 
						|
            seriesList.push({
 | 
						|
              imageIds: imageIds,
 | 
						|
              seriesId: item.Id,
 | 
						|
              seriesUid: item.SeriesInstanceUid,
 | 
						|
              seriesNumber: item.SeriesNumber,
 | 
						|
              sliceThickness: item.SliceThickness,
 | 
						|
              modality: item.Modality,
 | 
						|
              description: item.Description,
 | 
						|
              previewImageUrl: `/api/series/preview/${item.Id}`,
 | 
						|
              instanceCount: item.InstanceCount,
 | 
						|
              prefetchInstanceCount: 0,
 | 
						|
              hasLabel: item.HasLabel,
 | 
						|
              keySeries: item.KeySeries,
 | 
						|
              tpCode: scope.tpCode,
 | 
						|
              loadStatus: false,
 | 
						|
              imageloadedArr: []
 | 
						|
            })
 | 
						|
          })
 | 
						|
          scope.seriesList = seriesList
 | 
						|
          if (scope.seriesList.length > 0) {
 | 
						|
            scope.$refs.dicomViewer.loadImageStack(scope.seriesList[0], scope.labels[scope.tpCode])
 | 
						|
          }
 | 
						|
        }
 | 
						|
      })
 | 
						|
    },
 | 
						|
    previewImageLoad() {
 | 
						|
      this.previewImageCount++
 | 
						|
      if (this.previewImageCount === this.seriesCount) {
 | 
						|
        this.loadAllImages()
 | 
						|
      }
 | 
						|
    },
 | 
						|
    previewImageLoadError() {
 | 
						|
      this.previewImageCount++
 | 
						|
      if (this.previewImageCount === this.seriesCount) {
 | 
						|
        this.loadAllImages()
 | 
						|
      }
 | 
						|
    },
 | 
						|
    showSeriesImage(e, seriesIndex) {
 | 
						|
      // if (seriesIndex === this.currentSeriesIndex) return
 | 
						|
      const element = e.currentTarget
 | 
						|
      const elements = document.querySelectorAll('[series-type]')
 | 
						|
      Array.from(elements).forEach((e) => {
 | 
						|
        e.classList.remove('viewerSideActive')
 | 
						|
      })
 | 
						|
      element.classList.add('viewerSideActive')
 | 
						|
      this.currentSeriesIndex = seriesIndex
 | 
						|
      this.$refs.dicomViewer.loadImageStack(this.seriesList[seriesIndex])
 | 
						|
    },
 | 
						|
    initStudy() {
 | 
						|
      this.studyCode = this.$router.currentRoute.query.studyCode
 | 
						|
      this.modality = this.$router.currentRoute.query.modality
 | 
						|
      this.seriesCount = 1
 | 
						|
      this.description = this.$router.currentRoute.query.description
 | 
						|
      if (this.$router.currentRoute.query.series) {
 | 
						|
        const seriesInfo = JSON.parse(this.$router.currentRoute.query.series)
 | 
						|
        var seriesList = []
 | 
						|
        const imageIds = []
 | 
						|
        // const scope = this
 | 
						|
        seriesInfo.InstanceList.forEach(function(item) {
 | 
						|
          imageIds.push(`wadouri:/api/instance/content/${item}`)
 | 
						|
        })
 | 
						|
        seriesList.push({
 | 
						|
          imageIds: imageIds,
 | 
						|
          seriesId: seriesInfo.Id,
 | 
						|
          seriesUid: seriesInfo.SeriesInstanceUid,
 | 
						|
          seriesNumber: seriesInfo.SeriesNumber,
 | 
						|
          sliceThickness: seriesInfo.SliceThickness,
 | 
						|
          modality: seriesInfo.Modality,
 | 
						|
          description: seriesInfo.Description,
 | 
						|
          previewImageUrl: `/api/series/preview/${seriesInfo.Id}`,
 | 
						|
          instanceCount: seriesInfo.InstanceCount,
 | 
						|
          prefetchInstanceCount: 0,
 | 
						|
          hasLabel: seriesInfo.HasLabel,
 | 
						|
          keySeries: seriesInfo.KeySeries,
 | 
						|
          loadStatus: false,
 | 
						|
          imageloadedArr: []
 | 
						|
        })
 | 
						|
        this.seriesList = seriesList
 | 
						|
        if (this.seriesList.length > 0) {
 | 
						|
          this.$nextTick(() => {
 | 
						|
          // this.loadAllImages()
 | 
						|
            this.$refs.dicomViewer.loadImageStack(this.seriesList[0])
 | 
						|
          })
 | 
						|
        }
 | 
						|
      }
 | 
						|
    },
 | 
						|
    handleTabClick(tab, event) {
 | 
						|
      if (tab.name === 'second' && this.tpList.length <= 0) {
 | 
						|
        getRelationVisitList(this.visitNum, this.tpCode).then(res => {
 | 
						|
          this.tpList = res.Result
 | 
						|
        })
 | 
						|
      } else if (tab.name === 'third' && this.relationStudyList.length <= 0) {
 | 
						|
        if (this.studyId) {
 | 
						|
          const loading = this.$loading({
 | 
						|
            target: document.querySelector('.pane-third-wrapper'),
 | 
						|
            fullscreen: false,
 | 
						|
            lock: true,
 | 
						|
            text: 'Loading',
 | 
						|
            background: 'rgb(49 49 49 / 50%)',
 | 
						|
            spinner: 'el-icon-loading'
 | 
						|
          })
 | 
						|
          getAllRelationStudyList(this.studyId).then(res => {
 | 
						|
            loading.close()
 | 
						|
            this.relationStudyList = res.Result
 | 
						|
          }).catch(() => { loading.close() })
 | 
						|
        }
 | 
						|
      }
 | 
						|
    },
 | 
						|
    getRelationInfo(visit, index) {
 | 
						|
      this.getRelationStudy(visit, index)
 | 
						|
    },
 | 
						|
    getRelationStudy(visit, index) {
 | 
						|
      this.currentRelationIndex = index
 | 
						|
      const scope = this
 | 
						|
      if (scope.tpList[index].seriesCount) {
 | 
						|
        scope.tpList[index].showSeries = !scope.tpList[index].showSeries
 | 
						|
        scope.$forceUpdate()
 | 
						|
      } else {
 | 
						|
        getStudyInfo(visit.StudyId).then(data => {
 | 
						|
          if (data.IsSuccess) {
 | 
						|
            const { Result } = data
 | 
						|
            scope.tpList[index].studyCode = Result.StudyCode
 | 
						|
            scope.tpList[index].modality = Result.Modalities
 | 
						|
            scope.tpList[index].seriesCount = Result.SeriesCount
 | 
						|
            var url = ''
 | 
						|
            if (scope.type === 'Study') {
 | 
						|
              url = `/series/list/${visit.StudyId}`
 | 
						|
            } else {
 | 
						|
              url = `/series/list/${visit.StudyId}/${visit.TpCode}`
 | 
						|
            }
 | 
						|
            scope.getRelationSeriesList(url, index)
 | 
						|
          }
 | 
						|
        })
 | 
						|
      }
 | 
						|
    },
 | 
						|
    getRelationSeriesByStudy(studyId, index) {
 | 
						|
      if (this.relationStudyList[index].seriesCount) {
 | 
						|
        this.relationStudyList[index].showSeries = !this.relationStudyList[index].showSeries
 | 
						|
        this.$forceUpdate()
 | 
						|
      } else {
 | 
						|
        const scope = this
 | 
						|
        const loading = this.$loading({
 | 
						|
          target: document.querySelector(`.relation-study-wrapper-${index}`),
 | 
						|
          fullscreen: false,
 | 
						|
          lock: true,
 | 
						|
          text: 'Loading',
 | 
						|
          background: 'rgb(49 49 49 / 50%)',
 | 
						|
          spinner: 'el-icon-loading'
 | 
						|
        })
 | 
						|
 | 
						|
        getStudyInfo(studyId).then(data => {
 | 
						|
          scope.relationStudyList[index].studyCode = data.Result.StudyCode
 | 
						|
          scope.relationStudyList[index].modality = data.Result.Modalities
 | 
						|
          scope.relationStudyList[index].seriesCount = data.Result.SeriesCount
 | 
						|
          getSeriesList(`/series/list/${studyId}`).then(data => {
 | 
						|
            loading.close()
 | 
						|
            var seriesList = []
 | 
						|
            const { Result } = data
 | 
						|
            Result.forEach(function(item) {
 | 
						|
              const imageIds = []
 | 
						|
              item.InstanceList.forEach(function(id) {
 | 
						|
                imageIds.push(`wadouri:/api/instance/content/${id}`)
 | 
						|
              })
 | 
						|
              seriesList.push({
 | 
						|
                imageIds: imageIds,
 | 
						|
                seriesId: item.Id,
 | 
						|
                seriesUid: item.SeriesInstanceUid,
 | 
						|
                seriesNumber: item.SeriesNumber,
 | 
						|
                sliceThickness: item.SliceThickness,
 | 
						|
                modality: item.Modality,
 | 
						|
                description: item.Description,
 | 
						|
                previewImageUrl: `/api/series/preview/${item.Id}`,
 | 
						|
                instanceCount: item.InstanceCount,
 | 
						|
                prefetchInstanceCount: 0,
 | 
						|
                hasLabel: item.HasLabel,
 | 
						|
                keySeries: item.KeySeries,
 | 
						|
                loadStatus: false,
 | 
						|
                imageloadedArr: []
 | 
						|
              })
 | 
						|
            })
 | 
						|
            scope.relationStudyList[index].seriesCount = seriesList.length
 | 
						|
            scope.relationStudyList[index].seriesList = seriesList
 | 
						|
            scope.relationStudyList[index].showSeries = true
 | 
						|
            scope.$forceUpdate()
 | 
						|
          }).catch(() => { loading.close() })
 | 
						|
        }).catch(() => { loading.close() })
 | 
						|
      }
 | 
						|
    },
 | 
						|
    getRelationSeriesList(url, index) {
 | 
						|
      var scope = this
 | 
						|
      getSeriesList(url).then(data => {
 | 
						|
        if (data.IsSuccess) {
 | 
						|
          const { Result } = data
 | 
						|
          var seriesList = []
 | 
						|
          Result.forEach(function(item) {
 | 
						|
            const imageIds = []
 | 
						|
            item.InstanceList.forEach(function(id) {
 | 
						|
              imageIds.push(`wadouri:/api/instance/content/${id}`)
 | 
						|
            })
 | 
						|
            seriesList.push({
 | 
						|
              imageIds: imageIds,
 | 
						|
              seriesId: item.Id,
 | 
						|
              seriesUid: item.SeriesInstanceUid,
 | 
						|
              seriesNumber: item.SeriesNumber,
 | 
						|
              sliceThickness: item.SliceThickness,
 | 
						|
              modality: item.Modality,
 | 
						|
              description: item.Description,
 | 
						|
              previewImageUrl: `/api/series/preview/${item.Id}`,
 | 
						|
              instanceCount: item.InstanceCount,
 | 
						|
              prefetchInstanceCount: 0,
 | 
						|
              hasLabel: item.HasLabel,
 | 
						|
              keySeries: item.KeySeries,
 | 
						|
              tpCode: scope.tpCode,
 | 
						|
              loadStatus: false,
 | 
						|
              imageloadedArr: []
 | 
						|
            })
 | 
						|
          })
 | 
						|
          scope.tpList[index].seriesCount = seriesList.length
 | 
						|
          scope.tpList[index].seriesList = seriesList
 | 
						|
          scope.tpList[index].showSeries = true
 | 
						|
          scope.tpList[index].currentSeriesIndex = 0
 | 
						|
          scope.$forceUpdate()
 | 
						|
        }
 | 
						|
      })
 | 
						|
    },
 | 
						|
    showRelationSeriesImage(e, series, index) {
 | 
						|
      this.currentRelationIndex = index
 | 
						|
      const element = e.currentTarget
 | 
						|
      const elements = document.querySelectorAll('[series-type]')
 | 
						|
      Array.from(elements).forEach((e) => {
 | 
						|
        e.classList.remove('viewerSideActive')
 | 
						|
      })
 | 
						|
      element.classList.add('viewerSideActive')
 | 
						|
      if (this.type === 'Study') {
 | 
						|
        this.$refs.dicomViewer.loadImageStack(series)
 | 
						|
      } else {
 | 
						|
        this.$refs.dicomViewer.loadImageStack(series, this.labels[series.tpCode])
 | 
						|
      }
 | 
						|
    },
 | 
						|
    loadAllImages() {
 | 
						|
      // const series = this.seriesList.find(item => item.loadStatus === false)
 | 
						|
      // if (series) {
 | 
						|
      //   series.imageIds.forEach(imageId => {
 | 
						|
      //     cornerstone.loadImage(imageId)
 | 
						|
      //   })
 | 
						|
      // } else {
 | 
						|
      //   this.isLoadedAll = true
 | 
						|
      // }
 | 
						|
      requestPoolManager.startTaskTimer()
 | 
						|
      const scope = this
 | 
						|
      this.seriesList.forEach(series => {
 | 
						|
        series.imageIds.forEach(imageId => {
 | 
						|
          scope.load(imageId)
 | 
						|
        })
 | 
						|
      })
 | 
						|
    },
 | 
						|
    load(imageId, priority = 999) {
 | 
						|
      return new Promise((resolve, reject) => {
 | 
						|
        const imageTask = this.buildImageRequestTask(imageId, { priority })
 | 
						|
        requestPoolManager.addTaskIntoPool(imageTask).then((res) => {
 | 
						|
          resolve(res)
 | 
						|
        }).catch(e => {
 | 
						|
          reject(e)
 | 
						|
          console.log(e)
 | 
						|
          // if (e && e.error && e.error.exception) {
 | 
						|
          //   this.$message.error(e.error.exception)
 | 
						|
          // }
 | 
						|
        })
 | 
						|
      })
 | 
						|
    },
 | 
						|
    buildImageRequestTask(imageId, config = {}) {
 | 
						|
      return {
 | 
						|
        key: imageId,
 | 
						|
        ...config,
 | 
						|
        execute: () => {
 | 
						|
          return cornerstone.loadAndCacheImage(imageId)
 | 
						|
        }
 | 
						|
      }
 | 
						|
    },
 | 
						|
    datasetsCacheChanged(e) {
 | 
						|
      // const uri = e.detail.uri
 | 
						|
      const cacheInfo = e.detail.cacheInfo
 | 
						|
      const cacheSizeInBytes = cacheInfo.cacheSizeInBytes
 | 
						|
      if (cacheSizeInBytes >= maximumSizeInBytes) {
 | 
						|
        // this.unload()
 | 
						|
      }
 | 
						|
    },
 | 
						|
    unload() {
 | 
						|
      this.cachedImages.sort(this.compare)
 | 
						|
      cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.unload(this.cachedImages[0].uri)
 | 
						|
      this.cachedImages.splice(0, 1)
 | 
						|
    },
 | 
						|
    compare(a, b) {
 | 
						|
      if (a.timeStamp > b.timeStamp) {
 | 
						|
        return -1
 | 
						|
      }
 | 
						|
      if (a.timeStamp < b.timeStamp) {
 | 
						|
        return 1
 | 
						|
      }
 | 
						|
 | 
						|
      return 0
 | 
						|
    },
 | 
						|
    cornerstoneImageLoaded(e) {
 | 
						|
      const uri = e.detail.image.sharedCacheKey
 | 
						|
      const index = this.cachedImages.findIndex(item => item.uri === uri)
 | 
						|
      if (index === -1) {
 | 
						|
        this.cachedImages.push({ uri: uri, timestamp: new Date().getTime() })
 | 
						|
      } else {
 | 
						|
        this.cachedImages[index].timestamp = new Date().getTime()
 | 
						|
      }
 | 
						|
      // loadedDataSets[uri].dataSet.byteArray.length
 | 
						|
      // console.log(this.cachedImages.length)
 | 
						|
      // console.log(cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.getInfo().cacheSizeInBytes)
 | 
						|
      // const imageId = e.detail.image.imageId
 | 
						|
      var imageId = e.detail.image.imageId
 | 
						|
      var seriesUid = e.detail.image.data.string('x0020000e')
 | 
						|
      var seriesIndex = -1
 | 
						|
      for (let i = 0; i < this.seriesList.length; ++i) {
 | 
						|
        if (this.seriesList[i].seriesUid === seriesUid) {
 | 
						|
          seriesIndex = i
 | 
						|
          break
 | 
						|
        }
 | 
						|
      }
 | 
						|
      if (seriesIndex < 0) return
 | 
						|
 | 
						|
      const imageIdIndex = this.seriesList[seriesIndex].imageIds.indexOf(imageId)
 | 
						|
      if (imageIdIndex < 0) return
 | 
						|
      if (this.seriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0) {
 | 
						|
        ++this.seriesList[seriesIndex].prefetchInstanceCount
 | 
						|
        this.seriesList[seriesIndex].imageloadedArr.push(imageId)
 | 
						|
 | 
						|
        if (this.seriesList[seriesIndex].prefetchInstanceCount >= this.seriesList[seriesIndex].instanceCount) {
 | 
						|
          this.seriesList[seriesIndex].prefetchInstanceCount = this.seriesList[seriesIndex].instanceCount
 | 
						|
          // 设置当前序列状态为已下载完成
 | 
						|
          this.seriesList[seriesIndex].loadStatus = true
 | 
						|
          // if (!this.isLoadedAll) {
 | 
						|
          //   this.loadAllImages()
 | 
						|
          // }
 | 
						|
        }
 | 
						|
      }
 | 
						|
    }
 | 
						|
  }
 | 
						|
 | 
						|
}
 | 
						|
</script>
 | 
						|
 | 
						|
<style>
 | 
						|
.viewerContainer .el-tabs--border-card{
 | 
						|
  background:none;
 | 
						|
  border: none;
 | 
						|
}
 | 
						|
.viewerContainer .el-tabs__item{
 | 
						|
  height: 35px;
 | 
						|
  line-height: 35px;
 | 
						|
}
 | 
						|
.viewerContainer .el-tabs--border-card>.el-tabs__content{
 | 
						|
  padding: 5px 0px 0px 0px;
 | 
						|
}
 | 
						|
.viewerContainer ::-webkit-scrollbar {
 | 
						|
    width: 7px;
 | 
						|
    height: 7px;
 | 
						|
}
 | 
						|
.viewerContainer ::-webkit-scrollbar-thumb {
 | 
						|
    border-radius: 10px;
 | 
						|
    background: #d0d0d0;
 | 
						|
}
 | 
						|
.viewerContainer .relationVisit{
 | 
						|
  line-height: 20px;
 | 
						|
  cursor: pointer;
 | 
						|
}
 | 
						|
  .viewerContainer{
 | 
						|
    display: block;
 | 
						|
    height: 100%;
 | 
						|
    margin-left: auto;
 | 
						|
    margin-right: auto;
 | 
						|
    background-color: #444;
 | 
						|
    overflow: hidden;
 | 
						|
  }
 | 
						|
.viewerContainer  .viewerBanner {
 | 
						|
    background: linear-gradient(0,#444,#222);
 | 
						|
    min-height: 28px;
 | 
						|
    font-size: 16px;
 | 
						|
    margin: 0;
 | 
						|
    height: 30px;
 | 
						|
    padding-top: 0;
 | 
						|
    padding-left: 5px;
 | 
						|
    padding-right: 5px;
 | 
						|
    font-weight: bold;
 | 
						|
}
 | 
						|
.viewerContainer .viewerContentWrapper {
 | 
						|
  display: flex;
 | 
						|
  flex-direction: row;
 | 
						|
    width: 100%;
 | 
						|
    padding: 5px;
 | 
						|
    /* height: 95%; */
 | 
						|
    height: 99%;
 | 
						|
    overflow: hidden;
 | 
						|
    text-overflow: clip;
 | 
						|
    white-space: nowrap;
 | 
						|
}
 | 
						|
.viewerContainer .viewerContentWrapper>div {
 | 
						|
    display: inline-block;
 | 
						|
    white-space: normal;
 | 
						|
}
 | 
						|
.viewerContainer .viewerLeftSidePanel {
 | 
						|
    width: 215px;
 | 
						|
    background-color: #323232;
 | 
						|
    box-sizing: border-box;
 | 
						|
    margin: 0;
 | 
						|
    padding: 0;
 | 
						|
    margin-right: 2px;
 | 
						|
    color: #D0D0D0;
 | 
						|
    overflow-y: auto;
 | 
						|
}
 | 
						|
.viewerContainer .viewerContentWrapper>div>.sidePanelBody {
 | 
						|
    background: rgba(50,50,50,1);
 | 
						|
    word-break: break-all;
 | 
						|
    display: table;
 | 
						|
    width: 100%;
 | 
						|
    border: 1px solid #3e3f3a;
 | 
						|
}
 | 
						|
.viewerContainer .viewerContentWrapper>div>div.sidePanelBody>div {
 | 
						|
    width: 100%;
 | 
						|
    height: 100%;
 | 
						|
}
 | 
						|
.viewerContainer .studyDesc{
 | 
						|
  font-weight: bold;
 | 
						|
  font-size: 13px;
 | 
						|
  text-align: center;
 | 
						|
  background: rgb(88 84 83);
 | 
						|
  color: #d0d0d0;
 | 
						|
  padding: 2px;
 | 
						|
}
 | 
						|
.viewerContainer .ps {
 | 
						|
    overflow: hidden !important;
 | 
						|
    overflow-anchor: none;
 | 
						|
    -ms-overflow-style: none;
 | 
						|
    touch-action: auto;
 | 
						|
    -ms-touch-action: auto;
 | 
						|
}
 | 
						|
.viewerContainer .viewerLeftSidePanel .viewernavigatorwrapper {
 | 
						|
    display: flex;
 | 
						|
    width: 210px;
 | 
						|
    height: 84px;
 | 
						|
    padding: 1px 2px 1px 8px;
 | 
						|
    margin: 6px 0 6px 1px;
 | 
						|
    border-radius: 2px;
 | 
						|
    border: 1px solid #404040;
 | 
						|
}
 | 
						|
.viewerContainer .viewernavigatorwrapper .el-progress__text{
 | 
						|
  display: none;
 | 
						|
}
 | 
						|
.viewerContainer .viewernavigatorwrapper .el-progress-bar{
 | 
						|
  padding-right:0px;
 | 
						|
}
 | 
						|
.viewerContainer .ui-draggable-handle {
 | 
						|
    -ms-touch-action: none;
 | 
						|
    touch-action: none;
 | 
						|
}
 | 
						|
.viewerContainer .viewerLeftSidePanel .image-preview {
 | 
						|
    border: 2px solid #252525;
 | 
						|
    cursor: pointer;
 | 
						|
}
 | 
						|
.viewerContainer .viewerLeftSidePanel .viewernavitextwrapper {
 | 
						|
    /* width: 120px;
 | 
						|
    height: 80px; */
 | 
						|
    flex:1;
 | 
						|
    padding: 3px 1px 3px 4px;
 | 
						|
    vertical-align: top;
 | 
						|
    font-size: 12px;
 | 
						|
}
 | 
						|
.viewerContainer .viewerLeftSidePanel .viewerlabelwrapper {
 | 
						|
    width: 20px;
 | 
						|
 | 
						|
    font-size: 12px;
 | 
						|
}
 | 
						|
.viewerContainer .viewerSideActive {
 | 
						|
    background: #16477b;
 | 
						|
    background: #16477b80;
 | 
						|
    border: 1px solid #23527b;
 | 
						|
}
 | 
						|
.viewerContainer .viewerContent {
 | 
						|
    flex: 1;
 | 
						|
    height: 100%;
 | 
						|
    display: block;
 | 
						|
    background-color: black;
 | 
						|
    color: #D0D0D0;
 | 
						|
    font-size: 13px;
 | 
						|
}
 | 
						|
/* .viewerRightSidePanel {
 | 
						|
    width: 300px;
 | 
						|
    height: 100%;
 | 
						|
    background-color: #323232;
 | 
						|
    margin: 0;
 | 
						|
    padding: 0;
 | 
						|
    margin-left: 2px;
 | 
						|
    border: 1px solid blueviolet;
 | 
						|
    color: #D0D0D0;
 | 
						|
    font-size: 13px;
 | 
						|
} */
 | 
						|
</style>
 |