import {
  userType
} from '@/assets/js/blockSort'
export const employee = () => {
  return [{
    field: 'name',
    label: '姓名',
    align: 'center',
  }, {
    field: 'phone',
    label: '电话号码',
    align: 'center',
  }, {
    field: 'address',
    label: '详细地址',
    align: 'center',
  }, {
    field: 'addressType',
    label: '类型',
    align: 'center',
    options: userType()
  }, {
    field: 'action',
    label: '操作',
    colWidth: '260px',
    align: 'center',
    labelButton: [{
      type: 'logs',
      label: '详情',
      icon: 'el-icon-tickets',
      style: 'success',
    }, {
      type: 'edit',
      label: '编辑',
      icon: 'el-icon-edit',
      style: 'primary',
    }, {
      type: 'del',
      label: '删除',
      icon: 'el-icon-delete',
      style: 'danger',
    }]
  }]
}

export const formRules = () => {
  return [{
      field: 'name',
      label: '姓名',
      placeholder: '请输入姓名',
      type: 'input',
      colWidth: 24,
      rules: [{
        required: true,
        message: '请输入姓名',
        trigger: 'blur'
      }]
    }, {
      field: 'phone',
      label: '电话号码',
      placeholder: '请输入电话号码',
      type: 'input',
      colWidth: 24,
      rules: [{
        required: true,
        message: '请输入电话号码',
        trigger: 'blur'
      }, {
        pattern: /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/,
        message: '请输入正确手机号码',
        trigger: "blur"
      }]
    }, {
      field: 'address',
      label: '详细地址',
      placeholder: '请输入详细地址',
      type: 'input',
      colWidth: 24,
      rules: [{
        required: true,
        message: '请输入详细地址',
        trigger: 'blur'
      }]
    },
    // {
    //   field: 'addressType',
    //   label: '类型',
    //   placeholder: '类型',
    //   type: 'radio',
    //   colWidth: 24,
    //   rules: [{
    //     required: true,
    //     message: '选择类型',
    //     trigger: 'change'
    //   }],
    //   options: userType()
    // },
  ]
}
