import {
  startStatus
} from '@/assets/js/blockSort'
export const employee = () => {
  return [{
    field: 'index',
    label: '序号',
    align: 'center',
  }, {
    field: 'carNo',
    label: '车牌号',
    align: 'center',
  }, {
    field: 'sn',
    label: 'SN',
    align: 'center',
  }, {
    field: 'user.nickName',
    label: '司机',
    align: 'center',
    options: [],
  }, {
    field: 'status',
    label: '状态',
    align: 'center',
    options: startStatus()
  }, {
    field: 'action',
    label: '操作',
    colWidth: '240px',
    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: 'carNo',
    label: '车牌号',
    placeholder: '请输入车牌号',
    type: 'input',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请输入车牌号',
      trigger: 'blur'
    }]
  }, {
    field: 'sn',
    label: 'SN',
    placeholder: '请输入SN',
    type: 'input',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请输入SN',
      trigger: 'blur'
    }]
  }, {
    field: 'userId',
    type: 'select',
    label: '司机',
    placeholder: '请选择司机',
    colWidth: 24,
    multiple: false,
    rules: [{
      required: true,
      message: '请选择司机',
      trigger: 'change'
    }],
    options: [],
  }, {
    field: 'status',
    label: '启动状态',
    placeholder: '启动状态',
    type: 'radio',
    colWidth: 24,
    rules: [{
      required: true,
      message: '选择启动状态',
      trigger: 'change'
    }],
    options: startStatus()
  }]
}
