Ver Fonte

feat: 调试其他扫描

zhangjie há 10 meses atrás
pai
commit
0774394fbb

+ 2 - 2
src/components/base/FileTypeSelect.vue

@@ -9,8 +9,8 @@
     @change="select"
     @change="select"
   >
   >
     <el-option
     <el-option
-      v-for="item in optionList"
-      :key="item.id"
+      v-for="(item, index) in optionList"
+      :key="index"
       :value="item.name"
       :value="item.name"
       :label="item.name"
       :label="item.name"
     >
     >

+ 5 - 7
src/components/base/RoomClassSelect.vue

@@ -9,8 +9,8 @@
     @change="select"
     @change="select"
   >
   >
     <el-option
     <el-option
-      v-for="item in optionList"
-      :key="item.id"
+      v-for="(item, index) in optionList"
+      :key="index"
       :value="item.name"
       :value="item.name"
       :label="item.name"
       :label="item.name"
     >
     >
@@ -19,7 +19,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { roomQuery, classQuery } from "../../modules/client/api";
+import { classRoomQuery } from "../../modules/client/api";
 
 
 export default {
 export default {
   name: "room-class-select",
   name: "room-class-select",
@@ -28,7 +28,6 @@ export default {
     placeholder: { type: String, default: "请选择" },
     placeholder: { type: String, default: "请选择" },
     disabled: { type: Boolean, default: false },
     disabled: { type: Boolean, default: false },
     clearable: { type: Boolean, default: true },
     clearable: { type: Boolean, default: true },
-    type: { type: String, default: "room" },
     filterData: {
     filterData: {
       type: Object,
       type: Object,
       default() {
       default() {
@@ -54,7 +53,7 @@ export default {
     },
     },
     "filterData.courseCode": {
     "filterData.courseCode": {
       handler(val, oldval) {
       handler(val, oldval) {
-        console.log(val);
+        // console.log(val);
         if (val !== oldval) {
         if (val !== oldval) {
           this.search();
           this.search();
           this.$emit("input", "");
           this.$emit("input", "");
@@ -71,8 +70,7 @@ export default {
       this.optionList = [];
       this.optionList = [];
       if (!this.filterData.courseCode) return;
       if (!this.filterData.courseCode) return;
 
 
-      const func = this.type === "room" ? roomQuery : classQuery;
-      const res = await func(this.filterData);
+      const res = await classRoomQuery(this.filterData);
       this.optionList = res;
       this.optionList = res;
     },
     },
     select() {
     select() {

+ 5 - 9
src/modules/client/api.js

@@ -16,15 +16,10 @@ export const commonCourseQuery = (datas) => {
 export const fileTypeQuery = () => {
 export const fileTypeQuery = () => {
   return $postParam("/api/admin/common/course/query", {});
   return $postParam("/api/admin/common/course/query", {});
 };
 };
-// 考场
-export const roomQuery = (datas) => {
+// 班级/考场
+export const classRoomQuery = (datas) => {
   // examId,courseCode
   // examId,courseCode
-  return $postParam("/api/admin/common/room/query", datas);
-};
-// 班级
-export const classQuery = (datas) => {
-  // examId,courseCode
-  return $postParam("/api/admin/common/class/query", datas);
+  return $postParam("/api/admin/client/classroom/get", datas);
 };
 };
 
 
 // scan
 // scan
@@ -41,7 +36,8 @@ export const taskInfos = (datas) => {
   return $postParam(`/api/admin/client/task/get`, datas);
   return $postParam(`/api/admin/client/task/get`, datas);
 };
 };
 export const getStudentInfo = (datas) => {
 export const getStudentInfo = (datas) => {
-  return $postParam(`/api/admin/com/task/get`, datas);
+  // examId,courseCode,studentCode
+  return $postParam(`/api/admin/client/student/get`, datas);
 };
 };
 export const updateStudent = (datas) => {
 export const updateStudent = (datas) => {
   return $post("/api/admin/exam/student/save", datas);
   return $post("/api/admin/exam/student/save", datas);

+ 2 - 1
src/modules/client/components/ManualBindDialog.vue

@@ -296,7 +296,8 @@ export default {
       if (!valid) return;
       if (!valid) return;
 
 
       const res = await getStudentInfo({
       const res = await getStudentInfo({
-        // courseCode: this.task.courseCode,
+        examId: this.task.examId,
+        courseCode: this.task.courseCode,
         studentCode: this.modalForm.studentCode,
         studentCode: this.modalForm.studentCode,
       }).catch(() => {});
       }).catch(() => {});
       if (res) {
       if (res) {

+ 5 - 2
src/modules/client/components/SelectBatchNoDialog.vue

@@ -1,7 +1,9 @@
 <template>
 <template>
   <el-dialog
   <el-dialog
-    class="ocr-area-dialog"
     :visible.sync="modalIsShow"
     :visible.sync="modalIsShow"
+    title="选择批次号"
+    top="10vh"
+    width="400px"
     :close-on-click-modal="false"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     :close-on-press-escape="false"
     append-to-body
     append-to-body
@@ -12,7 +14,7 @@
       :model="modalForm"
       :model="modalForm"
       :rules="rules"
       :rules="rules"
       :key="modalForm.id"
       :key="modalForm.id"
-      label-width="100px"
+      label-width="70px"
     >
     >
       <el-form-item prop="serialNo" label="批次号:">
       <el-form-item prop="serialNo" label="批次号:">
         <el-select
         <el-select
@@ -20,6 +22,7 @@
           filterable
           filterable
           placeholder="编码"
           placeholder="编码"
           :disabled="!!originCode"
           :disabled="!!originCode"
+          style="width: 80px"
         >
         >
           <el-option
           <el-option
             v-for="item in codes"
             v-for="item in codes"

+ 16 - 10
src/modules/client/views/ScanOther.vue

@@ -13,6 +13,10 @@
           <room-class-select
           <room-class-select
             v-model="modalForm.roomOrClass"
             v-model="modalForm.roomOrClass"
             placeholder="请选择考场/班级"
             placeholder="请选择考场/班级"
+            :filter-data="{
+              examId: task.examId,
+              courseCode: task.courseCode,
+            }"
             :disabled="isScaning"
             :disabled="isScaning"
           >
           >
           </room-class-select>
           </room-class-select>
@@ -51,8 +55,8 @@
     <div class="part-box part-box-pad">
     <div class="part-box part-box-pad">
       <el-table ref="TableList" size="medium" :data="scanStageList">
       <el-table ref="TableList" size="medium" :data="scanStageList">
         <el-table-column
         <el-table-column
-          prop="文件名"
-          label="任务名称"
+          prop="filename"
+          label="文件名称"
           min-width="300"
           min-width="300"
         ></el-table-column>
         ></el-table-column>
         <el-table-column
         <el-table-column
@@ -82,6 +86,7 @@ import {
   saveOutputImage,
   saveOutputImage,
   clearDir,
   clearDir,
   getDirScanFile,
   getDirScanFile,
+  getScanFileBasename,
 } from "../../../plugins/imageOcr";
 } from "../../../plugins/imageOcr";
 import db from "../../../plugins/db";
 import db from "../../../plugins/db";
 import { evokeScanner } from "../../../plugins/scanner";
 import { evokeScanner } from "../../../plugins/scanner";
@@ -233,7 +238,7 @@ export default {
         return;
         return;
       }
       }
       logger.info(`03扫描仪停止,扫描数:${res.data.length}`);
       logger.info(`03扫描仪停止,扫描数:${res.data.length}`);
-      await this.stageScanImage(res.data);
+      this.stageScanImage(res.data);
       this.scanStatus = "FINISH";
       this.scanStatus = "FINISH";
       logger.info(`03-1完成条码解析`);
       logger.info(`03-1完成条码解析`);
     },
     },
@@ -246,7 +251,7 @@ export default {
         console.error(error);
         console.error(error);
       });
       });
       this.stopLoopScaningFile();
       this.stopLoopScaningFile();
-      await this.getScaningFile();
+      this.getScaningFile();
 
 
       const scanCount = this.scanStageList.length - this.scanCount;
       const scanCount = this.scanStageList.length - this.scanCount;
       this.scanCount = this.scanStageList.length;
       this.scanCount = this.scanStageList.length;
@@ -263,7 +268,7 @@ export default {
       }
       }
       logger.info(`03扫描仪停止,扫描数:${scanCount}`);
       logger.info(`03扫描仪停止,扫描数:${scanCount}`);
     },
     },
-    async stageScanImage(imageList) {
+    stageScanImage(imageList) {
       for (let i = 0, len = imageList.length; i < len; i++) {
       for (let i = 0, len = imageList.length; i < len; i++) {
         const fileInfo = {
         const fileInfo = {
           id: randomCode(16),
           id: randomCode(16),
@@ -275,6 +280,7 @@ export default {
           courseName: this.task.courseName,
           courseName: this.task.courseName,
           frontOriginImgPath: imageList[i].frontFile,
           frontOriginImgPath: imageList[i].frontFile,
           versoOriginImgPath: imageList[i].versoFile,
           versoOriginImgPath: imageList[i].versoFile,
+          filename: getScanFileBasename(imageList[i].frontFile),
           isFormal: 0,
           isFormal: 0,
           studentName: "",
           studentName: "",
           studentCode: "",
           studentCode: "",
@@ -309,7 +315,7 @@ export default {
         return;
         return;
       }
       }
 
 
-      this.$refs.selectBatchNoDialog.open();
+      this.$refs.SelectBatchNoDialog.open();
     },
     },
     async saveScanData(batchNo) {
     async saveScanData(batchNo) {
       if (this.saving) return;
       if (this.saving) return;
@@ -342,10 +348,10 @@ export default {
     },
     },
     // delay mode
     // delay mode
     // 实时获取扫描图片
     // 实时获取扫描图片
-    async loopScaningFile() {
+    loopScaningFile() {
       this.clearSetTs();
       this.clearSetTs();
       if (!this.looping) return;
       if (!this.looping) return;
-      await this.getScaningFile();
+      this.getScaningFile();
 
 
       this.addSetTime(this.loopScaningFile, 1 * 1000);
       this.addSetTime(this.loopScaningFile, 1 * 1000);
     },
     },
@@ -353,9 +359,9 @@ export default {
       this.clearSetTs();
       this.clearSetTs();
       this.looping = false;
       this.looping = false;
     },
     },
-    async getScaningFile() {
+    getScaningFile() {
       const newScanFiles = getDirScanFile(this.GLOBAL.input);
       const newScanFiles = getDirScanFile(this.GLOBAL.input);
-      await this.stageScanImage(newScanFiles);
+      this.stageScanImage(newScanFiles);
     },
     },
     // table action
     // table action
     async clearStage() {
     async clearStage() {

+ 4 - 1
src/modules/client/views/ScanPaper.vue

@@ -355,6 +355,7 @@ export default {
         }
         }
 
 
         const res = await getStudentInfo({
         const res = await getStudentInfo({
+          examId: this.task.examId,
           courseCode: this.task.courseCode,
           courseCode: this.task.courseCode,
           studentCode: fileInfo.studentCode,
           studentCode: fileInfo.studentCode,
         }).catch(() => {});
         }).catch(() => {});
@@ -418,7 +419,7 @@ export default {
         this.$message.error("当前无要保存的数据!");
         this.$message.error("当前无要保存的数据!");
         return;
         return;
       }
       }
-      this.$refs.selectBatchNoDialog.open();
+      this.$refs.SelectBatchNoDialog.open();
     },
     },
     async saveScanData(batchNo) {
     async saveScanData(batchNo) {
       if (this.saving) return;
       if (this.saving) return;
@@ -455,7 +456,9 @@ export default {
     async loopScaningFile() {
     async loopScaningFile() {
       this.clearSetTs();
       this.clearSetTs();
       if (!this.looping) return;
       if (!this.looping) return;
+      const st = Date.now();
       await this.getScaningFile();
       await this.getScaningFile();
+      console.log(`耗时:${Date.now() - st}ms`);
 
 
       this.addSetTime(this.loopScaningFile, 1 * 1000);
       this.addSetTime(this.loopScaningFile, 1 * 1000);
     },
     },

+ 1 - 0
src/modules/login/views/Login.vue

@@ -48,6 +48,7 @@
             type="password"
             type="password"
             v-model.trim="loginModel.password"
             v-model.trim="loginModel.password"
             placeholder="请输入密码"
             placeholder="请输入密码"
+            show-password
             clearable
             clearable
           >
           >
           </el-input>
           </el-input>

+ 1 - 1
src/plugins/imageUpload.js

@@ -35,7 +35,7 @@ export async function toUploadImg(options) {
     }
     }
   } else {
   } else {
     formData.append("fileType", options.fileType);
     formData.append("fileType", options.fileType);
-    formData.append("roomOrClass", options.roomOrClass);
+    formData.append("classRoomName", options.roomOrClass);
   }
   }
 
 
   return uploadImage(options.isFormal, formData);
   return uploadImage(options.isFormal, formData);