ViewPaper.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div style="position: relative">
  3. <LinkTitlesCustom :currentPaths="['试卷检查', '试卷列表', '试卷详情']" />
  4. <div style="position: absolute;right: 10px;">
  5. <el-button
  6. type="success"
  7. size="small"
  8. @click="back"
  9. style="padding-bottom:8px;"
  10. icon="el-icon-arrow-left"
  11. >返回</el-button
  12. >
  13. </div>
  14. <br />
  15. <div style="margin-left:50px;width: 95%;height: 80%" v-html="html"></div>
  16. </div>
  17. </template>
  18. <script>
  19. import { mapState } from "vuex";
  20. import { DATA_PROCESS_API } from "@/constants/constants";
  21. import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
  22. export default {
  23. data() {
  24. return {
  25. workId: "",
  26. examId: "",
  27. studentPaperId: "",
  28. examType: "",
  29. html: ""
  30. };
  31. },
  32. components: {
  33. LinkTitlesCustom
  34. },
  35. computed: {
  36. ...mapState({ user: state => state.user })
  37. },
  38. methods: {
  39. back() {
  40. var url =
  41. "/marking/mark_paper_check/" +
  42. this.workId +
  43. "/" +
  44. this.examId +
  45. "/" +
  46. this.examType;
  47. this.$router.push({
  48. path: url
  49. });
  50. },
  51. getStudentPaper() {
  52. var url =
  53. DATA_PROCESS_API +
  54. "/studentPapers/" +
  55. this.studentPaperId +
  56. "/" +
  57. this.examType;
  58. this.$http.get(url).then(response => {
  59. console.log(response);
  60. this.html = response.data.studentSubjectiveHtml;
  61. });
  62. }
  63. },
  64. created() {
  65. this.workId = this.$route.params.workId;
  66. this.examId = this.$route.params.examId;
  67. this.studentPaperId = this.$route.params.studentPaperId;
  68. this.examType = this.$route.params.examType;
  69. this.getStudentPaper();
  70. }
  71. };
  72. </script>