|
@@ -1,9 +1,231 @@
|
|
|
<template>
|
|
|
- <div>InTimeAudit</div>
|
|
|
+ <div v-if="hasTask" class="intime">
|
|
|
+ <div class="intime-head">
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="6">
|
|
|
+ <span class="head-label">扫描员:</span>
|
|
|
+ <span class="head-cont">{{ batchInfo.device }}</span>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <span class="head-label">批次:</span>
|
|
|
+ <span class="head-cont">{{ batchInfo.batchId }}</span>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <span class="head-label">时间:</span>
|
|
|
+ <span class="head-cont">{{ dateFormat(batchInfo.createTime) }}</span>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <span class="head-label">卷袋编号:</span>
|
|
|
+ <span class="head-cont">{{ batchInfo.packageCode }}</span>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
+ <div class="intime-side">
|
|
|
+ <div class="intime-side-body">
|
|
|
+ <div class="task-list">
|
|
|
+ <ul class="list-head">
|
|
|
+ <li style="width: 150px">准考证号</li>
|
|
|
+ <li style="width: 80px">姓名</li>
|
|
|
+ <li style="width: 60px">座位号</li>
|
|
|
+ <li style="width: 50px">状态</li>
|
|
|
+ </ul>
|
|
|
+ <div class="list-body">
|
|
|
+ <ul
|
|
|
+ v-for="(item, index) in dataList"
|
|
|
+ :key="item.examNumber"
|
|
|
+ :class="[
|
|
|
+ 'list-row',
|
|
|
+ { 'is-active': curStudent?.examNumber === item.examNumber },
|
|
|
+ ]"
|
|
|
+ @click="setCurStudent(index)"
|
|
|
+ >
|
|
|
+ <li style="width: 150px">{{ item.examNumber }}</li>
|
|
|
+ <li style="width: 80px">{{ item.name }}</li>
|
|
|
+ <li style="width: 60px">{{ item.seatNumber }}</li>
|
|
|
+ <li style="width: 50px">
|
|
|
+ <CheckCircleFilled v-if="item.status" class="color-success" />
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="intime-side-foot">
|
|
|
+ <a-space :size="7">
|
|
|
+ <template #split>
|
|
|
+ <a-divider
|
|
|
+ type="vertical"
|
|
|
+ style="height: 22px; background-color: #d9d9d9"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <a-button type="success" @click="onConfirm(true)">
|
|
|
+ <template #icon><CheckCircleOutlined /></template>
|
|
|
+ 通过
|
|
|
+ </a-button>
|
|
|
+ <a-button danger plain type="primary" @click="onConfirm(false)">
|
|
|
+ <template #icon><CloseCircleOutlined /></template>
|
|
|
+ 拒绝
|
|
|
+ </a-button>
|
|
|
+ </a-space>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="intime-body">
|
|
|
+ <template v-if="curStudent">
|
|
|
+ <div v-for="paper in curStudent.papers" :key="paper.number">
|
|
|
+ <img
|
|
|
+ v-for="(page, pindex) in paper.pages"
|
|
|
+ :key="pindex"
|
|
|
+ class="paper-img"
|
|
|
+ src="../../RecognizeCheck/data/202302040117-1.jpg"
|
|
|
+ />
|
|
|
+ <!-- <img
|
|
|
+ v-for="(page, pindex) in paper.pages"
|
|
|
+ :key="pindex"
|
|
|
+ :src="page"
|
|
|
+ /> -->
|
|
|
+ </div>
|
|
|
+ <ReviewMarkPan
|
|
|
+ :task-info="{
|
|
|
+ examNumber: curStudent.examNumber,
|
|
|
+ name: curStudent.name,
|
|
|
+ }"
|
|
|
+ @mark="onMark"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else class="intime is-wait">
|
|
|
+ <div>
|
|
|
+ <img src="@/assets/imgs/bg-wait.png" alt="等待" />
|
|
|
+ <p>等待审核结果…</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import { ref, onMounted } from "vue";
|
|
|
+import {
|
|
|
+ CheckCircleOutlined,
|
|
|
+ CloseCircleOutlined,
|
|
|
+ CheckCircleFilled,
|
|
|
+} from "@ant-design/icons-vue";
|
|
|
+import { message } from "ant-design-vue";
|
|
|
+import { omit } from "lodash-es";
|
|
|
+
|
|
|
+import {
|
|
|
+ IntimeAuditBatchResult,
|
|
|
+ IntimeAuditBatchStudent,
|
|
|
+} from "@/ap/types/audit";
|
|
|
+import { intimeAuditBatch, intimeAuditBatchSubmit } from "@/ap/audit";
|
|
|
+import { useUserStore } from "@/store";
|
|
|
+import { dateFormat } from "@/utils/tool";
|
|
|
+import useLoop from "@/hooks/useLoop";
|
|
|
+
|
|
|
+import ReviewMarkPan from "../../Review/ReviewMarkPan.vue";
|
|
|
+
|
|
|
defineOptions({
|
|
|
- name: "InTimeAudit",
|
|
|
+ name: "IntimeAudit",
|
|
|
+});
|
|
|
+
|
|
|
+const userStore = useUserStore();
|
|
|
+
|
|
|
+interface StudentItem extends IntimeAuditBatchStudent {
|
|
|
+ status: boolean;
|
|
|
+}
|
|
|
+type BatchData = Omit<IntimeAuditBatchResult, "students">;
|
|
|
+
|
|
|
+const dataList = ref<StudentItem[]>([]);
|
|
|
+const curStudent = ref<StudentItem | null>(null);
|
|
|
+const curStudentIndex = ref(0);
|
|
|
+const batchInfo = ref({} as BatchData);
|
|
|
+const hasTask = ref(false);
|
|
|
+
|
|
|
+const { start: startLoopGetData, stop: stopLoopGetData } = useLoop(
|
|
|
+ getData,
|
|
|
+ 2000
|
|
|
+);
|
|
|
+async function getData() {
|
|
|
+ const res = await intimeAuditBatch({ examId: userStore.curExam.id });
|
|
|
+ if (!res) {
|
|
|
+ hasTask.value = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ stopLoopGetData();
|
|
|
+ hasTask.value = true;
|
|
|
+ batchInfo.value = omit(res, "students");
|
|
|
+ dataList.value = res.students || [];
|
|
|
+ curStudentIndex.value = 0;
|
|
|
+ setCurStudent();
|
|
|
+}
|
|
|
+
|
|
|
+function onMark() {
|
|
|
+ curStudent.value.status = true;
|
|
|
+ getNextStudent();
|
|
|
+}
|
|
|
+
|
|
|
+// task
|
|
|
+function setCurStudent(index: number | undefined) {
|
|
|
+ if (index !== undefined) curStudentIndex.value = index;
|
|
|
+ curStudent.value = dataList.value[curStudentIndex.value];
|
|
|
+}
|
|
|
+function getNextStudent() {
|
|
|
+ if (curStudentIndex.value === dataList.value.length - 1) return;
|
|
|
+
|
|
|
+ curStudentIndex.value++;
|
|
|
+ setCurStudent();
|
|
|
+}
|
|
|
+function getPrevStudent() {
|
|
|
+ if (curStudentIndex.value === 0) return;
|
|
|
+
|
|
|
+ curStudentIndex.value--;
|
|
|
+ setCurStudent();
|
|
|
+}
|
|
|
+
|
|
|
+// confirm
|
|
|
+async function onConfirm(confirm: boolean) {
|
|
|
+ const res = await intimeAuditBatchSubmit({
|
|
|
+ batchId: batchInfo.value.batchId,
|
|
|
+ confirm,
|
|
|
+ });
|
|
|
+
|
|
|
+ startLoopGetData();
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ // startLoopGetData();
|
|
|
+
|
|
|
+ // TODO: 测试数据
|
|
|
+ hasTask.value = true;
|
|
|
+ batchInfo.value = {
|
|
|
+ batchId: 123,
|
|
|
+ device: "192.168.0.1",
|
|
|
+ createTime: Date.now(),
|
|
|
+ // 实时审核批次此字段有值
|
|
|
+ packageCode: "ET01245124",
|
|
|
+ };
|
|
|
+ dataList.value = "#"
|
|
|
+ .repeat(30)
|
|
|
+ .split("")
|
|
|
+ .map((item, index) => {
|
|
|
+ return {
|
|
|
+ examNumber: `3600802404012${index}`,
|
|
|
+ name: `考生名${index}`,
|
|
|
+ studentCode: `36008${index}`,
|
|
|
+ subjectCode: "科目代码",
|
|
|
+ subjectName: "科目名称",
|
|
|
+ seatNumber: "11",
|
|
|
+ status: Math.random() > 0.5,
|
|
|
+ papers: [
|
|
|
+ {
|
|
|
+ number: 1,
|
|
|
+ // 是否本张为人工绑定
|
|
|
+ assigned: true,
|
|
|
+ // 数组为空表示缺纸
|
|
|
+ pages: ["xxx.jpg", "111.png"],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ });
|
|
|
+ curStudentIndex.value = 0;
|
|
|
+ setCurStudent();
|
|
|
});
|
|
|
</script>
|