林致杰
2023-04-25 f312c93d1886b599b37889d226691476145c0c23
CIAQ报告预览支持
2个文件已添加
8个文件已修改
182 ■■■■ 已修改文件
package-lock.json 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/SETPOINT职业兴趣量表反馈报告1.0.pdf 补丁 | 查看 | 原始文档 | blame | 历史
src/lang/en.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/lang/th.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/lang/zh.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/paper/career_interests.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/paper/finish.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pdf/h5.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json
@@ -2514,8 +2514,8 @@
    },
    "async-validator": {
      "version": "1.8.5",
      "resolved": "http://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz",
      "integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=",
      "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-1.8.5.tgz",
      "integrity": "sha512-tXBM+1m056MAX0E8TL2iCjg8WvSyXu0Zc8LNtYqrVeyoL3+esHRZ4SieE9fKQyyU09uONjnMEjrNBMqT0mbvmA==",
      "requires": {
        "babel-runtime": "6.x"
      }
@@ -2717,8 +2717,8 @@
    },
    "babel-helper-vue-jsx-merge-props": {
      "version": "2.0.3",
      "resolved": "http://registry.npm.taobao.org/babel-helper-vue-jsx-merge-props/download/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
      "integrity": "sha1-Iq69OzOQIyjlEyk6jkmSs4T58bY="
      "resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
      "integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg=="
    },
    "babel-loader": {
      "version": "8.0.6",
@@ -3568,7 +3568,8 @@
      "version": "4.6.0",
      "resolved": "http://registry.npm.taobao.org/co/download/co-4.6.0.tgz",
      "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
      "dev": true
      "dev": true,
      "optional": true
    },
    "coa": {
      "version": "2.0.2",
@@ -4364,8 +4365,7 @@
    "de-indent": {
      "version": "1.0.2",
      "resolved": "http://registry.npm.taobao.org/de-indent/download/de-indent-1.0.2.tgz",
      "integrity": "sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=",
      "dev": true
      "integrity": "sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0="
    },
    "debug": {
      "version": "4.1.1",
@@ -4737,9 +4737,9 @@
      "dev": true
    },
    "element-ui": {
      "version": "2.10.1",
      "resolved": "https://registry.npm.taobao.org/element-ui/download/element-ui-2.10.1.tgz?cache=0&sync_timestamp=1562053824530&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-ui%2Fdownload%2Felement-ui-2.10.1.tgz",
      "integrity": "sha1-EBEBblDnb12ub7+chuU7blP8ues=",
      "version": "2.15.13",
      "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.13.tgz",
      "integrity": "sha512-LJoatEYX6WV74FqXBss8Xfho9fh9rjDSzrDrTyREdGb1h1R3uRvmLh5jqp2JU137aj4/BgqA3K06RQpQBX33Bg==",
      "requires": {
        "async-validator": "~1.8.1",
        "babel-helper-vue-jsx-merge-props": "^2.0.0",
@@ -6115,7 +6115,8 @@
        "ansi-regex": {
          "version": "2.1.1",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "aproba": {
          "version": "1.2.0",
@@ -6136,12 +6137,14 @@
        "balanced-match": {
          "version": "1.0.0",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "brace-expansion": {
          "version": "1.1.11",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "balanced-match": "^1.0.0",
            "concat-map": "0.0.1"
@@ -6156,17 +6159,20 @@
        "code-point-at": {
          "version": "1.1.0",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "concat-map": {
          "version": "0.0.1",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "console-control-strings": {
          "version": "1.1.0",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "core-util-is": {
          "version": "1.0.2",
@@ -6283,7 +6289,8 @@
        "inherits": {
          "version": "2.0.3",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "ini": {
          "version": "1.3.5",
@@ -6295,6 +6302,7 @@
          "version": "1.0.0",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "number-is-nan": "^1.0.0"
          }
@@ -6309,6 +6317,7 @@
          "version": "3.0.4",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "brace-expansion": "^1.1.7"
          }
@@ -6316,12 +6325,14 @@
        "minimist": {
          "version": "0.0.8",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "minipass": {
          "version": "2.3.5",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "safe-buffer": "^5.1.2",
            "yallist": "^3.0.0"
@@ -6340,6 +6351,7 @@
          "version": "0.5.1",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "minimist": "0.0.8"
          }
@@ -6420,7 +6432,8 @@
        "number-is-nan": {
          "version": "1.0.1",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "object-assign": {
          "version": "4.1.1",
@@ -6432,6 +6445,7 @@
          "version": "1.4.0",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "wrappy": "1"
          }
@@ -6517,7 +6531,8 @@
        "safe-buffer": {
          "version": "5.1.2",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "safer-buffer": {
          "version": "2.1.2",
@@ -6553,6 +6568,7 @@
          "version": "1.0.2",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "code-point-at": "^1.0.0",
            "is-fullwidth-code-point": "^1.0.0",
@@ -6572,6 +6588,7 @@
          "version": "3.0.1",
          "bundled": true,
          "dev": true,
          "optional": true,
          "requires": {
            "ansi-regex": "^2.0.0"
          }
@@ -6615,12 +6632,14 @@
        "wrappy": {
          "version": "1.0.2",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        },
        "yallist": {
          "version": "3.0.3",
          "bundled": true,
          "dev": true
          "dev": true,
          "optional": true
        }
      }
    },
@@ -6971,8 +6990,7 @@
    "he": {
      "version": "1.2.0",
      "resolved": "http://registry.npm.taobao.org/he/download/he-1.2.0.tgz",
      "integrity": "sha1-hK5l+n6vsWX922FWauFLrwVmTw8=",
      "dev": true
      "integrity": "sha1-hK5l+n6vsWX922FWauFLrwVmTw8="
    },
    "hex-color-regex": {
      "version": "1.1.0",
@@ -9001,8 +9019,8 @@
    },
    "normalize-wheel": {
      "version": "1.0.1",
      "resolved": "http://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz",
      "integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
      "resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
      "integrity": "sha512-1OnlAPZ3zgrk8B91HyRj+eVv+kS5u+Z0SCsak6Xil/kmgEia50ga7zfkumayonZrImffAxPU/5WcyGhzetHNPA=="
    },
    "normalize.css": {
      "version": "8.0.1",
@@ -9521,6 +9539,11 @@
        "safe-buffer": "^5.0.1",
        "sha.js": "^2.4.8"
      }
    },
    "pdfh5": {
      "version": "1.4.2",
      "resolved": "https://registry.npmmirror.com/pdfh5/-/pdfh5-1.4.2.tgz",
      "integrity": "sha512-1BL8HIx/EEZowRPBgas7/WokbGEv1gxKNRmmHSimG113178mKxIBH4pxWBc0tj6d25Sy+EwnlQwv9cUUmQa42w=="
    },
    "performance-now": {
      "version": "2.1.0",
@@ -10872,8 +10895,8 @@
    },
    "resize-observer-polyfill": {
      "version": "1.5.1",
      "resolved": "http://registry.npm.taobao.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz",
      "integrity": "sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ="
      "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
      "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
    },
    "resolve": {
      "version": "1.10.0",
@@ -10989,7 +11012,8 @@
      "version": "4.0.8",
      "resolved": "http://registry.npm.taobao.org/rx-lite/download/rx-lite-4.0.8.tgz",
      "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
      "dev": true
      "dev": true,
      "optional": true
    },
    "rx-lite-aggregates": {
      "version": "4.0.8",
@@ -11755,6 +11779,11 @@
      "requires": {
        "is-plain-obj": "^1.0.0"
      }
    },
    "sortablejs": {
      "version": "1.10.2",
      "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.2.tgz",
      "integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
    },
    "source-list-map": {
      "version": "2.0.1",
@@ -12569,8 +12598,8 @@
    },
    "throttle-debounce": {
      "version": "1.1.0",
      "resolved": "http://registry.npm.taobao.org/throttle-debounce/download/throttle-debounce-1.1.0.tgz",
      "integrity": "sha1-UYU9o3vmihVctugns1FKPEIuic0="
      "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-1.1.0.tgz",
      "integrity": "sha512-XH8UiPCQcWNuk2LYePibW/4qL97+ZQ1AN3FNXwZRBNPPowo/NRU5fAlDCSNBJIYCKbioZfuYtMhG4quqoJhVzg=="
    },
    "through": {
      "version": "2.3.8",
@@ -13294,7 +13323,6 @@
      "version": "2.6.10",
      "resolved": "http://registry.npm.taobao.org/vue-template-compiler/download/vue-template-compiler-2.6.10.tgz",
      "integrity": "sha1-MjtPNJXwT6o1AzN6gvXWUHeZycw=",
      "dev": true,
      "requires": {
        "de-indent": "^1.0.2",
        "he": "^1.1.0"
@@ -13306,6 +13334,14 @@
      "integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
      "dev": true
    },
    "vuedraggable": {
      "version": "2.24.3",
      "resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.24.3.tgz",
      "integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
      "requires": {
        "sortablejs": "1.10.2"
      }
    },
    "vuex": {
      "version": "3.1.0",
      "resolved": "http://registry.npm.taobao.org/vuex/download/vuex-3.1.0.tgz?cache=0&other_urls=http%3A%2F%2Fregistry.npm.taobao.org%2Fvuex%2Fdownload%2Fvuex-3.1.0.tgz",
package.json
@@ -22,6 +22,7 @@
    "js-cookie": "2.2.0",
    "normalize.css": "8.0.1",
    "nprogress": "0.2.0",
    "pdfh5": "^1.4.2",
    "vue": "2.6.10",
    "vue-i18n": "^8.15.3",
    "vue-router": "^3.0.3",
public/SETPOINTÖ°ÒµÐËȤÁ¿±í·´À¡±¨¸æ1.0.pdf
Binary files differ
src/lang/en.js
@@ -2,6 +2,7 @@
  start: 'Continue testing',
  submission: 'submit',
  down: 'download report',
  view: 'view report',
  lastQuestion: 'Last',
  nextQuestion: 'Next',
  recommendedTime: 'Recommended Time:',
@@ -53,6 +54,7 @@
  finishPersonalityInfo: 'You have completed the personality quetionnaire, and the data has been successfully uploaded to the server and saved. ',
  finishCareerInterestsInfo: 'You have completed the Career Interests quetionnaire, and the data has been successfully uploaded to the server and saved. ',
  finishPersonalityDownInfo: 'You may click the red button below to download your test report.',
  finishViewReportInfo: 'You can click on the red button below to view your result report.',
  langWelcomeThai: 'ยินดีตอนรับสู่เว็บไซย์สำหรับทำแบบทดสอบของ',
  langOptionThai: 'กรุณาเลือกภาษา à¹à¸¥à¸°à¸„ลิก â€œà¸”ำเนินการต่อ.',
    values_finishValuesInfo:'Thank you! Your responses have been submitted. You can close this page now.',
src/lang/th.js
@@ -2,6 +2,7 @@
  start: 'Continue testing',
  submission: 'submit',
  down: 'download report',
  view: 'view report',
  lastQuestion: 'Last',
  nextQuestion: 'Next',
  recommendedTime: 'Recommended Time:',
@@ -53,6 +54,7 @@
  finishPersonalityInfo: 'You have completed the personality quetionnaire, and the data has been successfully uploaded to the server and saved. ',
  finishCareerInterestsInfo: 'You have completed the Career Interests quetionnaire, and the data has been successfully uploaded to the server and saved. ',
  finishPersonalityDownInfo: 'You may click the red button below to download your test report.',
  finishViewReportInfo: 'You can click on the red button below to view your result report.',
  langWelcomeThai: 'ยินดีตอนรับสู่เว็บไซย์สำหรับทำแบบทดสอบของ',
  langOptionThai: 'กรุณาเลือกภาษา à¹à¸¥à¸°à¸„ลิก â€œà¸”ำเนินการต่อ.'
}
src/lang/zh.js
@@ -2,6 +2,7 @@
  start: '继续测试',
  submission: ' æäº¤',
  down: '下载报告',
  view: '查看报告',
  lastQuestion: '回到上一题',
  nextQuestion: '下一题',
  recommendedTime: '建议时间:',
@@ -53,6 +54,7 @@
  finishPersonalityInfo: '您已经完成了人格测试问卷,数据已经成功的上传至服务器,并已经保存好。',
  finishCareerInterestsInfo: '您已经完成了职业兴趣问卷,数据已经成功的上传至服务器,并已经保存好。',
  finishPersonalityDownInfo: '您可以点击下面红色按钮下载您的结果报告。',
  finishViewReportInfo: '您可以点击下面红色按钮查看您的结果报告。',
  langWelcomeThai: 'ยินดีตอนรับสู่เว็บไซย์สำหรับทำแบบทดสอบของ',
  langOptionThai: 'กรุณาเลือกภาษา à¹à¸¥à¸°à¸„ลิก â€œà¸”ำเนินการต่อ.',
    values_finishValuesInfo: '测试结束!您的所有选项数据已经上传至服务器,并已保存好。您可以关闭浏览器,退出答题界面。',
src/router.js
@@ -142,6 +142,18 @@
          meta: { title: 'career_interests' }
        }
      ]
    },
    {
      path: '/pdf',
      component: Layout,
      children: [
        {
          path: 'view',
          component: () => import('@/views/pdf/h5'),
          name: 'h5',
          meta: { title: 'pdf预览' }
        }
      ]
    }
  ]
})
src/views/exam/paper/career_interests.vue
@@ -265,7 +265,13 @@
      if (_this.partOrder !== nowPartOrder) {
        _this.isShowGuide(true)
      }
      _this.preDisable = true
      // å¦‚果上一题不是本段,则不能返回上一段
      if (this.isDiffPartOrder()) {
        _this.preDisable = false
      } else {
        _this.preDisable = true
      }
      _this.nextDisable = false
      _this.answer.answerItems[_this.order].startTime = _this.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
@@ -458,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, tokenId: _this.memberToken } })
          _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess, tokenId: _this.memberToken, type: 'CIAQ' } })
        } else {
          _this.$message.error(re.message + '/exam/finish')
        }
