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:24 +08:00
parent 9ebfeb6dda
commit 94f258a345
3 changed files with 358 additions and 266 deletions

View File

@ -1,212 +1,212 @@
{ {
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
"width": "100%",
"height": "100%"
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"width": "100%", "width": "100%",
"height": "50px" "height": "100%"
},
"subwidgets": [
{
"widgettype": "Button",
"options": {
"text": "返回列表",
"styleType": "default",
"style": {
"marginLeft": "20px",
"marginTop": "8px"
}
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "body/app",
"options": {
"url": "{{entire_url('contract_list.ui')}}"
}
}
]
},
{
"widgettype": "Filler"
},
{
"widgettype": "Button",
"options": {
"text": "编辑合同",
"styleType": "primary",
"style": {
"marginRight": "20px",
"marginTop": "8px"
}
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "body/app",
"options": {
"url": "{{entire_url('contract_edit.ui')}}",
"params": {
"id": "{% raw %}{{params_kw.get('contract_id')}}{% endraw %}"
}
}
}
]
}
]
}, },
{ "subwidgets": [
"widgettype": "Filler",
"options": {
"height": "10px"
}
},
{
"widgettype": "Form",
"options": {
"tblname": "contract",
"record_id": "{% raw %}{{params_kw.get('contract_id')}}{% endraw %}",
"readonly": true,
"width": "100%",
"style": {
"maxWidth": "1200px",
"margin": "0 auto"
}
}
},
{
"widgettype": "Filler",
"options": {
"height": "20px"
}
},
{
"widgettype": "HBox",
"options": {
"width": "100%",
"style": {
"maxWidth": "1200px",
"margin": "0 auto"
}
},
"subwidgets": [
{ {
"widgettype": "VBox", "widgettype": "HBox",
"options": { "options": {
"width": "50%"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "合同附件",
"style": {
"fontSize": "18px",
"fontWeight": "600",
"marginBottom": "10px"
}
}
},
{
"widgettype": "DataGrid",
"options": {
"tblname": "contract_attachment",
"width": "100%", "width": "100%",
"parent_field": "contract_id", "height": "50px"
"parent_value": "{% raw %}{{params_kw.get('contract_id')}}{% endraw %}" },
} "subwidgets": [
} {
] "widgettype": "Button",
"options": {
"styleType": "default",
"style": {
"marginLeft": "20px",
"marginTop": "8px"
},
"label": "返回列表"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "body/app",
"options": {
"url": "{{entire_url('contract_list.ui')}}"
}
}
]
},
{
"widgettype": "Filler"
},
{
"widgettype": "Button",
"options": {
"styleType": "primary",
"style": {
"marginRight": "20px",
"marginTop": "8px"
},
"label": "编辑合同"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "body/app",
"options": {
"url": "{{entire_url('contract_edit.ui')}}",
"params": {
"id": "{% raw %}{{params_kw.get('contract_id')}}{% endraw %}"
}
}
}
]
}
]
}, },
{ {
"widgettype": "Filler", "widgettype": "Filler",
"options": { "options": {
"width": "20px"
}
},
{
"widgettype": "VBox",
"options": {
"width": "50%"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "AI分析结果",
"style": {
"fontSize": "18px",
"fontWeight": "600",
"marginBottom": "10px"
}
}
},
{
"widgettype": "Text",
"options": {
"text": "合规检查结果:",
"style": {
"fontWeight": "600",
"marginBottom": "5px"
}
}
},
{
"widgettype": "Text",
"options": {
"fieldname": "ai_compliance_result",
"record_id": "{% raw %}{{params_kw.get('contract_id')}}{% endraw %}",
"tblname": "contract",
"style": {
"whiteSpace": "pre-wrap",
"backgroundColor": "#f8f9fa",
"padding": "10px",
"borderRadius": "4px"
}
}
},
{
"widgettype": "Filler",
"options": {
"height": "10px" "height": "10px"
}
},
{
"widgettype": "Text",
"options": {
"text": "关键时点:",
"style": {
"fontWeight": "600",
"marginBottom": "5px"
}
}
},
{
"widgettype": "Text",
"options": {
"fieldname": "ai_key_dates",
"record_id": "{% raw %}{{params_kw.get('contract_id')}}{% endraw %}",
"tblname": "contract",
"style": {
"whiteSpace": "pre-wrap",
"backgroundColor": "#f8f9fa",
"padding": "10px",
"borderRadius": "4px"
}
}
} }
] },
{
"widgettype": "Form",
"options": {
"tblname": "contract",
"record_id": "{% raw %}{{params_kw.get('contract_id')}}{% endraw %}",
"readonly": true,
"width": "100%",
"style": {
"maxWidth": "1200px",
"margin": "0 auto"
}
}
},
{
"widgettype": "Filler",
"options": {
"height": "20px"
}
},
{
"widgettype": "HBox",
"options": {
"width": "100%",
"style": {
"maxWidth": "1200px",
"margin": "0 auto"
}
},
"subwidgets": [
{
"widgettype": "VBox",
"options": {
"width": "50%"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "合同附件",
"style": {
"fontSize": "18px",
"fontWeight": "600",
"marginBottom": "10px"
}
}
},
{
"widgettype": "DataGrid",
"options": {
"tblname": "contract_attachment",
"width": "100%",
"parent_field": "contract_id",
"parent_value": "{% raw %}{{params_kw.get('contract_id')}}{% endraw %}"
}
}
]
},
{
"widgettype": "Filler",
"options": {
"width": "20px"
}
},
{
"widgettype": "VBox",
"options": {
"width": "50%"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "AI分析结果",
"style": {
"fontSize": "18px",
"fontWeight": "600",
"marginBottom": "10px"
}
}
},
{
"widgettype": "Text",
"options": {
"text": "合规检查结果:",
"style": {
"fontWeight": "600",
"marginBottom": "5px"
}
}
},
{
"widgettype": "Text",
"options": {
"fieldname": "ai_compliance_result",
"record_id": "{% raw %}{{params_kw.get('contract_id')}}{% endraw %}",
"tblname": "contract",
"style": {
"whiteSpace": "pre-wrap",
"backgroundColor": "#f8f9fa",
"padding": "10px",
"borderRadius": "4px"
}
}
},
{
"widgettype": "Filler",
"options": {
"height": "10px"
}
},
{
"widgettype": "Text",
"options": {
"text": "关键时点:",
"style": {
"fontWeight": "600",
"marginBottom": "5px"
}
}
},
{
"widgettype": "Text",
"options": {
"fieldname": "ai_key_dates",
"record_id": "{% raw %}{{params_kw.get('contract_id')}}{% endraw %}",
"tblname": "contract",
"style": {
"whiteSpace": "pre-wrap",
"backgroundColor": "#f8f9fa",
"padding": "10px",
"borderRadius": "4px"
}
}
}
]
}
]
} }
] ]
}
]
} }

