|
@@ -1,6 +1,12 @@
|
|
<template>
|
|
<template>
|
|
<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">
|
|
|
|
+ <a-tabs v-model:menuKey="menuKey" size="small" @change="menuChange">
|
|
|
|
+ <a-tab-pane key="examNumber" tab="准考证号"></a-tab-pane>
|
|
|
|
+ <a-tab-pane key="question" tab="客观题"></a-tab-pane>
|
|
|
|
+ </a-tabs>
|
|
|
|
+ </div>
|
|
<div class="check-menu-body">
|
|
<div class="check-menu-body">
|
|
<ul>
|
|
<ul>
|
|
<li
|
|
<li
|
|
@@ -50,12 +56,13 @@ import {
|
|
|
|
|
|
import { DataCheckListFilter, DataCheckListItem } from "@/ap/types/dataCheck";
|
|
import { DataCheckListFilter, DataCheckListItem } from "@/ap/types/dataCheck";
|
|
import { allCheckList, fetchAndParseData, getExamNumberInfo } from "./api";
|
|
import { allCheckList, fetchAndParseData, getExamNumberInfo } from "./api";
|
|
-import { StudentPage, AllCheckFilter } from "./types";
|
|
|
|
|
|
+import { StudentPage, AllCheckFilter, StudentCheckItem } 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";
|
|
import ScanImage from "./ScanImage/index.vue";
|
|
import ScanImage from "./ScanImage/index.vue";
|
|
import CheckAction from "./CheckAction.vue";
|
|
import CheckAction from "./CheckAction.vue";
|
|
|
|
+import { randomCode } from "@/utils/tool";
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
name: "DataCheck",
|
|
name: "DataCheck",
|
|
@@ -65,12 +72,18 @@ const dataCheckStore = useDataCheckStore();
|
|
const appStore = useAppStore();
|
|
const appStore = useAppStore();
|
|
dataCheckStore.resetInfo();
|
|
dataCheckStore.resetInfo();
|
|
|
|
|
|
|
|
+const menuKey = ref("examNumber");
|
|
|
|
+
|
|
let searchModel = {} as DataCheckListFilter;
|
|
let searchModel = {} as DataCheckListFilter;
|
|
const pageNumber = ref(1);
|
|
const pageNumber = ref(1);
|
|
-const pageSize = ref(20);
|
|
|
|
|
|
+const pageSize = ref(50);
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
const pageCount = ref(0);
|
|
const pageCount = ref(0);
|
|
-const allStudentList = ref<DataCheckListItem[]>([]);
|
|
|
|
|
|
+const menuStudents = ref<{
|
|
|
|
+ examNumber: StudentCheckItem[];
|
|
|
|
+ question: StudentCheckItem[];
|
|
|
|
+}>({ examNumber: [], question: [] });
|
|
|
|
+const allStudentList = ref<StudentCheckItem[]>([]);
|
|
const studentList = ref<DataCheckListItem[]>([]);
|
|
const studentList = ref<DataCheckListItem[]>([]);
|
|
const dataList = ref<StudentPage[]>([]);
|
|
const dataList = ref<StudentPage[]>([]);
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
@@ -80,20 +93,62 @@ async function getAllStudents(data: AllCheckFilter) {
|
|
const res = await allCheckList(data).catch(() => null);
|
|
const res = await allCheckList(data).catch(() => null);
|
|
loading.value = false;
|
|
loading.value = false;
|
|
if (!res) return;
|
|
if (!res) return;
|
|
|
|
+ menuStudents.value = {
|
|
|
|
+ examNumber: res.filter(
|
|
|
|
+ (item) => !item.info || item.info.includes("准考证号")
|
|
|
|
+ ),
|
|
|
|
+ question: res.filter((item) => item.info.includes("客观题")),
|
|
|
|
+ };
|
|
|
|
|
|
allStudentList.value = res;
|
|
allStudentList.value = res;
|
|
- total.value = res.length;
|
|
|
|
- pageCount.value = Math.ceil(total.value / pageSize.value);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
async function getList() {
|
|
async function getList() {
|
|
- studentList.value = allStudentList.value.slice(
|
|
|
|
- (pageNumber.value - 1) * pageSize.value,
|
|
|
|
- pageNumber.value * pageSize.value
|
|
|
|
|
|
+ studentList.value = buildStudentList(
|
|
|
|
+ allStudentList.value.slice(
|
|
|
|
+ (pageNumber.value - 1) * pageSize.value,
|
|
|
|
+ pageNumber.value * pageSize.value
|
|
|
|
+ )
|
|
);
|
|
);
|
|
|
|
|
|
parseStudentPageList(studentList.value);
|
|
parseStudentPageList(studentList.value);
|
|
}
|
|
}
|
|
|
|
+function buildStudentList(dataList: StudentCheckItem[]): DataCheckListItem[] {
|
|
|
|
+ const data: DataCheckListItem[] = (dataList || []).map((item) => {
|
|
|
|
+ const studentId = `${item.imageName}_${randomCode(8)}`;
|
|
|
|
+ const questions = (item.smda ? item.smda.split("|") : []).map((item) =>
|
|
|
|
+ item.trim().replace(/[\.\?]/g, "")
|
|
|
|
+ );
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ id: studentId,
|
|
|
|
+ examNumber: item.zkzh,
|
|
|
|
+ papers: [
|
|
|
|
+ {
|
|
|
|
+ id: `${studentId}_1`,
|
|
|
|
+ pages: [
|
|
|
|
+ {
|
|
|
|
+ index: 1,
|
|
|
|
+ sheetUri: `${appStore.serverUrl}/pic/${item.imageName}.jpg`,
|
|
|
|
+ absent: null,
|
|
|
|
+ breach: null,
|
|
|
|
+ paperType: null,
|
|
|
|
+ question: {
|
|
|
|
+ result: questions,
|
|
|
|
+ type: "FILL_AREA",
|
|
|
|
+ },
|
|
|
|
+ selective: null,
|
|
|
|
+ recogData: null,
|
|
|
|
+ recogUri: `${appStore.serverUrl}/omr/${item.imageName}.json`,
|
|
|
|
+ recogDpi: 150,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ return data;
|
|
|
|
+}
|
|
|
|
|
|
function parseStudentPageList(students: DataCheckListItem[]) {
|
|
function parseStudentPageList(students: DataCheckListItem[]) {
|
|
dataList.value = [] as StudentPage[];
|
|
dataList.value = [] as StudentPage[];
|
|
@@ -127,6 +182,17 @@ function parseStudentPageList(students: DataCheckListItem[]) {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// menu
|
|
|
|
+async function menuChange(key: string) {
|
|
|
|
+ menuKey.value = key;
|
|
|
|
+ allStudentList.value = menuStudents.value[menuKey.value];
|
|
|
|
+ total.value = allStudentList.value.length;
|
|
|
|
+ pageCount.value = Math.ceil(total.value / pageSize.value);
|
|
|
|
+ pageNumber.value = 1;
|
|
|
|
+ getList();
|
|
|
|
+ await onSelectStudent(0);
|
|
|
|
+}
|
|
|
|
+
|
|
// table
|
|
// table
|
|
function onChangeListPage(index: number) {
|
|
function onChangeListPage(index: number) {
|
|
pageNumber.value = index;
|
|
pageNumber.value = index;
|
|
@@ -134,10 +200,11 @@ function onChangeListPage(index: number) {
|
|
selectPage(0);
|
|
selectPage(0);
|
|
}
|
|
}
|
|
async function onSearch(data: AllCheckFilter) {
|
|
async function onSearch(data: AllCheckFilter) {
|
|
- pageNumber.value = 1;
|
|
|
|
await getAllStudents(data);
|
|
await getAllStudents(data);
|
|
- getList();
|
|
|
|
- await onSelectStudent(0);
|
|
|
|
|
|
+ const mk = menuStudents.value["examNumber"].length
|
|
|
|
+ ? "examNumber"
|
|
|
|
+ : "question";
|
|
|
|
+ await menuChange(mk);
|
|
}
|
|
}
|
|
|
|
|
|
// student
|
|
// student
|
|
@@ -230,6 +297,8 @@ 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[
|