// 导航系统类型定义

export interface MenuItem {
  id: string;
  label: string;
  icon?: string;
  path?: string;
  children?: MenuItem[];
}

export interface SubSystem {
  id: string;
  label: string;
  icon: string;
  menus: MenuItem[];
}

// 智能农机管理系统菜单
export const machineryMenus: MenuItem[] = [
  {
    id: 'machinery-archive',
    label: '农机档案',
    icon: 'FolderOpen',
    children: [
      { id: 'machinery-entry', label: '农机档案管理', path: '/machinery/archive/entry' },
      { id: 'machinery-classification', label: '农机分类与标签管理', path: '/machinery/archive/classification' },
      { id: 'machinery-qrcode', label: '农机二维码管理', path: '/machinery/archive/qrcode' },
    ]
  },
  {
    id: 'driver-archive',
    label: '驾驶员档案',
    icon: 'UserCircle',
    children: [
      { id: 'driver-info', label: '驾驶员信息管理', path: '/machinery/driver/info' },
      { id: 'driver-task', label: '驾驶员任务管理', path: '/machinery/driver/task' },
    ]
  },
  {
    id: 'load-management',
    label: '农机负载管理',
    icon: 'Gauge',
    children: [
      { id: 'load-type', label: '负载类型', path: '/machinery/load/type' },
      { id: 'load-parameter', label: '负载参数', path: '/machinery/load/parameter' },
      { id: 'load-device-library', label: '负载设备', path: '/machinery/load/library' },
      { id: 'load-device', label: '负载管理', path: '/machinery/load/device' },
    ]
  },
  {
    id: 'monitoring',
    label: '设备实时监控与定位',
    icon: 'MonitorDot',
    children: [
      { id: 'realtime-location', label: '实时位置追踪', path: '/machinery/monitoring/location' },
      { id: 'work-status', label: '工作状态监控', path: '/machinery/monitoring/status' },
      { id: 'operation-data', label: '作业数据监控', path: '/machinery/monitoring/operation' },
    ]
  },
  {
    id: 'fault-diagnosis',
    label: '远程诊断与故障预警',
    icon: 'AlertTriangle',
    children: [
      { id: 'alert-rules', label: '预警规则', path: '/machinery/fault/alert-rules' },
      { id: 'fault-warning', label: '预警记录', path: '/machinery/fault/warning' },
      { id: 'health-assessment', label: '健康评估', path: '/machinery/fault/health' },
      { id: 'parameter-monitor', label: '参数监测', path: '/machinery/fault/parameter' },
    ]
  },
  {
    id: 'precision-operation',
    label: '精准作业管理与支持',
    icon: 'Target',
    children: [
      { id: 'cockpit', label: '农业驾驶舱', path: '/machinery/operation/cockpit' },
      { id: 'route-planning', label: '作业路线规划', path: '/machinery/operation/route' },
      { id: 'plan-dispatch', label: '作业方案下发', path: '/machinery/operation/dispatch' },
      { id: 'operation-record', label: '作业数据记录', path: '/machinery/operation/record' },
    ]
  },
  {
    id: 'data-analysis',
    label: '数据管理与分析报告',
    icon: 'BarChart3',
    children: [
      { id: 'operation-analysis', label: '作业数据分析', path: '/machinery/data/analysis' },
      { id: 'history-comparison', label: '历史数据查询与对比', path: '/machinery/data/comparison' },
    ]
  },
  {
    id: 'scheduling',
    label: '农机管理与调度',
    icon: 'CalendarClock',
    children: [
      { id: 'task-assignment', label: '任务分配', path: '/machinery/scheduling/assignment' },
      { id: 'realtime-dispatch', label: '实时调度监控', path: '/machinery/scheduling/dispatch' },
      { id: 'track-playback', label: '农机作业轨迹回放', path: '/machinery/scheduling/playback' },
    ]
  },
  {
    id: 'security',
    label: '安全与安防',
    icon: 'Shield',
    children: [
      { id: 'geo-fence', label: '电子围栏', path: '/machinery/security/fence' },
    ]
  },
];

