code: function (name, value, extra, method) {
      let result = { status: 1, msg: '' };
      if (!name) {
          return result;
      }
      //自定义规则存在则检查
      if (extra && extra.valid) {
          let met;
          if (extra.method) {
              met = (extra.method).toUpperCase();
              if (met === 'ALL' || met === method) {
                  met = true;
              } else {
                  met = false;
              }
          }
          if (met) {
              let valid = extra.valid;
              if (!Array.isArray(valid)) {
                  valid = [valid];
              }
              valid.some(function (validItem) {
                  //自定义检测方法
                  if (typeof validItem === 'function') {
                      result = validItem(value);
                  } else if (typeof (rules[validItem]) === 'function') {
                      let args = extra[validItem + '_args'] || [];
                      if (!Array.isArray(args)) {
                          args = [args];
                      }
                      args = [value].concat(args);
                      if (rules[validItem].apply(rules, args) === false) {
                          result = { status: 0, msg: `${extra.msg[validItem]}` || `${name}值未通过检测!` };
                      }
                  }
              });
          }
      }
      return result;
  }
docs: 自定义规则检查
  extra格式
  {
  method: 'ADD', // ADD, UPDATE, ALL
  valid: ['required', 'range'],
  range_args: [],
  msg:{
  required: '必填',
  range: '必须在xx--xx整数范围'
  }
  }
  @param name
  @param value
  @param extra
  @param method
  @returns {{status: number, msg: string}}