fix: Text widgets use 'text' not 'label', Button widgets use 'label' not 'text'

Per bricks-framework spec:
- Text/Title: use 'text' for non-i18n, 'otext'+'i18n:true' for i18n
- Button: use 'label' for button text
This commit is contained in:
yumoqing 2026-05-05 19:28:26 +08:00
parent c0297e35f6
commit 32622d0a97
4 changed files with 344 additions and 282 deletions

View File

@ -12,12 +12,12 @@
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "工作台",
"style": { "style": {
"fontSize": "20px", "fontSize": "20px",
"fontWeight": "bold", "fontWeight": "bold",
"marginBottom": "16px" "marginBottom": "16px"
} },
"text": "工作台"
} }
}, },
{ {
@ -46,22 +46,22 @@
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "客户总数",
"style": { "style": {
"fontSize": "14px", "fontSize": "14px",
"opacity": 0.9 "opacity": 0.9
} },
"text": "客户总数"
} }
}, },
{ {
"widgettype": "Text", "widgettype": "Text",
"id": "lbl_customer_count", "id": "lbl_customer_count",
"options": { "options": {
"label": "--",
"style": { "style": {
"fontSize": "32px", "fontSize": "32px",
"fontWeight": "bold" "fontWeight": "bold"
} },
"text": "--"
} }
} }
] ]
@ -82,22 +82,22 @@
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "商机总数",
"style": { "style": {
"fontSize": "14px", "fontSize": "14px",
"opacity": 0.9 "opacity": 0.9
} },
"text": "商机总数"
} }
}, },
{ {
"widgettype": "Text", "widgettype": "Text",
"id": "lbl_opportunity_count", "id": "lbl_opportunity_count",
"options": { "options": {
"label": "--",
"style": { "style": {
"fontSize": "32px", "fontSize": "32px",
"fontWeight": "bold" "fontWeight": "bold"
} },
"text": "--"
} }
} }
] ]
@ -118,22 +118,22 @@
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "合同总数",
"style": { "style": {
"fontSize": "14px", "fontSize": "14px",
"opacity": 0.9 "opacity": 0.9
} },
"text": "合同总数"
} }
}, },
{ {
"widgettype": "Text", "widgettype": "Text",
"id": "lbl_contract_count", "id": "lbl_contract_count",
"options": { "options": {
"label": "--",
"style": { "style": {
"fontSize": "32px", "fontSize": "32px",
"fontWeight": "bold" "fontWeight": "bold"
} },
"text": "--"
} }
} }
] ]
@ -154,22 +154,22 @@
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "待审批",
"style": { "style": {
"fontSize": "14px", "fontSize": "14px",
"opacity": 0.9 "opacity": 0.9
} },
"text": "待审批"
} }
}, },
{ {
"widgettype": "Text", "widgettype": "Text",
"id": "lbl_approval_count", "id": "lbl_approval_count",
"options": { "options": {
"label": "--",
"style": { "style": {
"fontSize": "32px", "fontSize": "32px",
"fontWeight": "bold" "fontWeight": "bold"
} },
"text": "--"
} }
} }
] ]

View File

@ -10,11 +10,11 @@
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "统一仪表盘",
"fontSize": "24px", "fontSize": "24px",
"fontWeight": "bold", "fontWeight": "bold",
"color": "#1E40AF", "color": "#1E40AF",
"marginBottom": "20px" "marginBottom": "20px",
"text": "统一仪表盘"
} }
}, },
{ {
@ -49,19 +49,19 @@
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "业务仪表盘",
"fontSize": "18px", "fontSize": "18px",
"fontWeight": "bold", "fontWeight": "bold",
"color": "#1E40AF" "color": "#1E40AF",
"text": "业务仪表盘"
} }
}, },
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "实时业务数据可视化展示",
"fontSize": "14px", "fontSize": "14px",
"color": "#6B7280", "color": "#6B7280",
"marginTop": "8px" "marginTop": "8px",
"text": "实时业务数据可视化展示"
} }
} }
] ]
@ -91,19 +91,19 @@
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "报表中心",
"fontSize": "18px", "fontSize": "18px",
"fontWeight": "bold", "fontWeight": "bold",
"color": "#059669" "color": "#059669",
"text": "报表中心"
} }
}, },
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "生成和查看各类业务报表",
"fontSize": "14px", "fontSize": "14px",
"color": "#6B7280", "color": "#6B7280",
"marginTop": "8px" "marginTop": "8px",
"text": "生成和查看各类业务报表"
} }
} }
] ]
@ -133,19 +133,19 @@
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "移动端仪表盘",
"fontSize": "18px", "fontSize": "18px",
"fontWeight": "bold", "fontWeight": "bold",
"color": "#D97706" "color": "#D97706",
"text": "移动端仪表盘"
} }
}, },
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "适配移动设备的仪表盘视图",
"fontSize": "14px", "fontSize": "14px",
"color": "#6B7280", "color": "#6B7280",
"marginTop": "8px" "marginTop": "8px",
"text": "适配移动设备的仪表盘视图"
} }
} }
] ]

