export const formRules =  {
  parDescription: [
    { required: true, message: "请输入规则名称", trigger: ["change"] },
    {
      validator: (rule, value, callback) => {
        if (value.length > 100) {
          callback(new Error("规则名称不能超过100字"));
        } else {
          callback();
        }
      },
      trigger: "change"
    }
  ],
  parRuleType: [
    { required: true, message: "请选择规则类型", trigger: ["blur"] }
  ],
  parLenCode: [
    { required: true, message: "请选择规则术语类型", trigger: ["blur"] }
  ],
  parConceptId: [
    { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
  ],
  parHasSub: [
    { required: true, message: "请选择有无子条件", trigger: ["blur"] }
  ],

}

export const tableRules = {
  subMsg: [
    { required: true, message: "请输入附加信息", trigger: ["change"] },
    {
      validator: (rule, value, callback) => {
        if (value.length > 250) {
          callback(new Error("附加信息不能超过250字"));
        } else {
          callback();
        }
      },
      trigger: "change"
    }
  ],
  subMsgs: [
    {
      validator: (rule, value, callback) => {
        if (value && value.length > 250) {
          callback(new Error("附加信息不能超过250字"));
        } else {
          callback();
        }
      },
      trigger: "change"
    }
  ],
  subDescription: [
    { required: true, message: "请输入基础规则名称", trigger: ["change"] },
    {
      validator: (rule, value, callback) => {
        if (value && value.length > 100) {
          callback(new Error("规则名称不能超过100字"));
        } else {
          callback();
        }
      },
      trigger: "change"
    }
  ],
  subType: [
    { required: true, message: "请选择基础规则类型", trigger: ["blur"] }
  ],
  subLenCode: [
    {
      required: true,
      message: "请选择基础规则术语类型",
      trigger: ["blur"]
    }
  ],
  subConceptId: [
    { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
  ],
  dataType: [
    { required: true, message: "请选择类型", trigger: ["blur"] }
  ],
  
  
  subEqValue: [
    {
      validator: (rule, value, callback) => {
        if (value === "") {
          callback(new Error("请输入" + this.textName));
        } else if (value.length > 200) {
          callback(new Error(this.textName + "不能超过200字"));
        } else {
          callback();
        }
      },
      trigger: "blur"
    }
  ]
}