accounting/wwwroot/stat_account_count.ui
yumoqing 16163ecdc3 feat: add accounting module stat cards - total balance, daily/monthly consumption, account count
- 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()
2026-05-25 18:40:40 +08:00

54 lines
1.6 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=\"#3B82F6\" stroke-width=\"2\"><path d=\"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z\"/></svg>",
"width": "24px",
"height": "24px"
}
},
{
"widgettype": "Filler"
}
]
},
{
"widgettype": "Text",
"options": {
"text": "{{stats.account_count}}",
"fontSize": "32px",
"fontWeight": "700",
"color": "#F1F5F9",
"lineHeight": "1.1"
}
},
{
"widgettype": "Text",
"options": {
"text": "账户数量",
"fontSize": "14px",
"color": "#94A3B8",
"marginTop": "4px"
}
}
]
}