MarkHeader.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div
  3. class="flex gap-4 justify-between items-center bg-blue-100"
  4. style="z-index: 10000; position: relative; font-size: 16px; height: 40px"
  5. >
  6. <div>
  7. <a href="/mark/subject-select">{{ store.setting.subject?.name }}</a>
  8. </div>
  9. <div class="flex">
  10. <div>考生编号:{{ store.currentTask?.studentCode }}</div>
  11. <div v-if="store.currentTask?.objectiveScore">
  12. 考生编号:{{ store.currentTask?.objectiveScore }}
  13. </div>
  14. </div>
  15. <ul class="flex gap-2 mb-0">
  16. <li>已评{{ store.status.markedCount }}</li>
  17. <li v-if="store.setting.topCount">分配{{ store.setting.topCount }}</li>
  18. <li>未评{{ store.status.totalCount - store.status.markedCount }}</li>
  19. <li
  20. :title="`问题卷${store.status.problemCount}\n待仲裁${store.status.arbitrateCount}`"
  21. style="line-height: 20px"
  22. >
  23. <QuestionCircleOutlined :style="{ 'font-size': '20px' }" />
  24. </li>
  25. <li>进度{{ progress }}%</li>
  26. </ul>
  27. <ul class="flex gap-2 mb-0">
  28. <li @click="upScale" title="放大" style="line-height: 20px">
  29. <PlusCircleOutlined :style="{ 'font-size': '20px' }" />
  30. </li>
  31. <li @click="downScale" title="缩小" style="line-height: 20px">
  32. <MinusCircleOutlined :style="{ 'font-size': '20px' }" />
  33. </li>
  34. <li @click="normalScale" title="适应" style="line-height: 20px">
  35. <FullscreenOutlined :style="{ 'font-size': '20px' }" />
  36. </li>
  37. </ul>
  38. <div @click="toggleHistory" style="line-height: 20px" title="回看">
  39. <HistoryOutlined :style="{ 'font-size': '20px' }" />
  40. </div>
  41. <div
  42. class="flex place-items-center"
  43. :title="
  44. '评卷时间段:' +
  45. $filters.datetimeFilter(store.setting.startTime) +
  46. ' ~ ' +
  47. $filters.datetimeFilter(store.setting.startTime)
  48. "
  49. >
  50. <ClockCircleOutlined
  51. :style="{ 'font-size': '20px' }"
  52. style="line-height: 20px"
  53. />
  54. </div>
  55. <div>{{ group?.title }}(切换)</div>
  56. <div class="flex place-items-center">
  57. <UserOutlined
  58. :style="{ 'font-size': '18px' }"
  59. style="line-height: 18px"
  60. />{{ store.setting.marker?.name }}
  61. </div>
  62. <div class="flex place-items-center">
  63. <PoweroffOutlined
  64. :style="{ 'font-size': '18px' }"
  65. style="line-height: 18px"
  66. />退出
  67. </div>
  68. </div>
  69. </template>
  70. <script lang="ts">
  71. import { getHistoryTask } from "@/api/markPage";
  72. import { computed, defineComponent } from "vue";
  73. import { store } from "./store";
  74. import {
  75. PlusCircleOutlined,
  76. MinusCircleOutlined,
  77. FullscreenOutlined,
  78. HistoryOutlined,
  79. UserOutlined,
  80. PoweroffOutlined,
  81. ClockCircleOutlined,
  82. QuestionCircleOutlined,
  83. } from "@ant-design/icons-vue";
  84. export default defineComponent({
  85. name: "MarkHeader",
  86. components: {
  87. PlusCircleOutlined,
  88. MinusCircleOutlined,
  89. FullscreenOutlined,
  90. HistoryOutlined,
  91. UserOutlined,
  92. PoweroffOutlined,
  93. ClockCircleOutlined,
  94. QuestionCircleOutlined,
  95. },
  96. setup() {
  97. const progress = computed(() => {
  98. const { totalCount, markedCount } = store.status;
  99. if (totalCount <= 0) return 0;
  100. let p = markedCount / totalCount;
  101. if (p < 0.01 && markedCount >= 1) p = 0.01;
  102. p = Math.floor(p * 100);
  103. return p;
  104. });
  105. const group = computed(() => {
  106. return store.groups.find((g) => g.number === store.setting.groupNumber);
  107. });
  108. const upScale = () => {
  109. const s = store.setting.uiSetting["answer.paper.scale"];
  110. if (s < 3)
  111. store.setting.uiSetting["answer.paper.scale"] = +(s + 0.2).toFixed(1);
  112. };
  113. const downScale = () => {
  114. const s = store.setting.uiSetting["answer.paper.scale"];
  115. if (s > 0.2)
  116. store.setting.uiSetting["answer.paper.scale"] = +(s - 0.2).toFixed(1);
  117. };
  118. const normalScale = () => {
  119. store.setting.uiSetting["answer.paper.scale"] = 1;
  120. };
  121. const toggleHistory = () => {
  122. store.historyOpen = !store.historyOpen;
  123. };
  124. async function updateHistoryTask({
  125. pageNumber = 1,
  126. pageSize = 10,
  127. order = "markerTime",
  128. sort = "DESC",
  129. secretNumber = null,
  130. }: {
  131. pageNumber: number; // 从1开始
  132. pageSize: number;
  133. order: "markerTime" | "markerScore";
  134. sort: "ASC" | "DESC";
  135. secretNumber: string | null;
  136. }) {
  137. const res = await getHistoryTask({
  138. pageNumber,
  139. pageSize,
  140. order,
  141. sort,
  142. secretNumber,
  143. });
  144. if (res.data) {
  145. store.historyTasks.push(res.data);
  146. }
  147. }
  148. return {
  149. store,
  150. progress,
  151. group,
  152. upScale,
  153. downScale,
  154. normalScale,
  155. updateHistoryTask,
  156. toggleHistory,
  157. };
  158. },
  159. });
  160. </script>