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:
parent
21cbd1b2fb
commit
282c1780ba
322
wwwroot/index.ui
322
wwwroot/index.ui
@ -1,174 +1,174 @@
|
||||
{
|
||||
"id": "crm_main",
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"height": "100vh",
|
||||
"style": {
|
||||
"margin": "0",
|
||||
"padding": "0"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "HBox",
|
||||
"options": {
|
||||
"height": "56px",
|
||||
"id": "crm_main",
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"height": "100vh",
|
||||
"style": {
|
||||
"background": "#1a73e8",
|
||||
"color": "white",
|
||||
"alignItems": "center",
|
||||
"padding": "0 16px",
|
||||
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
|
||||
"margin": "0",
|
||||
"padding": "0"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"widgettype": "HBox",
|
||||
"options": {
|
||||
"flex": 1,
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
"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')}}"
|
||||
}
|
||||
],
|
||||
"widgettype": "HBox",
|
||||
"options": {
|
||||
"height": "56px",
|
||||
"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",
|
||||
"options": {
|
||||
"flex": 1,
|
||||
"style": {
|
||||
"overflow": "hidden",
|
||||
"background": "#fafafa"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Iframe",
|
||||
"id": "content_frame",
|
||||
"options": {
|
||||
"url": "{{entire_url('/unified_dashboard')}}",
|
||||
"width": "100%",
|
||||
"height": "100%",
|
||||
"widgettype": "HBox",
|
||||
"options": {
|
||||
"flex": 1,
|
||||
"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": [
|
||||
{
|
||||
"wid": "btn_logout",
|
||||
"event": "click",
|
||||
"actiontype": "fetch",
|
||||
"url": "{{entire_url('api/logout.dspy')}}",
|
||||
"method": "POST",
|
||||
"callback": {
|
||||
"success": "navigate('/login.ui')"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"binds": [
|
||||
{
|
||||
"wid": "btn_logout",
|
||||
"event": "click",
|
||||
"actiontype": "fetch",
|
||||
"url": "{{entire_url('api/logout.dspy')}}",
|
||||
"method": "POST",
|
||||
"callback": {
|
||||
"success": "navigate('/login.ui')"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
188
wwwroot/login.ui
188
wwwroot/login.ui
@ -1,100 +1,100 @@
|
||||
{
|
||||
"id": "login_page",
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"height": "100vh",
|
||||
"style": {
|
||||
"background": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
|
||||
"alignItems": "center",
|
||||
"justifyContent": "center"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"width": "400px",
|
||||
"id": "login_page",
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"height": "100vh",
|
||||
"style": {
|
||||
"background": "white",
|
||||
"borderRadius": "12px",
|
||||
"boxShadow": "0 8px 32px rgba(0,0,0,0.15)",
|
||||
"padding": "40px 32px"
|
||||
"background": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
|
||||
"alignItems": "center",
|
||||
"justifyContent": "center"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"label": "CRM系统登录",
|
||||
"style": {
|
||||
"fontSize": "24px",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "center",
|
||||
"marginBottom": "24px",
|
||||
"color": "#333"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Form",
|
||||
"id": "login_form",
|
||||
"options": {
|
||||
"url": "{{entire_url('api/login.dspy')}}",
|
||||
"method": "POST",
|
||||
"fields": [
|
||||
{
|
||||
"name": "username",
|
||||
"label": "用户名",
|
||||
"uitype": "str",
|
||||
"required": true,
|
||||
"placeholder": "请输入用户名"
|
||||
},
|
||||
{
|
||||
"name": "password",
|
||||
"label": "密码",
|
||||
"uitype": "password",
|
||||
"required": true,
|
||||
"placeholder": "请输入密码"
|
||||
}
|
||||
],
|
||||
"submitLabel": "登录",
|
||||
"submitVariant": "primary",
|
||||
"submitFullWidth": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "HBox",
|
||||
"options": {
|
||||
"style": {
|
||||
"justifyContent": "center",
|
||||
"marginTop": "16px",
|
||||
"gap": "16px"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Button",
|
||||
"id": "btn_register",
|
||||
"options": {
|
||||
"label": "注册账号",
|
||||
"variant": "text",
|
||||
"url": "{{entire_url('/rbac/user/register.ui')}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"width": "400px",
|
||||
"style": {
|
||||
"background": "white",
|
||||
"borderRadius": "12px",
|
||||
"boxShadow": "0 8px 32px rgba(0,0,0,0.15)",
|
||||
"padding": "40px 32px"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"style": {
|
||||
"fontSize": "24px",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "center",
|
||||
"marginBottom": "24px",
|
||||
"color": "#333"
|
||||
},
|
||||
"text": "CRM系统登录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Form",
|
||||
"id": "login_form",
|
||||
"options": {
|
||||
"url": "{{entire_url('api/login.dspy')}}",
|
||||
"method": "POST",
|
||||
"fields": [
|
||||
{
|
||||
"name": "username",
|
||||
"label": "用户名",
|
||||
"uitype": "str",
|
||||
"required": true,
|
||||
"placeholder": "请输入用户名"
|
||||
},
|
||||
{
|
||||
"name": "password",
|
||||
"label": "密码",
|
||||
"uitype": "password",
|
||||
"required": true,
|
||||
"placeholder": "请输入密码"
|
||||
}
|
||||
],
|
||||
"submitLabel": "登录",
|
||||
"submitVariant": "primary",
|
||||
"submitFullWidth": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "HBox",
|
||||
"options": {
|
||||
"style": {
|
||||
"justifyContent": "center",
|
||||
"marginTop": "16px",
|
||||
"gap": "16px"
|
||||
}
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Button",
|
||||
"id": "btn_register",
|
||||
"options": {
|
||||
"label": "注册账号",
|
||||
"variant": "text",
|
||||
"url": "{{entire_url('/rbac/user/register.ui')}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"binds": [
|
||||
{
|
||||
"wid": "login_form",
|
||||
"event": "submit",
|
||||
"actiontype": "formsubmit",
|
||||
"callback": {
|
||||
"success": "navigate('/index.ui')"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"binds": [
|
||||
{
|
||||
"wid": "login_form",
|
||||
"event": "submit",
|
||||
"actiontype": "formsubmit",
|
||||
"callback": {
|
||||
"success": "navigate('/index.ui')"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user