[测评系统]--前端(用户答题页面)
林致杰
2023-05-01 ba3091c2e072d728344bc04db8adb1b5dece2bf0
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
<template>
  <div>
    <el-container class="app-item-contain">
      <el-header class="align-center" style="height: 50px;padding: 1%;">
        <H2 v-html="$t('guide')" v-if="formDo.questionTemplateId !== 'job' || formDo.questionTemplateId !== 'values'"></H2>
      </el-header>
      <el-main style="padding-top:0%">
        <div v-html="formDo.guide"></div>
        <el-row class="do-align-center">
          <el-button @click="doExam" type="primary" round>{{$t('startDo')}}</el-button>
          <el-button v-if="formDo.questionTemplateId === 'job'" @click="openExplain" type="danger" round>打开岗位说明</el-button>
        </el-row>
      </el-main>
    </el-container>
  </div>
</template>
 
<script>
import { mapState } from 'vuex'
import examPaperApi from '@/api/examPaper'
export default {
  data () {
    return {
      formDo: this.$route.query.formDo
    }
  },
  created () {
  },
  mounted () {
 
  },
  beforeDestroy () {
    window.clearInterval(this.timer)
  },
  methods: {
    doExam: function () {
      let _this = this
      examPaperApi.updateTestMemberStatus(_this.memberToken).then(re => {
        _this.$router.push({ path: '/exam/' + _this.doUrl, query: { formDo: _this.$route.query.formDo } })
      }).catch(re => {
        _this.$message.error(re.message + ' 更新状态失败')
      })
    },
    openExplain: function () {
      let _this = this
      window.open(_this.formDo.jobDescriptionFile)
    }
  },
  computed: {
    ...mapState('exam', { doUrl: state => state.doUrl }),
    ...mapState('user', { memberToken: state => state.memberToken })
  }
}
</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>