View File

@ -1,48 +1,140 @@
{ {
"widgettype": "Page", "widgettype": "Page",
"options": { "options": {
"title": "合同管理", "title": "合同管理",
"style": {"height": "100vh", "padding": "0"} "style": {
}, "height": "100vh",
"subwidgets": [ "padding": "0"
{
"widgettype": "VBox",
"options": {"style": {"padding": "16px", "flex": 1, "overflow": "hidden"}},
"subwidgets": [
{
"widgettype": "HBox",
"options": {"style": {"marginBottom": "16px", "gap": "8px"}},
"subwidgets": [
{"widgettype": "TextField", "id": "search_keyword", "options": {"label": "搜索", "placeholder": "合同编号/名称", "style": {"flex": 1}}},
{"widgettype": "Button", "id": "btn_search", "options": {"text": "搜索", "variant": "primary"}},
{"widgettype": "Button", "id": "btn_add", "options": {"text": "新增", "variant": "primary", "action": "navigate('main/contract_management/contract_edit.ui')"}}
]
},
{
"widgettype": "DataGrid",
"id": "contract_grid",
"options": {
"url": "{{entire_url('api/contract_list.dspy')}}",
"style": {"flex": 1},
"columns": [
{"field": "contract_number", "header": "合同编号", "width": 140},
{"field": "title", "header": "合同名称", "width": 200},
{"field": "party_a", "header": "甲方", "width": 150},
{"field": "party_b", "header": "乙方", "width": 150},
{"field": "contract_type", "header": "类型", "width": 100},
{"field": "amount", "header": "金额", "width": 120},
{"field": "start_date", "header": "开始日期", "width": 110},
{"field": "end_date", "header": "结束日期", "width": 110},
{"field": "status", "header": "状态", "width": 90}
],
"toolbar": [
{"type": "button", "text": "详情", "icon": "view", "action": "navigate('main/contract_management/contract_detail.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')"},
{"type": "button", "text": "编辑", "icon": "edit", "action": "navigate('main/contract_management/contract_edit.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')"},
{"type": "button", "text": "删除", "icon": "delete", "action": "doDelete('{% raw %}{{selectedRow.id}}{% endraw %}')"}
]
}
} }
] },
} "subwidgets": [
] {
} "widgettype": "VBox",
"options": {
"style": {
"padding": "16px",
"flex": 1,
"overflow": "hidden"
}
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"style": {
"marginBottom": "16px",
"gap": "8px"
}
},
"subwidgets": [
{
"widgettype": "TextField",
"id": "search_keyword",
"options": {
"label": "搜索",
"placeholder": "合同编号/名称",
"style": {
"flex": 1
}
}
},
{
"widgettype": "Button",
"id": "btn_search",
"options": {
"variant": "primary",
"label": "搜索"
}
},
{
"widgettype": "Button",
"id": "btn_add",
"options": {
"variant": "primary",
"action": "navigate('main/contract_management/contract_edit.ui')",
"label": "新增"
}
}
]
},
{
"widgettype": "DataGrid",
"id": "contract_grid",
"options": {
"url": "{{entire_url('api/contract_list.dspy')}}",
"style": {
"flex": 1
},
"columns": [
{
"field": "contract_number",
"header": "合同编号",
"width": 140
},
{
"field": "title",
"header": "合同名称",
"width": 200
},
{
"field": "party_a",
"header": "甲方",
"width": 150
},
{
"field": "party_b",
"header": "乙方",
"width": 150
},
{
"field": "contract_type",
"header": "类型",
"width": 100
},
{
"field": "amount",
"header": "金额",
"width": 120
},
{
"field": "start_date",
"header": "开始日期",
"width": 110
},
{
"field": "end_date",
"header": "结束日期",
"width": 110
},
{
"field": "status",
"header": "状态",
"width": 90
}
],
"toolbar": [
{
"type": "button",
"text": "详情",
"icon": "view",
"action": "navigate('main/contract_management/contract_detail.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')"
},
{
"type": "button",
"text": "编辑",
"icon": "edit",
"action": "navigate('main/contract_management/contract_edit.ui?id={% raw %}{{selectedRow.id}}{% endraw %}')"
},
{
"type": "button",
"text": "删除",
"icon": "delete",
"action": "doDelete('{% raw %}{{selectedRow.id}}{% endraw %}')"
}
]
}
}
]
}
]
}

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": "查看合同详细信息及里程碑"
} }
} }
] ]
@ -175,19 +175,19 @@
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "AI配置",
"fontSize": "18px", "fontSize": "18px",
"fontWeight": "bold", "fontWeight": "bold",
"color": "#7C3AED" "color": "#7C3AED",
"text": "AI配置"
} }
}, },
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"label": "合同AI分析配置",
"fontSize": "14px", "fontSize": "14px",
"color": "#6B7280", "color": "#6B7280",
"marginTop": "8px" "marginTop": "8px",
"text": "合同AI分析配置"
} }
} }
] ]
@ -208,4 +208,4 @@
} }
} }
] ]
} }