- Create stats.py with get_accounting_stats() helper function - Add 4 stat widgets: stat_total_balance, stat_today_consumption, stat_month_consumption, stat_account_count - Update index.ui to display stat cards row above navigation cards - Register get_accounting_stats in load_accounting()
54 lines
1.9 KiB
XML
54 lines
1.9 KiB
XML
{% set stats = get_accounting_stats(request) %}
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"bgcolor": "#1E293B",
|
|
"padding": "20px",
|
|
"borderRadius": "12px",
|
|
"border": "1px solid #334155",
|
|
"flex": "1",
|
|
"minHeight": "110px"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {
|
|
"alignItems": "center",
|
|
"marginBottom": "12px"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Svg",
|
|
"options": {
|
|
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#22C55E\" stroke-width=\"2\"><path d=\"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125H3.375a.75.75 0 01-.75-.75V4.5m0 0V3.75c0-.621.504-1.125 1.125-1.125h1.5c1.243 0 2.25 1.007 2.25 2.25v.375M3.75 4.5h15.75m0 0v-.375c0-.621-.504-1.125-1.125-1.125h-1.5c-1.243 0-2.25 1.007-2.25 2.25v.375M3.75 12.75h15.75M3.75 16.5h15.75\"/></svg>",
|
|
"width": "24px",
|
|
"height": "24px"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Filler"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "Text",
|
|
"options": {
|
|
"text": "¥{{'%.2f' % stats.total_balance}}",
|
|
"fontSize": "32px",
|
|
"fontWeight": "700",
|
|
"color": "#F1F5F9",
|
|
"lineHeight": "1.1"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Text",
|
|
"options": {
|
|
"text": "账户总余额",
|
|
"fontSize": "14px",
|
|
"color": "#94A3B8",
|
|
"marginTop": "4px"
|
|
}
|
|
}
|
|
]
|
|
}
|