// 其他子系统的菜单可以类似定义
export const fieldMenus: MenuItem[] = [
  {
    id: 'field-archive',
    label: '地块档案管理',
    icon: 'FileText',
    children: [
      { id: 'field-entry-maintenance', label: '地块档案管理', path: '/field/archive/entry' },
      { id: 'field-classification-tags', label: '地块分类与标签管理', path: '/field/archive/classification' },
      { id: 'field-statistics', label: '统计分析', path: '/field/archive/statistics' },
    ]
  },
  {
    id: 'field-map',
    label: '地块数字化与地图管理',
    icon: 'Map',
    children: [
      { id: 'field-gis-map', label: 'GIS地图管理', path: '/field/map/gis' },
      { id: 'field-draw-edit', label: '数字化绘制与编辑', path: '/field/map/draw' },
      { id: 'field-spatial-query', label: '空间数据管理', path: '/field/map/spatial-query' },
      { id: 'field-satellite', label: '地块影像', path: '/field/map/satellite' },
    ]
  },
  {
    id: 'field-analysis',
    label: '空间分析与决策支持',
    icon: 'TrendingUp',
    children: [
      { id: 'soil-data', label: '土壤基础数据', path: '/field/analysis/soil-data' },
      { id: 'layer-sampling', label: '分层采样分析', path: '/field/analysis/layer-sampling' },
      { id: 'soil-quality', label: '土壤质量评价', path: '/field/analysis/soil-quality' },
    ]
  },
  {
    id: 'field-monitoring',
    label: '地块环境监测',
    icon: 'CloudSun',
    children: [
      { id: 'weather-monitoring', label: '气象监测', path: '/field/monitoring/weather' },
      { id: 'environment-monitoring', label: '环境监测', path: '/field/monitoring/environment' },
    ]
  },
  {
    id: 'field-suitability',
    label: '地块适宜性评价',
    icon: 'ClipboardCheck',
    children: [
      { id: 'comprehensive-evaluation', label: '多因子综合评价', path: '/field/suitability/comprehensive' },
      { id: 'batch-analysis', label: '自动化空间分析', path: '/field/suitability/batch' },
      { id: 'crop-recommendation', label: '作物适配推荐', path: '/field/suitability/crop' },
    ]
  },
  {
    id: 'field-comparison',
    label: '地块对比分析',
    icon: 'GitCompare',
    children: [
      { id: 'multi-indicator', label: '多维度指标看板', path: '/field/comparison/indicator' },
      { id: 'chart-analysis', label: '可视化图表分析', path: '/field/comparison/chart' },
      { id: 'report-generation', label: '对比报告生成', path: '/field/comparison/report' },
    ]
  },
  {
    id: 'field-risk',
    label: '地块风险预警',
    icon: 'AlertCircle',
    children: [
      { id: 'risk-monitoring', label: '实时风险监测', path: '/field/risk/monitoring' },
      { id: 'warning-push', label: '预警推送管理', path: '/field/risk/push' },
      { id: 'disposal-tracking', label: '预警处置跟踪', path: '/field/risk/disposal' },
    ]
  },
];

export const operationMenus: MenuItem[] = [
  {
    id: 'operation-planning',
    label: '农事计划',
    icon: 'ClipboardList',
    children: [
      { id: 'plan-creation', label: '计划制定', path: '/operation/planning/creation' },
      { id: 'resource-allocation', label: '资源分配规划', path: '/operation/planning/allocation' },
      { id: 'progress-tracking', label: '计划进度跟踪', path: '/operation/planning/progress' },
    ]
  },
  {
    id: 'operation-task',
    label: '农事任务',
    icon: 'ListTodo',
    children: [
      { id: 'task-management', label: '任务管理', path: '/operation/task/management' },
      { id: 'task-assignment', label: '任务分配与派发', path: '/operation/task/assignment' },
      { id: 'task-monitoring', label: '任务状态监控', path: '/operation/task/monitoring' },
      { id: 'task-statistics', label: '历史与统计', path: '/operation/task/statistics' },
    ]
  },
  {
    id: 'operation-execution',
    label: '农事执行',
    icon: 'PlayCircle',
    children: [
      { id: 'operation-type', label: '农事类型', path: '/operation/execution/type' },
      { id: 'operation-record', label: '操作录入', path: '/operation/execution/record' },
      { id: 'operation-log', label: '日志多维查询', path: '/operation/execution/log' },
    ]
  },
  {
    id: 'operation-calendar',
    label: '农事日历',
    icon: 'Calendar',
    children: [
      { id: 'calendar-view', label: '可视化视图', path: '/operation/calendar/view' },
      { id: 'calendar-gantt', label: '甘特图', path: '/operation/calendar/gantt' },
      { id: 'calendar-progress', label: '进度状态可视化', path: '/operation/calendar/progress' },
    ]
  },
  {
    id: 'operation-archive',
    label: '农事档案',
    icon: 'Archive',
    children: [
      { id: 'archive-aggregation', label: '档案归集与生成', path: '/operation/archive/aggregation' },
      { id: 'archive-view', label: '全维度数据视图', path: '/operation/archive/view' },
      { id: 'archive-trace', label: '追踪与溯源', path: '/operation/archive/trace' },
    ]
  },
  {
    id: 'operation-knowledge',
    label: '农事知识库',
    icon: 'BookOpen',
    children: [
      { id: 'knowledge-management', label: '多模态知识内容管理', path: '/operation/knowledge/management' },
      { id: 'knowledge-category', label: '分类与标签', path: '/operation/knowledge/category' },
      { id: 'knowledge-search', label: '智能检索', path: '/operation/knowledge/search' },
    ]
  },
  {
    id: 'operation-performance',
    label: '绩效管理',
    icon: 'Award',
    children: [
      { id: 'performance-staff', label: '人员管理', path: '/operation/performance/staff' },
      { id: 'performance-hours', label: '工时记录', path: '/operation/performance/hours' },
      { id: 'performance-statistics', label: '绩效统计', path: '/operation/performance/statistics' },
      { id: 'performance-schedule', label: '排班管理', path: '/operation/performance/schedule' },
    ]
  },
  {
    id: 'operation-issue',
    label: '农事问题协同',
    icon: 'MessageSquare',
    children: [
      { id: 'issue-report', label: '问题一键上报', path: '/operation/issue/report' },
      { id: 'issue-assign', label: '问题处理与分派', path: '/operation/issue/assign' },
      { id: 'issue-collaborate', label: '在线协同', path: '/operation/issue/collaborate' },
    ]
  },
];

