WorkOverview.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div class="overview">
  3. <div class="overview-head" v-if="overviewInfo.workName">
  4. <h1 class="overview-title">{{ overviewInfo.workName }}</h1>
  5. <div class="overview-infos">
  6. <ul class="overview-list">
  7. <li>
  8. <p>考生总数</p>
  9. <p>{{ overviewInfo.stuTotalCount }}</p>
  10. </li>
  11. <li>
  12. <p>缺考数量</p>
  13. <p>{{ overviewInfo.stuAbsentCount }}</p>
  14. </li>
  15. <li>
  16. <p>试卷总数</p>
  17. <p>{{ overviewInfo.paperCount }}</p>
  18. </li>
  19. <li>
  20. <p>评卷员总数</p>
  21. <p>{{ overviewInfo.markerCount }}</p>
  22. </li>
  23. <li>
  24. <p>试题套数</p>
  25. <p>{{ overviewInfo.questionCount }}</p>
  26. </li>
  27. </ul>
  28. </div>
  29. <div class="overview-actions">
  30. <Button
  31. type="primary"
  32. icon="md-download"
  33. @click="download(exportGradeScoreUrl)"
  34. >导出档位成绩</Button
  35. >
  36. <Button
  37. type="primary"
  38. icon="md-download"
  39. @click="download(exportScoreUrl)"
  40. >导出分数成绩</Button
  41. >
  42. </div>
  43. </div>
  44. <div class="overview-body">
  45. <div
  46. class="overview-subject"
  47. v-for="(subject, index) in overviewInfo.subjectOverviews"
  48. :key="index"
  49. >
  50. <div class="subject-content">
  51. <h2 class="subject-name">{{ subject.subjectName }}</h2>
  52. <div class="subject-infos">
  53. <ul class="overview-list">
  54. <li>
  55. <p>已上传</p>
  56. <p>{{ subject.uploadedCount }}</p>
  57. </li>
  58. <li>
  59. <p>未采集</p>
  60. <p>{{ subject.leftCount }}</p>
  61. </li>
  62. <li>
  63. <p>进度</p>
  64. <p>{{ subject.progress }}</p>
  65. </li>
  66. </ul>
  67. </div>
  68. <div class="subject-actions">
  69. <p>当前阶段</p>
  70. <p>{{ subject.markStageName }}</p>
  71. <div class="subject-actions-detail">
  72. <Button
  73. icon="md-download"
  74. @click="download(subject.exportAbsentDataUrl)"
  75. >导出缺考名单</Button
  76. >
  77. <Button @click="toCommit(subject)">评卷管理</Button>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </template>
  85. <script>
  86. import { workOverviewDetail } from "@/api";
  87. import { SUBJECT_STAGE } from "@/constants/enumerate";
  88. export default {
  89. name: "overview",
  90. data() {
  91. return {
  92. workId: this.$route.params.workId,
  93. SUBJECT_STAGE,
  94. exportGradeScoreUrl: "",
  95. exportScoreUrl: "",
  96. overviewInfo: {
  97. subjectOverviews: []
  98. }
  99. };
  100. },
  101. mounted() {
  102. this.getDetail();
  103. this.exportGradeScoreUrl = `${this.GLOBAL.domain}/export/score/exportLevelResult?workId=${this.workId}`;
  104. this.exportScoreUrl = `${this.GLOBAL.domain}/export/score/exportScoreResult?workId=${this.workId}`;
  105. },
  106. methods: {
  107. async getDetail() {
  108. const data = await workOverviewDetail(this.workId);
  109. data.subjectOverviews.map(item => {
  110. item.markStageName = SUBJECT_STAGE[item.markStage];
  111. item.exportAbsentDataUrl = `${this.GLOBAL.domain}/export/users/${this.workId}/${item.subject}/export`;
  112. item.progress =
  113. item.uploadedCount + item.leftCount
  114. ? (
  115. (100 * item.uploadedCount) /
  116. (item.uploadedCount + item.leftCount)
  117. ).toFixed(1) + "%"
  118. : "0.0%";
  119. });
  120. this.overviewInfo = data;
  121. },
  122. download(url) {
  123. window.open(url);
  124. },
  125. toCommit(subject) {
  126. const routerName = subject.markStage === "LEVEL" ? "Grading" : "Mark";
  127. this.$router.push({
  128. name: routerName,
  129. params: { workId: this.workId, subjectId: subject.subjectId }
  130. });
  131. }
  132. }
  133. };
  134. </script>