Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2026-05-15 09:55:47 +08:00
commit 6a10cb1afe
3 changed files with 34 additions and 23 deletions

View File

@ -203,6 +203,9 @@ export default {
methods: {
loadImageStack(dicomSeries) {
this.$nextTick(() => {
if (!dicomSeries || !Array.isArray(dicomSeries.imageIds) || dicomSeries.imageIds.length === 0) {
return
}
this.series = dicomSeries
this.stack.seriesId = dicomSeries.seriesId
this.stack.seriesNumber = dicomSeries.seriesNumber
@ -379,9 +382,7 @@ export default {
// var instanceId = image.imageId.split('/')[image.imageId.split('/').length - 1]
// instanceId = instanceId.split('.')[0]
// this.stack.instanceId = instanceId
this.height =
(this.stack.currentImageIdIndex * 100) /
(this.stack.imageIds.length - 1)
this.height = this.getStackHeightPercent()
this.resetWwwc()
},
onNewImage(e) {
@ -427,10 +428,14 @@ export default {
this.stack.currentImageIdIndex = newImageIdIndex
this.stack.imageIdIndex = newImageIdIndex
this.series.imageIdIndex = newImageIdIndex
this.height =
(this.stack.currentImageIdIndex * 100) /
(this.stack.imageIds.length - 1)
this.resetWwwc()
this.height = this.getStackHeightPercent()
},
getStackHeightPercent() {
const imageCount = Array.isArray(this.stack.imageIds) ? this.stack.imageIds.length : 0
if (imageCount <= 1) {
return 0
}
return (this.stack.currentImageIdIndex * 100) / (imageCount - 1)
},
stackScrollCallback(e) {
const { detail } = e
@ -737,6 +742,7 @@ export default {
var viewport = cornerstone.getViewport(this.canvas)
// viewport.invert = false
var image = cornerstone.getImage(this.canvas)
if (!viewport || !image) return
viewport.voi.windowWidth = image.windowWidth
viewport.voi.windowCenter = image.windowCenter
cornerstone.setViewport(this.canvas, viewport)

View File

@ -28,7 +28,7 @@ async function executeTask() {
task.callback({ success: true, res: result })
}).catch((error) => {
task.callback({ success: true, err: error })
task.callback({ success: false, err: error })
})
})
// let starLoadTime = performance.now()

View File

@ -346,20 +346,18 @@ export default {
this.isFromCRCUpload = !!this.$router.currentRoute.query.isFromCRCUpload
this.visitTaskId = this.$router.currentRoute.query.visitTaskId
this.page = this.$route.query.page
this.beforeUnloadHandler = () => {
cornerstone.imageCache.purgeCache()
requestPoolManager.resetRequestPool()
}
// cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
this.getStudiesInfo()
cornerstone.events.addEventListener('cornerstoneimageloadprogress', this.cornerstoneimageloadprogress)
window.addEventListener('beforeunload', e => {
cornerstone.imageCache.purgeCache()
requestPoolManager.resetRequestPool()
})
window.addEventListener('beforeunload', this.beforeUnloadHandler)
},
beforeDestroy() {
requestPoolManager.stopTaskTimer()
window.removeEventListener('beforeunload', e => {
cornerstone.imageCache.purgeCache()
requestPoolManager.resetRequestPool()
})
window.removeEventListener('beforeunload', this.beforeUnloadHandler)
workSpeedclose(true)
},
methods: {
@ -489,14 +487,17 @@ export default {
data.SeriesList = seriesList
this.studyList.push(data)
})
if (this.studyList.length > 0) {
this.$refs.dicomViewer.loadImageStack(this.studyList[0].SeriesList[0])
const imageId = this.studyList[0].SeriesList[0].imageIds[0]
const firstStudy = this.studyList.find(study => Array.isArray(study.SeriesList) && study.SeriesList.length > 0)
if (firstStudy) {
const firstSeries = firstStudy.SeriesList[0]
if (!Array.isArray(firstSeries.imageIds) || firstSeries.imageIds.length === 0) return
this.$refs.dicomViewer.loadImageStack(firstSeries)
const imageId = firstSeries.imageIds[0]
let instanceId = imageId.split('/')[imageId.split('/').length - 1]
instanceId = instanceId.split('.')[0]
this.firstInstanceId = instanceId
this.activeNames = [this.studyList[0].StudyId]
this.loadImages(this.studyList[0].SeriesList[0], 0)
this.activeNames = [firstStudy.StudyId]
this.loadImages(firstSeries, 0)
}
}
} catch (e) {
@ -599,7 +600,11 @@ export default {
}
if (!isAddToTakPool) {
var priority = parseInt(new Date().getTime())
if (series.isExistMutiFrames) {
if (series.isExistMutiFrames && imageIds.length > 1) {
imageIds.map(imageId => {
this.imageList.push({ imageId, seriesId: series.seriesId, priority })
})
} else if (series.isExistMutiFrames) {
series.instanceInfoList.map(image => {
this.imageList.push({ imageId: image.ImageId, seriesId: series.seriesId, priority })
})
@ -938,7 +943,7 @@ export default {
if (this.imageList.length > 0) {
requestPoolManager.startTaskTimer()
this.imageList.map(image => {
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority)
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).catch(() => {})
})
requestPoolManager.sortTaskPool()
this.imageList = []