|
@@ -0,0 +1,288 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="check-action">
|
|
|
|
+ <a-collapse
|
|
|
|
+ v-model:activeKey="panelKey"
|
|
|
|
+ :bordered="false"
|
|
|
|
+ expandIconPosition="end"
|
|
|
|
+ >
|
|
|
|
+ <a-collapse-panel key="1">
|
|
|
|
+ <template #header><FilterFilled />搜索条件 </template>
|
|
|
|
+ <a-form :label-col="{ style: { width: '83px' } }">
|
|
|
|
+ <a-form-item label="科目">
|
|
|
|
+ <a-select
|
|
|
|
+ v-model:value="searchSubjectCode"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ :options="courses"
|
|
|
|
+ :field-names="fieldNames"
|
|
|
|
+ filter-option
|
|
|
|
+ style="width: 150px"
|
|
|
|
+ ></a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item label="查找条件">
|
|
|
|
+ <a-select
|
|
|
|
+ v-model:value="searchDataCheckType"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ :options="dataCheckOptions"
|
|
|
|
+ ></a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-form>
|
|
|
|
+ <div class="box-justify">
|
|
|
|
+ <div></div>
|
|
|
|
+ <div>
|
|
|
|
+ <a-button class="m-r-8px" type="primary" @click="onSearch"
|
|
|
|
+ >查询</a-button
|
|
|
|
+ >
|
|
|
|
+ <a-button @click="onExport('common')">导出</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </a-collapse-panel>
|
|
|
|
+ <a-collapse-panel key="2">
|
|
|
|
+ <template #header><FilterFilled />搜索条件 (自定义)</template>
|
|
|
|
+
|
|
|
|
+ <a-form :label-col="{ style: { width: '83px' } }">
|
|
|
|
+ <a-form-item label="准考证号">
|
|
|
|
+ <div class="exam-number">
|
|
|
|
+ <a-textarea
|
|
|
|
+ v-model:value="searchModel.examNumber"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ :auto-size="{ minRows: 1, maxRows: 1 }"
|
|
|
|
+ ></a-textarea>
|
|
|
|
+ <div class="number-suffix">{{ examNumberCountCont }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ <a-button class="ant-simple m-l-8px" type="link">查看全部</a-button>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item label="查找条件">
|
|
|
|
+ <a-input
|
|
|
|
+ v-model:value="searchModel.name"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ style="width: 150px"
|
|
|
|
+ ></a-input>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item label="科目">
|
|
|
|
+ <a-select
|
|
|
|
+ v-model:value="searchCustomSubjectCode"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ :options="courses"
|
|
|
|
+ :field-names="fieldNames"
|
|
|
|
+ filter-option
|
|
|
|
+ style="width: 150px"
|
|
|
|
+ ></a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-row>
|
|
|
|
+ <a-col :span="12">
|
|
|
|
+ <a-form-item label="客观题作答">
|
|
|
|
+ <a-select
|
|
|
|
+ v-model:value="searchModel.questionFilled"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ :options="booleanOptions"
|
|
|
|
+ style="width: 85px"
|
|
|
|
+ ></a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="12">
|
|
|
|
+ <a-form-item label="主观题作答">
|
|
|
|
+ <a-select
|
|
|
|
+ v-model:value="searchModel.subjectiveFilled"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ :options="booleanOptions"
|
|
|
|
+ style="width: 85px"
|
|
|
|
+ ></a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="12">
|
|
|
|
+ <a-form-item label="有作答">
|
|
|
|
+ <a-select
|
|
|
|
+ v-model:value="searchModel.subjectiveFilled"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ :options="booleanOptions"
|
|
|
|
+ style="width: 85px"
|
|
|
|
+ ></a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="12">
|
|
|
|
+ <a-form-item label="试卷类型">
|
|
|
|
+ <a-select
|
|
|
|
+ v-model:value="searchModel.paperTypeStatus"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ :options="paperTypeOptions"
|
|
|
|
+ style="width: 85px"
|
|
|
|
+ ></a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ <div class="box-justify">
|
|
|
|
+ <a-form-item label="缺考">
|
|
|
|
+ <a-radio-group
|
|
|
|
+ v-model:value="searchModel.incomplete"
|
|
|
|
+ name="incomplete"
|
|
|
|
+ :options="booleanOptions"
|
|
|
|
+ >
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ </a-form-item>
|
|
|
|
+
|
|
|
|
+ <div>
|
|
|
|
+ <a-button class="m-r-8px" type="primary" @click="onCustomSearch"
|
|
|
|
+ >查询</a-button
|
|
|
|
+ >
|
|
|
|
+ <a-button @click="onExport('custom')">导出</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </a-form>
|
|
|
|
+ </a-collapse-panel>
|
|
|
|
+ <a-collapse-panel key="3">
|
|
|
|
+ <template #header><PictureFilled />图片类别 </template>
|
|
|
|
+
|
|
|
|
+ <a-radio-group v-model:value="imageType" @change="onImageTypeChange">
|
|
|
|
+ <a-radio
|
|
|
|
+ v-for="item in imageTypeOptions"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ >{{ item.label }}</a-radio
|
|
|
|
+ >
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ </a-collapse-panel>
|
|
|
|
+ <a-collapse-panel key="4">
|
|
|
|
+ <template #header><IdcardFilled />题卡信息 </template>
|
|
|
|
+ </a-collapse-panel>
|
|
|
|
+ </a-collapse>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- ExportTypeDialog -->
|
|
|
|
+ <ExportTypeDialog ref="exportTypeDialogRef" @confirm="onExportConfirm" />
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script setup lang="ts">
|
|
|
|
+import { computed, reactive, ref } from "vue";
|
|
|
|
+import { subjectList } from "@/ap/base";
|
|
|
|
+import {
|
|
|
|
+ FilterFilled,
|
|
|
|
+ PictureFilled,
|
|
|
|
+ IdcardFilled,
|
|
|
|
+} from "@ant-design/icons-vue";
|
|
|
|
+import { message } from "ant-design-vue";
|
|
|
|
+
|
|
|
|
+import { useUserStore } from "@/store";
|
|
|
|
+import { DataCheckListFilter } from "@/ap/types/dataCheck";
|
|
|
|
+import { SubjectItem } from "@/ap/types/base";
|
|
|
|
+import { dataCheckStudentExport, dataCheckRoomExport } from "@/ap/dataCheck";
|
|
|
|
+import useDictOption from "@/hooks/dictOption";
|
|
|
|
+import useLoading from "@/hooks/useLoading";
|
|
|
|
+import type { ImageType } from "@/constants/enumerate";
|
|
|
|
+import { downloadByApi } from "@/utils/download";
|
|
|
|
+
|
|
|
|
+import ExportTypeDialog from "../Review/ExportTypeDialog.vue";
|
|
|
|
+
|
|
|
|
+defineOptions({
|
|
|
|
+ name: "CheckAction",
|
|
|
|
+});
|
|
|
|
+const emit = defineEmits(["search", "imageTypeChange"]);
|
|
|
|
+
|
|
|
|
+const userStore = useUserStore();
|
|
|
|
+const { optionList: dataCheckOptions } = useDictOption("DATA_CHECK_TYPE");
|
|
|
|
+const { optionList: paperTypeOptions } = useDictOption("PAPER_TYPE_STATUS");
|
|
|
|
+const { optionList: imageTypeOptions } = useDictOption("IMAGE_TYPE");
|
|
|
|
+const booleanOptions = ref([
|
|
|
|
+ {
|
|
|
|
+ label: "是",
|
|
|
|
+ value: true,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "否",
|
|
|
|
+ value: false,
|
|
|
|
+ },
|
|
|
|
+]);
|
|
|
|
+const panelKey = ref(["1", "2", "3", "4"]);
|
|
|
|
+
|
|
|
|
+// course data
|
|
|
|
+const courses = ref<SubjectItem[]>([]);
|
|
|
|
+async function getCourses() {
|
|
|
|
+ const res = await subjectList({ examId: userStore.curExam.id });
|
|
|
|
+ courses.value = res || [];
|
|
|
|
+}
|
|
|
|
+const fieldNames = { label: "subjectName", value: "subjectCode" };
|
|
|
|
+
|
|
|
|
+// search
|
|
|
|
+const initSearchModel = {
|
|
|
|
+ examId: userStore.curExam.id,
|
|
|
|
+ status: "",
|
|
|
|
+ examStatus: "",
|
|
|
|
+ examNumber: "",
|
|
|
|
+ studentCode: "",
|
|
|
|
+ name: "",
|
|
|
|
+ packageCode: "",
|
|
|
|
+ campusCode: "",
|
|
|
|
+ subjectCode: "",
|
|
|
|
+ examSite: "",
|
|
|
|
+ examRoom: "",
|
|
|
|
+ province: "",
|
|
|
|
+ paperTypeStatus: "",
|
|
|
|
+ device: "",
|
|
|
|
+ absentSuspect: null,
|
|
|
|
+ omrAbsent: null,
|
|
|
|
+ assigned: null,
|
|
|
|
+ incomplete: null,
|
|
|
|
+ questionFilled: null,
|
|
|
|
+ subjectiveFilled: null,
|
|
|
|
+ withOmrDetail: null,
|
|
|
|
+};
|
|
|
|
+const searchModel = reactive<DataCheckListFilter>({ ...initSearchModel });
|
|
|
|
+const searchSubjectCode = ref("");
|
|
|
|
+const searchCustomSubjectCode = ref("");
|
|
|
|
+const searchDataCheckType = ref();
|
|
|
|
+const imageType = ref("" as ImageType);
|
|
|
|
+const actionType = ref("common");
|
|
|
|
+
|
|
|
|
+const examNumberCountCont = computed(() => {
|
|
|
|
+ const examNumbers = (searchModel.examNumber || "")
|
|
|
|
+ .split("\n")
|
|
|
|
+ .filter((item) => item);
|
|
|
|
+ return `${examNumbers.length}/100`;
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+function getSearchModel() {
|
|
|
|
+ return { ...searchModel, subjectCode: searchSubjectCode.value };
|
|
|
|
+}
|
|
|
|
+function getCustomSearchModel() {
|
|
|
|
+ return {
|
|
|
|
+ ...searchModel,
|
|
|
|
+ subjectCode: searchCustomSubjectCode.value,
|
|
|
|
+ };
|
|
|
|
+}
|
|
|
|
+function onSearch() {
|
|
|
|
+ emit("search", getSearchModel());
|
|
|
|
+}
|
|
|
|
+function onCustomSearch() {
|
|
|
|
+ emit("search", getCustomSearchModel());
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function onImageTypeChange() {
|
|
|
|
+ emit("imageTypeChange", imageType.value);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 导出
|
|
|
|
+const { loading: downloading, setLoading } = useLoading();
|
|
|
|
+const exportTypeDialogRef = ref();
|
|
|
|
+function onExport(type: string) {
|
|
|
|
+ if (downloading.value) return;
|
|
|
|
+ actionType.value = type;
|
|
|
|
+ exportTypeDialogRef.value?.open();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+async function onExportConfirm(type: "student" | "room") {
|
|
|
|
+ if (downloading.value) return;
|
|
|
|
+
|
|
|
|
+ setLoading(true);
|
|
|
|
+ const func =
|
|
|
|
+ type === "student" ? dataCheckStudentExport : dataCheckRoomExport;
|
|
|
|
+ const params =
|
|
|
|
+ actionType.value === "common" ? getSearchModel() : getCustomSearchModel();
|
|
|
|
+
|
|
|
|
+ const res = await downloadByApi(() => func(params)).catch((e: Error) => {
|
|
|
|
+ message.error(e.message || "下载失败,请重新尝试!");
|
|
|
|
+ });
|
|
|
|
+ setLoading(false);
|
|
|
|
+
|
|
|
|
+ if (!res) return;
|
|
|
|
+ message.success("导出成功!");
|
|
|
|
+}
|
|
|
|
+</script>
|