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

Per bricks-framework specification:
- Text/Title controls: use 'text' for non-i18n text, 'otext'+'i18n:true' for i18n
- Button controls: use 'label' for button display text
This commit is contained in:
yumoqing 2026-05-05 19:28:38 +08:00
parent 21cbd1b2fb
commit 282c1780ba
2 changed files with 257 additions and 257 deletions

View File

@ -1,174 +1,174 @@
{ {
"id": "crm_main", "id": "crm_main",
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
"width": "100%", "width": "100%",
"height": "100vh", "height": "100vh",
"style": {
"margin": "0",
"padding": "0"
}
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"height": "56px",
"style": { "style": {
"background": "#1a73e8", "margin": "0",
"color": "white", "padding": "0"
"alignItems": "center",
"padding": "0 16px",
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
} }
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"label": "CRM系统",
"style": {
"fontSize": "20px",
"fontWeight": "bold",
"color": "white"
}
}
},
{
"widgettype": "Filler",
"options": {}
},
{
"widgettype": "Text",
"id": "lbl_username",
"options": {
"label": "用户: admin",
"style": {
"color": "white",
"marginRight": "16px"
}
}
},
{
"widgettype": "Button",
"id": "btn_logout",
"options": {
"label": "退出登录",
"variant": "text",
"style": {
"color": "white"
}
}
}
]
}, },
{ "subwidgets": [
"widgettype": "HBox",
"options": {
"flex": 1,
"style": {
"overflow": "hidden"
}
},
"subwidgets": [
{ {
"widgettype": "VBox", "widgettype": "HBox",
"options": { "options": {
"width": "220px", "height": "56px",
"style": {
"background": "#f5f5f5",
"borderRight": "1px solid #e0e0e0",
"overflowY": "auto",
"padding": "8px 0"
}
},
"subwidgets": [
{
"widgettype": "Menu",
"id": "main_menu",
"options": {
"items": [
{
"name": "dashboard",
"label": "工作台",
"icon": "dashboard",
"url": "{{entire_url('/unified_dashboard')}}"
},
{
"name": "customers",
"label": "客户管理",
"icon": "people",
"url": "{{entire_url('/customer_management')}}"
},
{
"name": "opportunities",
"label": "商机管理",
"icon": "trending_up",
"url": "{{entire_url('/opportunity_management')}}"
},
{
"name": "contracts",
"label": "合同管理",
"icon": "description",
"url": "{{entire_url('/contract_management')}}"
},
{
"name": "finance",
"label": "财务管理",
"icon": "account_balance",
"url": "{{entire_url('/financial_management')}}"
},
{
"name": "approvals",
"label": "审批管理",
"icon": "check_circle",
"url": "{{entire_url('/workflow_approval')}}"
}
],
"style": { "style": {
"width": "100%" "background": "#1a73e8",
"color": "white",
"alignItems": "center",
"padding": "0 16px",
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
} }
} },
} "subwidgets": [
] {
"widgettype": "Text",
"options": {
"style": {
"fontSize": "20px",
"fontWeight": "bold",
"color": "white"
},
"text": "CRM系统"
}
},
{
"widgettype": "Filler",
"options": {}
},
{
"widgettype": "Text",
"id": "lbl_username",
"options": {
"style": {
"color": "white",
"marginRight": "16px"
},
"text": "用户: admin"
}
},
{
"widgettype": "Button",
"id": "btn_logout",
"options": {
"label": "退出登录",
"variant": "text",
"style": {
"color": "white"
}
}
}
]
}, },
{ {
"widgettype": "VBox", "widgettype": "HBox",
"options": { "options": {
"flex": 1, "flex": 1,
"style": {
"overflow": "hidden",
"background": "#fafafa"
}
},
"subwidgets": [
{
"widgettype": "Iframe",
"id": "content_frame",
"options": {
"url": "{{entire_url('/unified_dashboard')}}",
"width": "100%",
"height": "100%",
"style": { "style": {
"border": "none" "overflow": "hidden"
} }
} },
} "subwidgets": [
] {
"widgettype": "VBox",
"options": {
"width": "220px",
"style": {
"background": "#f5f5f5",
"borderRight": "1px solid #e0e0e0",
"overflowY": "auto",
"padding": "8px 0"
}
},
"subwidgets": [
{
"widgettype": "Menu",
"id": "main_menu",
"options": {
"items": [
{
"name": "dashboard",
"label": "工作台",
"icon": "dashboard",
"url": "{{entire_url('/unified_dashboard')}}"
},
{
"name": "customers",
"label": "客户管理",
"icon": "people",
"url": "{{entire_url('/customer_management')}}"
},
{
"name": "opportunities",
"label": "商机管理",
"icon": "trending_up",
"url": "{{entire_url('/opportunity_management')}}"
},
{
"name": "contracts",
"label": "合同管理",
"icon": "description",
"url": "{{entire_url('/contract_management')}}"
},
{
"name": "finance",
"label": "财务管理",
"icon": "account_balance",
"url": "{{entire_url('/financial_management')}}"
},
{
"name": "approvals",
"label": "审批管理",
"icon": "check_circle",
"url": "{{entire_url('/workflow_approval')}}"
}
],
"style": {
"width": "100%"
}
}
}
]
},
{
"widgettype": "VBox",
"options": {
"flex": 1,
"style": {
"overflow": "hidden",
"background": "#fafafa"
}
},
"subwidgets": [
{
"widgettype": "Iframe",
"id": "content_frame",
"options": {
"url": "{{entire_url('/unified_dashboard')}}",
"width": "100%",
"height": "100%",
"style": {
"border": "none"
}
}
}
]
}
]
} }
] ],
} "binds": [
], {
"binds": [ "wid": "btn_logout",
{ "event": "click",
"wid": "btn_logout", "actiontype": "fetch",
"event": "click", "url": "{{entire_url('api/logout.dspy')}}",
"actiontype": "fetch", "method": "POST",
"url": "{{entire_url('api/logout.dspy')}}", "callback": {
"method": "POST", "success": "navigate('/login.ui')"
"callback": { }
"success": "navigate('/login.ui')" }
} ]
} }
]
}

