浏览代码

fix: 缺考筛选条件

zhangjie 8 月之前
父节点
当前提交
8e21b5fbef

+ 9 - 0
src/render/ap/base.ts

@@ -88,3 +88,12 @@ export const cardInfo = (data: CardInfoParams): Promise<CardInfoResult> => {
     data,
   });
 };
+
+// 证号填涂位数获取
+export const examNumberFillCount = (examId: Number): Promise<number> => {
+  return request({
+    url: "/api/admin/exam/exam-number/fill-count",
+    method: "post",
+    data: { examId },
+  });
+};

+ 0 - 5
src/render/constants/enumerate.ts

@@ -9,11 +9,6 @@ export const DATA_CHECK_TYPE = {
   6: "缺考有条码",
 };
 
-export const ABSENT_CHECK_TYPE = {
-  1: "缺考",
-  2: "正常",
-};
-
 export const PAPER_TYPE_STATUS = {
   OK: "正常",
   BLANK: "空白",

+ 0 - 2
src/render/hooks/dictOption.ts

@@ -4,7 +4,6 @@ import type { DefaultOptionType } from "ant-design-vue/es/vc-select/Select";
 import {
   DEFAULT_LABEL,
   DATA_CHECK_TYPE,
-  ABSENT_CHECK_TYPE,
   PAPER_TYPE_STATUS,
   EXAM_STATUS,
   EXAM_SIMPLE_STATUS,
@@ -15,7 +14,6 @@ import {
 
 const dicts = {
   DATA_CHECK_TYPE,
-  ABSENT_CHECK_TYPE,
   PAPER_TYPE_STATUS,
   EXAM_STATUS,
   EXAM_SIMPLE_STATUS,

+ 33 - 16
src/render/views/AbsentCheck/CheckAction.vue

@@ -142,6 +142,7 @@ import {
   absentCheckRoomExport,
   examStatusSave,
 } from "@/ap/absentCheck";
+import { examNumberFillCount } from "@/ap/base";
 import useDictOption from "@/hooks/dictOption";
 import useLoading from "@/hooks/useLoading";
 
@@ -161,10 +162,37 @@ const emit = defineEmits(["search"]);
 const userStore = useUserStore();
 const dataCheckStore = useDataCheckStore();
 
-const { optionList: absentCheckOptions } = useDictOption("ABSENT_CHECK_TYPE");
 const { optionList: imageTypeOptions } = useDictOption("IMAGE_TYPE");
 const panelKey = ref(["1", "2", "3", "4"]);
 
+const absentCheckOptions = ref([]);
+async function getAbsentCheckOptions() {
+  const res = await examNumberFillCount(userStore.curExam.id);
+  absentCheckOptions.value = [
+    {
+      label: "缺考",
+      value: "ABSENT",
+    },
+    {
+      label: "正常",
+      value: "OK",
+    },
+    {
+      label: "客观题未作答+主观题有作答(待确认)",
+      value: "UNCHECK1",
+    },
+    {
+      label: `客观题未作答+主观题未作答+填涂≥${res}+有卷型(待确认)`,
+      value: "UNCHECK2",
+    },
+    {
+      label: `交叉对比缺考不一致(待确认)`,
+      value: "UNCHECK3",
+    },
+  ];
+}
+getAbsentCheckOptions();
+
 // search
 const initSearchModel = {
   examId: userStore.curExam.id,
@@ -175,7 +203,7 @@ const initSearchModel = {
   examStatus: [],
 };
 const searchModel = reactive<AbsentCheckListFilter>({ ...initSearchModel });
-const searchDataCheckType = ref();
+const searchDataCheckType = ref("");
 const imageType = ref(dataCheckStore.imageType);
 
 // imageType
@@ -199,20 +227,9 @@ function onExamNumberEdited(val: string) {
 }
 
 function absentCheckTypeChange() {
-  switch (searchDataCheckType.value) {
-    // 缺考
-    case "1":
-      searchModel.examStatus = ["ABSENT"];
-      break;
-    // 正常
-    case "2":
-      searchModel.examStatus = ["OK"];
-      break;
-
-    default:
-      searchModel.examStatus = [];
-      break;
-  }
+  searchModel.examStatus = searchDataCheckType
+    ? [searchDataCheckType.value]
+    : [];
 }
 
 function onSearch() {