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