export default {
  id: 'training',
  title: '所受培训',
  showProgress: true,
  progress: 0,
  get: {
    action: '/zws/v1/enrollment/trainings?project_id=1001',
    callback(data) {
      return data
    }
  },
  update: {
    action: '/zws/v1/enrollment/trainings/batch-upload',
    data: { project_id: 1001 },
    callback(data) {
      return { records: data }
    }
  },
  form: {
    options: {
      labelWidth: '80px'
    },
    hasAdd: true,
    defaultModel: {
      times: [],
      start_date: null,
      end_date: null,
      school_name_cn: '',
      school_country: ''
    },
    items: [
      {
        type: 'date-picker-form',
        elemType: 'monthrange',
        label: '培训时间',
        model: 'times',
        required: true,
        attrs: { 'value-format': 'yyyy-MM' },
        rules: [{ required: true, message: '请选择培训时间', trigger: 'blur' }]
      },
      {
        type: 'input-form',
        label: '培训机构',
        model: 'school_name_cn',
        rules: [{ required: true, message: '请输入培训机构', trigger: 'blur' }]
      },
      {
        type: 'input-form',
        label: '课程名称',
        model: 'school_country',
        rules: [
          {
            required: true,
            message: '请输入课程名称',
            trigger: 'blur'
          }
        ]
      }
    ]
  }
}
