diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 24fb68c..153739b 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -406,6 +406,104 @@ } } ] + }, + { + "widgettype": "VBox", + "options": { + "width": "100%", + "bgcolor": "#1E293B", + "borderRadius": "12px", + "padding": "20px", + "border": "1px solid #334155", + "marginTop": "20px" + }, + "subwidgets": [ + { + "widgettype": "Title4", + "options": { + "text": "用户调用排行(Top 5)", + "color": "#F1F5F9", + "fontWeight": "600", + "marginBottom": "16px" + } + }, + { + "widgettype": "RefreshWidget", + "id": "table_top_users_count", + "options": { + "period_seconds": 30, + "url": "{{entire_url('table_top_users_count.ui')}}" + } + } + ] + }, + { + "widgettype": "HBox", + "options": { + "width": "100%", + "gap": "20px", + "marginTop": "20px" + }, + "subwidgets": [ + { + "widgettype": "VBox", + "options": { + "width": "50%", + "bgcolor": "#1E293B", + "borderRadius": "12px", + "padding": "20px", + "border": "1px solid #334155" + }, + "subwidgets": [ + { + "widgettype": "Title4", + "options": { + "text": "供应商交易排行(金额 Top 5)", + "color": "#F1F5F9", + "fontWeight": "600", + "marginBottom": "16px" + } + }, + { + "widgettype": "RefreshWidget", + "id": "table_top_providers_amount", + "options": { + "period_seconds": 30, + "url": "{{entire_url('table_top_providers_amount.ui')}}" + } + } + ] + }, + { + "widgettype": "VBox", + "options": { + "width": "50%", + "bgcolor": "#1E293B", + "borderRadius": "12px", + "padding": "20px", + "border": "1px solid #334155" + }, + "subwidgets": [ + { + "widgettype": "Title4", + "options": { + "text": "供应商调用排行(数量 Top 5)", + "color": "#F1F5F9", + "fontWeight": "600", + "marginBottom": "16px" + } + }, + { + "widgettype": "RefreshWidget", + "id": "table_top_providers_count", + "options": { + "period_seconds": 30, + "url": "{{entire_url('table_top_providers_count.ui')}}" + } + } + ] + } + ] } ] } diff --git a/wwwroot/table_top_providers_amount.ui b/wwwroot/table_top_providers_amount.ui new file mode 100644 index 0000000..d126c3a --- /dev/null +++ b/wwwroot/table_top_providers_amount.ui @@ -0,0 +1,77 @@ +{% set providers = get_top_providers_by_amount(request) %} +{ + "widgettype": "VBox", + "options": { + "width": "100%" + }, + "subwidgets": [ +{% for p in providers %} + { + "widgettype": "HBox", + "options": { + "width": "100%", + "padding": "12px 0", +{% if not loop.first %} + "borderTop": "1px solid #334155", +{% endif %} + "alignItems": "center" + }, + "subwidgets": [ + { + "widgettype": "Text", + "options": { + "text": "{{loop.index}}", + "width": "30px", + "color": "#64748B", + "fontSize": "14px", + "textAlign": "center" + } + }, + { + "widgettype": "Text", + "options": { + "text": "{{p.provider_name}}", + "flex": "1", + "color": "#F1F5F9", + "fontSize": "14px", + "fontWeight": "500" + } + }, + { + "widgettype": "Text", + "options": { + "text": "{{p.cnt}} 笔", + "width": "80px", + "color": "#94A3B8", + "fontSize": "13px", + "textAlign": "right" + } + }, + { + "widgettype": "Text", + "options": { + "text": "¥{{p.total_amount}}", + "width": "100px", + "color": "#22C55E", + "fontSize": "14px", + "fontWeight": "600", + "textAlign": "right" + } + } + ] + }{% if not loop.last %},{% endif %} +{% endfor %} +{% if not providers %} + { + "widgettype": "Text", + "options": { + "text": "暂无数据", + "color": "#64748B", + "fontSize": "14px", + "textAlign": "center", + "padding": "20px 0" + } + } +{% endif %} + ] +} diff --git a/wwwroot/table_top_providers_count.ui b/wwwroot/table_top_providers_count.ui new file mode 100644 index 0000000..5654628 --- /dev/null +++ b/wwwroot/table_top_providers_count.ui @@ -0,0 +1,77 @@ +{% set providers = get_top_providers_by_count(request) %} +{ + "widgettype": "VBox", + "options": { + "width": "100%" + }, + "subwidgets": [ +{% for p in providers %} + { + "widgettype": "HBox", + "options": { + "width": "100%", + "padding": "12px 0", +{% if not loop.first %} + "borderTop": "1px solid #334155", +{% endif %} + "alignItems": "center" + }, + "subwidgets": [ + { + "widgettype": "Text", + "options": { + "text": "{{loop.index}}", + "width": "30px", + "color": "#64748B", + "fontSize": "14px", + "textAlign": "center" + } + }, + { + "widgettype": "Text", + "options": { + "text": "{{p.provider_name}}", + "flex": "1", + "color": "#F1F5F9", + "fontSize": "14px", + "fontWeight": "500" + } + }, + { + "widgettype": "Text", + "options": { + "text": "{{p.cnt}} 笔", + "width": "80px", + "color": "#60A5FA", + "fontSize": "14px", + "fontWeight": "600", + "textAlign": "right" + } + }, + { + "widgettype": "Text", + "options": { + "text": "¥{{p.total_amount}}", + "width": "100px", + "color": "#22C55E", + "fontSize": "13px", + "textAlign": "right" + } + } + ] + }{% if not loop.last %},{% endif %} +{% endfor %} +{% if not providers %} + { + "widgettype": "Text", + "options": { + "text": "暂无数据", + "color": "#64748B", + "fontSize": "14px", + "textAlign": "center", + "padding": "20px 0" + } + } +{% endif %} + ] +} diff --git a/wwwroot/table_top_users_count.ui b/wwwroot/table_top_users_count.ui new file mode 100644 index 0000000..af0de85 --- /dev/null +++ b/wwwroot/table_top_users_count.ui @@ -0,0 +1,77 @@ +{% set users = get_top_users_by_count(request) %} +{ + "widgettype": "VBox", + "options": { + "width": "100%" + }, + "subwidgets": [ +{% for u in users %} + { + "widgettype": "HBox", + "options": { + "width": "100%", + "padding": "12px 0", +{% if not loop.first %} + "borderTop": "1px solid #334155", +{% endif %} + "alignItems": "center" + }, + "subwidgets": [ + { + "widgettype": "Text", + "options": { + "text": "{{loop.index}}", + "width": "30px", + "color": "#64748B", + "fontSize": "14px", + "textAlign": "center" + } + }, + { + "widgettype": "Text", + "options": { + "text": "{{u.user_name}}", + "flex": "1", + "color": "#F1F5F9", + "fontSize": "14px", + "fontWeight": "500" + } + }, + { + "widgettype": "Text", + "options": { + "text": "{{u.cnt}} 笔", + "width": "80px", + "color": "#60A5FA", + "fontSize": "14px", + "fontWeight": "600", + "textAlign": "right" + } + }, + { + "widgettype": "Text", + "options": { + "text": "¥{{u.total_amount}}", + "width": "100px", + "color": "#22C55E", + "fontSize": "13px", + "textAlign": "right" + } + } + ] + }{% if not loop.last %},{% endif %} +{% endfor %} +{% if not users %} + { + "widgettype": "Text", + "options": { + "text": "暂无数据", + "color": "#64748B", + "fontSize": "14px", + "textAlign": "center", + "padding": "20px 0" + } + } +{% endif %} + ] +}