export default function(_this) {
  return {
    id: 'interview_byz',
    // title: '毕业证书',
    title: _this.$t('application.certificateOfGraduation'),
    get: {
      action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/${process.env.projectId}`,
      callback(data) {
        const { attachments = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
        const stageList = ['FILLING', 'PREPAYMENT', 'INTERVIEW_APPLICATION', 'AUDITION', 'INTERVIEW', 'PAYMENT', 'REGISTRATION', 'CLOSED']
        this.form.options.disabled = stageList.findIndex(item => item === submissionStage) > 2
        const DIPLOMA_CN = attachments.filter(item => {
          return item.file_type_id === 'DIPLOMA_CN'
        })
        return { DIPLOMA_CN }
      }
    },
    form: {
      next: { to: { query: { active: 'interview_cjd' } } },
      hasButton: false,
      options: {},
      items: [
        {
          type: 'v-upload',
          required: true,
          model: 'DIPLOMA_CN',
          attrs: {
            action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/attachments/${process.env.projectId}/put`,
            deleteAction: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/attachments/${process.env.projectId}/delete`,
            data: { file_type: 'DIPLOMA_CN' }
          },
          append: _this.$t('application.certificateOfGraduationNote')
        }
      ]
    }
  }
}
