浏览代码

自测修复

刘洋 8 月之前
父节点
当前提交
e62183d7d2

+ 6 - 0
src/render/ap/baseDataConfig.ts

@@ -138,6 +138,12 @@ export const importStu = async (params: {
   });
 };
 
+export const importStuProgress = (params: { taskId: string }) =>
+  request({
+    url: "/api/admin/student/import/progress",
+    params,
+  });
+
 export const exportStu = (params: { examId: any }) => {
   return request({
     url: "/api/admin/student/import/template",

+ 15 - 0
src/render/ap/scanManage.ts

@@ -140,3 +140,18 @@ export const getStuPage = (params: {
     url: "/api/admin/student/page",
     params,
   });
+
+export const exportStu = (params: {
+  examId: any;
+  campusCode?: string;
+  subjectCode?: string;
+  province?: string;
+  examSite?: string;
+  examRoom?: string;
+  scanned?: boolean | null;
+}) =>
+  request({
+    url: "/api/admin/student/export",
+    params,
+    download: true,
+  });

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

@@ -107,7 +107,7 @@ const fields = ref([
   {
     cell: "label1",
     label: "卷型条码内容",
-    colSpan: 6,
+    colSpan: 4,
     labelWidth: 130,
   },
   {
@@ -115,19 +115,19 @@ const fields = ref([
     cell: "paperTypeBarcodeContentItem",
     label: "",
     labelWidth: 0,
-    colSpan: 18,
+    colSpan: 20,
   },
   {
     cell: "label2",
     label: "图片检查",
-    colSpan: 6,
+    colSpan: 4,
     labelWidth: 130,
   },
   {
     prop: "imageCheckRatio",
     cell: "imageCheckRatio",
     label: "抽查比例",
-    colSpan: 9,
+    colSpan: 10,
   },
   {
     prop: "imageCheckOrder",
@@ -139,18 +139,18 @@ const fields = ref([
       ],
     },
     label: "检查顺序",
-    colSpan: 9,
+    colSpan: 10,
   },
   {
     cell: "label3",
     label: "实时审核",
-    colSpan: 6,
+    colSpan: 4,
     labelWidth: 130,
   },
   {
     prop: "enableSyncVerify",
     label: "",
-    colSpan: 18,
+    colSpan: 20,
     type: "radio",
     attrs: {
       options: [
@@ -162,19 +162,19 @@ const fields = ref([
   {
     cell: "label3",
     label: "人工绑定锁屏控制",
-    colSpan: 6,
+    colSpan: 4,
     labelWidth: 130,
   },
   {
     prop: "scannerAssignedMaxCount",
     cell: "scannerAssignedMaxCount",
     label: "锁屏数量",
-    colSpan: 9,
+    colSpan: 10,
   },
   {
     prop: "scannerAssignedVerifyPassword",
     type: "password",
-    colSpan: 9,
+    colSpan: 10,
     label: "解锁密码",
   },
 ]);
@@ -207,7 +207,7 @@ const rules = {
 };
 const save = () => {
   form.value.formRef.validate().then(() => {
-    let p: any = { ...params, examId: userStore.curExam.id };
+    let p: any = { ...params, examId: userStore.curExam?.id };
     p.imageCheckRatio = p.imageCheckRatio / 100;
     delete p.paperTypeBarcodeContentItem;
     saveBaseDataConfig(p).then((res: any) => {

+ 16 - 5
src/render/views/BaseDataConfig/StuImportFileDialog.vue

@@ -21,18 +21,27 @@
         >
       </template>
     </qm-low-form>
+    <my-modal v-model:open="showProgressDialog" title="考生导入进度">
+      <p>{{ curFileName }}</p>
+      <a-progress :percent="progress" :status="progressStatus" />
+    </my-modal>
   </my-modal>
 </template>
 <script name="StuImportFileDialog" lang="ts" setup>
 import { ref, reactive, h } from "vue";
-import { importStu, exportStu } from "@/ap/baseDataConfig";
+import { importStu, exportStu, importStuProgress } from "@/ap/baseDataConfig";
 import { VerticalAlignBottomOutlined } from "@ant-design/icons-vue";
-import { downloadByCrossUrl } from "@/utils/tool";
 import { useUserStore } from "@/store";
 
 const userStore = useUserStore();
 const form = ref();
 const visible = defineModel();
+const showProgressDialog = ref(false);
+const progressStatus = ref<
+  "active" | "success" | "normal" | "exception" | undefined
+>("active"); // 'exception' 'normal' 'success'
+const progress = ref(0);
+const curFileName = ref("");
 const emit = defineEmits(["success"]);
 
 const params = reactive({
@@ -48,19 +57,21 @@ const rules = {
 };
 const getFile = (file: any) => {
   params.file = file;
+  curFileName.value = file?.name || "";
 };
 const submitHandle = () => {
   form.value.formRef.validate().then(() => {
     importStu({ examId: userStore.curExam?.id as number, ...params }).then(
       (res: any) => {
-        window.$message.success("考生导入成功");
-        visible.value = false;
+        let taskId = res.taskId;
+        showProgressDialog.value = true;
+        // visible.value = false;
       }
     );
   });
 };
 const downloadTpl = () => {
-  exportStu({ examId: userStore.curExam.id });
+  exportStu({ examId: userStore.curExam?.id });
 };
 </script>
 <style lang="less" scoped></style>

+ 11 - 1
src/render/views/ScanManage/StuInfo.vue

@@ -25,7 +25,12 @@ import { useUserStore } from "@/store";
 import { useRequest } from "vue-request";
 import useTable from "@/hooks/useTable";
 import SelectSubject from "@/components/SelectSubject/index.vue";
-import { getSiteList, getCampusList, getStuPage } from "@/ap/scanManage";
+import {
+  getSiteList,
+  getCampusList,
+  getStuPage,
+  exportStu,
+} from "@/ap/scanManage";
 import type { TableColumnsType } from "@qmth/ui";
 const userStore = useUserStore();
 //考点下拉
@@ -112,6 +117,11 @@ const fields = computed(() => {
           attrs: {
             type: "default",
           },
+          onClick: () => {
+            exportStu(transParams.value).then(() => {
+              window.$message.success("导出成功!");
+            });
+          },
         },
       ],
     },