export const assetMenus: MenuItem[] = [
  {
    id: 'asset-basic',
    label: '基础信息管理',
    icon: 'Database',
    children: [
      { id: 'asset-materials', label: '农资档案管理', path: '/asset/basic/materials' },
      { id: 'asset-tools', label: '农具档案管理', path: '/asset/basic/tools' },
      { id: 'asset-suppliers', label: '供应商管理', path: '/asset/basic/suppliers' },
      { id: 'asset-customers', label: '客户管理', path: '/asset/basic/customers' },
    ]
  },
  {
    id: 'asset-purchase',
    label: '采购管理',
    icon: 'ShoppingCart',
    children: [
      { id: 'purchase-plan', label: '采购计划', path: '/asset/purchase/plan' },
      { id: 'purchase-order', label: '采购订单', path: '/asset/purchase/order' },
    ]
  },
  {
    id: 'asset-inventory',
    label: '库存管理',
    icon: 'Package',
    children: [
      { id: 'inventory-in', label: '入库管理', path: '/asset/inventory/in' },
      { id: 'inventory-out', label: '出库管理', path: '/asset/inventory/out' },
      { id: 'inventory-check', label: '盘点管理', path: '/asset/inventory/check' },
      { id: 'inventory-warning', label: '库存预警', path: '/asset/inventory/warning' },
      { id: 'inventory-detail', label: '库存明细', path: '/asset/inventory/detail' },
      { id: 'inventory-location', label: '库位管理', path: '/asset/inventory/location' },
      { id: 'inventory-suggest', label: '采购建议', path: '/asset/inventory/suggest' },
    ]
  },
  {
    id: 'asset-requisition',
    label: '物资领用',
    icon: 'HandCoins',
    children: [
      { id: 'requisition-apply', label: '领用申请', path: '/asset/requisition/apply' },
      { id: 'requisition-approval', label: '领用审批', path: '/asset/requisition/approval' },
      { id: 'requisition-checkout', label: '出库与核销', path: '/asset/requisition/checkout' },
      { id: 'requisition-record', label: '领用记录与溯源', path: '/asset/requisition/record' },
    ]
  },
  {
    id: 'asset-return',
    label: '物资归还',
    icon: 'Undo2',
    children: [
      { id: 'return-register', label: '归还登记', path: '/asset/return/register' },
      { id: 'return-process', label: '归还处理', path: '/asset/return/process' },
      { id: 'return-settlement', label: '领用记录关联核销', path: '/asset/return/settlement' },
      { id: 'return-history', label: '归还历史与资产台账', path: '/asset/return/history' },
    ]
  },
  {
    id: 'asset-equipment',
    label: '农资农具管理',
    icon: 'Wrench',
    children: [
      { id: 'equipment-archive', label: '物资档案', path: '/asset/equipment/archive' },
      { id: 'equipment-dispatch', label: '使用调度与状态', path: '/asset/equipment/dispatch' },
      { id: 'equipment-maintenance', label: '维修保养', path: '/asset/equipment/maintenance' },
      { id: 'equipment-depreciation', label: '折旧计算', path: '/asset/equipment/depreciation' },
      { id: 'equipment-disposal', label: '报废处理', path: '/asset/equipment/disposal' },
    ]
  },
  {
    id: 'asset-report',
    label: '可视化报表',
    icon: 'PieChart',
    children: [
      { id: 'report-overview', label: '全局概览核心指标', path: '/asset/report/overview' },
      { id: 'report-inventory', label: '库存动态可视化', path: '/asset/report/inventory' },
      { id: 'report-consumption', label: '领用消耗分析', path: '/asset/report/consumption' },
    ]
  },
];

