From 312e85d9b3ec3cb22f5b6434c1f8b05cc13d4ef0 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Wed, 27 May 2026 15:06:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=9E=8D=E5=90=88=E8=A7=86=E5=8F=A3=E6=A0=87?= =?UTF-8?q?=E6=B3=A8=E7=BB=91=E5=AE=9A=E4=BF=A1=E6=81=AF=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reading/dicoms3D/components/ReadPage.vue | 8 +++++-- .../components/customize/QuestionFormItem.vue | 24 ++++++++++++++++++- .../components/customize/QuestionList.vue | 11 ++++++++- 3 files changed, 39 insertions(+), 4 deletions(-) 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 fed9172c..e14e8ce9 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -1959,7 +1959,8 @@ export default { if (annotation.metadata.toolName.includes('histogram_')) return this.$refs.histogram.initToolValue(annotation) if (this.readingTaskState === 2) return if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return - const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series + let viewportIndex = this.fusion ? 2 : this.activeViewportIndex + const series = this.$refs[`${this.viewportKey}-${viewportIndex}`][0].series if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) { const referencedImageId = annotation.metadata.referencedImageId const params = this.getInstanceInfo(referencedImageId) @@ -2028,6 +2029,7 @@ export default { } }, async customAnnotationCompletedListener(e) { + console.log('completed') const { annotation } = e.detail if (!annotation) return if (annotation.metadata.toolName === FusionJumpToPointTool.toolName) return @@ -2040,7 +2042,8 @@ export default { } if (annotation.metadata.segmentationId) return if (annotation.metadata.toolName === 'PlanarFreehandROI' && !annotation.data.contour.closed) return - const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series + let viewportIndex = this.fusion ? 2 : this.activeViewportIndex + const series = this.$refs[`${this.viewportKey}-${viewportIndex}`][0].series if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) { const referencedImageId = annotation.metadata.referencedImageId const params = this.getInstanceInfo(referencedImageId) @@ -2116,6 +2119,7 @@ export default { } }, customAnnotationModifiedListener(e) { + console.log('modified') const { annotation, changeType } = e.detail const isStatsUpdated = changeType === ChangeTypes.StatsUpdated if (!annotation) return diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue index 8d53f335..ed9fff37 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue @@ -1464,7 +1464,9 @@ export default { if (!referencedImageId) return null const cacheKey = annotation.from || annotation.metadata.volumeId ? `volumeId:${referencedImageId}` : `imageId:${referencedImageId}` const points = ['x', 'y', 'z']; - const cachedStats = annotation.markTool === "ArrowAnnotate" ? annotation.data?.handles?.points[0] : annotation.data?.cachedStats?.[cacheKey] + const cachedStats = annotation.markTool === "ArrowAnnotate" + ? annotation.data?.handles?.points[0] + : this.getAnnotationCachedStats(annotation, cacheKey, prop) const hasProp = cachedStats && (Object.prototype.hasOwnProperty.call(cachedStats, prop) || cachedStats[points.indexOf(prop)]) if (!hasProp) return null @@ -1481,10 +1483,30 @@ export default { } else if (this.isNoneDicom && value !== null) { value = this.reRound(csUtils.roundNumber(value), this.digitPlaces) } + if (prop === 'total' && value !== null) { + return this.formatStatSum(value) + } return value !== null ? parseFloat(value).toFixed(this.digitPlaces) : value }, + getAnnotationCachedStats(annotation, cacheKey, prop) { + const cachedStatsMap = annotation?.data?.cachedStats || {} + const matchedStats = cachedStatsMap[cacheKey] + if (prop !== 'total') return matchedStats + const nmStats = Object.values(cachedStatsMap).find(item => item?.Modality === 'NM' && item.total !== undefined && item.total !== null) + return nmStats || matchedStats + }, + formatStatSum(value) { + const num = Number(value) + if (!Number.isFinite(num)) return value + + if (Math.abs(num - Math.round(num)) < 1e-6) { + return String(Math.round(num)) + } + + return this.reRound(num, this.digitPlaces) + }, reRound(result, finalPrecision) { if (typeof result === 'string' && result.includes(', ')) { const numStrs = result.split(', ') diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionList.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionList.vue index 29eadf0c..8b34c73a 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionList.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionList.vue @@ -1246,7 +1246,9 @@ export default { if (!referencedImageId) return null const cacheKey = annotation.from || annotation.metadata.volumeId ? `volumeId:${referencedImageId}` : `imageId:${referencedImageId}` const points = ['x', 'y', 'z'] - const cachedStats = annotation.markTool === "ArrowAnnotate" ? annotation.data?.handles?.points[0] : annotation.data?.cachedStats?.[cacheKey] + const cachedStats = annotation.markTool === "ArrowAnnotate" + ? annotation.data?.handles?.points[0] + : this.getAnnotationCachedStats(annotation, cacheKey, prop) const hasProp = cachedStats && (Object.prototype.hasOwnProperty.call(cachedStats, prop) || cachedStats[points.indexOf(prop)]) if (!hasProp) return null @@ -1270,6 +1272,13 @@ export default { ? parseFloat(value).toFixed(this.digitPlaces) : value }, + getAnnotationCachedStats(annotation, cacheKey, prop) { + const cachedStatsMap = annotation?.data?.cachedStats || {} + const matchedStats = cachedStatsMap[cacheKey] + if (prop !== 'total') return matchedStats + const nmStats = Object.values(cachedStatsMap).find(item => item?.Modality === 'NM' && item.total !== undefined && item.total !== null) + return nmStats || matchedStats + }, formatStatSum(value) { const num = Number(value) if (!Number.isFinite(num)) return value