{
  "id": "login_page",
  "widgettype": "VBox",
  "options": {
    "width": "100%",
    "height": "100vh",
    "style": {
      "background": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
      "alignItems": "center",
      "justifyContent": "center"
    }
  },
  "subwidgets": [
    {
      "widgettype": "VBox",
      "options": {
        "width": "400px",
        "style": {
          "background": "white",
          "borderRadius": "12px",
          "boxShadow": "0 8px 32px rgba(0,0,0,0.15)",
          "padding": "40px 32px"
        }
      },
      "subwidgets": [
        {
          "widgettype": "Text",
          "options": {
            "label": "CRM系统登录",
            "style": {
              "fontSize": "24px",
              "fontWeight": "bold",
              "textAlign": "center",
              "marginBottom": "24px",
              "color": "#333"
            }
          }
        },
        {
          "widgettype": "Form",
          "id": "login_form",
          "options": {
            "url": "{{entire_url('api/login.dspy')}}",
            "method": "POST",
            "fields": [
              {
                "name": "username",
                "label": "用户名",
                "uitype": "str",
                "required": true,
                "placeholder": "请输入用户名"
              },
              {
                "name": "password",
                "label": "密码",
                "uitype": "password",
                "required": true,
                "placeholder": "请输入密码"
              }
            ],
            "submitLabel": "登录",
            "submitVariant": "primary",
            "submitFullWidth": true
          }
        },
        {
          "widgettype": "HBox",
          "options": {
            "style": {
              "justifyContent": "center",
              "marginTop": "16px",
              "gap": "16px"
            }
          },
          "subwidgets": [
            {
              "widgettype": "Button",
              "id": "btn_register",
              "options": {
                "label": "注册账号",
                "variant": "text",
                "url": "/rbac/user/register.ui"
              }
            }
          ]
        }
      ]
    }
  ],
  "binds": [
    {
      "wid": "login_form",
      "event": "submit",
      "actiontype": "formsubmit",
      "callback": {
        "success": "navigate('/index.ui')"
      }
    }
  ]
}