export const aiMenus: MenuItem[] = [
  {
    id: 'ai-data-center',
    label: '全域数据感知中心',
    icon: 'Radar',
    children: [
      { id: 'data-external', label: '多源数据接入', path: '/ai/data-center/external' },
      { id: 'data-iot', label: '物联设备数据接入', path: '/ai/data-center/iot' },
      { id: 'device-type', label: '设备类型管理', path: '/ai/data-center/device-type' },
      { id: 'device-parameter', label: '设备参数管理', path: '/ai/data-center/device-parameter' },
    ]
  },
  {
    id: 'ai-model-integration',
    label: '模型接入集成',
    icon: 'Blocks',
    children: [
      { id: 'model-service-access', label: '模型服务接入', path: '/ai/model-integration/access' },
      { id: 'model-service-management', label: '模型服务管理', path: '/ai/model-integration/management' },
    ]
  },
  {
    id: 'ai-model-application',
    label: '模型应用中心',
    icon: 'Cpu',
    children: [
      { id: 'app-generation', label: '应用生成', path: '/ai/model-application/generation' },
      { id: 'app-scheduling', label: '调度管理', path: '/ai/model-application/scheduling' },
    ]
  },
  {
    id: 'ai-decision-generation',
    label: '智能决策生成',
    icon: 'Lightbulb',
    children: [
      { id: 'decision-fusion', label: '业务融合', path: '/ai/decision/fusion' },
      { id: 'decision-simulation', label: '决策模拟', path: '/ai/decision/simulation' },
      { id: 'decision-log', label: '决策日志', path: '/ai/decision/log' },
    ]
  },
  {
    id: 'ai-decision-support',
    label: '智能决策支持',
    icon: 'Brain',
    children: [
      { id: 'decision-dashboard', label: '决策看板', path: '/ai/support/dashboard' },
      { id: 'decision-detail', label: '决策详情', path: '/ai/support/detail' },
    ]
  },
  {
    id: 'ai-decision-application',
    label: '决策应用',
    icon: 'Zap',
    children: [
      { id: 'device-control', label: '设备控制集成', path: '/ai/application/device-control' },
      { id: 'external-system', label: '外部系统联动', path: '/ai/application/external-system' },
    ]
  },
  {
    id: 'ai-knowledge-base',
    label: 'AI知识库',
    icon: 'Library',
    children: [
      { id: 'knowledge-generation', label: 'AI知识自动生成与应用', path: '/ai/knowledge/generation' },
    ]
  },
  {
    id: 'ai-monitoring-center',
    label: '监控中心',
    icon: 'Eye',
    children: [
      { id: 'model-monitoring', label: '模型监控', path: '/ai/monitoring/model' },
      { id: 'audit-log', label: '全链路审计日志', path: '/ai/monitoring/audit' },
      { id: 'alert-management', label: '告警管理', path: '/ai/monitoring/alert' },
    ]
  },
];

