zhangjie 1 year ago
parent
commit
410d8b14aa

+ 3 - 1
src/modules/client/components/OcrAreaSetDialog.vue

@@ -72,7 +72,9 @@ export default {
     async dialogOpened() {
       await this.evokeScanExe();
       await this.initData();
-      this.initCropper();
+      this.$nextTick(() => {
+        this.initCropper();
+      });
     },
     async evokeScanExe() {
       await evokeScanner(this.GLOBAL.input).catch((error) => {

+ 6 - 1
src/modules/client/components/ScanTaskProcessDialog.vue

@@ -103,6 +103,7 @@ export default {
         SAVING: "保存数据中",
       },
       user: this.$ls.get("user", {}),
+      lastStudentCode: "",
     };
   },
   computed: {
@@ -220,8 +221,12 @@ export default {
             console.error(err);
             logger.error(`04-2条码解析失败,${err}`);
           });
-          fileInfo.studentCode = num || "";
+          fileInfo.studentCode = num || this.lastStudentCode;
           fileInfo.ocrArea = JSON.stringify(this.ocrArea);
+
+          if (fileInfo.studentCode) {
+            this.lastStudentCode = fileInfo.studentCode;
+          }
         }
         let res = true;
         await db.saveUploadInfo(fileInfo).catch((err) => {

+ 1 - 2
src/modules/client/views/Scan.vue

@@ -136,8 +136,7 @@ export default {
     },
     percentage() {
       const studentCount = this.task.studentCount || 0;
-      const scanStudentCount = 8;
-      // const scanStudentCount = this.task.scanStudentCount || 0;
+      const scanStudentCount = this.task.scanStudentCount || 0;
       if (!studentCount) return 0;
       return ((scanStudentCount * 100) / studentCount).toFixed(2) * 1;
     },

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

@@ -2,7 +2,7 @@
   <div class="login" @keyup.enter="submit">
     <div class="login-spin">
       <h1>欢迎使用</h1>
-      <h4>知学知考-档案电子化扫描系统</h4>
+      <h4>知学知考-试卷电子化扫描系统</h4>
     </div>
     <div class="login-body">
       <div class="login-head">

+ 2 - 1
src/plugins/scanner.js

@@ -16,7 +16,8 @@ export function evokeScanner(inputDir) {
   if (!isWindowsPlatform) return Promise.resolve(true);
 
   const commandStr = `${getScanExePath()} -scan -d${inputDir}`;
-  // console.log(commandStr);
+
+  console.log(commandStr);
   return childProcessExec(commandStr);
   // return Promise.resolve({ succeed: true });
 }

+ 1 - 0
vue.config.js

@@ -27,6 +27,7 @@ module.exports = defineConfig({
           signAndEditExecutable: false,
         },
       },
+      customFileProtocol: "./",
     },
   },
 });