export default function(type, rules, specialSign) {
  const defRules = [{ required: Boolean(rules.required), message: "内容不能为空" }]
  if(type === 'checkbox'){
    return [{ required: Boolean(rules.required), message: "至少选择一项" }];
  }
  if(type === 'radio'){
    return [{ required: Boolean(rules.required), message: "请选择一项" }];
  }
  if(specialSign){
    if(specialSign === 'phone') {
      // /(^\s*$)|(^(?:(?:\+|00)86)?1\d{10}$)/
      defRules.push({ pattern: /^s*$|(?:(?:\+|00)86)?1\d{10}$/, message: '请输入正确的手机号'})
    }
  }
  // console.log(defRules)
  return defRules;
}
