export const employee = () => {
  return [{
    field: 'index',
    label: '序号',
    align: 'center',
  }, {
    field: 'name',
    operation: true,
    label: '商品名称',
    align: 'center',
  }, {
    field: 'mediaType',
    label: '介质类型',
    align: 'center',
  }, {
    field: 'isShow',
    label: '是否展示',
    align: 'center',
    options: [{
        bgcolor: '#67C23A',
        label: '是',
        value: true,
      },
      {
        bgcolor: '#F56C6C',
        label: '否',
        value: false,
      }
    ]
  }, {
    field: 'showStartTime',
    label: '展示期限开始',
    align: 'center',
  }, {
    field: 'showEndTime',
    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: 'name',
    label: '商品名称',
    placeholder: '商品名称',
    type: 'input',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请输入商品名称',
      trigger: 'blur'
    }]
  }, {
    field: 'mediaType',
    label: '介质类型',
    placeholder: '介质类型',
    type: 'input',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请输入介质类型',
      trigger: 'blur'
    }]
  }, {
    field: 'price',
    label: '价格',
    placeholder: '请输入商品价格',
    type: 'input',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请输入商品价格',
      trigger: 'blur'
    }]
  }, {
    field: 'isShow',
    label: '是否显示',
    placeholder: '是否显示',
    type: 'radio',
    colWidth: 24,
    rules: [{
      required: true,
      message: '选择是否显示商品',
      trigger: 'change,blur'
    }],
    options: [{
        label: '是',
        value: true,
      },
      {
        label: '否',
        value: false,
      }
    ]
  }, {
    field: 'showTime',
    label: '期限',
    placeholder: '选择商品展示期限',
    type: 'section',
    colWidth: 24,
    rules: [{
      required: true,
      message: '请选择商品展示期限',
      trigger: 'change,blur'
    }]
  }, {
    field: 'img',
    label: '商品图片',
    type: 'singleUpload',
    colWidth: 6,
    crosswise: true,
    rules: [{
      required: false,
      message: '请选择商品图片',
      trigger: 'change,blur'
    }],
  }, ]
}
