export function validAmount(rule: any, value: any, callback: any) {
  if (value === '') {
    callback()
    return
  }

  setTimeout(() => {
    //校验输入的保证金的金额是否正确
    var pattern = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/;
    if (!pattern.test(value)) {
      return callback(new Error('输入格式不正确,请输入数字'))
    } else {
      callback()
    }
  }, 200)
}

export function arrayNotEmpty(rule: any, value: any, callback: any) {
  if (value.length === 0) {
    return callback(new Error('该项不能为空'))
  }
  callback()
}