import {
  process
} from '@/assets/js/blockSort'
export const employee = () => {
  return [{
    field: 'index',
    label: '序号',
    align: 'center',
  }, {
    field: 'sn',
    operation: true,
    label: 'SN',
    align: 'center',
  }, {
    field: 'optType',
    label: '类型',
    align: 'center',
    options: process(),
  }, {
    field: 'user.nickName',
    label: '关联人员',
    align: 'center',
  }, {
    field: 'action',
    label: '操作',
    colWidth: '200px',
    align: 'center',
    labelButton: [{
      type: 'edit',
      label: '编辑',
      icon: 'el-icon-edit',
      style: 'primary',
    }, {
      type: 'del',
      label: '删除',
      icon: 'el-icon-tickets',
      style: 'danger',
    }]
  }]
}

export const formRules = () => {
  return [{
    field: 'sn',
    label: 'SN',
    placeholder: '请输入SN',
    type: 'input',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请输入SN',
      trigger: 'blur'
    }]
  }, {
    field: 'type',
    label: '类型',
    placeholder: '类型',
    type: 'radio',
    colWidth: 12,
    rules: [{
      required: true,
      message: '选择设备类型',
      trigger: 'change'
    }],
    options: [{
        label: '手持枪',
        value: 1,
      },
      {
        label: '龙门',
        value: 2,
      }
    ]
  }, {
    field: 'optType',
    type: 'select',
    label: '关键步骤',
    placeholder: '请选择关键步骤',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请选择关键步骤',
      trigger: 'change'
    }],
    options: process(),
  }, {
    field: 'provUserId',
    type: 'searchSelect',
    label: '关联人员',
    placeholder: '请选择关联人员',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请选择关联人员',
      trigger: 'change'
    }],
    options: [],
  }, ]
}
