zhangjie 2 жил өмнө
parent
commit
5d8710278f

BIN
extra/database/org.rdb


+ 3 - 3
package.json

@@ -10,7 +10,7 @@
     "win:build": "vue-cli-service electron:build",
     "win:build": "vue-cli-service electron:build",
     "e:build": "vue-cli-service electron:build --win --x64 --ia32",
     "e:build": "vue-cli-service electron:build --win --x64 --ia32",
     "e:serve": "vue-cli-service electron:serve",
     "e:serve": "vue-cli-service electron:serve",
-    "postinstall": "electron-builder install-app-deps",
+    "postinstall": "electron-builder install-app-deps --arch=x64",
     "postuninstall": "electron-builder install-app-deps"
     "postuninstall": "electron-builder install-app-deps"
   },
   },
   "main": "background.js",
   "main": "background.js",
@@ -25,7 +25,7 @@
     "gm": "^1.23.1",
     "gm": "^1.23.1",
     "imagemagick": "^0.1.3",
     "imagemagick": "^0.1.3",
     "log4js": "^6.3.0",
     "log4js": "^6.3.0",
-    "sqlite3": "^4.2.0",
+    "sqlite3": "^5.0.0",
     "vue": "^2.6.11",
     "vue": "^2.6.11",
     "vue-ls": "^3.2.2",
     "vue-ls": "^3.2.2",
     "vue-router": "^3.2.0",
     "vue-router": "^3.2.0",
@@ -48,7 +48,7 @@
     "sass": "^1.26.5",
     "sass": "^1.26.5",
     "sass-loader": "^8.0.2",
     "sass-loader": "^8.0.2",
     "terser-webpack-plugin": "^3.0.1",
     "terser-webpack-plugin": "^3.0.1",
