export default {
  id: 'attachment',
  title: '资料上传',
  showProgress: true,
  progress: 0,
  get: {
    action: '/zws/v1/enrollment/attachments?project_id=1000',
    callback(data) {
      let _data = {
        uploadArrs22: [],
        uploadArrs23: [],
        uploadArrs30: [],
        uploadArrs31: []
      }
      data.forEach((item, index) => {
        _data['uploadArrs' + item.file_type].push({
          url: item.file,
          id: item.id,
          sso_file_name: item.sso_file_name
        })
      })
      return _data
    }
  },
  form: {
    hasButton: false,
    options: {
    },
    items: [
      /* 有效身份证件（正面） */
      {
        type: 'upload-form',
        label: '有效身份证件（正面）',
        required: true,
        model: 'uploadArrs22',
        action: '/zws/v1/enrollment/attachments',
        deleteAction: '/zws/v1/enrollment/attachments',
        data: {
          file_type: 22,
          project_id: 1000
        },
        attrs: {
          multiple: false,
          limit: 1
        },
        html: `
          <div style="color: #72818c; font-size: 14px;">
            <p style="margin: 0;">申请者需要将有效身份证件原件扫描或者拍照后提交。</p>
            <p style="margin: 0;">请您提供有效身份证件的扫描件，身份证与台港澳居民大陆通行证应包括正反两面扫描件。</p>
            <p style="margin: 0;">只上传一个文件，多份文件需合并到一个文件后打印出来检查无误后再上传。</p>
            <p style="margin: 0;">上传文件仅限“jpg,jpeg,gif,png”格式，文件小于10MB。</p>
          </div>
        `
      },
      /* 有效身份证件（反面） */
      {
        type: 'upload-form',
        label: '有效身份证件（反面）',
        required: true,
        model: 'uploadArrs23',
        action: '/zws/v1/enrollment/attachments',
        deleteAction: '/zws/v1/enrollment/attachments',
        data: {
          file_type: 23,
          project_id: 1000
        },
        attrs: {
          multiple: false,
          limit: 1
        },
        html: `
          <div style="color: #72818c; font-size: 14px;">
            <p style="margin: 0;">申请者需要将有效身份证件原件扫描或者拍照后提交。</p>
            <p style="margin: 0;">请您提供有效身份证件的扫描件，身份证与台港澳居民大陆通行证应包括正反两面扫描件。</p>
            <p style="margin: 0;">只上传一个文件，多份文件需合并到一个文件后打印出来检查无误后再上传。</p>
            <p style="margin: 0;">上传文件仅限“jpg,jpeg,gif,png”格式，文件小于10MB。</p>
          </div>
        `
      },
      /* 毕业证书 */
      {
        type: 'upload-form',
        label: '毕业证书',
        required: true,
        model: 'uploadArrs30',
        action: '/zws/v1/enrollment/attachments',
        deleteAction: '/zws/v1/enrollment/attachments',
        data: {
          file_type: 30,
          project_id: 1000
        },
        attrs: {
          multiple: true
        },
        html: `
          <div style="color: #72818c; font-size: 14px;">
            <p style="margin: 0;">申请者需要将本科或以上毕业证书原件扫描或者拍照后提交。</p>
            <p style="margin: 0;">可上传多个文件，请确保证书号码清晰可辨。</p>
            <p style="margin: 0;">上传文件仅限“jpg,jpeg,png”格式，文件小于10MB。</p>
          </div>
        `
      },
      /* 学位证书 */
      {
        type: 'upload-form',
        label: '学位证书',
        required: true,
        model: 'uploadArrs31',
        action: '/zws/v1/enrollment/attachments',
        deleteAction: '/zws/v1/enrollment/attachments',
        data: {
          file_type: 31,
          project_id: 1000
        },
        attrs: {
          multiple: true
        },
        html: `
          <div style="color: #72818c; font-size: 14px;">
            <p style="margin: 0;">申请者需要将学位证书原件扫描或者拍照后提交。</p>
            <p style="margin: 0;">可上传多个文件，请确保证书号码清晰可辨。</p>
            <p style="margin: 0;">上传文件仅限“jpg,jpeg,png”格式，文件小于10MB。</p>
          </div>
        `
      }
    ]
  }
}
