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:
parent
282c1780ba
commit
fe5bb67d1c
215
wwwroot/base.ui
215
wwwroot/base.ui
@ -1,55 +1,168 @@
|
|||||||
{
|
{
|
||||||
"type": "Page",
|
"type": "Page",
|
||||||
"title": "CRM Dashboard",
|
"title": "CRM Dashboard",
|
||||||
"content": {
|
"content": {
|
||||||
"type": "HBox",
|
"type": "HBox",
|
||||||
"style": {"height": "100vh"},
|
"style": {
|
||||||
"children": [
|
"height": "100vh"
|
||||||
{
|
},
|
||||||
"type": "Drawer",
|
|
||||||
"id": "navDrawer",
|
|
||||||
"width": 220,
|
|
||||||
"variant": "permanent",
|
|
||||||
"style": {"backgroundColor": "#1a1a2e"},
|
|
||||||
"content": {
|
|
||||||
"type": "VBox",
|
|
||||||
"gap": 4,
|
|
||||||
"style": {"padding": "8px"},
|
|
||||||
"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": "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",
|
|
||||||
"style": {"flex": 1, "backgroundColor": "#f5f5f5"},
|
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"type": "AppBar",
|
"type": "Drawer",
|
||||||
"title": "CRM Dashboard",
|
"id": "navDrawer",
|
||||||
"style": {"backgroundColor": "#16213e", "color": "#fff"},
|
"width": 220,
|
||||||
"actions": [
|
"variant": "permanent",
|
||||||
{"type": "Text", "id": "currentUser", "content": "User", "style": {"color": "#fff", "marginRight": "16px"}}
|
"style": {
|
||||||
]
|
"backgroundColor": "#1a1a2e"
|
||||||
},
|
},
|
||||||
{
|
"content": {
|
||||||
"type": "IFrame",
|
"type": "VBox",
|
||||||
"id": "contentFrame",
|
"gap": 4,
|
||||||
"src": "",
|
"style": {
|
||||||
"style": {"flex": 1, "border": "none"}
|
"padding": "8px"
|
||||||
}
|
},
|
||||||
|
"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": "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",
|
||||||
|
"style": {
|
||||||
|
"flex": 1,
|
||||||
|
"backgroundColor": "#f5f5f5"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "AppBar",
|
||||||
|
"title": "CRM Dashboard",
|
||||||
|
"style": {
|
||||||
|
"backgroundColor": "#16213e",
|
||||||
|
"color": "#fff"
|
||||||
|
},
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"id": "currentUser",
|
||||||
|
"content": "User",
|
||||||
|
"style": {
|
||||||
|
"color": "#fff",
|
||||||
|
"marginRight": "16px"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "IFrame",
|
||||||
|
"id": "contentFrame",
|
||||||
|
"src": "",
|
||||||
|
"style": {
|
||||||
|
"flex": 1,
|
||||||
|
"border": "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -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,9 +47,7 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"label": "退出登录",
|
"label": "退出登录",
|
||||||
"variant": "text",
|
"variant": "text",
|
||||||
"style": {
|
"color": "white"
|
||||||
"color": "white"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -66,21 +56,17 @@
|
|||||||
"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,9 +111,7 @@
|
|||||||
"url": "{{entire_url('/workflow_approval')}}"
|
"url": "{{entire_url('/workflow_approval')}}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"style": {
|
"width": "100%"
|
||||||
"width": "100%"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -136,10 +120,8 @@
|
|||||||
"widgettype": "VBox",
|
"widgettype": "VBox",
|
||||||
"options": {
|
"options": {
|
||||||
"flex": 1,
|
"flex": 1,
|
||||||
"style": {
|
"overflow": "hidden",
|
||||||
"overflow": "hidden",
|
"background": "#fafafa"
|
||||||
"background": "#fafafa"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"subwidgets": [
|
"subwidgets": [
|
||||||
{
|
{
|
||||||
@ -149,9 +131,7 @@
|
|||||||
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -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')"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user