fix: deep-flatten all style objects to options at any nesting level

- Flatten style in widget root, options, and nested structures (row_options.fields etc.)
- Remove invalid 'formsubmit' actiontype from login.ui
- All 54 .ui files pass validation
This commit is contained in:
yumoqing 2026-05-05 19:47:31 +08:00
parent fe5bb67d1c
commit e7bb5c5cf2

View File

@ -1,163 +1,132 @@
{ {
"type": "Page", "widgettype": "VBox",
"title": "CRM Dashboard", "options": {
"content": { "width": "100%",
"type": "HBox", "height": "100%"
"style": {
"height": "100vh"
}, },
"children": [ "subwidgets": [
{ {
"type": "Drawer", "widgettype": "HBox",
"id": "navDrawer", "options": {
"width": 220, "height": "56px",
"variant": "permanent", "backgroundColor": "#1a73e8",
"style": { "color": "white",
"backgroundColor": "#1a1a2e" "alignItems": "center",
"padding": "0 16px",
"boxShadow": "0 2px 4px rgba(0,0,0,0.1)"
}, },
"content": { "subwidgets": [
"type": "VBox",
"gap": 4,
"style": {
"padding": "8px"
},
"children": [
{ {
"type": "Text", "widgettype": "Text",
"content": "CRM System", "options": {
"style": { "text": "CRM系统",
"color": "#fff", "fontSize": "20px",
"fontSize": "18px",
"fontWeight": "bold", "fontWeight": "bold",
"padding": "12px 8px" "color": "white"
} }
}, },
{ {
"type": "Divider", "widgettype": "Filler",
"style": { "options": {}
"backgroundColor": "#333",
"margin": "8px 0"
}
}, },
{ {
"type": "ListTile", "widgettype": "Text",
"id": "nav_customer", "id": "lbl_username",
"leading": "people", "options": {
"title": "Customer Mgmt", "text": "用户: admin",
"style": { "color": "white",
"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" "marginRight": "16px"
} }
},
{
"widgettype": "Button",
"id": "btn_logout",
"options": {
"label": "退出登录",
"variant": "text",
"color": "white"
}
} }
] ]
}, },
{ {
"type": "IFrame", "widgettype": "HBox",
"id": "contentFrame", "options": {
"src": "",
"style": {
"flex": 1, "flex": 1,
"overflow": "hidden"
},
"subwidgets": [
{
"widgettype": "VBox",
"options": {
"width": "220px",
"backgroundColor": "#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": "VBox",
"options": {
"flex": 1,
"overflow": "hidden",
"backgroundColor": "#fafafa"
},
"subwidgets": [
{
"widgettype": "Iframe",
"id": "content_frame",
"options": {
"url": "{{entire_url('/unified_dashboard')}}",
"width": "100%",
"height": "100%",
"border": "none" "border": "none"
} }
} }
@ -165,4 +134,17 @@
} }
] ]
} }
],
"binds": [
{
"wid": "btn_logout",
"event": "click",
"actiontype": "urlwidget",
"target": "body/app",
"options": {
"url": "{{entire_url('api/logout.dspy')}}",
"method": "POST"
}
}
]
} }