提交 50abe3c6 authored 作者: 王鹏飞's avatar 王鹏飞

chore(报名申请): 预览增加下载

上级 cfd95b06
......@@ -38,13 +38,12 @@
<div v-html="item.computed(material[item.code])"></div>
</template>
<template v-else-if="item.isMultiple">
<div
v-if="item.code === 'educations'"
style="margin-bottom:20px;padding-bottom: 10px;border-bottom: 1px solid #f1f1f1;"
>
<div class="group" v-if="item.code === 'educations'">
<dl>
<dt>当前状态:</dt>
<dd>{{ material.basic_info.education_status }}</dd>
</dl>
<dl>
<dt>GPA:</dt>
<dd>{{ material.basic_info.gpa_score }}</dd>
</dl>
......@@ -110,6 +109,7 @@
>删除</el-button
>
<el-button size="mini" :disabled="item.status === 'LOG'" @click="handleSave(item)">存档</el-button>
<el-button size="mini" @click="handleDownload(item)">下载</el-button>
</el-button-group>
</li>
</ul>
......@@ -140,7 +140,8 @@
import 'viewerjs/dist/viewer.css'
import Viewer from 'viewerjs'
import * as api from '@/api/my'
import { saveAs } from 'file-saver'
import { pinyin } from 'pinyin-pro'
// 行业类别
const industryList = [
{ label: '互联网/电子商务', value: '1 ' },
......@@ -449,6 +450,44 @@ export default {
navbar: false,
toolbar: { zoomIn: true, zoomOut: true, rotateLeft: true, rotateRight: true }
})
},
capFirst(str) {
return str[0].toUpperCase() + str.slice(1)
},
// 下载
handleDownload(data) {
const fileUrl = data.oss_sign_url.replace(/^http:\/\//, 'https://')
const pinyinNameArray = pinyin(this.material.basic_info.real_name_cn, {
mode: 'surname',
toneType: 'none',
nonZh: 'consecutive',
type: 'array'
})
const [pinyinFirst, ...pinyinRest] = pinyinNameArray
const pinyinName = `${this.capFirst(pinyinFirst)} ${this.capFirst(pinyinRest.join(''))}`
const map = {
RESUME_CN: `CV-${pinyinName}`, // 个人简历
RESUME_EN: `CV-${pinyinName}`, // 个人简历
PROOF_READING: 'Diploma verification-Chinese', // 毕业证/在读证明(中文)
DIPLOMA_CN: 'Diploma verification-Chinese', // 毕业证/在读证明(中文)
DIPLOMA_EN: 'Diploma verification-English', // 毕业证/在读证明(英文)
INTERNATIONAL_LANGUAGE_SCORE: 'English proficiency', // 英语语言成绩单
ID_CARD_FRONT: `ID-${pinyinName}`, // 身份证
ID_CARD_BACK: `ID-${pinyinName}`, // 身份证
HK_ID_CARD: `ID-${pinyinName}`, // 身份证
PASSPORT: `ID-${pinyinName}`, // 身份证
OTHER_ID_CARD_PHOTO: `ID-${pinyinName}`, // 身份证
PERSONAL_STATEMENT: 'Personal statement', // 个人陈述
RECOMMENDATION_LETTER: 'Recommendation letter 1', // 推荐信1
RECOMMENDATION_LETTER_2: 'Recommendation letter 2', // 推荐信2
REPORT_CARD_CN: 'Transcript-Chinese', // 成绩单中文版
REPORT_CARD_EN: 'Transcript-English' // 成绩单英文版
}
fetch(fileUrl)
.then(res => res.blob())
.then(blob => {
saveAs(blob, map[data.file_type_id] || data.file_type_label)
})
}
},
beforeMount() {
......
差异被折叠。
......@@ -20,6 +20,7 @@
"js-file-download": "^0.4.12",
"lodash": "^4.17.21",
"nuxt": "^2.15.3",
"pinyin-pro": "^3.11.0",
"qrcode.vue": "^1.7.0",
"qs": "^6.10.1",
"swiper": "^5.4.5",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论