View File

@ -1,100 +1,100 @@
{ {
"id": "login_page", "id": "login_page",
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
"width": "100%", "width": "100%",
"height": "100vh", "height": "100vh",
"style": {
"background": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
"alignItems": "center",
"justifyContent": "center"
}
},
"subwidgets": [
{
"widgettype": "VBox",
"options": {
"width": "400px",
"style": { "style": {
"background": "white", "background": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
"borderRadius": "12px", "alignItems": "center",
"boxShadow": "0 8px 32px rgba(0,0,0,0.15)", "justifyContent": "center"
"padding": "40px 32px"
} }
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "Text", "widgettype": "VBox",
"options": { "options": {
"label": "CRM系统登录", "width": "400px",
"style": { "style": {
"fontSize": "24px", "background": "white",
"fontWeight": "bold", "borderRadius": "12px",
"textAlign": "center", "boxShadow": "0 8px 32px rgba(0,0,0,0.15)",
"marginBottom": "24px", "padding": "40px 32px"
"color": "#333" }
} },
} "subwidgets": [
}, {
{ "widgettype": "Text",
"widgettype": "Form", "options": {
"id": "login_form", "style": {
"options": { "fontSize": "24px",
"url": "{{entire_url('api/login.dspy')}}", "fontWeight": "bold",
"method": "POST", "textAlign": "center",
"fields": [ "marginBottom": "24px",
{ "color": "#333"
"name": "username", },
"label": "用户名", "text": "CRM系统登录"
"uitype": "str", }
"required": true, },
"placeholder": "请输入用户名" {
}, "widgettype": "Form",
{ "id": "login_form",
"name": "password", "options": {
"label": "密码", "url": "{{entire_url('api/login.dspy')}}",
"uitype": "password", "method": "POST",
"required": true, "fields": [
"placeholder": "请输入密码" {
} "name": "username",
], "label": "用户名",
"submitLabel": "登录", "uitype": "str",
"submitVariant": "primary", "required": true,
"submitFullWidth": true "placeholder": "请输入用户名"
} },
}, {
{ "name": "password",
"widgettype": "HBox", "label": "密码",
"options": { "uitype": "password",
"style": { "required": true,
"justifyContent": "center", "placeholder": "请输入密码"
"marginTop": "16px", }
"gap": "16px" ],
} "submitLabel": "登录",
}, "submitVariant": "primary",
"subwidgets": [ "submitFullWidth": true
{ }
"widgettype": "Button", },
"id": "btn_register", {
"options": { "widgettype": "HBox",
"label": "注册账号", "options": {
"variant": "text", "style": {
"url": "{{entire_url('/rbac/user/register.ui')}}" "justifyContent": "center",
} "marginTop": "16px",
} "gap": "16px"
] }
},
"subwidgets": [
{
"widgettype": "Button",
"id": "btn_register",
"options": {
"label": "注册账号",
"variant": "text",
"url": "{{entire_url('/rbac/user/register.ui')}}"
}
}
]
}
]
} }
] ],
} "binds": [
], {
"binds": [ "wid": "login_form",
{ "event": "submit",
"wid": "login_form", "actiontype": "formsubmit",
"event": "submit", "callback": {
"actiontype": "formsubmit", "success": "navigate('/index.ui')"
"callback": { }
"success": "navigate('/index.ui')" }
} ]
} }
]
}