<template>
  <div class="certificate">
    <div class="title">{{ $t('curriculumVitae:certificate:title') }}</div>
    <div class="fileBox">
      <!--最高医学学位毕业证书-->
      <div class="file_title">
        {{ $t('curriculumVitae:certificate:fileTitle:diploma') }}
      </div>
      <div class="file" v-if="true">
        <div class="name">简历1</div>
        <i
          class="el-icon-view"
          :title="$t('common:button:preview')"
          @click.stop="preview"
        />
        <i class="el-icon-delete" :title="$t('common:button:delete')" />
      </div>
      <div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
      <!--医师资格证-->
      <div class="file_title" v-if="true">
        {{ $t('curriculumVitae:certificate:fileTitle:certificate') }}
      </div>
      <div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
      <div class="file">
        <div class="name">简历1</div>
        <i
          class="el-icon-view"
          :title="$t('common:button:preview')"
          @click.stop="preview"
        />
        <i class="el-icon-delete" :title="$t('common:button:delete')" />
      </div>
      <!--医师执业证-->
      <div class="file_title" v-if="true">
        {{ $t('curriculumVitae:certificate:fileTitle:license') }}
      </div>
      <div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
      <div class="file">
        <div class="name">简历1</div>
        <i
          class="el-icon-view"
          :title="$t('common:button:preview')"
          @click.stop="preview"
        />
        <i class="el-icon-delete" :title="$t('common:button:delete')" />
      </div>
      <!--大型医用设备上岗证-->
      <div class="file_title">
        {{ $t('curriculumVitae:certificate:fileTitle:workPermit') }}
      </div>
      <template v-if="true">
        <div class="file_title">
          {{ $t('curriculumVitae:certificate:fileTitle:CT') }}
        </div>
        <div v-for="item in [1, 2]" :key="item">
          <div class="file">
            <div class="name">简历1</div>
            <i
              class="el-icon-view"
              :title="$t('common:button:preview')"
              @click.stop="preview"
            />
            <i class="el-icon-delete" :title="$t('common:button:delete')" />
          </div>
        </div>
      </template>
      <div class="noData" v-else>{{ $t('curriculumVitae:noData') }}</div>
      <div class="btnBox">
        <div style="position: relative">
          <el-button
            type="primary"
            size="small"
            :disabled="loading"
            :loading="loading"
          >
            {{ $t('curriculumVitae:certificate:btn:upload') }}
          </el-button>
          <input
            type="file"
            name="file"
            multiple
            ref="upload"
            :title="$t('curriculumVitae:certificate:btn:upload')"
            style="
              position: absolute;
              top: 0;
              left: 0;
              width: 100%;
              height: 100%;
              opacity: 0;
              cursor: pointer;
            "
            :accept="faccept.join(',')"
            @change="($event) => beginScanFiles($event)"
          />
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import PreviewFile from '@/components/PreviewFile/index'
export default {
  name: 'certificate',
  components: {
    PreviewFile,
  },
  data() {
    return {
      faccept: ['.pdf'],
      loading: false,
    }
  },
  methods: {
    preview() {
      this.$preview({
        path: '',
        type: '',
        title: '',
      })
    },
    beginScanFiles(e) {
      let files = e.target.files
    },
  },
}
</script>
<style lang="scss" scoped>
</style>