export default {
  id: 'honor',
  title: '荣誉奖励',
  showProgress: true,
  progress: 0,
  required: false,
  get: {
    action: '/zws/v1/enrollment/honors?project_id=1001'
  },
  update: {
    action: '/zws/v1/enrollment/honors/batch-upload',
    data: { project_id: 1001 },
    beforeRequest(data) {
      const records = data.map(item => {
        return ['title', 'summary'].reduce((result, key) => {
          result[key] = item[key]
          return result
        }, {})
      })
      return { records }
    }
  },
  form: {
    hasAdd: true,
    options: {
      labelWidth: '180px'
    },
    items: [
      {
        type: 'input-form',
        label: '荣誉/奖励',
        model: 'title',
        placeholder: '请输入荣誉/奖励名称',
        rules: [{ required: true, message: '请输入荣誉/奖励', trigger: 'blur' }]
      },
      {
        type: 'input-form',
        label: '证书颁发机构及获得时间',
        model: 'summary',
        rules: [
          {
            required: true,
            message: '请输入证书颁发机构及获得时间',
            trigger: 'blur'
          }
        ]
      }
    ]
  }
}
