|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div class="data-check">
|
|
|
|
|
|
+ <div class="data-check exam-number-check">
|
|
<div class="check-menu">
|
|
<div class="check-menu">
|
|
<div class="check-menu-body">
|
|
<div class="check-menu-body">
|
|
<ul>
|
|
<ul>
|
|
@@ -9,7 +9,10 @@
|
|
:class="{ 'is-active': dataCheckStore.curStudent?.id === item.id }"
|
|
:class="{ 'is-active': dataCheckStore.curStudent?.id === item.id }"
|
|
@click="onSelectStudent(index)"
|
|
@click="onSelectStudent(index)"
|
|
>
|
|
>
|
|
- {{ item.imageName }}
|
|
|
|
|
|
+ <span>{{ item.imageName }}</span>
|
|
|
|
+ <span v-if="item.checked" class="color-success"
|
|
|
|
+ ><CheckCircleFilled
|
|
|
|
+ /></span>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
@@ -39,11 +42,15 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { ref, reactive, onMounted, computed, onBeforeUnmount } from "vue";
|
|
import { ref, reactive, onMounted, computed, onBeforeUnmount } from "vue";
|
|
import { message } from "ant-design-vue";
|
|
import { message } from "ant-design-vue";
|
|
-import { CaretLeftOutlined, CaretRightOutlined } from "@ant-design/icons-vue";
|
|
|
|
|
|
+import {
|
|
|
|
+ CaretLeftOutlined,
|
|
|
|
+ CaretRightOutlined,
|
|
|
|
+ CheckCircleFilled,
|
|
|
|
+} from "@ant-design/icons-vue";
|
|
|
|
|
|
import { DataCheckListFilter, DataCheckListItem } from "@/ap/types/dataCheck";
|
|
import { DataCheckListFilter, DataCheckListItem } from "@/ap/types/dataCheck";
|
|
-import { allCheckList, fetchAndParseData } from "./api";
|
|
|
|
-import { StudentPage } from "./types";
|
|
|
|
|
|
+import { allCheckList, fetchAndParseData, getExamNumberInfo } from "./api";
|
|
|
|
+import { StudentPage, AllCheckFilter } from "./types";
|
|
import { useDataCheckStore, useAppStore } from "@/store";
|
|
import { useDataCheckStore, useAppStore } from "@/store";
|
|
|
|
|
|
import SimplePagination from "@/components/SimplePagination/index.vue";
|
|
import SimplePagination from "@/components/SimplePagination/index.vue";
|
|
@@ -68,9 +75,9 @@ const studentList = ref<DataCheckListItem[]>([]);
|
|
const dataList = ref<StudentPage[]>([]);
|
|
const dataList = ref<StudentPage[]>([]);
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
|
|
|
-async function getAllStudents() {
|
|
|
|
|
|
+async function getAllStudents(data: AllCheckFilter) {
|
|
loading.value = true;
|
|
loading.value = true;
|
|
- const res = await allCheckList().catch(() => null);
|
|
|
|
|
|
+ const res = await allCheckList(data).catch(() => null);
|
|
loading.value = false;
|
|
loading.value = false;
|
|
if (!res) return;
|
|
if (!res) return;
|
|
|
|
|
|
@@ -126,21 +133,31 @@ function onChangeListPage(index: number) {
|
|
getList();
|
|
getList();
|
|
selectPage(0);
|
|
selectPage(0);
|
|
}
|
|
}
|
|
-async function onSearch() {
|
|
|
|
|
|
+async function onSearch(data: AllCheckFilter) {
|
|
pageNumber.value = 1;
|
|
pageNumber.value = 1;
|
|
- await getAllStudents();
|
|
|
|
- onChangeListPage(1);
|
|
|
|
|
|
+ await getAllStudents(data);
|
|
|
|
+ getList();
|
|
|
|
+ await onSelectStudent(0);
|
|
}
|
|
}
|
|
|
|
|
|
// student
|
|
// student
|
|
-function onSelectStudent(index: number) {
|
|
|
|
|
|
+async function onSelectStudent(index: number) {
|
|
const student = studentList.value[index];
|
|
const student = studentList.value[index];
|
|
|
|
+ if (!student) return;
|
|
|
|
+ if (student.checked) {
|
|
|
|
+ const info = await getExamNumberInfo(student.imageName);
|
|
|
|
+ if (info) {
|
|
|
|
+ student.examNumber = info.zkzh;
|
|
|
|
+ student.papers[0].pages[0].question.result = info.questions;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
const pageIndex = dataList.value.findIndex(
|
|
const pageIndex = dataList.value.findIndex(
|
|
(item) => item.studentId === student.id
|
|
(item) => item.studentId === student.id
|
|
);
|
|
);
|
|
if (pageIndex === -1) return;
|
|
if (pageIndex === -1) return;
|
|
|
|
|
|
- selectPage(pageIndex);
|
|
|
|
|
|
+ await selectPage(pageIndex);
|
|
}
|
|
}
|
|
|
|
|
|
async function onPrevStudent() {
|
|
async function onPrevStudent() {
|
|
@@ -152,11 +169,11 @@ async function onPrevStudent() {
|
|
|
|
|
|
pageNumber.value--;
|
|
pageNumber.value--;
|
|
await getList();
|
|
await getList();
|
|
- onSelectStudent(studentList.value.length - 1);
|
|
|
|
|
|
+ await onSelectStudent(studentList.value.length - 1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- onSelectStudent(dataCheckStore.curStudentIndex - 1);
|
|
|
|
|
|
+ await onSelectStudent(dataCheckStore.curStudentIndex - 1);
|
|
}
|
|
}
|
|
|
|
|
|
async function onNextStudent() {
|
|
async function onNextStudent() {
|
|
@@ -168,11 +185,11 @@ async function onNextStudent() {
|
|
|
|
|
|
pageNumber.value++;
|
|
pageNumber.value++;
|
|
await getList();
|
|
await getList();
|
|
- onSelectStudent(0);
|
|
|
|
|
|
+ await onSelectStudent(0);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- onSelectStudent(dataCheckStore.curStudentIndex + 1);
|
|
|
|
|
|
+ await onSelectStudent(dataCheckStore.curStudentIndex + 1);
|
|
}
|
|
}
|
|
|
|
|
|
function getImgDpi(imgWidth: number): number {
|
|
function getImgDpi(imgWidth: number): number {
|
|
@@ -233,11 +250,11 @@ async function onPrevPage() {
|
|
|
|
|
|
pageNumber.value--;
|
|
pageNumber.value--;
|
|
await getList();
|
|
await getList();
|
|
- selectPage(dataList.value.length - 1);
|
|
|
|
|
|
+ await selectPage(dataList.value.length - 1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- selectPage(dataCheckStore.curPageIndex - 1);
|
|
|
|
|
|
+ await selectPage(dataCheckStore.curPageIndex - 1);
|
|
}
|
|
}
|
|
|
|
|
|
async function onNextPage() {
|
|
async function onNextPage() {
|
|
@@ -249,11 +266,11 @@ async function onNextPage() {
|
|
|
|
|
|
pageNumber.value++;
|
|
pageNumber.value++;
|
|
await getList();
|
|
await getList();
|
|
- selectPage(0);
|
|
|
|
|
|
+ await selectPage(0);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- selectPage(dataCheckStore.curPageIndex + 1);
|
|
|
|
|
|
+ await selectPage(dataCheckStore.curPageIndex + 1);
|
|
}
|
|
}
|
|
|
|
|
|
// shortcut
|
|
// shortcut
|
|
@@ -297,7 +314,7 @@ onMounted(async () => {
|
|
}
|
|
}
|
|
appStore.setState({ serverUrl: appConfig.base.serverUrl });
|
|
appStore.setState({ serverUrl: appConfig.base.serverUrl });
|
|
registShortcut();
|
|
registShortcut();
|
|
- onSearch();
|
|
|
|
|
|
+ onSearch({ imageName: "", isCheck: true });
|
|
});
|
|
});
|
|
onBeforeUnmount(() => {
|
|
onBeforeUnmount(() => {
|
|
removeShortcut();
|
|
removeShortcut();
|