From e7bb5c5cf24f9f1f96df1a1a53c7aa6639cae87f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 5 May 2026 19:47:31 +0800 Subject: [PATCH] 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 --- wwwroot/base.ui | 296 +++++++++++++++++++++++------------------------- 1 file changed, 139 insertions(+), 157 deletions(-) diff --git a/wwwroot/base.ui b/wwwroot/base.ui index da1c7a6..a863fd4 100644 --- a/wwwroot/base.ui +++ b/wwwroot/base.ui @@ -1,168 +1,150 @@ { - "type": "Page", - "title": "CRM Dashboard", - "content": { - "type": "HBox", - "style": { - "height": "100vh" - }, - "children": [ - { - "type": "Drawer", - "id": "navDrawer", - "width": 220, - "variant": "permanent", - "style": { - "backgroundColor": "#1a1a2e" + "widgettype": "VBox", + "options": { + "width": "100%", + "height": "100%" + }, + "subwidgets": [ + { + "widgettype": "HBox", + "options": { + "height": "56px", + "backgroundColor": "#1a73e8", + "color": "white", + "alignItems": "center", + "padding": "0 16px", + "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", - "gap": 4, - "style": { - "padding": "8px" + { + "widgettype": "Filler", + "options": {} + }, + { + "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", - "content": "CRM System", - "style": { - "color": "#fff", - "fontSize": "18px", - "fontWeight": "bold", - "padding": "12px 8px" + "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": [ { - "type": "Divider", - "style": { - "backgroundColor": "#333", - "margin": "8px 0" + "widgettype": "Iframe", + "id": "content_frame", + "options": { + "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": { - "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" - } - } - ] + ] + } + ], + "binds": [ + { + "wid": "btn_logout", + "event": "click", + "actiontype": "urlwidget", + "target": "body/app", + "options": { + "url": "{{entire_url('api/logout.dspy')}}", + "method": "POST" } - ] - } -} \ No newline at end of file + } + ] +}