export default {
  id: 'honor',
  title: '荣誉奖励（可选）',
  showProgress: true,
  progress: 0,
  get: {
    action: '/zws/v1/enrollment/honors?project_id=1000'
  },
  update: {
    action: '/zws/v1/enrollment/honors/batch-upload',
    data: { project_id: 1000 },
    beforeRequest(data) {
      const records = data.map(item => {
        return ['title', 'summary'].reduce((result, key) => {
          result[key] = item[key]
          return result
        }, {})
      })
      return { records }
    }
  },
  form: {
    hint: '请列出曾获得的荣誉和专业资格，从最重要的开始',
    hasAdd: true,
    options: {
      labelWidth: '180px'
    },
    items: [
      /* 荣誉/奖励名称 */
      {
        type: 'input-form',
        label: '荣誉/奖励',
        model: 'title',
        modelWidth: '300px',
        placeholder: '请输入荣誉/奖励',
        rules: [{ required: true, message: '请输入荣誉/奖励', trigger: 'blur' }]
      },
      /* 颁发机构名称 */
      {
        type: 'input-form',
        label: '证书颁发机构及获得时间',
        model: 'summary',
        rules: [
          {
            required: true,
            message: '请输入证书颁发机构及获得时间',
            trigger: 'blur'
          }
        ]
      }
    ]
  }
}
