import { FormRules } from "element-plus";

export const ladderFormRules: FormRules = {
  key: {
    trigger: "change",
    required: true,
    message: "请选择商品类型"
  },
  value: {
    trigger: "change",
    required: true,
    message: "请选择单位"
  }
};

export const projectFormRules: FormRules = {
  number: {
    trigger: "change",
    required: true,
    validator(_, value) {
      if (value === "") return new Error("请输入库存变动数");
      return true;
    }
  },
  flag: {
    trigger: "change",
    required: true,
    validator(_, value) {
      if (value.length === 0) return new Error("请选择修改状态！");
      return true;
    }
  }
};
