/*
 * @Author: liuJie
 * @Date: 2026-01-27 16:29:28
 * @LastEditors: liuJie
 * @LastEditTime: 2026-02-06 13:35:38
 * @Describe: file describe
 */
import { FormConfig } from '@/types/basic-form';

export const INVENTORY_FORM_CONFIG: FormConfig[] = [
  {
    prop: 'itemName',
    label: '员工工号：',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入员工工号',
    },
  },
  {
    prop: 'itemName',
    label: '员工姓名：',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入员工姓名',
    },
  },
  {
    prop: 'itemQuantity',
    label: '组织名称：',
    component: 'ElSelect',
    componentProps: {
      placeholder: '请选择组织',
    },
  },
  {
    label: '岗位职责：',
    prop: 'remarks',
    component: 'ElInput',
    componentProps: {
      type: 'textarea',
      rows: 5,
      placeholder: '请填写岗位职责',
    },
  },
  {
    prop: 'status',
    label: '状态：',
    slot: 'status',
  },
];

export const INVENTORY_FORM_DATA = {
  itemName: '',
  warehouseDate: '',
  itemQuantity: 1, // 最小值为1
  remarks: '',
  orgId: '',
  jobResp: '',
};
// 表单验证规则
export const FORM_RULES = {
  employeeId: [
    { required: true, message: '请输入员工工号', trigger: 'blur' },
    { min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' },
  ],
  employeeName: [
    { required: true, message: '请输入员工姓名', trigger: 'blur' },
    { min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'blur' },
  ],
  orgId: [{ required: true, message: '请选择组织名称', trigger: 'change' }],
  jobResp: [
    { required: true, message: '请填写岗位职责', trigger: 'blur' },
    { min: 1, max: 300, message: '最大字数300字', trigger: 'blur' },
  ],
  status: [{ required: true, message: '请选择状态', trigger: 'blur' }],
};
