/*
 * @Author: liuJie
 * @Date: 2026-02-26 13:57:24
 * @LastEditors: liuJie
 * @LastEditTime: 2026-02-26 17:22:35
 * @Describe: file describe
 */
import { FormConfig } from '@/types/basic-form';

export const INVENTORY_FORM_CONFIG: FormConfig[] = [
  {
    prop: 'itemName',
    label: '物品名称：',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入物品名称',
    },
  },
  {
    prop: 'warehouseDate',
    label: '入库日期：',
    component: 'ElDatePicker',
    componentProps: {
      type: 'date',
      placeholder: '请选择入库日期',
      valueFormat: 'YYYY-MM-DD',
    },
  },
  {
    prop: 'itemQuantity',
    label: '物品数量：',
    component: 'ElInputNumber',
    componentProps: {
      min: 1,
      max: 99999,
      precision: 0, // 不允许小数点，只能输入整数
      placeholder: '请输入物品数量',
    },
  },
  {
    label: '备注：',
    prop: 'remarks',
    component: 'ElInput',
    componentProps: {
      type: 'textarea',
      rows: 5,
      placeholder: '请输入备注',
    },
  },
];

export const INVENTORY_FORM_DATA = {
  itemName: '',
  warehouseDate: '',
  itemQuantity: 1, // 最小值为1
  remarks: '',
};

// 验证规则
export const TRAINING_FORM_RULES = {
  courseType: [{ required: true, message: '请选择课程所属类别', trigger: 'blur' }],
  courseName: [{ required: true, message: '请输入培训课程名称', trigger: 'blur' }],
  trainingMethod: [{ required: true, message: '请输入培训方式', trigger: 'blur' }],
  trainingTeacher: [{ required: true, message: '请输入培训课程讲师', trigger: 'blur' }],
  planNumOfParticipants: [
    { required: true, message: '请输入计划参与人数', trigger: 'blur' },
    { type: 'number', message: '人数必须为数字值', trigger: 'blur' },
  ],
  groupOfParticipants: [
    { required: true, message: '请选择参与人员分组', trigger: 'change' },
    { type: 'array', min: 1, message: '至少选择一个分组', trigger: 'change' },
  ],
  startDate: [{ required: true, message: '请选择培训开始日期', trigger: 'change' }],
  endDate: [{ required: true, message: '请选择培训结束日期', trigger: 'change' }],
  courseIntroduction: [{ required: true, message: '请输入培训课程简述', trigger: 'blur' }],
  courseContent: [{ required: true, message: '请输入课程内容', trigger: 'blur' }],
  isSign: [{ required: true, message: '请选择是否需要签名', trigger: 'change' }],
};
