import {
  iceraftStatus
} from '@/assets/js/blockSort'

export const incubator = () => {
  return [{
    field: 'selection',
    label: '多选',
    align: 'center',
  }, {
    field: 'T_devName',
    label: '名称',
    align: 'center',
  }]
}
export const iceList = () => {
  return [{
    field: 'selection',
    label: '多选',
    align: 'center',
  }, {
    field: 'code',
    label: '编号',
    align: 'center',
  }, {
    field: 'label',
    label: '备注',
    align: 'center',
  }, {
    field: 'iceRaftRecord.status',
    label: '状态',
    align: 'center',
    options: [{
      bgcolor: '#fa3534',
      label: '冷冻中',
      value: '1',
    }, {
      bgcolor: '#67C23A',
      label: '待使用',
      value: '2',
    }]
  }, {
    field: 'freezeClaim',
    label: '冷冻要求',
    align: 'center',
  }, {
    field: 'freezeDuration',
    label: '冷冻时间',
    align: 'center',
  }, {
    field: 'iceRaftRecord.inStorageTime',
    label: '入库时间',
    align: 'center',
  }]
}
export const employee = () => {
  return [{
    field: 'index',
    label: '序号',
    align: 'center',
  }, {
    field: 'name',
    label: '名称',
    align: 'center',
  }, {
    field: 'sn',
    label: 'SN',
    align: 'center',
  }, {
    field: 'status',
    label: '状态',
    align: 'center',
    options: iceraftStatus()
  }, {
    field: 'deviceData.T_t',
    label: '最新温度',
    align: 'center',
  }, {
    field: 'deviceData.T_time',
    label: '最新记录时间',
    align: 'center',
  }, {
    field: 'action',
    label: '操作',
    colWidth: '360px',
    align: 'center',
    labelButton: [{
      type: 'cooling',
      label: '冰排释冷',
      // icon: 'el-icon-s-order',
      style: 'primary',
    }, {
      type: 'record',
      label: '记录',
      icon: 'el-icon-s-order',
      style: 'primary',
    }, {
      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: false,
      message: '请输入SN',
      trigger: 'blur'
    }]
  }, {
    field: 'status',
    label: '状态',
    placeholder: '状态',
    type: 'radio',
    colWidth: 24,
    rules: [{
      required: true,
      message: '选择状态',
      trigger: 'change'
    }],
    options: iceraftStatus()
  }, ]
}