-    "vue-cli-plugin-electron-builder": "~1.4.6",
+    "vue-cli-plugin-electron-builder": "~2.0.0-rc.5",
     "vue-template-compiler": "^2.6.11"
     "vue-template-compiler": "^2.6.11"
   },
   },
   "gitHooks": {
   "gitHooks": {

+ 2 - 1
src/mixins/initStoreMixin.js

@@ -17,7 +17,8 @@ export default {
         "startCountTime",
         "startCountTime",
         "lastLoginUser",
         "lastLoginUser",
         "domain",
         "domain",
-        "schoolCode", 'ocrArea'
+        "schoolCode",
+        "ocrArea"
       ];
       ];
       for (let i = 0; i < needInitDict.length; i++) {
       for (let i = 0; i < needInitDict.length; i++) {
         if (!Object.prototype.hasOwnProperty.call(storeDict, needInitDict[i])) {
         if (!Object.prototype.hasOwnProperty.call(storeDict, needInitDict[i])) {

+ 8 - 7
src/modules/client/components/OcrAreaSetDialog.vue

@@ -47,6 +47,7 @@
 <script>
 <script>
 import Cropper from "cropperjs";
 import Cropper from "cropperjs";
 import db from "@/plugins/db";
 import db from "@/plugins/db";
+import { getPreUploadFiles } from "../../../plugins/imageOcr";
 
 
 export default {
 export default {
   name: "ocr-area-set",
   name: "ocr-area-set",
@@ -57,7 +58,7 @@ export default {
       rotate: 0,
       rotate: 0,
       spinStyle: {},
       spinStyle: {},
       ocrArea: {},
       ocrArea: {},
-      curImageUrl: "",
+      curImageUrl: ""
     };
     };
   },
   },
   methods: {
   methods: {
@@ -89,7 +90,7 @@ export default {
       delete defCodeArea.rotate;
       delete defCodeArea.rotate;
 
 
       this.spinStyle = {
       this.spinStyle = {
-        transform: `translate(-50%, -50%) rotate(${this.rotate}deg)`,
+        transform: `translate(-50%, -50%) rotate(${this.rotate}deg)`
       };
       };
 
 
       this.cropper = new Cropper(this.$refs.editImage, {
       this.cropper = new Cropper(this.$refs.editImage, {
@@ -102,7 +103,7 @@ export default {
         ready() {
         ready() {
           _this.cropper.setData(defCodeArea);
           _this.cropper.setData(defCodeArea);
           // _this.$emit("on-ready");
           // _this.$emit("on-ready");
-        },
+        }
       });
       });
     },
     },
     toRotateSpin() {
     toRotateSpin() {
@@ -110,25 +111,25 @@ export default {
       if (this.rotate === 360) this.rotate = 0;
       if (this.rotate === 360) this.rotate = 0;
 
 
       this.spinStyle = {
       this.spinStyle = {
-        transform: `translate(-50%, -50%) rotate(${this.rotate}deg)`,
+        transform: `translate(-50%, -50%) rotate(${this.rotate}deg)`
       };
       };
     },
     },
     confirm() {
     confirm() {
       const ocrArea = {
       const ocrArea = {
         ...this.cropper.getData(),
         ...this.cropper.getData(),
-        rotate: this.rotate,
+        rotate: this.rotate
       };
       };
       db.setDict("ocrArea", JSON.stringify(ocrArea));
       db.setDict("ocrArea", JSON.stringify(ocrArea));
       this.$store.commit("client/setOcrArea", ocrArea);
       this.$store.commit("client/setOcrArea", ocrArea);
       this.$emit("modified", ocrArea);
       this.$emit("modified", ocrArea);
       this.close();
       this.close();
-    },
+    }
   },
   },
   beforeDestroy() {
   beforeDestroy() {
     if (this.cropper) {
     if (this.cropper) {
       this.cropper.destroy();
       this.cropper.destroy();
       this.cropper = false;
       this.cropper = false;
     }
     }
-  },
+  }
 };
 };
 </script>
 </script>

+ 19 - 19
src/modules/client/components/ScanTaskProcessDialog.vue

@@ -73,7 +73,7 @@ import {
   saveOutputImage,
   saveOutputImage,
   renamePreUploadJsonFile,
   renamePreUploadJsonFile,
   clearDir,
   clearDir,
-  decodeImageCode,
+  decodeImageCode
 } from "../../../plugins/imageOcr";
 } from "../../../plugins/imageOcr";
 import setTimeMixins from "../../../mixins/setTimeMixins";
 import setTimeMixins from "../../../mixins/setTimeMixins";
 import db from "../../../plugins/db";
 import db from "../../../plugins/db";
@@ -88,8 +88,8 @@ export default {
       type: Object,
       type: Object,
       default() {
       default() {
         return {};
         return {};
-      },
-    },
+      }
+    }
   },
   },
   mixins: [setTimeMixins],
   mixins: [setTimeMixins],
   data() {
   data() {
@@ -99,20 +99,20 @@ export default {
       user: this.$ls.get("user", { id: "" }),
       user: this.$ls.get("user", { id: "" }),
       scanStatus: "INIT", // INIT:初始状态,START:已开始,PAUSE:已暂停
       scanStatus: "INIT", // INIT:初始状态,START:已开始,PAUSE:已暂停
       modalForm: {
       modalForm: {
-        preScanCount: 0,
+        preScanCount: 0
       },
       },
       rules: {
       rules: {
         preScanCount: [
         preScanCount: [
           {
           {
             required: true,
             required: true,
             message: "请输入预扫张数",
             message: "请输入预扫张数",
-            trigger: "change",
-          },
-        ],
+            trigger: "change"
+          }
+        ]
       },
       },
       scaningImageList: [],
       scaningImageList: [],
       realScanCount: 0,
       realScanCount: 0,
-      taskScanUserId: "",
+      taskScanUserId: ""
     };
     };
   },
   },
   computed: {
   computed: {
@@ -122,7 +122,7 @@ export default {
     },
     },
     taskBound() {
     taskBound() {
       return this.user.id === this.taskScanUserId;
       return this.user.id === this.taskScanUserId;
-    },
+    }
   },
   },
   beforeDestroy() {
   beforeDestroy() {
     this.clearSetTs();
     this.clearSetTs();
@@ -168,7 +168,7 @@ export default {
       if (!this.taskBound) {
       if (!this.taskBound) {
         await bingScanUser({
         await bingScanUser({
           paperScanTaskId: this.task.id,
           paperScanTaskId: this.task.id,
-          userId: this.user.id,
+          userId: this.user.id
         });
         });
         this.taskScanUserId = this.user.id;
         this.taskScanUserId = this.user.id;
       }
       }
@@ -189,7 +189,7 @@ export default {
     async evokeScanExe() {
     async evokeScanExe() {
       logger.info("02唤起扫描仪");
       logger.info("02唤起扫描仪");
       // console.log(commandStr);
       // console.log(commandStr);
-      await evokeScanner(this.GLOBAL.input).catch((error) => {
+      await evokeScanner(this.GLOBAL.input).catch(error => {
         console.error(error);
         console.error(error);
       });
       });
       this.scanStatus = "PAUSE";
       this.scanStatus = "PAUSE";
@@ -222,7 +222,7 @@ export default {
       logger.info(`04-2保存数据结束`);
       logger.info(`04-2保存数据结束`);
 
 
       const confirm = await this.$confirm(`是否继续扫描?`, "提示", {
       const confirm = await this.$confirm(`是否继续扫描?`, "提示", {
-        type: "warning",
+        type: "warning"
       }).catch(() => {});
       }).catch(() => {});
       this.clearScanList();
       this.clearScanList();
 
 
@@ -238,7 +238,7 @@ export default {
         `取消扫描后,当前未保存的数据将会被清空,确定要取消扫描吗?`,
         `取消扫描后,当前未保存的数据将会被清空,确定要取消扫描吗?`,
         "提示",
         "提示",
         {
         {
-          type: "warning",
+          type: "warning"
         }
         }
       ).catch(() => {});
       ).catch(() => {});
       if (confirm !== "confirm") return;
       if (confirm !== "confirm") return;
@@ -262,7 +262,7 @@ export default {
         const ouputImageList = saveOutputImage(
         const ouputImageList = saveOutputImage(
           [files.frontFile, files.versoFile],
           [files.frontFile, files.versoFile],
           {
           {
-            taskId: this.task.id,
+            taskId: this.task.id
           }
           }
         );
         );
         const fileInfo = {
         const fileInfo = {
@@ -276,18 +276,18 @@ export default {
           examNumber: "",
           examNumber: "",
           clientUserId: this.user.id,
           clientUserId: this.user.id,
           clientUsername: this.user.name,
           clientUsername: this.user.name,
-          clientUserLoginTime: this.user.loginTime,
+          clientUserLoginTime: this.user.loginTime
         };
         };
 
 
         if (this.openScan) {
         if (this.openScan) {
-          const num = await decodeImageCode(ouputImageList[0]).catch(() => {
+          const num = await decodeImageCode(ouputImageList[0]).catch(err => {
             console.error(err);
             console.error(err);
             logger.error(`04-2条码解析失败,${err}`);
             logger.error(`04-2条码解析失败,${err}`);
           });
           });
           fileInfo.examNumber = num || "";
           fileInfo.examNumber = num || "";
         }
         }
 
 
-        await db.saveUploadInfo(fileInfo).catch((err) => {
+        await db.saveUploadInfo(fileInfo).catch(err => {
           console.error(err);
           console.error(err);
           logger.error(`04-1保存数据错误,${err}`);
           logger.error(`04-1保存数据错误,${err}`);
         });
         });
@@ -296,7 +296,7 @@ export default {
     clearScanList() {
     clearScanList() {
       this.scaningImageList = [];
       this.scaningImageList = [];
       clearDir(this.GLOBAL.input);
       clearDir(this.GLOBAL.input);
-    },
-  },
+    }
+  }
 };
 };
 </script>
 </script>

+ 1 - 1
src/modules/client/store.js

@@ -21,7 +21,7 @@ const mutations = {
   setUnuploadNo(state, unuploadNo) {
   setUnuploadNo(state, unuploadNo) {
     state.unuploadNo = unuploadNo;
     state.unuploadNo = unuploadNo;
   },
   },
-  setOcrArea(state,ocrArea) {
+  setOcrArea(state, ocrArea) {
     state.ocrArea = ocrArea;
     state.ocrArea = ocrArea;
   }
   }
 };
 };

+ 13 - 13
src/modules/client/views/TaskManage.vue

@@ -150,7 +150,7 @@ export default {
   name: "task-manage",
   name: "task-manage",
   components: {
   components: {
     ScanTaskProcessDialog,
     ScanTaskProcessDialog,
-    OcrAreaSetDialog,
+    OcrAreaSetDialog
   },
   },
   data() {
   data() {
     return {
     return {
@@ -158,22 +158,22 @@ export default {
       tabs: [
       tabs: [
         {
         {
           name: "全部",
           name: "全部",
-          val: "all",
+          val: "all"
         },
         },
         {
         {
           name: "我的",
           name: "我的",
-          val: "my",
-        },
+          val: "my"
+        }
       ],
       ],
       cacheData: {
       cacheData: {
         all: {},
         all: {},
-        my: {},
+        my: {}
       },
       },
       filter: {
       filter: {
         paperArchivesId: "",
         paperArchivesId: "",
         courseName: "",
         courseName: "",
         teachClazzName: "",
         teachClazzName: "",
-        isMine: false,
+        isMine: false
       },
       },
       current: 1,
       current: 1,
       size: 10,
       size: 10,
@@ -183,13 +183,13 @@ export default {
       recordList: [],
       recordList: [],
       courseList: [],
       courseList: [],
       teachingClassList: [],
       teachingClassList: [],
-      ocrArea: null,
+      ocrArea: null
     };
     };
   },
   },
   computed: {
   computed: {
     openScan() {
     openScan() {
       return this.$store.state.user.openScan;
       return this.$store.state.user.openScan;
-    },
+    }
   },
   },
   mounted() {
   mounted() {
     this.getOcrArea();
     this.getOcrArea();
@@ -211,7 +211,7 @@ export default {
     async getList() {
     async getList() {
       let datas = {
       let datas = {
         pageNumber: this.current,
         pageNumber: this.current,
-        pageSize: this.size,
+        pageSize: this.size
       };
       };
       if (this.curTab === "all") {
       if (this.curTab === "all") {
         datas = { ...datas, ...this.filter };
         datas = { ...datas, ...this.filter };
@@ -230,7 +230,7 @@ export default {
       this.cacheData[this.curTab] = {
       this.cacheData[this.curTab] = {
         current: this.current,
         current: this.current,
         total: this.total,
         total: this.total,
-        dataList: this.dataList,
+        dataList: this.dataList
       };
       };
 
 
       this.curTab = curTab;
       this.curTab = curTab;
@@ -256,10 +256,10 @@ export default {
     async toEnable(row) {
     async toEnable(row) {
       await enableScanTask({
       await enableScanTask({
         paperScanTaskId: row.id,
         paperScanTaskId: row.id,
-        enable: !row.enable,
+        enable: !row.enable
       });
       });
       row.enable = !row.enable;
       row.enable = !row.enable;
-    },
-  },
+    }
+  }
 };
 };
 </script>
 </script>

+ 11 - 7
src/plugins/imageOcr.js

@@ -1,7 +1,12 @@
 import {
 import {
-  getInputDir, getOutputDir, makeDirSync, getImgDecodeTool, getTmpDir, getExtraDir,
+  getInputDir,
+  getOutputDir,
+  makeDirSync,
+  getImgDecodeTool,
+  getTmpDir,
+  getExtraDir
 } from "./env";
 } from "./env";
-import { randomCode } from "./utils";
+import { randomCode, formatDate } from "./utils";
 const fs = require("fs");
 const fs = require("fs");
 const path = require("path");
 const path = require("path");
 const childProcess = require("child_process");
 const childProcess = require("child_process");
@@ -10,8 +15,7 @@ const gm = require("gm").subClass({
   appPath: getExtraDir("imagemagick/")
   appPath: getExtraDir("imagemagick/")
 });
 });
 
 
-
-/** 
+/**
  * 旋转图片,并保存为正式文件
  * 旋转图片,并保存为正式文件
  * @param {*} scaningImageList 图片路径
  * @param {*} scaningImageList 图片路径
  * @param {String} paperInfo 保持文件名称
  * @param {String} paperInfo 保持文件名称
@@ -182,7 +186,7 @@ export function decodeImageCode(imgPath, codeArea) {
 
 
   return new Promise((resolve, reject) => {
   return new Promise((resolve, reject) => {
     // 写入临时文件
     // 写入临时文件
-    imgObj.write(tmpFile, function (err) {
+    imgObj.write(tmpFile, function(err) {
       if (err) {
       if (err) {
         reject("条形码临时文件获取失败");
         reject("条形码临时文件获取失败");
         return;
         return;
@@ -207,9 +211,9 @@ export function decodeImageCode(imgPath, codeArea) {
         return;
         return;
       }
       }
       // 暂时不删除临时文件
       // 暂时不删除临时文件
-      fs.unlink(tmpFile, () => { });
+      fs.unlink(tmpFile, () => {});
 
 
       resolve(code);
       resolve(code);
     });
     });
   });
   });
-}
+}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 365 - 274
yarn.lock


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно