阅片页面加载网速监控
continuous-integration/drone/push Build encountered an error Details

uat
wangxiaoshuang 2025-07-16 17:29:54 +08:00
parent f8b4dd70c8
commit edf1377374
9 changed files with 58 additions and 20 deletions

View File

@ -12,7 +12,7 @@ import { getCustomTag } from '@/api/reading'
import requestPoolManager from '@/utils/request-pool'
import { getReadingVisitStudyList } from '@/api/trials'
import { getNetWorkSpeed, setNetWorkSpeedSize, workSpeedclose } from "@/utils"
import { getNetWorkSpeed, setNetWorkSpeedSizeAll, workSpeedclose } from "@/utils"
const hangingAgreement = [
{ name: 'A', row: 1, col: 1 },
{ name: 'A|A', row: 1, col: 2 },
@ -1076,7 +1076,7 @@ const actions = {
let file = series.instanceInfoList.find(item => item.ImageId === obj.imageId)
if (file) {
getNetWorkSpeed()
setNetWorkSpeedSize(obj.percentComplete, file.FileSize, obj.imageId)
setNetWorkSpeedSizeAll(obj.percentComplete, file.FileSize, obj.imageId)
}
if (prefetchInstanceCount >= instanceCount * 100) {
series.prefetchInstanceCount = instanceCount * 100

View File

@ -105,6 +105,7 @@ export function formatSize(size, fixed = 2) {
let timer = null, // 网速定时器
lastPercentage = 0,
percentageById = {},
imageId = null,
bytesReceivedPerSecond = {}; // 时间节点上传文件总量
// 获取网速
@ -154,6 +155,32 @@ export function setNetWorkSpeedSize(totalPercentage, total, Id) {
}
store.state.trials.uploadSize = `${formatSize(totalPercentage / 100 * total)}/${formatSize(total)}`
}
export function setNetWorkSpeedSizeAll(totalPercentage, total, Id) {
if (!percentageById[Id]) {
percentageById[Id] = 0
}
let percentage = totalPercentage - percentageById[Id]
percentage = percentage / 100
percentageById[Id] = totalPercentage
// console.log(percentage, totalPercentage, total)
let time = new Date().getTime();
let timeList = Object.keys(bytesReceivedPerSecond).sort((a, b) => a - b);
let bytesTime = timeList.find(item => time - item < 1000);
if (bytesTime) {
bytesReceivedPerSecond[bytesTime] += total * percentage;
} else {
// console.log("未查询到时间")
if (timeList.length > 0) {
bytesReceivedPerSecond[timeList[timeList.length - 1]] += total * percentage;
} else {
bytesReceivedPerSecond[time] = total * percentage;
}
}
let isComplete = Object.keys(percentageById).every(key => percentageById[key >= 100])
if (isComplete) {
workSpeedclose(true)
}
}
export function workSpeedclose(isForce = false) {
if (!isForce && lastPercentage < 100) {
return false
@ -167,5 +194,6 @@ export function workSpeedclose(isForce = false) {
}
bytesReceivedPerSecond = {};
lastPercentage = 0;
imageId = null
imageId = null;
percentageById = {};
}

View File

@ -193,7 +193,8 @@ export default {
showSeriesList: [],
currentLoadIns: [],
isFromCRCUpload: false,
isReading: null
isReading: null,
activeSeriesId: null
}
},
created: function () {
@ -444,6 +445,8 @@ export default {
}
},
showSeriesImage(e, seriesIndex, series) {
this.activeSeriesId = series.seriesId
workSpeedclose(true)
// if (seriesIndex === this.currentSeriesIndex) return
const element = e.currentTarget
const elements = document.querySelectorAll('[series-type]')
@ -833,6 +836,9 @@ export default {
const seriesIndex = params.seriesIndex
var prefetchInstanceCount = this.seriesList[seriesIndex].prefetchInstanceCount
var instanceCount = this.seriesList[seriesIndex].instanceCount
if (!this.activeSeriesId) {
this.activeSeriesId = this.seriesList[seriesIndex].seriesId
}
if (this.seriesList[seriesIndex].imageloadedArr.indexOf(imageId) < 0 && this.seriesList[seriesIndex].imageloadedArr.length < this.seriesList[seriesIndex].instanceCount) {
const i = this.currentLoadIns.findIndex(i => i.imageId === imageId)
if (i > -1) {
@ -853,7 +859,7 @@ export default {
}
}
let file = this.seriesList[seriesIndex].instanceInfoList.find(item => item.ImageId === imageId)
if (file) {
if (file && this.activeSeriesId === this.seriesList[seriesIndex].seriesId) {
getNetWorkSpeed()
setNetWorkSpeedSize(percentComplete, file.FileSize, imageId)
}

View File

@ -299,7 +299,7 @@ export default {
computed: {
...mapGetters(['visitTaskList', 'currentReadingTaskState']),
NSTip() {
return `${this.$store.state.trials.uploadSize},NS: ${this.$store.state.trials.uploadTip}`
return `NS: ${this.$store.state.trials.uploadTip}`
}
},
watch: {

View File

@ -297,7 +297,7 @@ export default {
computed: {
...mapGetters(['visitTaskList', 'currentReadingTaskState']),
NSTip() {
return `${this.$store.state.trials.uploadSize},NS: ${this.$store.state.trials.uploadTip}`
return `NS: ${this.$store.state.trials.uploadTip}`
}
},
watch: {

View File

@ -789,7 +789,7 @@ export default {
},
computed: {
NSTip() {
return `${this.$store.state.trials.uploadSize},NS: ${this.$store.state.trials.uploadTip}`
return `NS: ${this.$store.state.trials.uploadTip}`
}
},
}

View File

@ -617,7 +617,7 @@ import colorMap from './colorMap.vue'
import RectangleROITool from './tools/RectangleROITool'
import uploadDicomAndNonedicom from '@/components/uploadDicomAndNonedicom'
import downloadDicomAndNonedicom from '@/components/downloadDicomAndNonedicom'
import { getNetWorkSpeed, setNetWorkSpeedSize, workSpeedclose } from "@/utils"
import { getNetWorkSpeed, setNetWorkSpeedSizeAll, workSpeedclose } from "@/utils"
const { visibility } = annotation
const { ViewportType, Events } = Enums
const renderingEngineId = 'myRenderingEngine'
@ -1326,7 +1326,7 @@ export default {
let file = series.find(item => item.ImageId === imageId)
if (file) {
getNetWorkSpeed()
setNetWorkSpeedSize(percentComplete, file.FileSize, imageId)
setNetWorkSpeedSizeAll(percentComplete, file.FileSize, imageId)
}
if (percentComplete === 100) {
workSpeedclose()

View File

@ -540,7 +540,7 @@ export default {
},
computed: {
NSTip() {
return `${this.$store.state.trials.uploadSize},NS: ${this.$store.state.trials.uploadTip}`
return `NS: ${this.$store.state.trials.uploadTip}`
}
},
}

View File

@ -407,15 +407,19 @@
</el-card>
<!-- 复核问题查看 -->
<el-card shadow="hover" style="margin-top: 10px" v-else>
<el-tabs v-model="secondReviewActiveName" type="card" v-if="secondReviewList.length > 0">
<el-tab-pane v-for="item in secondReviewList" :key="item.SecondReviewTime"
:label="`${item.SecondReviewTime} ${item.UserName}(${item.FullName})`" :name="item.SecondReviewTime">
<h3>{{ $t('trials:audit:title:resetQuestions') }}</h3>
<div style="overflow-y: auto">
<QuestionForm :trial-id="trialId" :subject-visit-id="data.Id" :qc-process-enum="data.QCProcessEnum"
:current-q-c-enum="currentQCType" :is-audit="isAudit" :SecondReviewTime="item.SecondReviewTime" />
</div>
</el-tab-pane>
<el-tabs v-model="secondReviewActiveName" type="card"
v-if="secondReviewList.length > 0 && secondReviewList.find(item => item.SignTime)">
<template v-for="item in secondReviewList">
<el-tab-pane :key="item.SecondReviewTime" v-if="item.SignTime"
:label="`${$t('trials:audit:tab:title:resetQuestions')} ${item.FullName}(${item.SignTime})`"
:name="item.SecondReviewTime">
<h3>{{ $t('trials:audit:title:resetQuestions') }}</h3>
<div style="overflow-y: auto">
<QuestionForm :trial-id="trialId" :subject-visit-id="data.Id" :qc-process-enum="data.QCProcessEnum"
:current-q-c-enum="currentQCType" :is-audit="isAudit" :SecondReviewTime="item.SecondReviewTime" />
</div>
</el-tab-pane>
</template>
</el-tabs>
</el-card>
<!-- 发起质疑 -->