[测评系统]--前端(用户答题页面)
林致杰
2022-04-14 7fdd018b85633b81f1d97aa1afdb8c67f6f9eaa4
除JAQ外答题结束显示下载链接
10个文件已修改
38 ■■■■ 已修改文件
src/lang/en.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/lang/th.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/lang/zh.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/demography/langOption.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/demography/login.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/paper/do.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/paper/doPuzzle.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/paper/finish.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/paper/job.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/paper/personality.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/lang/en.js
@@ -1,7 +1,7 @@
export default {
  start: 'Continue testing',
  submission: 'submit',
  down: 'download',
  down: 'download report',
  lastQuestion: 'Last',
  nextQuestion: 'Next',
  recommendedTime: 'Recommended Time:',
src/lang/th.js
@@ -1,7 +1,7 @@
export default {
  start: 'Continue testing',
  submission: 'submit',
  down: 'download',
  down: 'download report',
  lastQuestion: 'Last',
  nextQuestion: 'Next',
  recommendedTime: 'Recommended Time:',
src/lang/zh.js
@@ -1,7 +1,7 @@
export default {
  start: '继续测试',
  submission: ' 提交',
  down: '下载',
  down: '下载报告',
  lastQuestion: '回到上一题',
  nextQuestion: '下一题',
  recommendedTime: '建议时间:',
src/views/demography/langOption.vue
@@ -84,7 +84,7 @@
      if (_this.reportTemplateId.trim() === '' || _this.reportTemplateId.trim() === null) {
        examPaperApi.selectTokenId(_this.memberToken).then(re => {
          if (re.response.finish === 1) {
            _this.$router.push({ path: '/exam/finish', query: { name: '', content: _this.$t('finishMsg') } })
            _this.$router.push({ path: '/exam/finish', query: { name: '', content: _this.$t('finishMsg'), tokenId: _this.memberToken } })
          } else {
            _this.setReportTemplateId(re.response.reportTemplateId)
            demographyApi.queryLangList(_this.memberToken, _this.reportTemplateId).then(function (result) {
src/views/demography/login.vue
@@ -31,7 +31,7 @@
    // 已经答完了不能答题
    examPaperApi.selectTokenId(_this.paraMemberToken).then(re => {
      if (re.response.finish === 1) {
        _this.$router.push({ path: '/exam/finish', query: { name: '', content: _this.$t('finishMsg') } })
        _this.$router.push({ path: '/exam/finish', query: { name: '', content: _this.$t('finishMsg'), tokenId: _this.paraMemberToken } })
      } else if (re.response.status !== '1') {
        _this.$router.push({ path: '/exam/exception', query: { name: '', content: _this.statusInfo[re.response.status] } })
      } else {
src/views/exam/paper/do.vue
@@ -251,7 +251,7 @@
      let _this = this
      examPaperAnswerApi.answerSubmit(this.answer, _this.memberToken).then(re => {
        if (re.code === 1) {
          _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess } })
          _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess, tokenId: _this.memberToken } })
        } else {
          _this.$message.error(re.message + '/exam/finish')
        }
src/views/exam/paper/doPuzzle.vue
@@ -241,7 +241,7 @@
      let _this = this
      examPaperAnswerApi.answerSubmit(this.answer, _this.memberToken).then(re => {
        if (re.code === 1) {
          _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess } })
          _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess, tokenId: _this.memberToken } })
        } else {
          _this.$message.error(re.message)
        }
src/views/exam/paper/finish.vue
@@ -6,7 +6,7 @@
      <el-main class="align-center">
        <H1 v-if="content!==null && content.trim()!==''">{{content}}</H1>
        <H1 v-else>{{$t('finishMsg')}}</H1>
        <el-button type="danger" :disabled="downDisable" @click="downReport" round>{{$t('down')}}</el-button>
        <el-button type="danger" v-if ="downDisable" @click="downReport" round>{{$t('down')}}</el-button>
      </el-main>
    </el-container>
  </div>
@@ -14,22 +14,24 @@
<script>
import examPaperApi from '@/api/examPaper'
import {mapState} from "vuex";
export default {
  data () {
    return {
      name: this.$route.query.name,
      content: this.$route.query.content,
      downDisable: true,
      tokenId: this.$route.query.tokenId,
      downDisable: false,
      downUrl: ''
    }
  },
  created () {
    let _this = this
    examPaperApi.selectTesterReport(_this.memberToken).then(re => {
    // 查询报告文件名
    examPaperApi.selectTesterReport(_this.tokenId).then(re => {
      if (re.code === 0) {
        _this.downDisable = false
        _this.downUrl = re.msg
        _this.downDisable = true
        // 设置下载路径
        _this.downUrl = '/api/exam/paper/download?fileName=' + re.msg + '&delete=false'
        console.log(re)
      } else {
        console.log(re)
@@ -42,13 +44,13 @@
  beforeDestroy () {
  },
  methods: {
    // 下载报告
    downReport: function () {
      let _this = this
      examPaperApi.down(_this.downUrl)
      window.open(_this.downUrl)
    }
  },
  computed: {
    ...mapState('user', { memberToken: state => state.memberToken })
  }
}
</script>
src/views/exam/paper/job.vue
@@ -353,7 +353,7 @@
      let answerSubmit = _this.getSubmitAnswerValue()
      examPaperAnswerApi.answerSubmit(answerSubmit, _this.memberToken).then(re => {
        if (re.code === 1) {
          _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess } })
          _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess, tokenId: _this.memberToken } })
        } else {
          _this.$message.error(re.message + '/exam/finish')
        }
src/views/exam/paper/personality.vue
@@ -166,7 +166,7 @@
                }
                if (_this.isForFinish(i)) {
                  _this.$router.push({ path: '/exam/finish', query: { name: '', content: _this.$t('finishMsg') } })
                  _this.$router.push({ path: '/exam/finish', query: { name: '', content: _this.$t('finishMsg'), tokenId: _this.memberToken } })
                }
              }
              // 如果上一题不是本段,则不能返回上一段
@@ -464,7 +464,7 @@
      examPaperAnswerApi.answerSubmit(answerSubmit, _this.memberToken).then(re => {
        loading.close()
        if (re.code === 1) {
          _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess } })
          _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess, tokenId: _this.memberToken } })
        } else {
          _this.$message.error(re.message + '/exam/finish')
        }