All Chinese text strings converted to use otext with i18n:true so
bricks framework can look up translations. Template strings with
{{...}} left as text (correct - dynamic content).
Affected files:
- index.ui: 数据概览, 快捷入口, 模型管理, 用户管理, 知识库, 异常记录,
用户消费排行, 用户调用排行, 供应商交易排行, 供应商调用排行, Top 3 模型
- stat_*.ui: 今日活跃用户, 在线用户, 记账异常, 本月新增用户, 今日消费金额,
今日调用笔数, 组织机构数, 用户总数
- today_amount.ui, today_usage.ui: 今日交易金额, 今日调用笔数
- accounting_errors.ui, concurrent_users.ui, total_users.ui
- table_top_*.ui: 暂无数据
- top_users_amount.ui: 用户金额TOP5, 排名, 用户, 金额, 调用次数
65 lines
2.9 KiB
XML
65 lines
2.9 KiB
XML
{
|
||
"widgettype": "VBox",
|
||
"options": {
|
||
"bgcolor": "#FFFFFF",
|
||
"padding": "20px",
|
||
"borderRadius": "8px",
|
||
"minHeight": "280px"
|
||
},
|
||
"subwidgets": [
|
||
{
|
||
"widgettype": "Text",
|
||
"options": {
|
||
"otext": "用户金额 TOP 5(今日)",
|
||
|
||
"i18n": true,
|
||
"fontSize": "16px",
|
||
"fontWeight": "bold",
|
||
"color": "#333",
|
||
"marginBottom": "12px"
|
||
}
|
||
},
|
||
{% set rows = get_top_users_by_amount(request) %}
|
||
{% if rows %}
|
||
{
|
||
"widgettype": "VBox",
|
||
"options": {"spacing": "8px"},
|
||
"subwidgets": [
|
||
{
|
||
"widgettype": "HBox",
|
||
"options": {"bgcolor": "#f5f5f5", "padding": "8px 12px", "borderRadius": "4px"},
|
||
"subwidgets": [
|
||
{"widgettype": "Text", "options": {"otext": "排名",
|
||
"i18n": true, "fontSize": "12px", "color": "#888", "width": "50px"}},
|
||
{"widgettype": "Text", "options": {"otext": "用户",
|
||
"i18n": true, "fontSize": "12px", "color": "#888", "flex": "1"}},
|
||
{"widgettype": "Text", "options": {"otext": "金额",
|
||
"i18n": true, "fontSize": "12px", "color": "#888", "width": "100px", "textAlign": "right"}},
|
||
{"widgettype": "Text", "options": {"otext": "笔数",
|
||
"i18n": true, "fontSize": "12px", "color": "#888", "width": "60px", "textAlign": "right"}}
|
||
]
|
||
},
|
||
{% for item in rows %}
|
||
{
|
||
"widgettype": "HBox",
|
||
"options": {"padding": "8px 12px", "borderRadius": "4px", "bgcolor": "{% if loop.index == 1 %}#fff3e0{% elif loop.index == 2 %}#fff8e1{% elif loop.index == 3 %}#fffde7{% else %}#fafafa{% endif %}"},
|
||
"subwidgets": [
|
||
{"widgettype": "Text", "options": {"text": "{{loop.index}}", "fontSize": "13px", "color": "{% if loop.index <= 3 %}#e65100{% else %}#666{% endif %}", "width": "50px", "fontWeight": "bold"}},
|
||
{"widgettype": "Text", "options": {"text": "{{item.user_name}}", "fontSize": "13px", "color": "#333", "flex": "1"}},
|
||
{"widgettype": "Text", "options": {"text": "{{item.total_amount|round(2)}}", "fontSize": "13px", "color": "#2e7d32", "width": "100px", "textAlign": "right", "fontWeight": "bold"}},
|
||
{"widgettype": "Text", "options": {"text": "{{item.cnt}}", "fontSize": "13px", "color": "#666", "width": "60px", "textAlign": "right"}}
|
||
]
|
||
}{% if not loop.last %},{% endif %}
|
||
{% endfor %}
|
||
]
|
||
}
|
||
{% else %}
|
||
{
|
||
"widgettype": "Text",
|
||
"options": {"otext": "暂无数据",
|
||
"i18n": true, "fontSize": "14px", "color": "#999", "textAlign": "center"}
|
||
}
|
||
{% endif %}
|
||
]
|
||
}
|