配额进度

This commit is contained in:
18631081161 2026-01-20 15:08:16 +08:00
parent 0cd0fce8c2
commit 88427cab99

View File

@ -195,14 +195,16 @@
<el-col :span="6">
<div class="summary-item">
<div class="summary-label">总进度</div>
<div class="summary-value">
<div class="summary-value progress-value">
<el-progress
type="circle"
:percentage="getTotalProgressPercentage()"
:width="60"
:stroke-width="6"
:status="getProgressStatus(getTotalProgressPercentage() / 100)"
:width="45"
:stroke-width="5"
:color="getProgressColor(getTotalProgressPercentage())"
:show-text="false"
/>
<span class="progress-text">{{ getTotalProgressPercentage() }}%</span>
</div>
</div>
</el-col>
@ -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;