index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div class="home audit">
  3. <div class="home-head">
  4. <div>
  5. <a-space v-if="userStore.curExam" :size="6">
  6. <span class="head-no">No.{{ userStore.curExam.id }}</span>
  7. <a-tag class="head-mode" color="blue"
  8. >{{ userStore.curExam.mode }}模式</a-tag
  9. >
  10. <h3 class="head-name">{{ userStore.curExam.name }}</h3>
  11. </a-space>
  12. </div>
  13. <div>
  14. <a-button @click="onSwitchExam">
  15. <template #icon><SwapOutlined /></template>切换考试
  16. </a-button>
  17. </div>
  18. </div>
  19. <div class="home-body">
  20. <template v-if="overviewData">
  21. <div class="audit-box">
  22. <div class="audit-box-head">
  23. <h4>实时审核</h4>
  24. </div>
  25. <div class="audit-box-body">
  26. <div class="audit-card">
  27. <div class="audit-card-icon audit-wait"></div>
  28. <div class="audit-card-content">
  29. <p>待审核</p>
  30. <p>{{ overviewData.verifyTask.todoCount }}</p>
  31. </div>
  32. <div class="audit-card-action" @click="toPage('IntimeAudit')">
  33. 进入 <RightOutlined />
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="audit-box">
  39. <div class="audit-box-head">
  40. <h4>人工绑定审核</h4>
  41. </div>
  42. <div class="audit-box-body">
  43. <div class="audit-card">
  44. <div class="audit-card-icon audit-wait"></div>
  45. <div class="audit-card-content">
  46. <p>待审核</p>
  47. <p>{{ overviewData.assignedCheck.todoCount }}</p>
  48. </div>
  49. <div class="audit-card-action" @click="toPage('ReviewAudit')">
  50. 进入 <RightOutlined />
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="audit-box img-check">
  56. <div class="audit-box-head">
  57. <h4>图片检查</h4>
  58. </div>
  59. <div class="audit-box-body">
  60. <div class="audit-card">
  61. <div class="audit-card-icon audit-done"></div>
  62. <div class="audit-card-content">
  63. <p>已审核</p>
  64. <p>{{ overviewData.imageCheckTask.finishCount }}</p>
  65. </div>
  66. </div>
  67. <div class="audit-card">
  68. <div class="audit-card-icon audit-wait"></div>
  69. <div class="audit-card-content">
  70. <p>待审核</p>
  71. <p>{{ overviewData.imageCheckTask.todoCount }}</p>
  72. </div>
  73. <div class="audit-card-action" @click="toPage('ImageCheckAudit')">
  74. 进入 <RightOutlined />
  75. </div>
  76. </div>
  77. </div>
  78. <div class="audit-box-foot">
  79. <a-tag :bordered="false">
  80. <template #icon><PieChartFilled /></template>抽查比例:0%
  81. </a-tag>
  82. <a-space :size="8">
  83. <span>轮播时间配置:</span>
  84. <a-input-number
  85. v-model:value="imageCheckLoopTime"
  86. :min="1"
  87. :max="999"
  88. :precision="0"
  89. :controls="false"
  90. ></a-input-number>
  91. <span>秒/张</span>
  92. <a-button type="primary" @click="onSetLoopTime">设置</a-button>
  93. </a-space>
  94. </div>
  95. </div>
  96. </template>
  97. </div>
  98. </div>
  99. <!-- SelectExamDialog -->
  100. <SelectExamDialog ref="selectExamDialogRef" />
  101. </template>
  102. <script setup lang="ts">
  103. import { ref, watch } from "vue";
  104. import {
  105. SwapOutlined,
  106. RightOutlined,
  107. PieChartFilled,
  108. } from "@ant-design/icons-vue";
  109. import { message } from "ant-design-vue";
  110. import { examOverview } from "@/ap/audit";
  111. import { ExamOverviewResult } from "@/ap/types/audit";
  112. import { useRouter } from "vue-router";
  113. import { useUserStore } from "@/store";
  114. import SelectExamDialog from "./SelectExamDialog.vue";
  115. defineOptions({
  116. name: "Audit",
  117. });
  118. const router = useRouter();
  119. const userStore = useUserStore();
  120. const overviewData = ref<ExamOverviewResult | null>(null);
  121. async function getOverviewData() {
  122. if (!userStore.curExam) return;
  123. const res = await examOverview({ examId: userStore.curExam.id });
  124. overviewData.value = res || null;
  125. }
  126. function toPage(name: string) {
  127. router.push({ name });
  128. }
  129. const selectExamDialogRef = ref();
  130. function onSwitchExam() {
  131. selectExamDialogRef.value?.open();
  132. }
  133. const imageCheckLoopTime = ref(userStore.imageCheckLoopTime || undefined);
  134. function onSetLoopTime() {
  135. if (!imageCheckLoopTime.value) {
  136. message.error("请输入轮播时间");
  137. return;
  138. }
  139. userStore.setImageCheckLoopTime(imageCheckLoopTime.value);
  140. message.success("设置成功!");
  141. }
  142. watch(
  143. () => userStore.curExam,
  144. (val) => {
  145. if (!val) return;
  146. // getOverviewData();
  147. },
  148. { immediate: true }
  149. );
  150. // TODO:测试
  151. overviewData.value = {
  152. //实时审核任务
  153. verifyTask: {
  154. todoCount: 5,
  155. },
  156. //图片审核
  157. imageCheckTask: {
  158. //抽查比例
  159. checkRatio: 0.5,
  160. finishCount: 50,
  161. //全部未处理数量
  162. todoCount: 20,
  163. },
  164. //人工绑定审核
  165. assignedCheck: {
  166. todoCount: 30,
  167. },
  168. };
  169. </script>