import {
  startStatus
} from '@/assets/js/blockSort'
export const employee = () => {
  return [{
    field: 'index',
    label: '序号',
    align: 'center',
  }, {
    field: 'name',
    label: '名称',
    align: 'center',
  }, {
    field: 'sn',
    label: 'SN',
    align: 'center',
  }, {
    field: 'address',
    label: '详细地址',
    align: 'center',
  }, {
    field: 'status',
    label: '状态',
    align: 'center',
    options: startStatus()
  }, {
    field: 'user.nickName',
    label: '仓库管理员',
    align: 'center',
  }, {
    field: 'action',
    label: '操作',
    colWidth: '230px',
    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: 'sn',
    label: 'SN',
    placeholder: '请输入SN',
    type: 'input',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请输入SN',
      trigger: 'blur'
    }]
  }, {
    field: 'address',
    label: '详细地址',
    placeholder: '请输入详细地址',
    type: 'input',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请输入详细地址',
      trigger: 'blur'
    }]
  }, {
    field: 'status',
    label: '状态',
    placeholder: '状态',
    type: 'radio',
    colWidth: 24,
    rules: [{
      required: true,
      message: '选择状态',
      trigger: 'change'
    }],
    options: startStatus()
  }, {
    field: 'userId',
    type: 'select',
    label: '仓库管理员',
    placeholder: '请选择仓库管理员',
    colWidth: 24,
    multiple: false,
    rules: [{
      required: true,
      message: '请选择仓库管理员',
      trigger: 'change'
    }],
    options: [],
  }]
}
