提交 2a0c3ee0 authored 作者: 王鹏飞's avatar 王鹏飞

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

上级 2d2ac3b6
...@@ -37,28 +37,13 @@ ...@@ -37,28 +37,13 @@
<template v-if="item.computed"> <template v-if="item.computed">
<div v-html="item.computed(material[item.code])"></div> <div v-html="item.computed(material[item.code])"></div>
</template> </template>
<template v-else-if="item.isMultiple && item.code !== 'educations'"> <template v-else-if="item.isMultiple">
<div class="group" v-for="(data, index) in material[item.code]" :key="index"> <div class="group" v-if="item.code === 'educations'">
<dl
v-for="subitem in item.items"
:key="subitem.code"
v-if="subitem.visible ? subitem.visible() : true"
>
<dt>{{ subitem.label }}</dt>
<dd>
<template v-if="subitem.computed">
<div v-html="subitem.computed(data)"></div>
</template>
<template v-else>{{ data[subitem.code] }}</template>
</dd>
</dl>
</div>
</template>
<template v-else-if="item.isMultiple && item.code === 'educations'">
<div style="margin-bottom:20px;padding-bottom: 10px;border-bottom: 1px solid #f1f1f1;">
<dl> <dl>
<dt>当前状态:</dt> <dt>当前状态:</dt>
<dd>{{ material.basic_info.education_status }}</dd> <dd>{{ material.basic_info.education_status }}</dd>
</dl>
<dl>
<dt>GPA:</dt> <dt>GPA:</dt>
<dd>{{ material.basic_info.gpa_score }}</dd> <dd>{{ material.basic_info.gpa_score }}</dd>
</dl> </dl>
...@@ -135,6 +120,7 @@ ...@@ -135,6 +120,7 @@
>删除</el-button >删除</el-button
> >
<el-button size="mini" :disabled="item.status === 'LOG'" @click="handleSave(item)">存档</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> </el-button-group>
</li> </li>
</ul> </ul>
...@@ -165,7 +151,8 @@ ...@@ -165,7 +151,8 @@
import 'viewerjs/dist/viewer.css' import 'viewerjs/dist/viewer.css'
import Viewer from 'viewerjs' import Viewer from 'viewerjs'
import * as api from '@/api/my' import * as api from '@/api/my'
import { saveAs } from 'file-saver'
import { pinyin } from 'pinyin-pro'
// 行业类别 // 行业类别
const industryList = [ const industryList = [
{ label: '互联网/电子商务', value: '1 ' }, { label: '互联网/电子商务', value: '1 ' },
...@@ -483,6 +470,44 @@ export default { ...@@ -483,6 +470,44 @@ export default {
navbar: false, navbar: false,
toolbar: { zoomIn: true, zoomOut: true, rotateLeft: true, rotateRight: true } 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() { beforeMount() {
......
差异被折叠。
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"js-file-download": "^0.4.12", "js-file-download": "^0.4.12",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"nuxt": "^2.15.3", "nuxt": "^2.15.3",
"pinyin-pro": "^3.11.0",
"qrcode.vue": "^1.7.0", "qrcode.vue": "^1.7.0",
"qs": "^6.10.1", "qs": "^6.10.1",
"swiper": "^5.4.5", "swiper": "^5.4.5",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论