Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
6ca9ed8a9b
|
@ -1,7 +1,7 @@
|
|||
import * as cornerstone from 'cornerstone-core'
|
||||
var taskPool = [] // 请求池
|
||||
let numRequest = 0 // 正在执行数量
|
||||
const maxRequest = 6 // 可配置
|
||||
const maxRequest = 5 // 可配置
|
||||
let taskTimer // 轮询的定时器
|
||||
var cachedTask = {} // 存放的任务数据
|
||||
let sortType = 1
|
||||
|
@ -10,15 +10,16 @@ let startExecuteTask = null
|
|||
let endExecuteTask = performance.now()
|
||||
// 执行下载
|
||||
async function executeTask() {
|
||||
console.log(taskPool)
|
||||
endExecuteTask = performance.now()
|
||||
i++
|
||||
// stopTaskTimer()
|
||||
stopTaskTimer()
|
||||
if (taskPool.length > 0) {
|
||||
let startSortTime = performance.now()
|
||||
// let startSortTime = performance.now()
|
||||
if( sortType ){
|
||||
sortTaskPool()
|
||||
}
|
||||
let endSortTime = performance.now()
|
||||
// let endSortTime = performance.now()
|
||||
var requestNum = Math.min(taskPool.length, maxRequest)
|
||||
const tasks = taskPool.splice(0, requestNum);
|
||||
|
||||
|
@ -30,17 +31,16 @@ async function executeTask() {
|
|||
task.callback({ success: true, err: error })
|
||||
})
|
||||
})
|
||||
let starLoadTime = performance.now()
|
||||
// let starLoadTime = performance.now()
|
||||
await Promise.all(taskPromises)
|
||||
let endLoadTime = performance.now()
|
||||
let isTest = process.env.VUE_APP_OSS_PATH === '/test/dist'
|
||||
if(i > 1 && isTest){
|
||||
// if (eval(process.env.NODE_ENV) === 'development')
|
||||
// let endLoadTime = performance.now()
|
||||
// let isTest = process.env.VUE_APP_OSS_PATH === '/test/dist'
|
||||
// if(i > 1 && isTest){
|
||||
|
||||
console.log(`第${i}次:${startExecuteTask?endExecuteTask - startExecuteTask:0}:${endSortTime - startSortTime}:${endLoadTime - starLoadTime}`)
|
||||
}
|
||||
// console.log(`第${i}次:${startExecuteTask?endExecuteTask - startExecuteTask:0}:${endSortTime - startSortTime}:${endLoadTime - starLoadTime}`)
|
||||
// }
|
||||
|
||||
startExecuteTask = performance.now()
|
||||
// startExecuteTask = performance.now()
|
||||
executeTask()
|
||||
}else{
|
||||
startTaskTimer()
|
||||
|
@ -119,6 +119,14 @@ function removeTask(seriesId){
|
|||
}
|
||||
startTaskTimer()
|
||||
}
|
||||
function changePriority(seriesId){
|
||||
taskPool.map(task=>{
|
||||
if(task.seriesId === seriesId){
|
||||
task.priority = parseInt(new Date().getTime()) * 10
|
||||
}
|
||||
})
|
||||
sortTaskPool()
|
||||
}
|
||||
function setSortType(type){
|
||||
sortType = type
|
||||
}
|
||||
|
@ -147,6 +155,7 @@ export default {
|
|||
executeTask,
|
||||
setSortType,
|
||||
sortTaskPool,
|
||||
changePriority,
|
||||
startTaskTimer,
|
||||
stopTaskTimer,
|
||||
loadAndCacheImagePlus,
|
||||
|
|
|
@ -152,7 +152,8 @@ export default {
|
|||
firstInstanceId: '',
|
||||
showDelete: false,
|
||||
loading: false,
|
||||
imageList: []
|
||||
imageList: [],
|
||||
showSeriesList: []
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
|
@ -307,17 +308,22 @@ export default {
|
|||
this.currentSeriesIndex = seriesIndex
|
||||
this.$refs.dicomViewer.loadImageStack(this.seriesList[seriesIndex])
|
||||
if (!series.loadStatus) {
|
||||
series.isLoading = true
|
||||
var p = new Date().getTime()
|
||||
series.imageIds.map((imageId, i) => {
|
||||
var priority = ''
|
||||
if (i === 0) {
|
||||
priority = new Date(new Date().setHours(23, 59, 59, 999)).getTime()
|
||||
} else {
|
||||
priority = p - 1
|
||||
}
|
||||
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, priority })
|
||||
})
|
||||
requestPoolManager.changePriority(series.seriesId)
|
||||
// var isAddToTakPool = false
|
||||
// if (this.showSeriesList.includes(`${seriesIndex}`)) {
|
||||
// isAddToTakPool = true
|
||||
// } else {
|
||||
// this.showSeriesList.push(`${seriesIndex}`)
|
||||
// }
|
||||
// if (!isAddToTakPool) {
|
||||
// var priority = parseInt(new Date().getTime())
|
||||
// series.isLoading = true
|
||||
// series.imageIds.map((imageId) => {
|
||||
// this.imageList.push({ imageId: imageId, seriesId: series.seriesId, priority })
|
||||
// })
|
||||
// } else {
|
||||
// requestPoolManager.changePriority(series.seriesId)
|
||||
// }
|
||||
}
|
||||
},
|
||||
initStudy() {
|
||||
|
|
|
@ -233,7 +233,8 @@ export default {
|
|||
showDelete: 0,
|
||||
imageList: [],
|
||||
activeNames: [],
|
||||
relationActiveName: []
|
||||
relationActiveName: [],
|
||||
showSeriesList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -323,18 +324,22 @@ export default {
|
|||
this.currentSeriesIndex = seriesIndex
|
||||
this.$refs.dicomViewer.loadImageStack(this.studyList[studyIndex].SeriesList[seriesIndex])
|
||||
if (!series.loadStatus) {
|
||||
series.isLoading = true
|
||||
var p = parseInt(new Date().getTime())
|
||||
series.imageIds.map((imageId, i) => {
|
||||
var priority = ''
|
||||
if (i === 0) {
|
||||
priority = parseInt(new Date().getTime()) * 10
|
||||
} else {
|
||||
priority = p - 1
|
||||
}
|
||||
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, priority })
|
||||
// this.load(imageId, series.seriesId, priority)
|
||||
})
|
||||
requestPoolManager.changePriority(series.seriesId)
|
||||
// var isAddToTakPool = false
|
||||
// if (this.showSeriesList.includes(`${studyIndex}_${seriesIndex}`)) {
|
||||
// isAddToTakPool = true
|
||||
// } else {
|
||||
// this.showSeriesList.push(`${studyIndex}_${seriesIndex}`)
|
||||
// }
|
||||
// if (!isAddToTakPool) {
|
||||
// var priority = parseInt(new Date().getTime())
|
||||
// series.isLoading = true
|
||||
// series.imageIds.map((imageId, i) => {
|
||||
// this.imageList.push({ imageId: imageId, seriesId: series.seriesId, priority })
|
||||
// })
|
||||
// } else {
|
||||
// requestPoolManager.changePriority(series.seriesId)
|
||||
// }
|
||||
}
|
||||
},
|
||||
changeReadingStatus(callback, data) {
|
||||
|
@ -515,7 +520,7 @@ export default {
|
|||
this.imageLoaded(image, res.data.string('x0020000e'))
|
||||
})
|
||||
})
|
||||
|
||||
requestPoolManager.sortTaskPool()
|
||||
this.imageList = []
|
||||
}
|
||||
},
|
||||
|
|
|
@ -822,9 +822,9 @@ export default {
|
|||
this.getWwcTpl()
|
||||
// cornerstone.imageCache.setMaximumSizeBytes(0)
|
||||
|
||||
const maximumSizeInBytes = 1024 * 1024 * 1024 // 1 GB
|
||||
// const maximumSizeInBytes = 1024 * 1024 * 500
|
||||
cornerstone.imageCache.setMaximumSizeBytes(maximumSizeInBytes)
|
||||
// const maximumSizeInBytes = 1024 * 1024 * 1024 // 1 GB
|
||||
// // const maximumSizeInBytes = 1024 * 1024 * 500
|
||||
// cornerstone.imageCache.setMaximumSizeBytes(maximumSizeInBytes)
|
||||
this.customWwc = { visible: false, title: this.$t('trials:reading:dagTitle:wwwcCustom') }
|
||||
this.CriterionType = parseInt(localStorage.getItem('CriterionType'))
|
||||
if (this.CriterionType === 10) {
|
||||
|
|
|
@ -690,7 +690,8 @@ export default {
|
|||
await store.dispatch('reading/setCurrentReadingTaskState', 2)
|
||||
var isAutoTask = await this.getAutoTaskVal()
|
||||
if (isAutoTask) {
|
||||
DicomEvent.$emit('getNextTask')
|
||||
// DicomEvent.$emit('getNextTask')
|
||||
window.location.reload()
|
||||
} else {
|
||||
// '当前阅片任务已完成,是否进入下一个阅片任务?'
|
||||
this.$confirm(this.$t('trials:readingReport:message:msg4'), {
|
||||
|
@ -698,7 +699,8 @@ export default {
|
|||
distinguishCancelAndClose: true
|
||||
})
|
||||
.then(() => {
|
||||
DicomEvent.$emit('getNextTask')
|
||||
window.location.reload()
|
||||
// DicomEvent.$emit('getNextTask')
|
||||
})
|
||||
.catch(action => {
|
||||
changeURLStatic('visitTaskId', this.visitTaskId)
|
||||
|
|
|
@ -56,9 +56,9 @@
|
|||
<i class="el-icon-video-play" style="font-size: 18px;margin-right: 5px;color: #ffeb3b;cursor: pointer;" @click.stop="loadSeries(series,index,i)" />
|
||||
</el-tooltip>
|
||||
<!-- 暂停 -->
|
||||
<el-tooltip v-else class="item" effect="dark" :content="$t('trials:reading:button:pause')" placement="bottom">
|
||||
<!-- <el-tooltip v-else class="item" effect="dark" :content="$t('trials:reading:button:pause')" placement="bottom">
|
||||
<i class="el-icon-video-pause" style="font-size: 18px;margin-right: 5px;color: #ffeb3b;cursor: pointer;" @click.stop="stopLoadSeries(series,index,i)" />
|
||||
</el-tooltip>
|
||||
</el-tooltip> -->
|
||||
</div>
|
||||
<el-tooltip v-else-if="series.isDicom && series.prefetchInstanceCount === 0 &&series.modality!== 'SR'" class="item" effect="dark" :content="$t('trials:reading:button:download')" placement="bottom">
|
||||
<i class="el-icon-video-play" style="font-size: 18px;margin-right: 5px;color: #ffeb3b;cursor: pointer;" @click.stop="loadSeries(series,index,i)" />
|
||||
|
@ -170,6 +170,7 @@ export default {
|
|||
return {
|
||||
studyList: [],
|
||||
cachedImages: [],
|
||||
showSeriesList: [],
|
||||
studyIndex: null,
|
||||
seriesIndex: null,
|
||||
loading: false,
|
||||
|
@ -224,13 +225,62 @@ export default {
|
|||
// }
|
||||
// })
|
||||
cornerstone.events.addEventListener('cornerstoneimageloaded', this.cornerstoneImageLoaded)
|
||||
// cornerstone.events.addEventListener('cornerstoneimagecachefull', this.cornerstoneimagecachefull)
|
||||
// cornerstone.events.addEventListener('cornerstoneimagecachechanged', this.cornerstoneimagecachechanged)
|
||||
},
|
||||
beforeDestroy() {
|
||||
console.log('study---beforeDestroy')
|
||||
cornerstone.imageCache.purgeCache()
|
||||
DicomEvent.$off('refreshStudyListMeasureData')
|
||||
},
|
||||
methods: {
|
||||
initStudyInfo() {
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
// 初始化待渲染序列
|
||||
this.getInitSeries().then((res) => {
|
||||
requestPoolManager.startTaskTimer()
|
||||
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)
|
||||
if (idx > -1) {
|
||||
this.measureData = this.visitTaskList[idx].MeasureData
|
||||
this.studyList = this.visitTaskList[idx].StudyList
|
||||
var priority = parseInt(new Date().getTime())
|
||||
res[i].imageIds.map(image => {
|
||||
priority--
|
||||
this.imageList.push({ imageId: image, seriesId: res[i].seriesId, studyIndex: res[i].studyIndex, seriesIndex: res[i].seriesIndex, visitTaskId: res[i].visitTaskId, priority })
|
||||
})
|
||||
|
||||
// this.studyList.map((study, studyIndex) => {
|
||||
// study.SeriesList.map((series, seriesIndex) => {
|
||||
// if (series.modality !== 'SR') {
|
||||
// series.imageIds.map(image => {
|
||||
// let priority = 0
|
||||
// if (series.seriesId === res[i].seriesId) {
|
||||
// priority = parseInt(new Date().getTime()) * 10
|
||||
// } else {
|
||||
// priority = --p
|
||||
// }
|
||||
// this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
this.loopLoad()
|
||||
}
|
||||
}
|
||||
DicomEvent.$emit('loadImageStacks', res)
|
||||
loading.close()
|
||||
this.isRender = true
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
initStudyInfo2() {
|
||||
console.log('initStudyInfo')
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
// 初始化待渲染序列
|
||||
|
@ -555,19 +605,23 @@ export default {
|
|||
if (!series.loadStatus && series.modality !== 'SR') {
|
||||
this.loopLoadStatus = -1
|
||||
series.isLoading = true
|
||||
var p = parseInt(new Date().getTime())
|
||||
series.imageIds.map((imageId, i) => {
|
||||
var priority = ''
|
||||
if (i === 0) {
|
||||
priority = parseInt(new Date().getTime()) * 10
|
||||
} else {
|
||||
priority = --p
|
||||
var isAddToTakPool = false
|
||||
if (this.showSeriesList.includes(`${studyIndex}_${seriesIndex}`)) {
|
||||
isAddToTakPool = true
|
||||
} else {
|
||||
this.showSeriesList.push(`${studyIndex}_${seriesIndex}`)
|
||||
}
|
||||
if (!isAddToTakPool) {
|
||||
var priority = parseInt(new Date().getTime())
|
||||
series.imageIds.map((imageId) => {
|
||||
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||
})
|
||||
if (this.imageList.length > 0) {
|
||||
this.loopLoadStatus = 0
|
||||
this.loopLoad()
|
||||
}
|
||||
this.imageList.push({ imageId: imageId, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||
})
|
||||
if (this.imageList.length > 0) {
|
||||
this.loopLoadStatus = 0
|
||||
this.loopLoad()
|
||||
} else {
|
||||
requestPoolManager.changePriority(series.seriesId)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -618,21 +672,28 @@ export default {
|
|||
store.dispatch('reading/setActiveSeries', series)
|
||||
},
|
||||
loadImages(taskInfo) {
|
||||
const isBaseLineTask = taskInfo.IsBaseLineTask
|
||||
// const isBaseLineTask = taskInfo.IsBaseLineTask
|
||||
const isCurrentTask = taskInfo.IsCurrentTask
|
||||
// var priority = isCurrentTask ? parseInt(new Date().getTime()) : 999
|
||||
var priority = parseInt(new Date().getTime())
|
||||
this.studyList.map((study, studyIndex) => {
|
||||
study.SeriesList.map((series, seriesIndex) => {
|
||||
if (!series.loadStatus && series.isDicom && series.modality !== 'SR') {
|
||||
if (isCurrentTask || isBaseLineTask) {
|
||||
// 当前任务/基线任务下载所有影像
|
||||
series.imageIds.map(image => {
|
||||
priority = priority - 1
|
||||
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||
})
|
||||
} else if (!isBaseLineTask && !isCurrentTask && study.IsCriticalSequence) {
|
||||
// 非当前随访任务下载关键影像
|
||||
// if (isCurrentTask || isBaseLineTask) {
|
||||
// // 当前任务/基线任务下载所有影像
|
||||
// series.imageIds.map(image => {
|
||||
// priority = priority - 1
|
||||
// this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||
// })
|
||||
// } else if (!isBaseLineTask && !isCurrentTask && study.IsCriticalSequence) {
|
||||
// // 非当前随访任务下载关键影像
|
||||
// series.imageIds.map(image => {
|
||||
// priority = priority - 1
|
||||
// this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||
// })
|
||||
// }
|
||||
// 均只下载关键序列
|
||||
if (!isCurrentTask && study.IsCriticalSequence) {
|
||||
series.imageIds.map(image => {
|
||||
priority = priority - 1
|
||||
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||
|
@ -646,15 +707,14 @@ export default {
|
|||
|
||||
loopLoad() {
|
||||
if (this.imageList.length > 0) {
|
||||
|
||||
requestPoolManager.startTaskTimer()
|
||||
// requestPoolManager.startTaskTimer()
|
||||
this.imageList.map(image => {
|
||||
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => {
|
||||
this.imageLoaded({ visitTaskId: this.visitTaskId, imageId: image.imageId }, res.data.string('x0020000e'))
|
||||
})
|
||||
})
|
||||
requestPoolManager.sortTaskPool()
|
||||
|
||||
|
||||
this.imageList = []
|
||||
}
|
||||
},
|
||||
|
@ -663,15 +723,26 @@ export default {
|
|||
console.log('loadSeries')
|
||||
this.loopLoadStatus = -1
|
||||
this.$set(this.studyList[studyIndex].SeriesList[seriesIndex], 'isLoading', true)
|
||||
const priority = parseInt(new Date().getTime())
|
||||
series.imageIds.map(image => {
|
||||
if (series.imageloadedArr.indexOf(image) === -1) {
|
||||
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||
var isAddToTakPool = false
|
||||
if (this.showSeriesList.includes(`${studyIndex}_${seriesIndex}`)) {
|
||||
isAddToTakPool = true
|
||||
} else {
|
||||
this.showSeriesList.push(`${studyIndex}_${seriesIndex}`)
|
||||
}
|
||||
if (!isAddToTakPool) {
|
||||
const priority = parseInt(new Date().getTime())
|
||||
series.imageIds.map(image => {
|
||||
const index = this.cachedImages.findIndex(item => item.uri === image)
|
||||
if (index === -1) {
|
||||
this.imageList.push({ imageId: image, seriesId: series.seriesId, studyIndex: studyIndex, seriesIndex: seriesIndex, visitTaskId: series.visitTaskId, priority })
|
||||
}
|
||||
})
|
||||
if (this.imageList.length > 0) {
|
||||
this.loopLoadStatus = 0
|
||||
this.loopLoad()
|
||||
}
|
||||
})
|
||||
if (this.imageList.length > 0) {
|
||||
this.loopLoadStatus = 0
|
||||
this.loopLoad()
|
||||
} else {
|
||||
requestPoolManager.changePriority(series.seriesId)
|
||||
}
|
||||
},
|
||||
// 暂停下载
|
||||
|
@ -732,6 +803,13 @@ export default {
|
|||
this.studyList[studyIndex].SeriesList[seriesIndex].loadStatus = true
|
||||
}
|
||||
}
|
||||
},
|
||||
cornerstoneimagecachechanged(e) {
|
||||
const cacheInfo = cornerstone.imageCache.getCacheInfo()
|
||||
console.log(cacheInfo)
|
||||
},
|
||||
cornerstoneimagecachefull(e) {
|
||||
console.log('超过内存了')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -744,6 +822,7 @@ export default {
|
|||
width:100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
.dicom-desc{
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
|
|
Loading…
Reference in New Issue