'use client'; import { useReducer } from 'react'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { BookOpen, Target } from 'lucide-react'; import { cropRecommendReducer, initialState } from './components/cropRecommendReducer'; import { FieldEnvironmentOverview } from './components/FieldEnvironmentOverview'; import { KnowledgeBaseDialog } from './components/KnowledgeBaseDialog'; export default function CropPage() { const [state, dispatch] = useReducer(cropRecommendReducer, initialState); // 获取当前选中的地块结果 const currentResult = state.evaluationResults.find(r => r.fieldId === state.selectedField) || state.evaluationResults[0]; const handleFieldChange = (value: string) => { dispatch({ type: 'SET_SELECTED_FIELD', payload: value }); }; const handleToggleKnowledgeBase = () => { dispatch({ type: 'SET_SHOW_KNOWLEDGE_BASE', payload: !state.showKnowledgeBase }); }; const getGradeColor = (grade: string) => { switch (grade) { case '高度适宜': return 'bg-green-500'; case '一般适宜': return 'bg-yellow-500'; case '不适宜': return 'bg-red-500'; default: return 'bg-gray-500'; } }; return (

作物适配推荐

智能作物推荐清单、基于知识库的精准匹配

{/* 地块选择和适宜性概览 */}
{/* 适宜性评分卡片 */}

适宜性评分

{currentResult.totalScore}

{currentResult.grade}
{/* 因子评分统计 */}

因子评分统计

优秀因子 {currentResult.factors.filter(f => f.score >= 80).length}
待改善因子 {currentResult.factors.filter(f => f.score < 70).length}
评价时间 {currentResult.timestamp}
{/* 知识库对话框 */} {/* 系统说明 */}

作物-环境知识库匹配系统

🌾 知识库构成

  • 作物种类: 多种主要农作物
  • 土壤参数: pH、有机质等7项指标
  • 气候参数: 温度、降雨、光照
  • 最佳范围: 每个因子的要求范围

🎯 智能匹配流程

  • 参数对比: 地块值与要求对比
  • 评分计算: 最佳100分,可接受60分
  • 综合匹配度: 加权平均所有因子
  • 分级推荐: ≥85高度推荐,70-84推荐

📊 产量预测机制

  • 三级产量区间: 高/中/低适宜性
  • 历史数据支撑: 基于实测数据模型
  • 动态调整: 根据匹配度选择区间
  • 品种差异: 考虑作物产量特性

⚠️ 风险识别系统

  • 多维度监测: 土壤、气候、营养
  • 条件触发: 自动判断风险存在
  • 严重度分级: 高/中/低风险等级
  • 应对建议: 每个风险配套措施

💡 系统优势: 本系统整合了土壤科学、作物学、气象学等多学科知识,建立了完整的作物-环境适配知识库。 通过科学的评分体系和智能匹配算法,为农业生产决策提供可靠的数据支持,帮助优化作物布局, 提高土地利用率和经济效益,同时有效规避种植风险。

); }