fix: flatten style to options, remove invalid actiontype, fix Button/Text widget properties

- Flatten nested style objects directly into options (bricks doesn't recognize 'style')
- Remove invalid 'formsubmit' actiontype from login.ui binds
- Text/Title use 'text', Button uses 'label'
- All paths use {{entire_url()}}
This commit is contained in:
yumoqing 2026-05-05 19:35:58 +08:00
parent 282c1780ba
commit fe5bb67d1c
3 changed files with 208 additions and 133 deletions

View File

@ -3,50 +3,163 @@
"title": "CRM Dashboard", "title": "CRM Dashboard",
"content": { "content": {
"type": "HBox", "type": "HBox",
"style": {"height": "100vh"}, "style": {
"height": "100vh"
},
"children": [ "children": [
{ {
"type": "Drawer", "type": "Drawer",
"id": "navDrawer", "id": "navDrawer",
"width": 220, "width": 220,
"variant": "permanent", "variant": "permanent",
"style": {"backgroundColor": "#1a1a2e"}, "style": {
"backgroundColor": "#1a1a2e"
},
"content": { "content": {
"type": "VBox", "type": "VBox",
"gap": 4, "gap": 4,
"style": {"padding": "8px"}, "style": {
"padding": "8px"
},
"children": [ "children": [
{"type": "Text", "content": "CRM System", "style": {"color": "#fff", "fontSize": "18px", "fontWeight": "bold", "padding": "12px 8px"}}, {
{"type": "Divider", "style": {"backgroundColor": "#333", "margin": "8px 0"}}, "type": "Text",
{"type": "ListTile", "id": "nav_customer", "leading": "people", "title": "Customer Mgmt", "style": {"color": "#ccc"}, "onclick": "navigate('main/customer_management/base.ui')"}, "content": "CRM System",
{"type": "ListTile", "id": "nav_opportunity", "leading": "trending_up", "title": "Opportunity Mgmt", "style": {"color": "#ccc"}, "onclick": "navigate('main/opportunity_management/opportunity_management.ui')"}, "style": {
{"type": "ListTile", "id": "nav_contract", "leading": "description", "title": "Contract Mgmt", "style": {"color": "#ccc"}, "onclick": "navigate('main/contract_management/contract_list.ui')"}, "color": "#fff",
{"type": "ListTile", "id": "nav_financial", "leading": "account_balance", "title": "Financial Mgmt", "style": {"color": "#ccc"}, "onclick": "navigate('main/financial_management/receivables.ui')"}, "fontSize": "18px",
{"type": "Divider", "style": {"backgroundColor": "#333", "margin": "8px 0"}}, "fontWeight": "bold",
{"type": "ListTile", "id": "nav_workflow", "leading": "approval", "title": "Workflow Approval", "style": {"color": "#ccc"}, "onclick": "navigate('main/workflow_approval/base.ui')"}, "padding": "12px 8px"
{"type": "Divider", "style": {"backgroundColor": "#333", "margin": "8px 0"}}, }
{"type": "ListTile", "id": "nav_admin", "leading": "admin_panel_settings", "title": "Admin", "style": {"color": "#ccc"}, "onclick": "navigate('main/rbac/admin_menu.ui')"}, },
{"type": "ListTile", "id": "nav_logout", "leading": "logout", "title": "Logout", "style": {"color": "#f44336"}, "onclick": "navigate('/logout')"} {
"type": "Divider",
"style": {
"backgroundColor": "#333",
"margin": "8px 0"
}
},
{
"type": "ListTile",
"id": "nav_customer",
"leading": "people",
"title": "Customer Mgmt",
"style": {
"color": "#ccc"
},
"onclick": "navigate('main/customer_management/base.ui')"
},
{
"type": "ListTile",
"id": "nav_opportunity",
"leading": "trending_up",
"title": "Opportunity Mgmt",
"style": {
"color": "#ccc"
},
"onclick": "navigate('main/opportunity_management/opportunity_management.ui')"
},
{
"type": "ListTile",
"id": "nav_contract",
"leading": "description",
"title": "Contract Mgmt",
"style": {
"color": "#ccc"
},
"onclick": "navigate('main/contract_management/contract_list.ui')"
},
{
"type": "ListTile",
"id": "nav_financial",
"leading": "account_balance",
"title": "Financial Mgmt",
"style": {
"color": "#ccc"
},
"onclick": "navigate('main/financial_management/receivables.ui')"
},
{
"type": "Divider",
"style": {
"backgroundColor": "#333",
"margin": "8px 0"
}
},
{
"type": "ListTile",
"id": "nav_workflow",
"leading": "approval",
"title": "Workflow Approval",
"style": {
"color": "#ccc"
},
"onclick": "navigate('main/workflow_approval/base.ui')"
},
{
"type": "Divider",
"style": {
"backgroundColor": "#333",
"margin": "8px 0"
}
},
{
"type": "ListTile",
"id": "nav_admin",
"leading": "admin_panel_settings",
"title": "Admin",
"style": {
"color": "#ccc"
},
"onclick": "navigate('main/rbac/admin_menu.ui')"
},
{
"type": "ListTile",
"id": "nav_logout",
"leading": "logout",
"title": "Logout",
"style": {
"color": "#f44336"
},
"onclick": "navigate('/logout')"
}
] ]
} }
}, },
{ {
"type": "VBox", "type": "VBox",
"style": {"flex": 1, "backgroundColor": "#f5f5f5"}, "style": {
"flex": 1,
"backgroundColor": "#f5f5f5"
},
"children": [ "children": [
{ {
"type": "AppBar", "type": "AppBar",
"title": "CRM Dashboard", "title": "CRM Dashboard",
"style": {"backgroundColor": "#16213e", "color": "#fff"}, "style": {
"backgroundColor": "#16213e",
"color": "#fff"
},
"actions": [ "actions": [
{"type": "Text", "id": "currentUser", "content": "User", "style": {"color": "#fff", "marginRight": "16px"}} {
"type": "Text",
"id": "currentUser",
"content": "User",
"style": {
"color": "#fff",
"marginRight": "16px"
}
}
] ]
}, },
{ {
"type": "IFrame", "type": "IFrame",
"id": "contentFrame", "id": "contentFrame",
"src": "", "src": "",
"style": {"flex": 1, "border": "none"} "style": {
"flex": 1,
"border": "none"
}
} }
] ]
} }

View File

@ -4,34 +4,28 @@
"options": { "options": {
"width": "100%", "width": "100%",
"height": "100vh", "height": "100vh",
"style": {
"margin": "0", "margin": "0",
"padding": "0" "padding": "0"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "HBox", "widgettype": "HBox",
"options": { "options": {
"height": "56px", "height": "56px",
"style": {
"background": "#1a73e8", "background": "#1a73e8",
"color": "white", "color": "white",
"alignItems": "center", "alignItems": "center",
"padding": "0 16px", "padding": "0 16px",
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)" "boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"style": { "text": "CRM系统",
"fontSize": "20px", "fontSize": "20px",
"fontWeight": "bold", "fontWeight": "bold",
"color": "white" "color": "white"
},
"text": "CRM系统"
} }
}, },
{ {
@ -42,11 +36,9 @@
"widgettype": "Text", "widgettype": "Text",
"id": "lbl_username", "id": "lbl_username",
"options": { "options": {
"style": { "text": "用户: admin",
"color": "white", "color": "white",
"marginRight": "16px" "marginRight": "16px"
},
"text": "用户: admin"
} }
}, },
{ {
@ -55,32 +47,26 @@
"options": { "options": {
"label": "退出登录", "label": "退出登录",
"variant": "text", "variant": "text",
"style": {
"color": "white" "color": "white"
} }
} }
}
] ]
}, },
{ {
"widgettype": "HBox", "widgettype": "HBox",
"options": { "options": {
"flex": 1, "flex": 1,
"style": {
"overflow": "hidden" "overflow": "hidden"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
"width": "220px", "width": "220px",
"style": {
"background": "#f5f5f5", "background": "#f5f5f5",
"borderRight": "1px solid #e0e0e0", "borderRight": "1px solid #e0e0e0",
"overflowY": "auto", "overflowY": "auto",
"padding": "8px 0" "padding": "8px 0"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
@ -125,21 +111,17 @@
"url": "{{entire_url('/workflow_approval')}}" "url": "{{entire_url('/workflow_approval')}}"
} }
], ],
"style": {
"width": "100%" "width": "100%"
} }
} }
}
] ]
}, },
{ {
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
"flex": 1, "flex": 1,
"style": {
"overflow": "hidden", "overflow": "hidden",
"background": "#fafafa" "background": "#fafafa"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
@ -149,11 +131,9 @@
"url": "{{entire_url('/unified_dashboard')}}", "url": "{{entire_url('/unified_dashboard')}}",
"width": "100%", "width": "100%",
"height": "100%", "height": "100%",
"style": {
"border": "none" "border": "none"
} }
} }
}
] ]
} }
] ]
@ -163,11 +143,11 @@
{ {
"wid": "btn_logout", "wid": "btn_logout",
"event": "click", "event": "click",
"actiontype": "fetch", "actiontype": "urlwidget",
"url": "{{entire_url('api/logout.dspy')}}", "url": "{{entire_url('api/logout.dspy')}}",
"method": "POST", "target": "body/app",
"callback": { "options": {
"success": "navigate('/login.ui')" "method": "POST"
} }
} }
] ]

