|
@@ -2,7 +2,7 @@
|
|
<div class="data-check exam-number-check">
|
|
<div class="data-check exam-number-check">
|
|
<div class="check-menu">
|
|
<div class="check-menu">
|
|
<div class="check-menu-head">
|
|
<div class="check-menu-head">
|
|
- <a-tabs v-model:menuKey="menuKey" size="small" @change="menuChange">
|
|
|
|
|
|
+ <a-tabs v-model:activeKey="menuKey" size="small" @change="menuChange">
|
|
<a-tab-pane key="examNumber" tab="准考证号"></a-tab-pane>
|
|
<a-tab-pane key="examNumber" tab="准考证号"></a-tab-pane>
|
|
<a-tab-pane key="question" tab="客观题"></a-tab-pane>
|
|
<a-tab-pane key="question" tab="客观题"></a-tab-pane>
|
|
</a-tabs>
|
|
</a-tabs>
|
|
@@ -46,7 +46,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { ref, reactive, onMounted, computed, onBeforeUnmount } from "vue";
|
|
|
|
|
|
+import { ref, reactive, onMounted, onBeforeUnmount } from "vue";
|
|
import { message } from "ant-design-vue";
|
|
import { message } from "ant-design-vue";
|
|
import {
|
|
import {
|
|
CaretLeftOutlined,
|
|
CaretLeftOutlined,
|
|
@@ -72,7 +72,7 @@ const dataCheckStore = useDataCheckStore();
|
|
const appStore = useAppStore();
|
|
const appStore = useAppStore();
|
|
dataCheckStore.resetInfo();
|
|
dataCheckStore.resetInfo();
|
|
|
|
|
|
-const menuKey = ref("examNumber");
|
|
|
|
|
|
+const menuKey = ref("");
|
|
|
|
|
|
let searchModel = {} as DataCheckListFilter;
|
|
let searchModel = {} as DataCheckListFilter;
|
|
const pageNumber = ref(1);
|
|
const pageNumber = ref(1);
|
|
@@ -103,7 +103,7 @@ async function getAllStudents(data: AllCheckFilter) {
|
|
allStudentList.value = res;
|
|
allStudentList.value = res;
|
|
}
|
|
}
|
|
|
|
|
|
-async function getList() {
|
|
|
|
|
|
+function getList() {
|
|
studentList.value = buildStudentList(
|
|
studentList.value = buildStudentList(
|
|
allStudentList.value.slice(
|
|
allStudentList.value.slice(
|
|
(pageNumber.value - 1) * pageSize.value,
|
|
(pageNumber.value - 1) * pageSize.value,
|
|
@@ -123,6 +123,7 @@ function buildStudentList(dataList: StudentCheckItem[]): DataCheckListItem[] {
|
|
...item,
|
|
...item,
|
|
id: studentId,
|
|
id: studentId,
|
|
examNumber: item.zkzh,
|
|
examNumber: item.zkzh,
|
|
|
|
+ originQuestions: [...questions],
|
|
papers: [
|
|
papers: [
|
|
{
|
|
{
|
|
id: `${studentId}_1`,
|
|
id: `${studentId}_1`,
|
|
@@ -183,8 +184,7 @@ function parseStudentPageList(students: DataCheckListItem[]) {
|
|
}
|
|
}
|
|
|
|
|
|
// menu
|
|
// menu
|
|
-async function menuChange(key: string) {
|
|
|
|
- menuKey.value = key;
|
|
|
|
|
|
+async function menuChange() {
|
|
allStudentList.value = menuStudents.value[menuKey.value];
|
|
allStudentList.value = menuStudents.value[menuKey.value];
|
|
total.value = allStudentList.value.length;
|
|
total.value = allStudentList.value.length;
|
|
pageCount.value = Math.ceil(total.value / pageSize.value);
|
|
pageCount.value = Math.ceil(total.value / pageSize.value);
|
|
@@ -201,22 +201,37 @@ function onChangeListPage(index: number) {
|
|
}
|
|
}
|
|
async function onSearch(data: AllCheckFilter) {
|
|
async function onSearch(data: AllCheckFilter) {
|
|
await getAllStudents(data);
|
|
await getAllStudents(data);
|
|
- const mk = menuStudents.value["examNumber"].length
|
|
|
|
- ? "examNumber"
|
|
|
|
- : "question";
|
|
|
|
- await menuChange(mk);
|
|
|
|
|
|
+ if (menuKey.value && menuStudents.value[menuKey.value].length) {
|
|
|
|
+ await menuChange();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const mk = menuStudents.value.examNumber.length ? "examNumber" : "question";
|
|
|
|
+ menuKey.value = mk;
|
|
|
|
+ await menuChange();
|
|
}
|
|
}
|
|
|
|
|
|
// student
|
|
// student
|
|
async function onSelectStudent(index: number) {
|
|
async function onSelectStudent(index: number) {
|
|
|
|
+ dataCheckStore.setInfo({
|
|
|
|
+ taskList: [],
|
|
|
|
+ curTask: null,
|
|
|
|
+ });
|
|
const student = studentList.value[index];
|
|
const student = studentList.value[index];
|
|
if (!student) return;
|
|
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 info = await getExamNumberInfo(student.imageName);
|
|
|
|
+ if (info) {
|
|
|
|
+ const handleQuestionIndexs = [];
|
|
|
|
+ student.originQuestions.forEach((item, index) => {
|
|
|
|
+ if (info.questions[index] && item !== info.questions[index]) {
|
|
|
|
+ handleQuestionIndexs.push(index);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ student.handleQuestionIndexs = handleQuestionIndexs;
|
|
|
|
+ student.examNumber = info.zkzh;
|
|
|
|
+ student.papers[0].pages[0].question.result = info.questions;
|
|
}
|
|
}
|
|
|
|
|
|
const pageIndex = dataList.value.findIndex(
|
|
const pageIndex = dataList.value.findIndex(
|
|
@@ -235,7 +250,7 @@ async function onPrevStudent() {
|
|
}
|
|
}
|
|
|
|
|
|
pageNumber.value--;
|
|
pageNumber.value--;
|
|
- await getList();
|
|
|
|
|
|
+ getList();
|
|
await onSelectStudent(studentList.value.length - 1);
|
|
await onSelectStudent(studentList.value.length - 1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -244,6 +259,9 @@ async function onPrevStudent() {
|
|
}
|
|
}
|
|
|
|
|
|
async function onNextStudent() {
|
|
async function onNextStudent() {
|
|
|
|
+ if (!dataCheckStore.curStudent) return;
|
|
|
|
+
|
|
|
|
+ dataCheckStore.curStudent.checked = true;
|
|
if (dataCheckStore.curStudentIndex >= studentList.value.length - 1) {
|
|
if (dataCheckStore.curStudentIndex >= studentList.value.length - 1) {
|
|
if (pageNumber.value >= pageCount.value) {
|
|
if (pageNumber.value >= pageCount.value) {
|
|
message.error("没有下一个学生了");
|
|
message.error("没有下一个学生了");
|
|
@@ -251,7 +269,7 @@ async function onNextStudent() {
|
|
}
|
|
}
|
|
|
|
|
|
pageNumber.value++;
|
|
pageNumber.value++;
|
|
- await getList();
|
|
|
|
|
|
+ getList();
|
|
await onSelectStudent(0);
|
|
await onSelectStudent(0);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -275,7 +293,7 @@ function getImgSize(url: string) {
|
|
return new Promise<{ width: number; height: number }>((resolve) => {
|
|
return new Promise<{ width: number; height: number }>((resolve) => {
|
|
const img = new Image();
|
|
const img = new Image();
|
|
img.src = url;
|
|
img.src = url;
|
|
- console.log(url);
|
|
|
|
|
|
+ // console.log(url);
|
|
|
|
|
|
img.onload = () => {
|
|
img.onload = () => {
|
|
resolve({
|
|
resolve({
|
|
@@ -297,8 +315,6 @@ async function selectPage(index: number) {
|
|
curPageIndex: index,
|
|
curPageIndex: index,
|
|
});
|
|
});
|
|
|
|
|
|
- updatePageTasks(dataList.value[index]);
|
|
|
|
-
|
|
|
|
if (!dataCheckStore.curPage) return;
|
|
if (!dataCheckStore.curPage) return;
|
|
|
|
|
|
const curStudent = studentList.value[
|
|
const curStudent = studentList.value[
|
|
@@ -318,7 +334,7 @@ async function onPrevPage() {
|
|
}
|
|
}
|
|
|
|
|
|
pageNumber.value--;
|
|
pageNumber.value--;
|
|
- await getList();
|
|
|
|
|
|
+ getList();
|
|
await selectPage(dataList.value.length - 1);
|
|
await selectPage(dataList.value.length - 1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -334,7 +350,7 @@ async function onNextPage() {
|
|
}
|
|
}
|
|
|
|
|
|
pageNumber.value++;
|
|
pageNumber.value++;
|
|
- await getList();
|
|
|
|
|
|
+ getList();
|
|
await selectPage(0);
|
|
await selectPage(0);
|
|
return;
|
|
return;
|
|
}
|
|
}
|