View File

@ -24,7 +24,6 @@
{ {
"widgettype": "Button", "widgettype": "Button",
"options": { "options": {
"text": "新建报表",
"onClick": "goto('unified_dashboard/report_template/create.ui')", "onClick": "goto('unified_dashboard/report_template/create.ui')",
"style": { "style": {
"backgroundColor": "#007bff", "backgroundColor": "#007bff",
@ -32,7 +31,8 @@
"border": "none", "border": "none",
"padding": "6px 12px", "padding": "6px 12px",
"borderRadius": "4px" "borderRadius": "4px"
} },
"label": "新建报表"
} }
} }
] ]
@ -45,7 +45,11 @@
"org_id": "${logined_orgid}", "org_id": "${logined_orgid}",
"is_active": "Y" "is_active": "Y"
}, },
"fields": ["template_name", "report_type", "created_at"], "fields": [
"template_name",
"report_type",
"created_at"
],
"fieldLabels": { "fieldLabels": {
"template_name": "报表名称", "template_name": "报表名称",
"report_type": "报表类型", "report_type": "报表类型",

View File

@ -2,19 +2,50 @@
"widgettype": "Page", "widgettype": "Page",
"options": { "options": {
"title": "报表中心", "title": "报表中心",
"style": {"height": "100%", "padding": "0"} "style": {
"height": "100%",
"padding": "0"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "VBox", "widgettype": "VBox",
"options": {"style": {"padding": "16px", "flex": 1, "overflow": "auto"}}, "options": {
"style": {
"padding": "16px",
"flex": 1,
"overflow": "auto"
}
},
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "HBox", "widgettype": "HBox",
"options": {"style": {"marginBottom": "16px", "gap": "8px"}}, "options": {
"style": {
"marginBottom": "16px",
"gap": "8px"
}
},
"subwidgets": [ "subwidgets": [
{"widgettype": "TextField", "id": "report_search", "options": {"label": "搜索报表", "placeholder": "报表名称", "style": {"flex": 1}}}, {
{"widgettype": "Button", "id": "btn_search", "options": {"text": "搜索", "variant": "primary"}} "widgettype": "TextField",
"id": "report_search",
"options": {
"label": "搜索报表",
"placeholder": "报表名称",
"style": {
"flex": 1
}
}
},
{
"widgettype": "Button",
"id": "btn_search",
"options": {
"variant": "primary",
"label": "搜索"
}
}
] ]
}, },
{ {
@ -22,16 +53,43 @@
"id": "report_grid", "id": "report_grid",
"options": { "options": {
"url": "{{entire_url('api/report_list.dspy')}}", "url": "{{entire_url('api/report_list.dspy')}}",
"style": {"flex": 1}, "style": {
"flex": 1
},
"columns": [ "columns": [
{"field": "template_name", "header": "报表名称", "width": 200}, {
{"field": "category", "header": "分类", "width": 120}, "field": "template_name",
{"field": "description", "header": "说明", "width": 300}, "header": "报表名称",
{"field": "is_active", "header": "状态", "width": 80}, "width": 200
{"field": "created_at", "header": "创建时间", "width": 160} },
{
"field": "category",
"header": "分类",
"width": 120
},
{
"field": "description",
"header": "说明",
"width": 300
},
{
"field": "is_active",
"header": "状态",
"width": 80
},
{
"field": "created_at",
"header": "创建时间",
"width": 160
}
], ],
"toolbar": [ "toolbar": [
{"type": "button", "text": "查看", "icon": "view", "action": "navigate('main/unified_dashboard/report_view.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')"} {
"type": "button",
"text": "查看",
"icon": "view",
"action": "navigate('main/unified_dashboard/report_view.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')"
}
] ]
} }
} }