|
@@ -57,11 +57,20 @@
|
|
|
style="height: 22px; background-color: #d9d9d9"
|
|
|
/>
|
|
|
</template>
|
|
|
- <a-button type="success" @click="onConfirm(true)">
|
|
|
+ <a-button
|
|
|
+ type="success"
|
|
|
+ :disabled="canSubmit"
|
|
|
+ :loading="loading"
|
|
|
+ @click="onConfirm(true)"
|
|
|
+ >
|
|
|
<template #icon><CheckCircleOutlined /></template>
|
|
|
通过
|
|
|
</a-button>
|
|
|
- <a-button type="error-light" @click="onConfirm(false)">
|
|
|
+ <a-button
|
|
|
+ type="error-light"
|
|
|
+ :loading="loading"
|
|
|
+ @click="onConfirm(false)"
|
|
|
+ >
|
|
|
<template #icon><CloseCircleOutlined /></template>
|
|
|
拒绝
|
|
|
</a-button>
|
|
@@ -70,18 +79,15 @@
|
|
|
</div>
|
|
|
<div class="audit-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="@/assets/imgs/paper.jpg"
|
|
|
- />
|
|
|
- <!-- <img
|
|
|
- v-for="(page, pindex) in paper.pages"
|
|
|
- :key="pindex"
|
|
|
- :src="page"
|
|
|
- /> -->
|
|
|
+ <div class="audit-body-imgs">
|
|
|
+ <div v-for="paper in curStudent.papers" :key="paper.number">
|
|
|
+ <img
|
|
|
+ v-for="(page, pindex) in paper.pages"
|
|
|
+ :key="pindex"
|
|
|
+ class="paper-img"
|
|
|
+ :src="getFileUrl(page)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<ReviewMarkPan
|
|
|
:task-info="{
|
|
@@ -102,7 +108,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, onMounted, onBeforeUnmount } from "vue";
|
|
|
+import { ref, onMounted, onBeforeUnmount, computed } from "vue";
|
|
|
import {
|
|
|
CheckCircleOutlined,
|
|
|
CloseCircleOutlined,
|
|
@@ -116,12 +122,17 @@ import {
|
|
|
AuditBatchStudent,
|
|
|
AuditBatchData,
|
|
|
} from "@/ap/types/audit";
|
|
|
-import { intimeAuditBatch, intimeAuditBatchSubmit } from "@/ap/audit";
|
|
|
+import {
|
|
|
+ intimeAuditBatch,
|
|
|
+ intimeAuditBatchSubmit,
|
|
|
+ intimeAuditBatchRelease,
|
|
|
+} from "@/ap/audit";
|
|
|
import { useUserStore } from "@/store";
|
|
|
-import { dateFormat } from "@/utils/tool";
|
|
|
+import { dateFormat, getFileUrl } from "@/utils/tool";
|
|
|
import useLoop from "@/hooks/useLoop";
|
|
|
|
|
|
import ReviewMarkPan from "../../Review/ReviewMarkPan.vue";
|
|
|
+import useLoading from "@/hooks/useLoading";
|
|
|
|
|
|
defineOptions({
|
|
|
name: "IntimeAudit",
|
|
@@ -139,6 +150,18 @@ const curStudentIndex = ref(0);
|
|
|
const batchInfo = ref({} as AuditBatchData);
|
|
|
const hasTask = ref(false);
|
|
|
|
|
|
+const canSubmit = computed(() => {
|
|
|
+ return !dataList.value.some((item) => !item.status);
|
|
|
+});
|
|
|
+
|
|
|
+function initData() {
|
|
|
+ dataList.value = [];
|
|
|
+ curStudent.value = null;
|
|
|
+ curStudentIndex.value = 0;
|
|
|
+ batchInfo.value = {};
|
|
|
+ hasTask.value = false;
|
|
|
+}
|
|
|
+
|
|
|
const { start: startLoopGetData, stop: stopLoopGetData } = useLoop(
|
|
|
getData,
|
|
|
2000
|
|
@@ -178,55 +201,33 @@ function getPrevStudent() {
|
|
|
}
|
|
|
|
|
|
// confirm
|
|
|
+const { loading, setLoading } = useLoading();
|
|
|
async function onConfirm(confirm: boolean) {
|
|
|
+ if (loading.value) return;
|
|
|
+ setLoading(true);
|
|
|
const res = await intimeAuditBatchSubmit({
|
|
|
batchId: batchInfo.value.batchId,
|
|
|
confirm,
|
|
|
- });
|
|
|
+ }).catch(() => {});
|
|
|
+ setLoading(false);
|
|
|
+ if (!res) return;
|
|
|
|
|
|
+ message.success("操作成功!");
|
|
|
+ initData();
|
|
|
startLoopGetData();
|
|
|
}
|
|
|
|
|
|
+async function releaseBatch() {
|
|
|
+ await intimeAuditBatchRelease({ examId: userStore.curExam.id });
|
|
|
+}
|
|
|
+
|
|
|
onBeforeUnmount(() => {
|
|
|
+ releaseBatch();
|
|
|
stopLoopGetData();
|
|
|
});
|
|
|
|
|
|
-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();
|
|
|
+onMounted(async () => {
|
|
|
+ await releaseBatch();
|
|
|
+ startLoopGetData();
|
|
|
});
|
|
|
</script>
|