feat: 在方案对比表格中增加损耗费用净现值列
- 新增'损耗费用净现值 (万元)'列,显示生命周期内损耗费用的净现值 - 使用npv_loss字段替代annual_loss_cost,考虑折现率对全生命周期成本的影响 - 支持按损耗费用净现值排序,便于方案经济性对比
This commit is contained in:
7
gui.py
7
gui.py
@@ -815,6 +815,7 @@ def index():
|
|||||||
"cost_wan": f"{res['cost'] / 10000:.2f}",
|
"cost_wan": f"{res['cost'] / 10000:.2f}",
|
||||||
"loss_kw": f"{res['loss']:.2f}",
|
"loss_kw": f"{res['loss']:.2f}",
|
||||||
"total_length": f"{total_length_km:.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}",
|
"total_cost_npv_wan": f"{res.get('total_cost_npv', res['cost']) / 10000:.2f}",
|
||||||
"note": note,
|
"note": note,
|
||||||
"original_name": res["name"],
|
"original_name": res["name"],
|
||||||
@@ -984,6 +985,12 @@ def index():
|
|||||||
"field": "total_length",
|
"field": "total_length",
|
||||||
"sortable": True,
|
"sortable": True,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "npv_loss_wan",
|
||||||
|
"label": "损耗费用净现值 (万元)",
|
||||||
|
"field": "npv_loss_wan",
|
||||||
|
"sortable": True,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "total_cost_npv_wan",
|
"name": "total_cost_npv_wan",
|
||||||
"label": "总费用 (万元)",
|
"label": "总费用 (万元)",
|
||||||
|
|||||||
Reference in New Issue
Block a user