修改bug
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
<!-- 进度条颜色和宽度动态绑定 -->
|
||||
<div class="progress-bar" :style="{
|
||||
width: itemList[0].progress + '%',
|
||||
background: getColor(item.currentValue, item.targetValue)
|
||||
background: getColor(item.progress)
|
||||
}"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="progress-percent">完成率</div>
|
||||
<!-- 百分比颜色动态绑定 -->
|
||||
<div class="progress-percent" :style="{
|
||||
color: getColor(item.currentValue, item.targetValue)
|
||||
color: getColor(item.progress)
|
||||
}">
|
||||
{{ item.progress }}%
|
||||
</div>
|
||||
@@ -103,8 +103,8 @@ export default {
|
||||
]
|
||||
},
|
||||
// 颜色判断核心方法:实际值≥预算值返回绿色,否则返回橙色
|
||||
getColor(currentValue, targetValue) {
|
||||
return currentValue >= targetValue
|
||||
getColor(progress) {
|
||||
return progress >= 100
|
||||
? "rgba(98, 213, 180, 1)"
|
||||
: "rgba(249, 164, 74, 1)";
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user