瀏覽代碼

调接口,自测

刘洋 9 月之前
父節點
當前提交
d6989eb08a

+ 3 - 1
src/render/ap/scanManage.ts

@@ -1,6 +1,6 @@
 import { request } from "@/utils/request";
 import { getFileMD5 } from "@/utils/crypto";
-import { obj2formData } from "@/utils/tool";
+import { download, obj2formData } from "@/utils/tool";
 
 //获取扫描批次科目列表
 export const batchSubjectList = (params: {
@@ -82,6 +82,7 @@ export const exportWorkStatistics = (params: {
   request({
     url: "/api/admin/scanner/workload/export",
     params,
+    download: true,
   });
 
 export const getSiteList = (params: { examId: number | undefined }) =>
@@ -123,6 +124,7 @@ export const exportScanned = (params: {
   request({
     url: "/api/admin/exam-room/scanned/export",
     params,
+    download: true,
   });
 
 export const getStuPage = (params: {

+ 1 - 0
src/render/components/SelectSubject/index.vue

@@ -7,6 +7,7 @@
     :multiple="false"
     :field-names="fieldNames"
     v-bind="attrs"
+    allow-clear
     @change="onChange"
   >
   </a-select>

+ 0 - 1
src/render/views/BaseDataConfig/AddUserDialog.vue

@@ -58,7 +58,6 @@ const rules = {
 const submitHandle = () => {
   form.value.formRef.validate().then(() => {
     addUser(params).then((res: any) => {
-      console.log("mock 新建用户", res);
       window.$message.success("操作成功");
       visible.value = false;
       emit("success");

+ 0 - 1
src/render/views/BaseDataConfig/ResetPasswordDialog.vue

@@ -47,7 +47,6 @@ const submitHandle = () => {
       password: params.value.password,
       userId: props.curRow?.id,
     }).then((res: any) => {
-      console.log("mock 新建用户", res);
       window.$message.success("操作成功");
       visible.value = false;
       emit("success");

+ 1 - 1
src/render/views/BaseDataConfig/ScanParams.vue

@@ -14,6 +14,7 @@
             <a-input
               style="width: 200px"
               v-model:value="params.paperTypeBarcodeContentItem"
+              allow-clear
             />
             <qm-button
               class="m-l-8px"
@@ -209,7 +210,6 @@ const save = () => {
     let p: any = { ...params };
     delete p.paperTypeBarcodeContentItem;
     saveBaseDataConfig(p).then((res: any) => {
-      console.log("mock 保存基础数据配置", res);
       window.$message.success("保存成功");
     });
   });

+ 0 - 1
src/render/views/BaseDataConfig/SetImportParamsDialog.vue

@@ -71,7 +71,6 @@ const submit = () => {
       ...params.value,
       examId: userStore.curExam?.id as number,
     }).then((res: any) => {
-      console.log("mock 保存考生导入参数设置", res);
       window.$message.success("操作成功");
       visible.value = false;
       emit("success");

+ 9 - 8
src/render/views/BaseDataConfig/StuImport.vue

@@ -29,7 +29,6 @@
 <script name="StuImport" lang="ts" setup>
 import { ref } from "vue";
 import SetImportParamsDialog from "./SetImportParamsDialog.vue";
-import useTable from "@/hooks/useTable";
 import { getStuList } from "@/ap/baseDataConfig";
 import { useUserStore } from "@/store";
 import { getStuImportSet, clearStuData } from "@/ap/baseDataConfig";
@@ -41,11 +40,10 @@ const showSetParamsDialog = ref(false);
 const showStuImportFileDialog = ref(false);
 const year = ref();
 const yearHalf = ref();
-
+const loading = ref(false);
 const _getStuImportSet = () => {
   getStuImportSet({ examId: userStore.curExam?.id as number }).then(
     (res: any) => {
-      console.log("mock 考生导入参数设置获取", res);
       year.value = res?.year;
       yearHalf.value = res?.yearHalf;
     }
@@ -94,10 +92,14 @@ const columns: TableColumnsType = [
 ];
 const dataList = ref([]);
 const search = () => {
-  getStuList({ examId: userStore.curExam?.id as number }).then((res: any) => {
-    console.log("mock 考生列表", res);
-    dataList.value = res || [];
-  });
+  loading.value = true;
+  getStuList({ examId: userStore.curExam?.id as number })
+    .then((res: any) => {
+      dataList.value = res || [];
+    })
+    .finally(() => {
+      loading.value = false;
+    });
 };
 search();
 const clear = (row: any) => {
@@ -109,7 +111,6 @@ const clear = (row: any) => {
         examId: userStore.curExam?.id as number,
         subjectCode: row.subjectCode,
       }).then(() => {
-        console.log("mock 删除考生单条数据");
         window.$message.success("操作成功");
         search();
       });

+ 0 - 1
src/render/views/BaseDataConfig/StuImportFileDialog.vue

@@ -53,7 +53,6 @@ const submitHandle = () => {
   form.value.formRef.validate().then(() => {
     importStu({ examId: userStore.curExam?.id as number, ...params }).then(
       (res: any) => {
-        console.log("mock 考生导入", res);
         window.$message.success("考生导入成功");
         visible.value = false;
       }

+ 1 - 1
src/render/views/BaseDataConfig/UserManage.vue

@@ -68,6 +68,7 @@ const fields = ref([
     label: "角色",
     attrs: {
       options: enum2Options(ROLES),
+      allowClear: true,
     },
   },
   {
@@ -139,7 +140,6 @@ const toggleStatus = (row: any, status: boolean) => {
     content: `确认${str}该用户吗?`,
     onOk() {
       toggleUserStatus({ userId: row.id, enable: status }).then((res: any) => {
-        console.log("mock 启用/禁用用户", res);
         window.$message.success("操作成功");
       });
     },

+ 10 - 1
src/render/views/CurExam/AddExamDialog.vue

@@ -19,7 +19,9 @@
 import { ref, computed } from "vue";
 import { setValueFromObj } from "@/utils/tool";
 import { addOrEditExam } from "@/ap/baseDataConfig";
+import { useUserStore } from "@/store";
 
+const userStore = useUserStore();
 const form = ref();
 const IS_EDIT = computed(() => !!props.curRow?.id);
 const visible = defineModel();
@@ -40,9 +42,16 @@ const handleOk = () => {
   form.value.formRef.validate().then(() => {
     addOrEditExam({ name: params.value.name, id: props.curRow?.id }).then(
       (res: any) => {
-        console.log("mock 创建或编辑考试:", res);
         window.$message.success("操作成功");
         visible.value = false;
+        if (props.curRow?.id) {
+          const exam = userStore.curExam;
+          if (exam) {
+            let obj = { ...exam };
+            obj.name = params.value.name;
+            userStore.setCurExam(obj);
+          }
+        }
       }
     );
   });

+ 0 - 2
src/render/views/CurExam/index.vue

@@ -335,7 +335,6 @@ const choosedExamId = ref();
 const allData = ref<any>({});
 const getAllCardData = () => {
   getExamOverview({ examId: choosedExamId.value }).then((res: any) => {
-    console.log("mock 考试概览数据:", res);
     allData.value = res || {};
   });
 };
@@ -355,7 +354,6 @@ const showExamListModal = ref(false);
 const _getExamList = () => {
   getExamList({ enable: true, pageNumber: 1, pageSize: 10000 }).then(
     (res: any) => {
-      console.log("mock 考试列表:", res);
       if (res?.result?.length) {
         examList.value = res.result || [];
       } else {

+ 0 - 1
src/render/views/Login/AdminLogin.vue

@@ -46,7 +46,6 @@ const loginHandle = () => {
     .validate()
     .then(() => {
       adminLogin(params).then((res: any) => {
-        console.log("mock 登录:", res);
         userStore.setUserInfo(res);
         let routeName =
           res.role === "SCHOOL_ADMIN"

+ 0 - 1
src/render/views/Login/index.vue

@@ -44,7 +44,6 @@ const checkEnvHandle = () => {
   envCheckLoading.value = true;
   getServerStatus()
     .then((res: any) => {
-      console.log("mock 环境检测:", res);
       appStore.setServerStatus(res);
       envCheckLoading.value = false;
       curStepIndex.value++;

+ 30 - 7
src/render/views/ScanManage/ImageView.vue

@@ -151,22 +151,44 @@ const _batchStudentList = () => {
     listType.value = "level4";
   });
 };
+function parseStudentPage(student: any) {
+  dataList.value = [];
+
+  student.papers.forEach((paper: any, paperIndex: number) => {
+    if (!paper.pages) return;
+    paper.pages.forEach((page: any, pageIndex: number) => {
+      dataList.value.push({
+        ...page,
+        paperId: paper.id as number,
+        pageIndex,
+        paperIndex,
+        studentIndex: 0,
+        studentId: student.id,
+        examId: userStore.curExam?.id,
+        kid: `${student.id}-${0}-${paperIndex}-${pageIndex}`,
+      });
+    });
+  });
+}
 const _getStuCardDetail = () => {
   getStuCardDetail({
     batchId: curBatch.value.value,
     studentId: curStu.value.studentId,
   }).then((res: any) => {
     curStuCardData.value = res || {};
-    dataCheckStore.setInfo({
-      curPage: curStuCardData.value as any,
-      curPageIndex: -1,
-    });
-
-    if (!dataCheckStore.curPage) return;
-    dataCheckStore.setInfo({ curStudent: curStuCardData.value as any });
+    parseStudentPage(curStuCardData.value);
+    selectPage(0);
   });
 };
+function selectPage(index: number) {
+  dataCheckStore.setInfo({
+    curPage: dataList.value[index],
+    curPageIndex: index,
+  });
 
+  if (!dataCheckStore.curPage) return;
+  dataCheckStore.setInfo({ curStudent: curStuCardData.value as any });
+}
 onMounted(() => {
   _batchSubjectList();
 });
@@ -206,6 +228,7 @@ const curStu = ref({
   studentName: "",
 });
 const curStuCardData = ref({});
+const dataList = ref<any>([]);
 
 const chooseLeft = (item: any, index: number) => {
   activeIndex.value = index;

+ 4 - 5
src/render/views/ScanManage/ScanCheckMiss.vue

@@ -30,7 +30,6 @@ import SelectSubject from "@/components/SelectSubject/index.vue";
 import { useUserStore } from "@/store";
 import { useRequest } from "vue-request";
 import useTable from "@/hooks/useTable";
-import { downloadByApi } from "@/utils/download";
 
 import {
   getSiteList,
@@ -85,6 +84,7 @@ const fields = computed(() => {
       attrs: {
         options: examSiteOptions.value || [],
         fieldNames: { label: "name", value: "code" },
+        allowClear: true,
       },
     },
     {
@@ -95,6 +95,7 @@ const fields = computed(() => {
       attrs: {
         options: examCampusOptions.value || [],
         fieldNames: { label: "name", value: "code" },
+        allowClear: true,
       },
     },
     {
@@ -102,6 +103,7 @@ const fields = computed(() => {
       type: "select",
       colSpan: 3,
       label: "考场号",
+      allowClear: true,
     },
     {
       prop: "scanned",
@@ -165,13 +167,10 @@ const exportFile = async () => {
   if (exportLoading.value) return;
   exportLoading.value = true;
 
-  downloadByApi(() => exportScanned(transParams.value))
+  exportScanned(transParams.value)
     .then(() => {
       window.$message.success("导出成功!");
     })
-    .catch((e: Error) => {
-      window.$message.error(e.message || "下载失败,请重新尝试!");
-    })
     .finally(() => {
       exportLoading.value = false;
     });

+ 0 - 1
src/render/views/ScanManage/ScanProcess.vue

@@ -49,7 +49,6 @@ const search = () => {
     examId: userStore.curExam?.id,
     subjectCode: params.subjectCode,
   }).then((res: any) => {
-    console.log("mock 科目扫描进度查询", res);
     totals.value = res?.total || {};
     tableData.value = res?.subjects || [];
   });

+ 5 - 0
src/render/views/ScanManage/StuInfo.vue

@@ -61,11 +61,13 @@ const fields = computed(() => {
       prop: "examNumber",
       colSpan: 3,
       label: "准考证号",
+      attrs: { allowClear: true },
     },
     {
       prop: "name",
       colSpan: 3,
       label: "姓名",
+      attrs: { allowClear: true },
     },
     {
       prop: "examSite",
@@ -75,6 +77,7 @@ const fields = computed(() => {
       attrs: {
         options: examSiteOptions.value || [],
         fieldNames: { label: "name", value: "code" },
+        allowClear: true,
       },
     },
     {
@@ -85,12 +88,14 @@ const fields = computed(() => {
       attrs: {
         options: examCampusOptions.value || [],
         fieldNames: { label: "name", value: "code" },
+        allowClear: true,
       },
     },
     {
       prop: "packageCode",
       colSpan: 3,
       label: "卷袋号",
+      attrs: { allowClear: true },
     },
     {
       type: "buttons",

+ 1 - 6
src/render/views/ScanManage/WorkStatistics.vue

@@ -19,7 +19,6 @@ import { getWorkStatistics, exportWorkStatistics } from "@/ap/scanManage";
 import { useUserStore } from "@/store";
 import VueEcharts from "vue-echarts";
 import { graphic } from "echarts";
-import { downloadByApi } from "@/utils/download";
 
 const userStore = useUserStore();
 const params = reactive({
@@ -35,7 +34,6 @@ const transParams = computed(() => {
 const data = ref([]);
 const search = () => {
   getWorkStatistics(transParams.value).then((res: any) => {
-    console.log("mock 扫描员工作量统计", res);
     data.value = res || [];
   });
 };
@@ -162,13 +160,10 @@ const exportFile = async () => {
   if (exportLoading.value) return;
   exportLoading.value = true;
 
-  downloadByApi(() => exportWorkStatistics(transParams.value))
+  exportWorkStatistics(transParams.value)
     .then(() => {
       window.$message.success("导出成功!");
     })
-    .catch((e: Error) => {
-      window.$message.error(e.message || "下载失败,请重新尝试!");
-    })
     .finally(() => {
       exportLoading.value = false;
     });