Browse Source

fix:仲裁

zhangjie 8 months ago
parent
commit
639a481b92
2 changed files with 59 additions and 19 deletions
  1. 2 0
      src/render/styles/pages.less
  2. 57 19
      src/render/views/RecognizeCheck/RecognizeArbitrate.vue

+ 2 - 0
src/render/styles/pages.less

@@ -294,11 +294,13 @@
 
     .modal-box {
       min-height: 88px;
+      height: 100%;
       background: #ffffff;
       border-radius: 6px;
       border: 1px solid #e5e5e5;
       padding: 16px;
       color: @text-color1;
+      overflow: hidden;
 
       .box-title {
         height: 22px;

+ 57 - 19
src/render/views/RecognizeCheck/RecognizeArbitrate.vue

@@ -25,7 +25,18 @@
         <a-row align="top" :gutter="8" class="m-b-8px">
           <a-col :span="6">
             <div class="modal-box">
-              <p class="box-title">客观题</p>
+              <p
+                v-if="curArbitrateTaskDetail.type === 'question'"
+                class="box-title"
+              >
+                客观题
+              </p>
+              <p
+                v-else-if="curArbitrateTaskDetail.type === 'paperType'"
+                class="box-title"
+              >
+                卷型
+              </p>
               <p class="box-cont">{{ curTaskDetailName }}</p>
             </div>
           </a-col>
@@ -41,7 +52,7 @@
             </div>
           </a-col>
         </a-row>
-        <a-row align="top" :gutter="8">
+        <a-row align="stretch" :gutter="8">
           <a-col :span="3">
             <div class="modal-box">
               <p class="box-title">一评结果</p>
@@ -97,9 +108,11 @@ import {
   SwapLeftOutlined,
 } from "@ant-design/icons-vue";
 import { message } from "ant-design-vue";
+import { useUserStore } from "@/store";
 
 import RecognizeImage from "./RecognizeImage.vue";
 
+import { getBaseDataConfig } from "@/ap/baseDataConfig";
 import {
   recognizeArbitrateTask,
   recognizeArbitrateSave,
@@ -121,8 +134,15 @@ defineOptions({
 
 const router = useRouter();
 const route = useRoute();
+const userStore = useUserStore();
 const groupId = route.params.groupId ? Number(route.params.groupId) : 0;
 
+const paperTypeBarcodeContent = ref<string[]>([]);
+async function getConfig() {
+  const res = await getBaseDataConfig({ examId: userStore.curExam.id });
+  paperTypeBarcodeContent.value = res.paperTypeBarcodeContent || [];
+}
+
 // 任务进度
 const progress = ref({
   finishCount: 0,
@@ -217,22 +237,38 @@ function parseDetails(
     //   });
     // }
 
-    // // 试卷类型
-    // if (page.paperType) {
-    //   details.push({
-    //     ...parseDetailSize(
-    //       recogData.paperType.fill_result[0],
-    //       "paperType",
-    //       0,
-    //       []
-    //     ),
-    //     result1: page.paperType ? page.paperType[0] : "",
-    //     result2: page.paperType ? page.paperType[1] : "",
-    //     pageIndex: page.index,
-    //     groupId: groupId,
-    //     uri: page.uri,
-    //   });
-    // }
+    // 试卷类型
+    if (page.paperType) {
+      let fillArea: AreaSize | null = null;
+      const rect = recogData.paperType.rect || null;
+      if (rect) {
+        const hasArea = rect.some((item) => item);
+        if (hasArea) {
+          fillArea = {
+            x: rect[0],
+            y: rect[1],
+            w: rect[2],
+            h: rect[3],
+          };
+        }
+      }
+
+      details.push({
+        ...parseDetailSize(
+          recogData.paperType.fill_result[0],
+          "paperType",
+          0,
+          []
+        ),
+        options: ["#", ...paperTypeBarcodeContent.value],
+        result1: page.paperType ? page.paperType[0] : "",
+        result2: page.paperType ? page.paperType[1] : "",
+        pageIndex: page.index,
+        groupId,
+        fillArea: fillArea || { x: 0, y: 0, w: 0, h: 0 },
+        uri: page.uri,
+      });
+    }
 
     // 试题
     let index = 0;
@@ -262,8 +298,9 @@ function parseDetails(
 // 任务执行流程 ----------------- start>
 async function setCurTaskDetail() {
   const val = curArbitrateTaskDetails.value[curArbitrateTaskDetailIndex.value];
-  curArbitrateTaskDetail.value = val;
+  if (!val) return;
 
+  curArbitrateTaskDetail.value = val;
   curArbitrateTaskDetail.value.sliceImg = await getSliceFileUrl(
     val.uri,
     val.fillArea
@@ -511,6 +548,7 @@ function goback() {
 
 onMounted(async () => {
   await releaseTask();
+  getConfig();
   initData();
   registKeyEvent();
 });