[测评系统]--前端(用户答题页面)
84702473
2023-03-06 1ad79fa6dd4fdd5165db783d9b624699987ce439
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<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">
        <H1 v-if="content!==null && content.trim()!==''">{{content}}</H1>
        <H1 v-else>{{$t('finishMsg')}}</H1>
        <!-- 新增下载报告提示语 -->
        <H1 v-if ="downDisable">{{$t('finishPersonalityDownInfo')}}</H1>
        <el-button type="danger" v-if ="downDisable" @click="downReport" round>{{$t('down')}}</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,
      downDisable: false,
      downUrl: ''
    }
  },
  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)
      }
    })
  },
  mounted () {
 
  },
  beforeDestroy () {
  },
  methods: {
    // 下载报告
    downReport: function () {
      let _this = this
      window.open(_this.downUrl)
    }
  },
  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>