diff --git a/src/frontend/src/views/allocations/AllocationList.vue b/src/frontend/src/views/allocations/AllocationList.vue index bf21a6c..6fd5ae5 100644 --- a/src/frontend/src/views/allocations/AllocationList.vue +++ b/src/frontend/src/views/allocations/AllocationList.vue @@ -195,14 +195,16 @@
总进度
-
+
+ {{ getTotalProgressPercentage() }}%
@@ -554,6 +556,12 @@ function getProgressStatus(rate: number): string { return 'warning' } +function getProgressColor(percentage: number): string { + if (percentage >= 100) return '#67c23a' // 绿色 + if (percentage >= 60) return '#409eff' // 蓝色 + return '#e6a23c' // 橙色 +} + function getUnitLevelTagType(level: string): string { switch (level) { case 'Division': return 'danger' @@ -632,13 +640,18 @@ function getTotalConsumed(): number { if (authStore.organizationalLevelNum >= 3 && selectedAllocation.value) { return (selectedAllocation.value as any).visibleActualCompletion || 0 } + // 师部账号:使用 selectedAllocation 中的 distributions 数据 + if (selectedAllocation.value?.distributions) { + return selectedAllocation.value.distributions.reduce((sum, d) => sum + (d.actualCompletion || 0), 0) + } return distributions.value.reduce((sum, d) => sum + (d.actualCompletion || 0), 0) } function getTotalProgressPercentage(): number { if (!selectedAllocation.value || !selectedAllocation.value.totalQuota) return 0 const consumed = getTotalConsumed() - return Math.round((consumed / selectedAllocation.value.totalQuota) * 100) + const percentage = Math.round((consumed / selectedAllocation.value.totalQuota) * 100) + return percentage } // 根据时间范围筛选后的分配数据 @@ -1046,6 +1059,17 @@ onMounted(() => { gap: 4px; } +.summary-value.progress-value { + align-items: center; + gap: 12px; +} + +.progress-text { + font-size: 22px; + font-weight: bold; + color: #303133; +} + .summary-value .number { font-size: 24px; font-weight: 700;