From edf13773749849e9a42741b9267f2184565a34c5 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Wed, 16 Jul 2025 17:29:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=85=E7=89=87=E9=A1=B5=E9=9D=A2=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E7=BD=91=E9=80=9F=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/reading.js | 4 +-- src/utils/index.js | 30 ++++++++++++++++++- src/views/dicom-show/dicom-study.vue | 10 +++++-- .../reading/dicoms/components/DicomCanvas.vue | 2 +- .../dicoms/customize/CustomizeDicomCanvas.vue | 2 +- .../dicoms3D/components/PetCtViewport.vue | 2 +- .../reading/dicoms3D/components/ReadPage.vue | 4 +-- .../reading/dicoms3D/components/Viewport.vue | 2 +- .../qc-check/components/qualityAssurance.vue | 22 ++++++++------ 9 files changed, 58 insertions(+), 20 deletions(-) diff --git a/src/store/modules/reading.js b/src/store/modules/reading.js index 42372f07..b1874ec5 100644 --- a/src/store/modules/reading.js +++ b/src/store/modules/reading.js @@ -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 diff --git a/src/utils/index.js b/src/utils/index.js index a6db6712..ca185a34 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -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 = {}; } \ No newline at end of file diff --git a/src/views/dicom-show/dicom-study.vue b/src/views/dicom-show/dicom-study.vue index c893076e..24ced2b6 100644 --- a/src/views/dicom-show/dicom-study.vue +++ b/src/views/dicom-show/dicom-study.vue @@ -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) } diff --git a/src/views/trials/trials-panel/reading/dicoms/components/DicomCanvas.vue b/src/views/trials/trials-panel/reading/dicoms/components/DicomCanvas.vue index 2d7c400e..9af3f930 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/DicomCanvas.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/DicomCanvas.vue @@ -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: { diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomCanvas.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomCanvas.vue index f03aa5d0..32102de2 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomCanvas.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomCanvas.vue @@ -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: { diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue index bedebeae..fba1fe07 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue @@ -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}` } }, } diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue index 128dff15..c4ad8b1a 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -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() diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/Viewport.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/Viewport.vue index 03858212..7dea42c6 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/Viewport.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/Viewport.vue @@ -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}` } }, } diff --git a/src/views/trials/trials-panel/visit/qc-check/components/qualityAssurance.vue b/src/views/trials/trials-panel/visit/qc-check/components/qualityAssurance.vue index 555f9be6..5d4d8c61 100644 --- a/src/views/trials/trials-panel/visit/qc-check/components/qualityAssurance.vue +++ b/src/views/trials/trials-panel/visit/qc-check/components/qualityAssurance.vue @@ -407,15 +407,19 @@ - - -

{{ $t('trials:audit:title:resetQuestions') }}

-
- -
-
+ +