<template>
|
<div>
|
<el-container class="app-item-contain">
|
<el-header class="align-center" style="height: 0px; margin: 8%;">
|
</el-header>
|
<el-main class="align-center">
|
<H2 v-if="content!==null && content.trim()!==''">{{content}}</H2>
|
<H2 v-else>{{$t('finishMsg')}}</H2>
|
<el-button type="danger" @click="closePage" round>{{$t('close')}}</el-button>
|
<!-- 新增下载报告提示语 -->
|
<H2 v-if ="downDisable">{{$t('finishPersonalityDownInfo')}}</H2>
|
<el-button type="success" v-if ="downDisable" @click="downReport" round>{{$t('down')}}</el-button>
|
<!-- 新增预览提示语 -->
|
<!-- <H1 v-if ="viewDisable">{{$t('finishViewReportInfo')}}</H1>-->
|
<!-- <el-button type="danger" v-if ="viewDisable" @click="viewReport" round>{{$t('view')}}</el-button>-->
|
<!-- -->
|
<H2 v-if ="type == 'CIAQ'">{{$t('finishViewReportInfo')}}</H2>
|
<el-button type="danger" v-if ="type == 'CIAQ'" @click="viewReportH5" round>{{$t('view')}}</el-button>
|
</el-main>
|
</el-container>
|
</div>
|
</template>
|
|
<script>
|
import examPaperApi from '@/api/examPaper'
|
export default {
|
data () {
|
return {
|
name: this.$route.query.name,
|
content: this.$route.query.content,
|
tokenId: this.$route.query.tokenId,
|
type: this.$route.query.type,
|
downDisable: false,
|
viewDisable: false,
|
downUrl: '',
|
viewUrl: ''
|
}
|
},
|
created () {
|
let _this = this
|
// 查询报告文件名
|
examPaperApi.selectTesterReport(_this.tokenId).then(re => {
|
if (re.code === 0) {
|
_this.downDisable = true
|
// 设置下载路径
|
_this.downUrl = '/api/exam/paper/download?fileName=' + re.msg + '&delete=false'
|
console.log(re)
|
} else {
|
console.log(re)
|
}
|
})
|
|
// CIAQ PDF预览Url
|
// examPaperApi.selectTesterReportUrl(_this.tokenId).then(re => {
|
// if (re.code === 0) {
|
// _this.viewDisable = true
|
// // 设置预览路径
|
// _this.viewUrl = re.msg
|
// console.log(re)
|
// } else {
|
// console.log(re)
|
// }
|
// })
|
},
|
mounted () {
|
|
},
|
beforeDestroy () {
|
},
|
methods: {
|
|
// 下载报告
|
downReport: function () {
|
let _this = this
|
window.open(_this.downUrl)
|
},
|
// 关闭页面
|
closePage: function () {
|
window.close()
|
},
|
// 预览报告
|
viewReport: function () {
|
let _this = this
|
_this.$router.push({ path: '/report/view', query: { fileUrl: _this.viewUrl } })
|
},
|
// 预览报告(H5)
|
viewReportH5: function () {
|
let _this = this
|
_this.$router.push({ path: '/report/h5', query: { tokenId: _this.tokenId } })
|
},
|
isMobile () {
|
let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
|
return flag
|
}
|
},
|
computed: {
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.align-center {
|
text-align: center
|
}
|
|
.exam-question-item {
|
padding: 10px;
|
|
.el-form-item__label {
|
font-size: 15px !important;
|
}
|
}
|
|
.question-title-padding {
|
padding-left: 25px;
|
padding-right: 25px;
|
}
|
</style>
|