配额进度
This commit is contained in:
parent
0cd0fce8c2
commit
88427cab99
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user