feat: KPI多粒度目标值补提交 — dashboard API + 前端3视图(目标值月/季/年)

已上线未提交的历史功能(2026-08-17): kpi_target_by_frequency + target_monthly/quarterly/yearly 字段透传
This commit is contained in:
Hermes CI Fix
2026-08-20 06:57:13 +08:00
parent bd9c70ea05
commit dd53212bcc
5 changed files with 244 additions and 7 deletions
+8 -1
View File
@@ -70,7 +70,7 @@
</div>
<div class="kpi-value-row">
<div class="kpi-actual">{{ fmtValue(k.actual_value, k.kpi_code) }}</div>
<div class="kpi-target">目标 {{ k.target_value ?? '-' }}</div>
<div class="kpi-target">{{ targetLabel(k) }} {{ k.target_value ?? '-' }}</div>
</div>
<el-progress
:percentage="k.target_value ? Math.min(100, Math.round((k.actual_value || 0) / k.target_value * 100)) : 0"
@@ -140,6 +140,13 @@ function fmtValue(val: any, code: string) {
return val
}
function targetLabel(k: any) {
const freq = k.frequency || 'monthly'
if (freq === 'quarterly' || freq === 'half_year') return '目标(季)'
if (freq === 'yearly') return '目标(年)'
return '目标(月)'
}
function planIcon(p: any) {
if (p.status === 'completed') return '✅'
if (p.overdue) return '🔴'