{
    "widgettype": "VBox",
    "options": {
        "width": "100%",
        "height": "100%"
    },
    "subwidgets": [
        {
            "widgettype": "HBox",
            "options": {
                "height": "56px",
                "bgcolor": "#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"
                    }
                },
                {
                    "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",
                        "bgcolor": "#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",
                        "bgcolor": "#fafafa"
                    },
                    "subwidgets": [
                        {
                            "widgettype": "Iframe",
                            "id": "content_frame",
                            "options": {
                                "url": "{{entire_url('/unified_dashboard')}}",
                                "width": "100%",
                                "height": "100%",
                                "border": "none"
                            }
                        }
                    ]
                }
            ]
        }
    ],
    "binds": [
        {
            "wid": "btn_logout",
            "event": "click",
            "actiontype": "urlwidget",
            "target": "body/app",
            "options": {
                "url": "{{entire_url('api/logout.dspy')}}",
                "method": "POST"
            }
        }
    ]
}
