{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "邛崃回澜酒厂威士忌陈酿库监控系统 UI Schema",
  "description": "定义前端UI状态、交互逻辑、主题配置（威士忌深色主题：琥珀金 + 深褐色）",
  "version": "4.0",
  "lastUpdated": "2026-06-06 19:25",
  
  "theme": {
    "name": "威士忌深色主题 (Whisky Dark Theme)",
    "description": "琥珀金 + 深褐色背景，符合威士忌陈酿库的专业氛围",
    "colors": {
      "navbar": {
        "background": "linear-gradient(to right, #8B4513, #654321)",
        "text": "#FFFFFF",
        "description": "顶部导航栏：琥珀金渐变"
      },
      "primary": {
        "main": "#D4A574",
        "light": "#E8C9A3",
        "dark": "#A67C52",
        "description": "主色：琥珀金（Amber Gold）"
      },
      "background": {
        "default": "#1C1410",
        "card": "linear-gradient(145deg, #2A2018 0%, #1C1410 100%)",
        "description": "背景：深褐色 + 渐变卡片"
      },
      "text": {
        "primary": "#F5F5DC",
        "secondary": "#D4A574",
        "muted": "#8B7355",
        "description": "文字：米色主文字 + 琥珀金强调 + 棕灰辅助"
      },
      "alert": {
        "critical": "#EF4444",
        "warning": "#F59E0B",
        "info": "#3B82F6",
        "success": "#10B981",
        "description": "告警颜色：红色、橙色、蓝色、绿色"
      },
      "status": {
        "online": "#10B981",
        "offline": "#6B7280",
        "fault": "#EF4444",
        "description": "设备状态：在线（绿）、离线（灰）、故障（红）"
      },
      "border": {
        "default": "#D4A574",
        "active": "#E8C9A3",
        "danger": "#EF4444",
        "description": "边框：琥珀金默认 + 高亮 + 危险"
      }
    },
    "typography": {
      "fontFamily": "'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
      "numberFont": "-apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', sans-serif",
      "titleFontWeight": 700,
      "lineHeight": 1.5,
      "description": "字体：无衬线字体 + 等宽字体用于数值"
    },
    "spacing": {
      "xs": "4px",
      "sm": "8px",
      "md": "16px",
      "lg": "24px",
      "xl": "32px",
      "description": "间距：4px、8px、16px、24px、32px"
    },
    "borderRadius": {
      "card": "16px",
      "button": "8px",
      "badge": "12px",
      "description": "圆角：卡片16px、按钮8px、徽章12px"
    },
    "shadow": {
      "card": "0 4px 12px rgba(212, 165, 116, 0.15)",
      "hover": "0 6px 16px rgba(212, 165, 116, 0.25)",
      "description": "阴影：琥珀金投影"
    }
  },

  "pages": {
    "home": {
      "title": "首页（监控看板）",
      "route": "/pages/tabBar/home/index",
      "tabBarLabel": "首页",
      "tabBarIcon": "home",
      "description": "8个陈酿库监控看板，展示核心指标（温度/湿度/酒精/设备状态）",
      "components": [
        {
          "id": "navbar",
          "type": "navbar",
          "title": "威士忌陈酿库监控",
          "subtitle": "邛崃回澜酒厂",
          "backgroundColor": "linear-gradient(to right, #8B4513, #654321)",
          "textColor": "#FFFFFF",
          "showRefresh": true,
          "state": {
            "loading": {
              "description": "数据加载中",
              "showSpinner": true
            },
            "idle": {
              "description": "正常显示"
            }
          }
        },
        {
          "id": "weatherWidget",
          "type": "widget",
          "description": "天气组件（成都实时天气）",
          "dataSource": "GET /api/weather/current?city=成都",
          "state": {
            "normal": {
              "backgroundColor": "rgba(42, 32, 24, 0.3)",
              "textColor": "#F5F5DC"
            }
          },
          "fields": [
            {"label": "温度", "key": "temp", "unit": "°C"},
            {"label": "湿度", "key": "humidity", "unit": "%"},
            {"label": "天气", "key": "weather"}
          ]
        },
        {
          "id": "floorTabs",
          "type": "tabs",
          "description": "楼层切换（1楼 / 3楼）",
          "state": {
            "active": {
              "backgroundColor": "#D4A574",
              "textColor": "#1C1410",
              "fontWeight": 700
            },
            "inactive": {
              "backgroundColor": "transparent",
              "textColor": "#8B7355",
              "fontWeight": 400
            }
          },
          "items": [
            {"id": "floor1", "label": "1楼（3库）", "cellarCount": 3},
            {"id": "floor3", "label": "3楼（5库）", "cellarCount": 5}
          ]
        },
        {
          "id": "coreMetrics",
          "type": "metricsGrid",
          "description": "核心指标（温度/湿度/酒精）",
          "layout": "grid",
          "columns": 3,
          "dataSource": "GET /api/dashboard/metrics",
          "state": {
            "normal": {
              "backgroundColor": "linear-gradient(145deg, #2A2018, #1C1410)",
              "borderColor": "#D4A574",
              "borderWidth": "1px",
              "textColor": "#D4A574"
            },
            "warning": {
              "backgroundColor": "linear-gradient(145deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1))",
              "borderColor": "#F59E0B",
              "textColor": "#F59E0B"
            },
            "danger": {
              "backgroundColor": "linear-gradient(145deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.15))",
              "borderColor": "#EF4444",
              "textColor": "#EF4444"
            }
          },
          "items": [
            {
              "id": "temperature",
              "label": "温度",
              "icon": "thermometer-half",
              "unit": "°C",
              "threshold": {"min": 15, "max": 20},
              "description": "< 15°C 或 > 20°C 触发告警"
            },
            {
              "id": "humidity",
              "label": "湿度",
              "icon": "tint",
              "unit": "%",
              "threshold": {"min": 65, "max": 75},
              "description": "< 65% 或 > 75% 触发告警"
            },
            {
              "id": "alcohol",
              "label": "酒精浓度",
              "icon": "wine-glass-alt",
              "unit": "%",
              "threshold": {"min": 60, "max": 70},
              "description": "< 60% 或 > 70% 触发告警"
            }
          ]
        },
        {
          "id": "deviceStats",
          "type": "statsGrid",
          "description": "设备统计（空调/温度传感器/酒精探测仪/摄像头）",
          "layout": "grid",
          "columns": 4,
          "dataSource": "GET /api/dashboard/device-stats",
          "state": {
            "normal": {
              "backgroundColor": "linear-gradient(145deg, #2A2018, #1C1410)",
              "borderColor": "#D4A574"
            }
          },
          "items": [
            {
              "id": "ac",
              "label": "空调",
              "icon": "snowflake",
              "total": 8,
              "online": 8
            },
            {
              "id": "tempSensor",
              "label": "温度传感器",
              "icon": "thermometer-half",
              "total": 16,
              "online": 16
            },
            {
              "id": "alcoholSensor",
              "label": "酒精探测仪",
              "icon": "wine-glass-alt",
              "total": 32,
              "online": 32
            },
            {
              "id": "camera",
              "label": "摄像头",
              "icon": "video",
              "total": 36,
              "online": 36
            }
          ]
        },
        {
          "id": "cellarCards",
          "type": "cardList",
          "description": "8个陈酿库卡片列表",
          "layout": "vertical",
          "dataSource": "GET /api/dashboard/cellars",
          "state": {
            "normal": {
              "backgroundColor": "linear-gradient(145deg, #2A2018, #1C1410)",
              "borderColor": "#D4A574",
              "shadowColor": "rgba(212, 165, 116, 0.15)"
            },
            "warning": {
              "backgroundColor": "linear-gradient(145deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1))",
              "borderColor": "#F59E0B"
            },
            "danger": {
              "backgroundColor": "linear-gradient(145deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.15))",
              "borderColor": "#EF4444"
            }
          },
          "items": [
            {"id": "1F-1号库", "floor": 1, "cellar": 1},
            {"id": "1F-2号库", "floor": 1, "cellar": 2},
            {"id": "1F-3号库", "floor": 1, "cellar": 3},
            {"id": "3F-1号库", "floor": 3, "cellar": 1},
            {"id": "3F-2号库", "floor": 3, "cellar": 2},
            {"id": "3F-3号库", "floor": 3, "cellar": 3},
            {"id": "3F-4号库", "floor": 3, "cellar": 4},
            {"id": "3F-5号库", "floor": 3, "cellar": 5}
          ]
        }
      ],
      "unknowns": [
        "实时数据刷新频率（建议 5 秒）",
        "卡片点击后跳转到详情页还是趋势图？",
        "是否支持陈酿库排序（按温度/湿度/酒精浓度）？"
      ]
    },

    "scene": {
      "title": "场景（自动化联动）",
      "route": "/pages/tabBar/scene/index",
      "tabBarLabel": "场景",
      "tabBarIcon": "layer-group",
      "description": "5个预设场景模板 + 自定义场景管理",
      "components": [
        {
          "id": "navbar",
          "type": "navbar",
          "title": "场景联动",
          "backgroundColor": "linear-gradient(to right, #8B4513, #654321)",
          "textColor": "#FFFFFF"
        },
        {
          "id": "sceneTemplates",
          "type": "cardList",
          "description": "5个预设场景",
          "layout": "vertical",
          "dataSource": "GET /api/scenes/templates",
          "state": {
            "disabled": {
              "backgroundColor": "linear-gradient(145deg, #2A2018, #1C1410)",
              "borderColor": "#D4A574",
              "opacity": 0.5,
              "description": "未启用"
            },
            "enabled": {
              "backgroundColor": "linear-gradient(145deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1))",
              "borderColor": "#10B981",
              "description": "已启用"
            }
          },
          "items": [
            {
              "id": "scene1",
              "name": "过温保护",
              "icon": "temperature-high",
              "iconColor": "#EF4444",
              "trigger": "温度 > 20°C",
              "actions": ["空调开机", "制冷模式", "目标温度18°C"],
              "notification": ["短信", "邮件"]
            },
            {
              "id": "scene2",
              "name": "低温加热",
              "icon": "temperature-low",
              "iconColor": "#3B82F6",
              "trigger": "温度 < 15°C",
              "actions": ["空调开机", "制热模式", "目标温度18°C"],
              "notification": ["短信", "邮件"]
            },
            {
              "id": "scene3",
              "name": "酒精异常报警",
              "icon": "wine-glass-alt",
              "iconColor": "#F59E0B",
              "trigger": "酒精浓度 < 60% 或 > 70%",
              "actions": ["摄像头开启", "日志记录"],
              "notification": ["短信", "邮件", "电话"]
            },
            {
              "id": "scene4",
              "name": "湿度平衡",
              "icon": "tint",
              "iconColor": "#06B6D4",
              "trigger": "湿度 < 65% 或 > 75%",
              "actions": ["加湿器/除湿器启动"],
              "notification": ["应用推送"]
            },
            {
              "id": "scene5",
              "name": "夜间控制",
              "icon": "moon",
              "iconColor": "#8B5CF6",
              "trigger": "22:00 - 06:00",
              "actions": ["空调节能模式", "照明关闭"],
              "notification": []
            }
          ]
        },
        {
          "id": "customScenes",
          "type": "cardList",
          "description": "用户自定义场景",
          "layout": "vertical",
          "dataSource": "GET /api/scenes/custom",
          "state": {
            "disabled": {
              "backgroundColor": "linear-gradient(145deg, #2A2018, #1C1410)",
              "borderColor": "#D4A574",
              "opacity": 0.5
            },
            "enabled": {
              "backgroundColor": "linear-gradient(145deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1))",
              "borderColor": "#10B981"
            }
          }
        }
      ],
      "unknowns": [
        "用户是否可以修改预设场景的阈值？",
        "场景执行日志是否需要单独展示？",
        "场景冲突时如何处理优先级？"
      ]
    },

    "trend": {
      "title": "动态（系统事件）",
      "route": "/pages/tabBar/trend/trend",
      "tabBarLabel": "动态",
      "tabBarIcon": "chart-line",
      "description": "系统事件时间线：告警、场景执行、设备状态变化",
      "components": [
        {
          "id": "navbar",
          "type": "navbar",
          "title": "系统动态",
          "backgroundColor": "linear-gradient(to right, #8B4513, #654321)",
          "textColor": "#FFFFFF"
        },
        {
          "id": "eventFilter",
          "type": "tabs",
          "description": "事件筛选（全部/告警/场景/设备）",
          "state": {
            "active": {
              "backgroundColor": "#D4A574",
              "textColor": "#1C1410"
            },
            "inactive": {
              "backgroundColor": "transparent",
              "textColor": "#8B7355"
            }
          },
          "items": [
            {"id": "all", "label": "全部"},
            {"id": "alert", "label": "告警"},
            {"id": "scene", "label": "场景"},
            {"id": "device", "label": "设备"}
          ]
        },
        {
          "id": "timeline",
          "type": "timeline",
          "description": "事件时间线",
          "layout": "vertical",
          "dataSource": "GET /api/events/timeline",
          "state": {
            "alert": {
              "iconColor": "#EF4444",
              "icon": "exclamation-triangle",
              "description": "告警事件（红色）"
            },
            "scene": {
              "iconColor": "#10B981",
              "icon": "layer-group",
              "description": "场景执行（绿色）"
            },
            "device": {
              "iconColor": "#3B82F6",
              "icon": "cog",
              "description": "设备事件（蓝色）"
            },
            "system": {
              "iconColor": "#8B7355",
              "icon": "info-circle",
              "description": "系统事件（灰色）"
            }
          },
          "fields": [
            {"key": "time", "label": "时间", "format": "HH:mm"},
            {"key": "type", "label": "类型"},
            {"key": "message", "label": "内容"},
            {"key": "location", "label": "位置"}
          ]
        }
      ],
      "unknowns": [
        "事件是否支持导出（CSV/PDF）？",
        "历史事件保留时长（建议 90 天）？",
        "是否支持事件搜索功能？"
      ]
    },

    "user": {
      "title": "我的（个人中心）",
      "route": "/pages/tabBar/user/index",
      "tabBarLabel": "我的",
      "tabBarIcon": "user",
      "description": "个人信息、数据统计、系统设置、帮助反馈",
      "components": [
        {
          "id": "userProfile",
          "type": "profileCard",
          "description": "用户信息卡片",
          "backgroundColor": "linear-gradient(to right, #8B4513, #654321)",
          "state": {
            "normal": {
              "avatarBorderColor": "#D4A574",
              "textColor": "#FFFFFF"
            }
          },
          "fields": [
            {"key": "name", "label": "姓名"},
            {"key": "role", "label": "职位"},
            {"key": "phone", "label": "电话"}
          ]
        },
        {
          "id": "dataOverview",
          "type": "statsCard",
          "description": "数据概览",
          "backgroundColor": "linear-gradient(145deg, #2A2018, #1C1410)",
          "borderColor": "#D4A574",
          "state": {
            "normal": {
              "textColor": "#F5F5DC"
            }
          },
          "items": [
            {"key": "cellarCount", "label": "陈酿库", "unit": "个", "color": "#10B981"},
            {"key": "deviceCount", "label": "在线设备", "unit": "台", "color": "#3B82F6"},
            {"key": "alertCount", "label": "告警", "unit": "条", "color": "#F59E0B"}
          ]
        },
        {
          "id": "menuList",
          "type": "menuList",
          "description": "功能菜单",
          "backgroundColor": "linear-gradient(145deg, #2A2018, #1C1410)",
          "borderColor": "#D4A574",
          "state": {
            "normal": {
              "iconColor": "#D4A574",
              "textColor": "#F5F5DC",
              "borderBottomColor": "#3D2F26"
            },
            "hover": {
              "backgroundColor": "rgba(212, 165, 116, 0.1)"
            }
          },
          "items": [
            {
              "id": "notifications",
              "icon": "bell",
              "label": "消息通知",
              "badge": 3,
              "badgeColor": "#EF4444",
              "route": "/pages/notifications/index"
            },
            {
              "id": "history",
              "icon": "history",
              "label": "历史记录",
              "route": "/pages/history/index"
            },
            {
              "id": "reports",
              "icon": "chart-line",
              "label": "统计报表",
              "route": "/pages/reports/index"
            },
            {
              "id": "export",
              "icon": "download",
              "label": "数据导出",
              "route": "/pages/export/index"
            }
          ]
        },
        {
          "id": "settingsMenu",
          "type": "menuList",
          "description": "系统设置",
          "backgroundColor": "linear-gradient(145deg, #2A2018, #1C1410)",
          "borderColor": "#D4A574",
          "items": [
            {
              "id": "account",
              "icon": "user-cog",
              "label": "账号设置",
              "route": "/pages/settings/account"
            },
            {
              "id": "security",
              "icon": "shield-alt",
              "label": "安全中心",
              "route": "/pages/settings/security"
            },
            {
              "id": "system",
              "icon": "cog",
              "label": "系统设置",
              "route": "/pages/settings/system"
            },
            {
              "id": "help",
              "icon": "question-circle",
              "label": "帮助与反馈",
              "route": "/pages/help/index"
            }
          ]
        },
        {
          "id": "appInfo",
          "type": "infoCard",
          "description": "应用信息",
          "backgroundColor": "linear-gradient(145deg, #2A2018, #1C1410)",
          "borderColor": "#D4A574",
          "state": {
            "normal": {
              "textColor": "#F5F5DC"
            }
          },
          "fields": [
            {"key": "appName", "value": "威士忌陈酿库监控系统"},
            {"key": "platform", "value": "基于 FastBee 物联网平台"},
            {"key": "version", "value": "v2.3.5"},
            {"key": "build", "value": "20260606"}
          ]
        },
        {
          "id": "logoutButton",
          "type": "button",
          "label": "退出登录",
          "icon": "sign-out-alt",
          "backgroundColor": "linear-gradient(145deg, #2A2018, #1C1410)",
          "borderColor": "#EF4444",
          "state": {
            "normal": {
              "textColor": "#EF4444"
            },
            "hover": {
              "backgroundColor": "rgba(239, 68, 68, 0.1)"
            }
          }
        }
      ],
      "unknowns": [
        "用户头像是否支持修改？",
        "消息通知是否支持推送到手机？",
        "数据导出格式（CSV/Excel/PDF）？"
      ]
    }
  },

  "interactions": {
    "cellarCardClick": {
      "description": "点击陈酿库卡片",
      "action": "navigateToCellarDetail",
      "params": {
        "cellarId": "string"
      }
    },
    "metricCardClick": {
      "description": "点击指标卡片",
      "action": "navigateToTrendChart",
      "params": {
        "metricType": "temperature | humidity | alcohol",
        "cellarId": "string"
      }
    },
    "sceneToggle": {
      "description": "启用/禁用场景",
      "action": "toggleScene",
      "params": {
        "sceneId": "string",
        "enabled": "boolean"
      }
    },
    "eventClick": {
      "description": "点击事件时间线项",
      "action": "navigateToEventDetail",
      "params": {
        "eventId": "string"
      }
    },
    "menuItemClick": {
      "description": "点击功能菜单项",
      "action": "navigate",
      "params": {
        "route": "string"
      }
    }
  },

  "globalState": {
    "refreshInterval": 5000,
    "alertMuteDuration": 1800000,
    "theme": "dark",
    "description": "全局配置：数据刷新间隔5秒，告警消音30分钟，深色主题"
  }
}