export const irrigationMenus: MenuItem[] = [
  {
    id: 'water-fertilizer-management',
    label: '水肥机管理',
    icon: 'Settings',
    children: [
      { id: 'wf-device', label: '水肥机设备', path: '/irrigation/wf-management/device' },
      { id: 'wf-component', label: '水肥机部件配置', path: '/irrigation/wf-management/component' },
      { id: 'wf-parameter', label: '水肥机参数配置', path: '/irrigation/wf-management/parameter' },
      { id: 'wf-mapping', label: '水肥设备映射', path: '/irrigation/wf-management/mapping' },
    ]
  },
  {
    id: 'smart-irrigation',
    label: '智能灌溉',
    icon: 'Droplets',
    children: [
      { id: 'auto-irrigation', label: '智能灌溉', path: '/irrigation/smart/auto' },
      { id: 'manual-irrigation', label: '人工灌溉', path: '/irrigation/smart/manual' },
      { id: 'realtime-monitor', label: '水肥机实时监测数据', path: '/irrigation/smart/realtime' },
      { id: 'history-monitor', label: '水肥机历史监测数据', path: '/irrigation/smart/history' },
    ]
  },
  {
    id: 'fertilizer-formula',
    label: '施肥配方管理',
    icon: 'FlaskConical',
    children: [
      { id: 'water-control', label: '加水控制', path: '/irrigation/fertilizer/water-control' },
      { id: 'level-setting', label: '液位设定', path: '/irrigation/fertilizer/level-setting' },
      { id: 'stirring-control', label: '搅拌控制', path: '/irrigation/fertilizer/stirring-control' },
      { id: 'history-data', label: '历史监测数据', path: '/irrigation/fertilizer/history-data' },
    ]
  },
  {
    id: 'water-fertilizer-control',
    label: '水肥控制',
    icon: 'Sliders',
    children: [
      { id: 'fertilizer-params', label: '施肥参数设置', path: '/irrigation/wf-control/params' },
      { id: 'tank-realtime', label: '肥料桶实时监测数据', path: '/irrigation/wf-control/tank-realtime' },
      { id: 'valve-control', label: '阀门控制', path: '/irrigation/wf-control/valve-control' },
      { id: 'valve-realtime', label: '电动阀实时监测数据', path: '/irrigation/wf-control/valve-realtime' },
      { id: 'fertilizer-history', label: '施肥与配比历史数据', path: '/irrigation/wf-control/fertilizer-history' },
      { id: 'valve-history', label: '电动阀历史监测数据', path: '/irrigation/wf-control/valve-history' },
    ]
  },
  {
    id: 'monitoring-alert',
    label: '实时监测与预警',
    icon: 'Bell',
    children: [
      { id: 'alert-logic', label: '预警逻辑管理', path: '/irrigation/monitoring/alert-logic' },
      { id: 'threshold-alert', label: '阈值预警与告警', path: '/irrigation/monitoring/threshold-alert' },
      { id: 'notification-push', label: '多通道告警推送', path: '/irrigation/monitoring/notification-push' },
    ]
  },
];

export const configMenus: MenuItem[] = [
  {
    id: 'personal-center',
    label: '个人中心',
    icon: 'UserCircle',
    children: [
      { id: 'personal-info', label: '个人信息', path: '/config/profile/info' },
      { id: 'account-security', label: '账户安全', path: '/config/profile/security' },
    ]
  },
  {
    id: 'tenant-management',
    label: '租户管理',
    icon: 'Building2',
    children: [
      { id: 'enterprise-management', label: '企业管理', path: '/config/tenant/enterprise-management' },
      { id: 'enterprise-audit', label: '企业审核', path: '/config/tenant/enterprise-audit' },
      { id: 'audit-history', label: '审核历史', path: '/config/tenant/audit-history' },
      { id: 'enterprise-info', label: '企业信息', path: '/config/tenant/enterprise-info' },
      { id: 'platform-user-management', label: '用户管理', path: '/config/tenant/user-management' },
    ]
  },
  {
    id: 'user-management',
    label: '用户管理',
    icon: 'Users',
    children: [
      { id: 'department-management', label: '部门管理', path: '/config/user/department' },
      { id: 'employee-management', label: '员工管理', path: '/config/user/employee' },
      { id: 'role-management', label: '角色管理', path: '/config/user/role' },
      { id: 'menu-management', label: '菜单管理', path: '/config/user/menu' },
      { id: 'permission-config', label: '权限配置管理', path: '/config/user/permission' },
    ]
  },
  {
    id: 'system-params',
    label: '系统参数',
    icon: 'Cog',
    children: [
      { id: 'system-settings', label: '系统设置', path: '/config/system/settings' },
      { id: 'category-dictionary', label: '分类字典', path: '/config/system/category' },
      { id: 'data-dictionary', label: '数据字典', path: '/config/system/dictionary' },
    ]
  },
  {
    id: 'system-monitor',
    label: '系统监控',
    icon: 'Activity',
    children: [
      { id: 'login-log', label: '登录日志', path: '/config/monitor/login-log' },
      { id: 'operation-log', label: '操作日志', path: '/config/monitor/operation-log' },
      { id: 'performance-monitor', label: '性能监控', path: '/config/monitor/performance' },
      { id: 'network-log', label: '网络日志', path: '/config/monitor/network-log' },
    ]
  },
  {
    id: 'message-center',
    label: '消息中心',
    icon: 'Mail',
    children: [
      { id: 'message-send', label: '消息发送', path: '/config/message/send' },
      { id: 'message-template', label: '消息模版', path: '/config/message/template' },
      { id: 'message-log', label: '消息日志', path: '/config/message/log' },
    ]
  },
];
