达标函数删除,图表label置于最顶层

This commit is contained in:
2026-04-14 10:17:38 +08:00
parent 0d74e762ce
commit 7135ab0e4b
208 changed files with 3567 additions and 12787 deletions

View File

@@ -96,18 +96,6 @@ export default {
}
})
},
getRateFlag(rate, real, target) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
// 1. 完成率 >= 100 => 达标
if (rate >= 100) return 1;
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
if (rate === 0 && target === 0) return 1;
// 其他情况 => 未达标
return 0;
},
updateChart(data) {
// 修复核心:正确获取默认值(调用 factory 函数)
@@ -124,12 +112,12 @@ getRateFlag(rate, real, target) {
// 整合flag字段
this.ytdIncomeData = {
...incomeItem,
flag: this.getRateFlag(incomeItem.rate, incomeItem.real, incomeItem.budget)
flag: incomeItem.rate > 100 ? 1 : 0
};
this.ytdCostData = {
...costItem,
flag: this.getRateFlag(costItem.rate, costItem.real, costItem.budget)
flag: costItem.rate > 100 ? 1 : 0
};
console.log('累计收入数据:', this.ytdIncomeData);