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

@ -1,180 +1,180 @@
{
"id": "unified_dashboard",
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"style": {
"padding": "16px"
}
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"label": "工作台",
"id": "unified_dashboard",
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"style": {
"fontSize": "20px",
"fontWeight": "bold",
"marginBottom": "16px"
"padding": "16px"
}
}
},
{
"widgettype": "HBox",
"options": {
"style": {
"gap": "16px",
"flexWrap": "wrap",
"marginBottom": "24px"
"subwidgets": [
{
"widgettype": "Text",
"options": {
"style": {
"fontSize": "20px",
"fontWeight": "bold",
"marginBottom": "16px"
},
"text": "工作台"
}
},
{
"widgettype": "HBox",
"options": {
"style": {
"gap": "16px",
"flexWrap": "wrap",
"marginBottom": "24px"
}
},
"subwidgets": [
{
"widgettype": "VBox",
"options": {
"style": {
"background": "#4CAF50",
"color": "white",
"padding": "24px",
"borderRadius": "8px",
"minWidth": "200px",
"flex": 1
}
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"style": {
"fontSize": "14px",
"opacity": 0.9
},
"text": "客户总数"
}
},
{
"widgettype": "Text",
"id": "lbl_customer_count",
"options": {
"style": {
"fontSize": "32px",
"fontWeight": "bold"
},
"text": "--"
}
}
]
},
{
"widgettype": "VBox",
"options": {
"style": {
"background": "#2196F3",
"color": "white",
"padding": "24px",
"borderRadius": "8px",
"minWidth": "200px",
"flex": 1
}
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"style": {
"fontSize": "14px",
"opacity": 0.9
},
"text": "商机总数"
}
},
{
"widgettype": "Text",
"id": "lbl_opportunity_count",
"options": {
"style": {
"fontSize": "32px",
"fontWeight": "bold"
},
"text": "--"
}
}
]
},
{
"widgettype": "VBox",
"options": {
"style": {
"background": "#FF9800",
"color": "white",
"padding": "24px",
"borderRadius": "8px",
"minWidth": "200px",
"flex": 1
}
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"style": {
"fontSize": "14px",
"opacity": 0.9
},
"text": "合同总数"
}
},
{
"widgettype": "Text",
"id": "lbl_contract_count",
"options": {
"style": {
"fontSize": "32px",
"fontWeight": "bold"
},
"text": "--"
}
}
]
},
{
"widgettype": "VBox",
"options": {
"style": {
"background": "#F44336",
"color": "white",
"padding": "24px",
"borderRadius": "8px",
"minWidth": "200px",
"flex": 1
}
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"style": {
"fontSize": "14px",
"opacity": 0.9
},
"text": "待审批"
}
},
{
"widgettype": "Text",
"id": "lbl_approval_count",
"options": {
"style": {
"fontSize": "32px",
"fontWeight": "bold"
},
"text": "--"
}
}
]
}
]
}
},
"subwidgets": [
{
"widgettype": "VBox",
"options": {
"style": {
"background": "#4CAF50",
"color": "white",
"padding": "24px",
"borderRadius": "8px",
"minWidth": "200px",
"flex": 1
}
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"label": "客户总数",
"style": {
"fontSize": "14px",
"opacity": 0.9
}
}
},
{
"widgettype": "Text",
"id": "lbl_customer_count",
"options": {
"label": "--",
"style": {
"fontSize": "32px",
"fontWeight": "bold"
}
}
}
]
},
{
"widgettype": "VBox",
"options": {
"style": {
"background": "#2196F3",
"color": "white",
"padding": "24px",
"borderRadius": "8px",
"minWidth": "200px",
"flex": 1
}
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"label": "商机总数",
"style": {
"fontSize": "14px",
"opacity": 0.9
}
}
},
{
"widgettype": "Text",
"id": "lbl_opportunity_count",
"options": {
"label": "--",
"style": {
"fontSize": "32px",
"fontWeight": "bold"
}
}
}
]
},
{
"widgettype": "VBox",
"options": {
"style": {
"background": "#FF9800",
"color": "white",
"padding": "24px",
"borderRadius": "8px",
"minWidth": "200px",
"flex": 1
}
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"label": "合同总数",
"style": {
"fontSize": "14px",
"opacity": 0.9
}
}
},
{
"widgettype": "Text",
"id": "lbl_contract_count",
"options": {
"label": "--",
"style": {
"fontSize": "32px",
"fontWeight": "bold"
}
}
}
]
},
{
"widgettype": "VBox",
"options": {
"style": {
"background": "#F44336",
"color": "white",
"padding": "24px",
"borderRadius": "8px",
"minWidth": "200px",
"flex": 1
}
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"label": "待审批",
"style": {
"fontSize": "14px",
"opacity": 0.9
}
}
},
{
"widgettype": "Text",
"id": "lbl_approval_count",
"options": {
"label": "--",
"style": {
"fontSize": "32px",
"fontWeight": "bold"
}
}
}
]
}
]
}
]
]
}

View File

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

View File

@ -1,58 +1,62 @@
{
"widgettype": "VBox",
"options": {
"maxWidth": "100%",
"padding": "15px"
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"alignItems": "center",
"justifyContent": "space-between",
"marginBottom": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "报表中心",
"fontSize": "18px",
"fontWeight": "bold"
}
},
{
"widgettype": "Button",
"options": {
"text": "新建报表",
"onClick": "goto('unified_dashboard/report_template/create.ui')",
"style": {
"backgroundColor": "#007bff",
"color": "white",
"border": "none",
"padding": "6px 12px",
"borderRadius": "4px"
}
}
}
]
"widgettype": "VBox",
"options": {
"maxWidth": "100%",
"padding": "15px"
},
{
"widgettype": "DataGrid",
"options": {
"tblname": "report_template",
"where": {
"org_id": "${logined_orgid}",
"is_active": "Y"
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"alignItems": "center",
"justifyContent": "space-between",
"marginBottom": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "报表中心",
"fontSize": "18px",
"fontWeight": "bold"
}
},
{
"widgettype": "Button",
"options": {
"onClick": "goto('unified_dashboard/report_template/create.ui')",
"style": {
"backgroundColor": "#007bff",
"color": "white",
"border": "none",
"padding": "6px 12px",
"borderRadius": "4px"
},
"label": "新建报表"
}
}
]
},
"fields": ["template_name", "report_type", "created_at"],
"fieldLabels": {
"template_name": "报表名称",
"report_type": "报表类型",
"created_at": "创建时间"
},
"onRowClick": "view_report('${id}')"
}
}
]
{
"widgettype": "DataGrid",
"options": {
"tblname": "report_template",
"where": {
"org_id": "${logined_orgid}",
"is_active": "Y"
},
"fields": [
"template_name",
"report_type",
"created_at"
],
"fieldLabels": {
"template_name": "报表名称",
"report_type": "报表类型",
"created_at": "创建时间"
},
"onRowClick": "view_report('${id}')"
}
}
]
}

View File

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