export default {
  id: 'interview_ywjl',
  title: '英文简历',
  get: {
    action: `/api/enrollment/v1.0/application-materials/${webConf.others.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 RESUME_EN = attachments.filter(item => {
        return item.file_type_id === 'RESUME_EN'
      })
      return { RESUME_EN }
    }
  },
  form: {
    prev: { to: { query: { active: 'interview_xwzsywzm' } } },
    next: { to: { query: { active: 'interview_cjd' } } },
    hasButton: false,
    options: {},
    items: [
      {
        type: 'v-upload',
        required: true,
        model: 'RESUME_EN',
        attrs: {
          action: `/api/enrollment/v1.0/application-materials/attachments/${webConf.others.projectId}/put`,
          deleteAction: `/api/enrollment/v1.0/application-materials/attachments/${webConf.others.projectId}/delete`,
          data: { file_type: 'RESUME_EN' }
        },
        append: `
        <p>请下载填写英文简历模板后上传 [<a href="https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/chinafflg/%E8%8B%B1%E6%96%87%E7%AE%80%E5%8E%86.docx" target="_blank" download="英文简历模板">下载模板</a>]</p>
        <p>请将英文简历填写完存为"pdf"格式上传，文件小于10MB。</p>`
      }
    ]
  }
}
