Browse Source

Merge branch 'dev_2.0.0' of http://git.qmth.com.cn/scan-central/client-admin into dev_2.0.0

刘洋 9 months ago
parent
commit
d90e218449

+ 9 - 3
src/render/Layout/index.vue

@@ -13,7 +13,9 @@
         </div>
       </div>
       <div class="user-space">
-        <qm-button type="text" :icon="h(UserOutlined)">admin1</qm-button>
+        <qm-button type="text" :icon="h(UserOutlined)">{{
+          userStore.userInfo?.name
+        }}</qm-button>
         <qm-button
           type="text"
           :icon="h(MinusOutlined)"
@@ -67,10 +69,14 @@ const matched = computed(() => {
   return route.matched || [];
 });
 const isIndexPage = computed(() => {
-  return route.name === "CurExam";
+  return route.name === "CurExam" || route.name === "Audit";
 });
 const backToIndexPage = () => {
-  router.push({ name: "CurExam" });
+  if (userStore.userInfo.role === "AUDITOR") {
+    router.push({ name: "Audit" });
+  } else {
+    router.push({ name: "CurExam" });
+  }
 };
 
 const windowToMin = () => {

+ 4 - 1
src/render/ap/baseDataConfig.ts

@@ -1,6 +1,7 @@
 import { request } from "@/utils/request";
 import { getFileMD5 } from "@/utils/crypto";
 import { obj2formData } from "@/utils/tool";
+import { ConfigInfo } from "./types/base";
 
 export const addOrEditExam = (params: { id?: string | number; name: string }) =>
   request({
@@ -8,7 +9,9 @@ export const addOrEditExam = (params: { id?: string | number; name: string }) =>
     params,
   });
 
-export const getBaseDataConfig = (params: { examId: any }) =>
+export const getBaseDataConfig = (params: {
+  examId: number;
+}): Promise<ConfigInfo> =>
   request({
     url: "/api/admin/exam/config/info",
     params,

+ 11 - 0
src/render/ap/types/base.ts

@@ -30,3 +30,14 @@ export interface UploadFileResult {
   uri: string;
   updateTime: number;
 }
+
+// base config
+export interface ConfigInfo {
+  examId: number;
+  paperTypeBarcodeContent: string[];
+  imageCheckRatio: string | number;
+  imageCheckOrder: string;
+  enableSyncVerify: boolean;
+  scannerAssignedMaxCount: string | number;
+  scannerAssignedVerifyPassword: string;
+}

+ 5 - 5
src/render/views/Audit/ImageCheck/index.vue

@@ -4,19 +4,19 @@
       <a-row :gutter="8">
         <a-col :span="3">
           <span class="head-label">姓名:</span>
-          <span class="head-cont">{{ curImage.name }}</span>
+          <span class="head-cont">{{ curImage?.name }}</span>
         </a-col>
         <a-col :span="4">
           <span class="head-label">准考证号:</span>
-          <span class="head-cont">{{ curImage.examNumber }}</span>
+          <span class="head-cont">{{ curImage?.examNumber }}</span>
         </a-col>
         <a-col :span="4">
           <span class="head-label">科目:</span>
-          <span class="head-cont">{{ batchInfo.device }}</span>
+          <span class="head-cont">{{ curImage?.subjectName }}</span>
         </a-col>
         <a-col :span="3">
           <span class="head-label">张数:</span>
-          <span class="head-cont">{{ batchInfo.batchId }}</span>
+          <span class="head-cont">{{ curImage?.pageName }}</span>
         </a-col>
         <a-col :span="5">
           <span class="head-label">倒计时:</span>
@@ -169,7 +169,7 @@ function initImageData() {
   batchInfo.value.students.forEach((student) => {
     student.papers.forEach((paper, paperIndex) => {
       paper.pages.forEach((page, pageIndex) => {
-        const pageName = `第${paperIndex + 1}张${
+        const pageName = `第${paperIndex + 1}张-${
           pageIndex === 0 ? "正" : "反"
         }面`;
         images.push({

+ 1 - 1
src/render/views/Audit/Main/index.vue

@@ -81,7 +81,7 @@
           <div class="audit-box-foot">
             <a-tag :bordered="false">
               <template #icon><PieChartFilled /></template>抽查比例:{{
-                overviewData.imageCheckTask.checkRatio
+                overviewData.imageCheckTask.checkRatio * 100
               }}%
             </a-tag>
             <a-space :size="8">

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

@@ -84,7 +84,7 @@ const { token } = useToken();
 const getData = () => {
   getBaseDataConfig({ examId: userStore.curExam?.id }).then((res: any) => {
     params.paperTypeBarcodeContent = res.paperTypeBarcodeContent || [];
-    params.imageCheckRatio = res.imageCheckRatio;
+    params.imageCheckRatio = res.imageCheckRatio * 100;
     params.imageCheckOrder = res.imageCheckOrder;
     params.enableSyncVerify = res.enableSyncVerify;
     params.scannerAssignedMaxCount = res.scannerAssignedMaxCount;
@@ -208,6 +208,7 @@ const rules = {
 const save = () => {
   form.value.formRef.validate().then(() => {
     let p: any = { ...params, examId: userStore.curExam.id };
+    p.imageCheckRatio = p.imageCheckRatio / 100;
     delete p.paperTypeBarcodeContentItem;
     saveBaseDataConfig(p).then((res: any) => {
       window.$message.success("保存成功");

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

@@ -1,6 +1,6 @@
 <template>
   <div class="base-data-config h-full">
-    <a-tabs v-model:activeKey="activeKey">
+    <a-tabs v-model:activeKey="activeKey" destroyInactiveTabPane>
       <a-tab-pane key="1" tab="扫描参数配置">
         <ScanParams />
       </a-tab-pane>

+ 87 - 0
src/render/views/DataCheck/ModifyPaperType.vue

@@ -0,0 +1,87 @@
+<template>
+  <a-modal v-model:open="visible" :width="334" centered @ok="confirm">
+    <template #title> 更改卷型号 </template>
+
+    <a-form
+      ref="formRef"
+      :model="formData"
+      :rules="rules"
+      :label-col="{ style: { width: '90px' } }"
+    >
+      <a-form-item label="识别结果">{{ recogData.result.join() }}</a-form-item>
+      <a-form-item label="识别图片">
+        <div class="paper-type-img">
+          <img :src="recogData.areaImg" alt="识别图片" />
+        </div>
+      </a-form-item>
+      <a-form-item label="更改卷型">
+        <ul>
+          <li
+            :class="['type-item', { 'is-active': paperType === '#' }]"
+            @click="selectPaperType('#')"
+          >
+            空
+          </li>
+          <li
+            v-for="item in paperTypeBarcodeContent"
+            :key="item"
+            :class="['type-item', { 'is-active': paperType === item }]"
+            @click="selectPaperType(item)"
+          >
+            {{ item }}
+          </li>
+        </ul>
+      </a-form-item>
+    </a-form>
+  </a-modal>
+</template>
+
+<script setup lang="ts">
+import { onMounted, ref } from "vue";
+import { message } from "ant-design-vue";
+
+import { getBaseDataConfig } from "@/ap/baseDataConfig";
+import { useUserStore } from "@/store";
+import useModal from "@/hooks/useModal";
+
+import { RecogBlock } from "@/utils/recog/recog";
+
+defineOptions({
+  name: "ModifyPaperType",
+});
+
+/* modal */
+const { visible, open, close } = useModal();
+defineExpose({ open, close });
+
+const props = defineProps<{
+  recogData: RecogBlock;
+}>();
+
+const emit = defineEmits(["modified"]);
+
+const paperTypeBarcodeContent = ref<string[]>([]);
+const userStore = useUserStore();
+const paperType = ref("");
+
+async function getConfig() {
+  const res = await getBaseDataConfig({ examId: userStore.curExam.id });
+  paperTypeBarcodeContent.value = res.paperTypeBarcodeContent || [];
+}
+
+function selectPaperType(val: string) {
+  paperType.value = val;
+}
+
+function confirm() {
+  if (!paperType.value) {
+    message.error("请选择卷型");
+    return;
+  }
+  emit("confirm");
+}
+
+onMounted(() => {
+  getConfig();
+});
+</script>

+ 10 - 1
src/render/views/DataCheck/QuestionPanel.vue

@@ -19,7 +19,7 @@
         </template>
         <template v-else>
           <a-button class="ant-gray m-r-4px">{{ info.paperType }}</a-button>
-          <a-button>
+          <a-button @click="onEditPaperType">
             <template #icon><SwapOutlined /></template>
           </a-button>
         </template>
@@ -70,6 +70,8 @@
       </div>
     </div>
   </div>
+
+  <ModifyPaperType ref="modifyPaperTypeRef" />
 </template>
 
 <script setup lang="ts">
@@ -78,6 +80,7 @@ import { message } from "ant-design-vue";
 import { SwapOutlined } from "@ant-design/icons-vue";
 import { QuestionInfo } from "./types";
 import useDictOption from "@/hooks/dictOption";
+import ModifyPaperType from "./ModifyPaperType.vue";
 
 import { vEleClickOutsideDirective } from "@/directives/eleClickOutside";
 
@@ -180,6 +183,12 @@ function onSaveQuesion() {
   emit("change", questionList.value);
 }
 
+// edit paper
+const modifyPaperTypeRef = ref();
+function onEditPaperType() {
+  modifyPaperTypeRef.value?.open();
+}
+
 watch(
   () => props.questions,
   (val) => {

+ 1 - 1
src/render/views/DataCheck/ScanImage/FillAreaSetDialog.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-modal v-model:open="visible" :width="334" centered @ok="confirm">
+  <a-modal v-model:open="visible" :width="334" centered>
     <template #title> 填涂区设置 </template>
 
     <a-form

+ 8 - 1
src/render/views/RecognizeCheck/RecognizeArbitrate.vue

@@ -103,6 +103,7 @@ import {
   recognizeArbitrateSave,
   recognizeArbitrateProgress,
   recognizeArbitrateHistory,
+  recognizeArbitrateRelease,
 } from "@/ap/recognizeCheck";
 import {
   RecognizeArbitrateItem,
@@ -462,6 +463,10 @@ async function submitCurTask() {
   await recognizeArbitrateSave({ id: curTask.id, pages }).catch(() => false);
 }
 
+async function releaseTask() {
+  await recognizeArbitrateRelease(groupId);
+}
+
 // 任务执行流程 ----------------- end>
 
 // 返回
@@ -469,12 +474,14 @@ function goback() {
   router.back();
 }
 
-onMounted(() => {
+onMounted(async () => {
+  await releaseTask();
   initData();
   registKeyEvent();
 });
 
 onBeforeUnmount(() => {
+  releaseTask();
   removeKeyEvent();
 });
 </script>

+ 1 - 1
src/render/views/ScanManage/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="scan-manage h-full">
-    <a-tabs v-model:activeKey="activeKey">
+    <a-tabs v-model:activeKey="activeKey" destroyInactiveTabPane>
       <a-tab-pane key="1" tab="图片查找">
         <ImageView></ImageView>
       </a-tab-pane>