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

uat_us
熊飞 2024-01-25 12:44:55 +08:00
commit aab9481030
3 changed files with 16 additions and 3 deletions

View File

@ -4,6 +4,7 @@ let numRequest = 0 // 正在执行数量
const maxRequest = 6 // 可配置
let taskTimer // 轮询的定时器
var cachedTask = {} // 存放的任务数据
let sortType = 1
var i= 0
let startExecuteTask = null
let endExecuteTask = performance.now()
@ -14,7 +15,9 @@ async function executeTask() {
// stopTaskTimer()
if (taskPool.length > 0) {
let startSortTime = performance.now()
sortTaskPool()
if( sortType ){
sortTaskPool()
}
let endSortTime = performance.now()
var requestNum = Math.min(taskPool.length, maxRequest)
const tasks = taskPool.splice(0, requestNum);
@ -116,14 +119,16 @@ function removeTask(seriesId){
}
startTaskTimer()
}
function setSortType(type){
sortType = type
}
function resetRequestPool(){
taskPool = []
pendingList =[]
cachedTask = {}
sortType = 1
}
function resetCachedTask(){
taskPool = []
pendingList =[]
cachedTask = {}
}
function buildImageRequestTask(imageId,seriesId, config = {}) {
@ -140,6 +145,8 @@ function buildImageRequestTask(imageId,seriesId, config = {}) {
export default {
addTaskIntoPool,
executeTask,
setSortType,
sortTaskPool,
startTaskTimer,
stopTaskTimer,
loadAndCacheImagePlus,

View File

@ -646,12 +646,15 @@ export default {
loopLoad() {
if (this.imageList.length > 0) {
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 = []
}
},

View File

@ -179,6 +179,7 @@ import DicomEvent from './components/DicomEvent'
import store from '@/store'
import { getToken } from '@/utils/auth'
import { changeURLStatic } from '@/utils/history.js'
import requestPoolManager from '@/utils/request-pool'
export default {
name: 'Reading',
components: {
@ -228,6 +229,8 @@ export default {
}
},
mounted() {
requestPoolManager.resetRequestPool()
requestPoolManager.setSortType(0)
DicomEvent.$on('questionFormChange', (v) => {
if (this.questionFormChangeNum !== 0) {
this.questionFormChangeState = v