src/views/exam/paper/finish.vue
@@ -9,6 +9,9 @@
        <!-- æ–°å¢žä¸‹è½½æŠ¥å‘Šæç¤ºè¯­ -->
        <H1 v-if ="downDisable">{{$t('finishPersonalityDownInfo')}}</H1>
        <el-button type="danger" 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>
      </el-main>
    </el-container>
  </div>
@@ -22,7 +25,9 @@
      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: ''
    }
  },
@@ -50,6 +55,11 @@
    downReport: function () {
      let _this = this
      window.open(_this.downUrl)
    },
    // ä¸‹è½½æŠ¥å‘Š
    viewReport: function () {
      let _this = this
      _this.$router.push({ path: '/pdf/view', query: { fileUrl: _this.downUrl } })
    }
  },
  computed: {
src/views/pdf/h5.vue
New file
@@ -0,0 +1,45 @@
<template>
  <div class="m-pdf">
    <div id="pdf-content"></div>
  </div>
</template>
<script>
import Pdfh5 from 'pdfh5'
import 'pdfh5/css/pdfh5.css'
export default {
  name: 'Pdfh5',
  data () {
    return {
      pdfh5: null,
      // å¯å¼•入网络文件或者本地文件
      pdfUrl: this.$route.query.fileUrl
      // å¦‚果引入本地pdf文件,需要将pdf放在public文件夹下,引用时使用绝对路径(/:表示public文件夹)
    }
  },
  mounted () {
    this.initPdf()
  },
  methods: {
    initPdf () {
      // pdfh5实例化时传两个参数:selector选择器,options配置项参数,会返回一个pdfh5实例对象,可以用来操作pdf,监听相关事件
      // pdfh5 = new Pdfh5(selector, options) goto初始到第几页,logo设置每一页pdf上的水印
      this.pdfh5 = new Pdfh5('#pdf-content', {
        pdfurl: this.pdfUrl,
        goto: 1
        // è®¾ç½®æ¯ä¸€é¡µpdf上的水印
        // logo: { src: require('@/assets/images/bus/icon_head@2x.png'), x: 420, y: 700, width: 120, height: 120 }
      })
      this.pdfh5.scrollEnable(true) // å…è®¸pdf滚动
      // ç›‘听pdf准备开始渲染,此时可以拿到pdf总页数
      this.pdfh5.on('ready', function () {
        console.log('总页数:' + this.totalNum)
      })
      // ç›‘听pdf加载完成事件,加载失败、渲染成功都会触发
      this.pdfh5.on('complete', (status, msg, time) => {
        console.log('状态:' + status + ',信息:' + msg + ',耗时:' + time + '毫秒')
      })
    }
  }
}
</script>