View File

@ -4,36 +4,30 @@
"options": { "options": {
"width": "100%", "width": "100%",
"height": "100vh", "height": "100vh",
"style": {
"background": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)", "background": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
"alignItems": "center", "alignItems": "center",
"justifyContent": "center" "justifyContent": "center"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "VBox", "widgettype": "VBox",
"options": { "options": {
"width": "400px", "width": "400px",
"style": {
"background": "white", "background": "white",
"borderRadius": "12px", "borderRadius": "12px",
"boxShadow": "0 8px 32px rgba(0,0,0,0.15)", "boxShadow": "0 8px 32px rgba(0,0,0,0.15)",
"padding": "40px 32px" "padding": "40px 32px"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "Text", "widgettype": "Text",
"options": { "options": {
"style": { "text": "CRM系统登录",
"fontSize": "24px", "fontSize": "24px",
"fontWeight": "bold", "fontWeight": "bold",
"textAlign": "center", "textAlign": "center",
"marginBottom": "24px", "marginBottom": "24px",
"color": "#333" "color": "#333"
},
"text": "CRM系统登录"
} }
}, },
{ {
@ -66,11 +60,9 @@
{ {
"widgettype": "HBox", "widgettype": "HBox",
"options": { "options": {
"style": {
"justifyContent": "center", "justifyContent": "center",
"marginTop": "16px", "marginTop": "16px",
"gap": "16px" "gap": "16px"
}
}, },
"subwidgets": [ "subwidgets": [
{ {
@ -86,15 +78,5 @@
} }
] ]
} }
],
"binds": [
{
"wid": "login_form",
"event": "submit",
"actiontype": "formsubmit",
"callback": {
"success": "navigate('/index.ui')"
}
}
] ]
} }