
/**
 * 校验表单必填字段
 */
export function formRequiredVerify (_this, formKey, callback) {
  let validResult = false
  _this.$refs[formKey].validate((valid, verifyObject) => {
    if (valid) {
      validResult = true
    } else {
      validResult = false
      if (verifyObject != null) {
        for (let key in verifyObject) {
          let fieldRule = verifyObject[key]
          if (fieldRule != null) {
            _this.$message.error(fieldRule[0].message)
            break
          }
        }
      }
    }
    if (typeof callback === 'function') {
      callback(validResult)
    }
  })
}
