feat: 在方案对比表格中增加损耗费用净现值列

- 新增'损耗费用净现值 (万元)'列,显示生命周期内损耗费用的净现值
- 使用npv_loss字段替代annual_loss_cost,考虑折现率对全生命周期成本的影响
- 支持按损耗费用净现值排序,便于方案经济性对比
This commit is contained in:
dmy
2026-01-07 11:27:29 +08:00
parent 7aef58de1e
commit e0b5b0c3dc

7
gui.py
View File

@@ -815,6 +815,7 @@ def index():
"cost_wan": f"{res['cost'] / 10000:.2f}",
"loss_kw": f"{res['loss']:.2f}",
"total_length": f"{total_length_km:.2f}",
"npv_loss_wan": f"{res.get('npv_loss', 0) / 10000:.2f}",
"total_cost_npv_wan": f"{res.get('total_cost_npv', res['cost']) / 10000:.2f}",
"note": note,
"original_name": res["name"],
@@ -984,6 +985,12 @@ def index():
"field": "total_length",
"sortable": True,
},
{
"name": "npv_loss_wan",
"label": "损耗费用净现值 (万元)",
"field": "npv_loss_wan",
"sortable": True,
},
{
"name": "total_cost_npv_wan",
"label": "总费用 (万元)",