paper.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="bg-page fx-column fx-cen-cen">
  3. <index-card title="心理健康(MHT)" class="index-block">
  4. <el-button slot="more" v-has-history size="small" round @click="$router.back()">返回</el-button>
  5. <mx-paper :options="options" />
  6. </index-card>
  7. </div>
  8. </template>
  9. <script>
  10. import IndexCard from '@/views/login/components/modules/shared/IndexCard.vue'
  11. import MxPaper from '@/components/MxPaper/mx-paper.vue'
  12. import transferMixin from '@/components/mx-transfer-mixin'
  13. import paperMixin from '@/components/MxPaper/mx-paper-mixin'
  14. import EventBus from '@/components/EventBus'
  15. import {openExamineePaper, scoreExamineeQuestion} from "@/api/webApi/studentEvaluating";
  16. export default {
  17. name: 'MentalHealthPaper',
  18. components: { IndexCard, MxPaper },
  19. mixins: [transferMixin, paperMixin],
  20. data() {
  21. return {
  22. overrideOpts: {
  23. customScoredAction: true,
  24. customCommittedAction: true,
  25. navigatorSpan: 10
  26. }
  27. }
  28. },
  29. computed: {
  30. queryApi() {
  31. // always use openExamineePaper api.
  32. return openExamineePaper
  33. },
  34. scoreApi() {
  35. // always use scoreExamineeQuestion api.
  36. return scoreExamineeQuestion
  37. }
  38. },
  39. mounted() {
  40. EventBus.instance.$on('customScoredAction', () => this.innerLoadPaper())
  41. EventBus.instance.$on('customCommittedAction', () => this.innerLoadPaper())
  42. this.loadPaper(this.prevData, this.overrideOpts)
  43. },
  44. beforeDestroy() {
  45. EventBus.instance.$off('customScoredAction')
  46. EventBus.instance.$off('customCommittedAction')
  47. },
  48. methods: {
  49. innerLoadPaper() {
  50. const next = {
  51. ...this.prevData,
  52. examineeId: this.paper.examineeId
  53. }
  54. const nextRoute = this.$router.resolve({name: 'MentalHealthReport'})
  55. this.transferTo(nextRoute.href, next, null, true)
  56. }
  57. }
  58. }
  59. </script>
  60. <style scoped>
  61. </style>