// 农事类型共享数据
// 用于农事执行和农事计划模块

export type OperationType = '深翻' | '旋耕' | '播种' | '撒肥' | '喷药' | '灌溉' | '除草' | '修剪' | '采收';

export interface OperationParameter {
  name: string;
  type: 'text' | 'number' | 'select' | 'date' | 'image' | 'location';
  required: boolean;
  unit?: string;
  options?: string[];
  defaultValue?: any;
  description?: string;
}

export interface OperationTypeTemplate {
  id: string;
  name: OperationType;
  category: '土地整理' | '种植管理' | '田间管理' | '植保管理' | '收获管理';
  icon: string;
  color: string;
  description: string;
  parameters: OperationParameter[];
  createdAt: string;
  updatedAt: string;
}

// 农事类型库数据
export const operationTypesData: OperationTypeTemplate[] = [
  {
    id: 'type-1',
    name: '深翻',
    category: '土地整理',
    icon: '🚜',
    color: 'bg-brown-100 text-brown-800',
    description: '对土壤进行深层翻耕，改善土壤结构',
    parameters: [
      { name: '深度', type: 'number', required: true, unit: 'cm', description: '翻耕深度' },
      { name: '机械型号', type: 'text', required: true, description: '使用的农机型号' },
      { name: '作业面积', type: 'number', required: true, unit: '亩', description: '实际作业面积' },
      { name: '现场照片', type: 'image', required: false, description: '作业现场照片' },
    ],
    createdAt: '2024-01-01',
    updatedAt: '2024-01-01',
  },
  {
    id: 'type-2',
    name: '旋耕',
    category: '土地整理',
    icon: '🌾',
    color: 'bg-yellow-100 text-yellow-800',
    description: '使用旋耕机对土壤进行浅层耕作',
    parameters: [
      { name: '深度', type: 'number', required: true, unit: 'cm', description: '旋耕深度' },
      { name: '机械型号', type: 'text', required: true, description: '使用的农机型号' },
      { name: '作业面积', type: 'number', required: true, unit: '亩', description: '实际作业面积' },
      { name: '作业遍数', type: 'number', required: true, description: '旋耕遍数' },
    ],
    createdAt: '2024-01-01',
    updatedAt: '2024-01-01',
  },
  {
    id: 'type-3',
    name: '播种',
    category: '种植管理',
    icon: '🌱',
    color: 'bg-green-100 text-green-800',
    description: '进行作物种子的播种作业',
    parameters: [
      { name: '作物品种', type: 'text', required: true, description: '播种的作物品种' },
      { name: '种子品牌', type: 'text', required: true, description: '种子品牌' },
      { name: '种子批号', type: 'text', required: false, description: '种子批号，可扫码录入' },
      { name: '播种量', type: 'number', required: true, unit: 'kg', description: '单位面积播种量' },
      { name: '播种方式', type: 'select', required: true, options: ['条播', '穴播', '撒播', '点播'], description: '播种方式' },
      { name: '行距', type: 'number', required: false, unit: 'cm', description: '播种行距' },
      { name: '株距', type: 'number', required: false, unit: 'cm', description: '播种株距' },
      { name: '播种深度', type: 'number', required: true, unit: 'cm', description: '播种深度' },
    ],
    createdAt: '2024-01-01',
    updatedAt: '2024-01-01',
  },
  {
    id: 'type-4',
    name: '撒肥',
    category: '田间管理',
    icon: '🌾',
    color: 'bg-orange-100 text-orange-800',
    description: '施用化肥或有机肥',
    parameters: [
      { name: '肥料类型', type: 'select', required: true, options: ['有机肥', '复合肥', '氮肥', '磷肥', '钾肥', '微量元素肥'], description: '肥料类型' },
      { name: '肥料品牌', type: 'text', required: true, description: '肥料品牌' },
      { name: '肥料批号', type: 'text', required: false, description: '肥料批号，可扫码录入' },
      { name: '施肥量', type: 'number', required: true, unit: 'kg/亩', description: '单位面积施肥量' },
      { name: '总用量', type: 'number', required: true, unit: 'kg', description: '总施肥量' },
      { name: '施肥方法', type: 'select', required: true, options: ['基肥', '追肥', '叶面肥', '冲施'], description: '施肥方法' },
      { name: '施肥浓度', type: 'number', required: false, unit: '%', description: '施肥浓度（液肥）' },
      { name: '施肥位置', type: 'text', required: false, description: '具体地块/行号' },
    ],
    createdAt: '2024-01-01',
    updatedAt: '2024-01-01',
  },
  {
    id: 'type-5',
    name: '喷药',
    category: '植保管理',
    icon: '💊',
    color: 'bg-red-100 text-red-800',
    description: '喷洒农药进行病虫害防治',
    parameters: [
      { name: '农药类型', type: 'select', required: true, options: ['杀虫剂', '杀菌剂', '除草剂', '植物生长调节剂'], description: '农药类型' },
      { name: '农药品牌', type: 'text', required: true, description: '农药品牌' },
      { name: '农药批号', type: 'text', required: false, description: '农药批号，可扫码录入' },
      { name: '用药量', type: 'number', required: true, unit: 'ml/亩', description: '单位面积用药量' },
      { name: '总用量', type: 'number', required: true, unit: 'ml', description: '总用药量' },
      { name: '稀释倍数', type: 'number', required: true, description: '稀释倍数' },
      { name: '喷洒方式', type: 'select', required: true, options: ['无人机', '喷雾器', '喷杆喷雾机'], description: '喷洒方式' },
      { name: '防治对象', type: 'text', required: true, description: '防治的病虫害名称' },
      { name: '安全间隔期', type: 'number', required: true, unit: '天', description: '安全间隔期' },
    ],
    createdAt: '2024-01-01',
    updatedAt: '2024-01-01',
  },
  {
    id: 'type-6',
    name: '灌溉',
    category: '田间管理',
    icon: '💧',
    color: 'bg-blue-100 text-blue-800',
    description: '对作物进行灌溉作业',
    parameters: [
      { name: '灌溉方式', type: 'select', required: true, options: ['滴灌', '喷灌', '漫灌', '沟灌'], description: '灌溉方式' },
      { name: '灌溉时长', type: 'number', required: true, unit: '小时', description: '灌溉持续时间' },
      { name: '水量', type: 'number', required: true, unit: 'm³', description: '总用水量' },
      { name: '单位水量', type: 'number', required: false, unit: 'm³/亩', description: '单位面积水量' },
      { name: '水源', type: 'select', required: true, options: ['井水', '河水', '水库', '自来水'], description: '水源类型' },
    ],
    createdAt: '2024-01-01',
    updatedAt: '2024-01-01',
  },
  {
    id: 'type-7',
    name: '除草',
    category: '田间管理',
    icon: '🌿',
    color: 'bg-purple-100 text-purple-800',
    description: '清除田间杂草',
    parameters: [
      { name: '除草方式', type: 'select', required: true, options: ['人工除草', '机械除草', '化学除草'], description: '除草方式' },
      { name: '除草面积', type: 'number', required: true, unit: '亩', description: '除草面积' },
      { name: '除草剂品牌', type: 'text', required: false, description: '除草剂品牌（化学除草）' },
      { name: '除草剂用量', type: 'number', required: false, unit: 'ml/亩', description: '除草剂用量' },
    ],
    createdAt: '2024-01-01',
    updatedAt: '2024-01-01',
  },
  {
    id: 'type-8',
    name: '修剪',
    category: '田间管理',
    icon: '✂️',
    color: 'bg-pink-100 text-pink-800',
    description: '对作物进行整枝修剪',
    parameters: [
      { name: '修剪部位', type: 'select', required: true, options: ['主枝', '侧枝', '叶片', '花果'], description: '修剪部位' },
      { name: '修剪强度', type: 'select', required: true, options: ['轻度', '中度', '重度'], description: '修剪强度' },
      { name: '修剪面积', type: 'number', required: true, unit: '亩', description: '修剪面积' },
    ],
    createdAt: '2024-01-01',
    updatedAt: '2024-01-01',
  },
  {
    id: 'type-9',
    name: '采收',
    category: '收获管理',
    icon: '🎃',
    color: 'bg-amber-100 text-amber-800',
    description: '作物成熟后的采收作业',
    parameters: [
      { name: '采收方式', type: 'select', required: true, options: ['人工采收', '机械采收'], description: '采收方式' },
      { name: '采收面积', type: 'number', required: true, unit: '亩', description: '采收面积' },
      { name: '产量', type: 'number', required: true, unit: 'kg', description: '总产量' },
      { name: '单产', type: 'number', required: false, unit: 'kg/亩', description: '单位面积产量' },
      { name: '品质等级', type: 'select', required: false, options: ['特等', '一等', '二等', '三等'], description: '产品品质等级' },
    ],
    createdAt: '2024-01-01',
    updatedAt: '2024-01-01',
  },
];
