zhangjie пре 4 година
родитељ
комит
3be37c833a

+ 1 - 0
.gitignore

@@ -2,6 +2,7 @@
 node_modules*
 dist*
 dev-proxy.js
+extra/database/client.rdb
 
 # local env files
 .env.local

BIN
extra/database/client.rdb


+ 1 - 1
src/assets/styles/base.less

@@ -96,7 +96,7 @@ select {
 }
 ::-webkit-scrollbar-thumb {
   border-radius: 8px;
-  background: @dark;
+  background: #999;
 }
 ::-webkit-scrollbar-corner {
   background: transparent;

+ 8 - 6
src/assets/styles/home.less

@@ -68,11 +68,13 @@
     > span {
       display: inline-block;
       vertical-align: middle;
-      &:nth-of-type(2) {
-        width: 10px;
-        border-bottom: 1px solid @fontMain;
-        margin: 0 5px;
-      }
+    }
+    > i {
+      display: inline-block;
+      vertical-align: middle;
+      width: 10px;
+      border-bottom: 1px solid @fontMain;
+      margin: 0 5px;
     }
   }
 }
@@ -105,7 +107,7 @@
   left: 80px;
   height: 50px;
   cursor: move;
-  z-index: 999;
+  z-index: 9999;
 }
 
 /* other */

+ 18 - 1
src/assets/styles/pages.less

@@ -337,7 +337,14 @@
     font-size: 40px;
   }
 }
-
+/* scan-wait */
+.scan-wait {
+  padding-top: 200px;
+  text-align: center;
+  button {
+    margin: 0 10px;
+  }
+}
 /* check-info */
 .check-info {
   .check-form {
@@ -654,6 +661,16 @@
   }
 }
 
+/* scan-area-dialog */
+.scan-area-dialog {
+  .ivu-modal-content {
+    background: #25294a !important;
+  }
+  .ivu-modal-body {
+    top: 62px !important;
+  }
+}
+
 @keyframes zoomIn {
   from {
     opacity: 0;

+ 2 - 2
src/background.js

@@ -20,9 +20,9 @@ function createWindow() {
   // Create the browser window.
   win = new BrowserWindow({
     width: isDevelopment ? 1428 : 1024,
-    height: 600,
+    height: 700,
     minWidth: 1024,
-    minHeight: 600,
+    minHeight: 700,
     frame: isDevelopment,
     useContentSize: true,
     webPreferences: {

+ 12 - 7
src/modules/client/components/ScanAreaDialog.vue

@@ -2,24 +2,29 @@
   <Modal
     class="scan-area-dialog"
     v-model="modalIsShow"
-    title="采集设置"
+    title="设置当前试卷采集信息"
     :mask-closable="false"
     :closable="false"
     fullscreen
     footer-hide
   >
-    <setting-steps
-      :image-url="curImage.url"
-      :cur-setting="curCollectConfig"
-      @on-finished="finished"
-      v-if="curImage.url && modalIsShow && curCollectConfig"
-    ></setting-steps>
+    <div class="part-box">
+      <scan-area-steps
+        :image-url="curImage.url"
+        :cur-setting="curCollectConfig"
+        @on-finished="finished"
+        v-if="curImage.url && modalIsShow && curCollectConfig"
+      ></scan-area-steps>
+    </div>
   </Modal>
 </template>
 
 <script>
+import ScanAreaSteps from "../components/ScanAreaSteps";
+
 export default {
   name: "scan-area-dialog",
+  components: { ScanAreaSteps },
   props: {
     curImage: {
       type: Object,

+ 2 - 0
src/modules/client/components/ScanExceptionDialog.vue

@@ -97,6 +97,7 @@
 <script>
 import Cropper from "cropperjs";
 import { getStudentByExamNumber } from "../api";
+const fs = require("fs");
 
 export default {
   name: "scan-exception-dialog",
@@ -195,6 +196,7 @@ export default {
       this.cancel();
     },
     toRescan() {
+      fs.unlinkSync(this.curImage.url);
       this.$emit("on-rescan");
       this.cancel();
     },

+ 6 - 0
src/modules/client/router.js

@@ -2,6 +2,7 @@ import Subject from "./views/Subject.vue";
 import Camera from "./views/Camera.vue";
 import ScanArea from "./views/ScanArea.vue";
 import CheckInfo from "./views/CheckInfo.vue";
+import ScanWait from "./views/ScanWait.vue";
 import GroupScan from "./views/GroupScan.vue";
 import LineScan from "./views/LineScan.vue";
 
@@ -26,6 +27,11 @@ export default [
     name: "CheckInfo",
     component: CheckInfo
   },
+  {
+    path: "/scan-wait",
+    name: "ScanWait",
+    component: ScanWait
+  },
   {
     path: "/group-scan",
     name: "GroupScan",

+ 3 - 8
src/modules/client/views/Camera.vue

@@ -3,7 +3,7 @@
     <div class="part-head">
       <h2>获取相机编号</h2>
     </div>
-    <div class="camera-form">
+    <div class="camera-form" @keyup.enter="submit">
       <Form
         ref="modalFormComp"
         :model="modalForm"
@@ -66,7 +66,7 @@ export default {
     };
   },
   computed: {
-    ...mapState("client", ["curSubject", "clientConfig"])
+    ...mapState("client", ["curSubject"])
   },
   methods: {
     ...mapMutations("client", ["setCamera"]),
@@ -83,13 +83,8 @@ export default {
 
       this.setCamera(this.modalForm.camera);
 
-      const scanRouter = this.clientConfig.packageScan
-        ? "GroupScan"
-        : "LineScan";
       const routerName = this.curSubject.collectConfig
-        ? this.clientConfig.paperStage
-          ? "CheckInfo"
-          : scanRouter
+        ? "ScanWait"
         : "ScanArea";
       this.$router.push({ name: routerName });
     }

+ 2 - 9
src/modules/client/views/ScanArea.vue

@@ -34,7 +34,7 @@ export default {
     };
   },
   computed: {
-    ...mapState("client", ["curSubject", "clientConfig"])
+    ...mapState("client", ["curSubject"])
   },
   mounted() {
     this.curSetting = this.curSubject.collectConfig || {};
@@ -59,14 +59,7 @@ export default {
       });
       this.updateCurSubject(curSubject);
 
-      if (this.clientConfig.paperStage) {
-        this.$router.push({ name: "CheckInfo" });
-      } else {
-        const scanName = this.clientConfig.packageScan
-          ? "GroupScan"
-          : "LineScan";
-        this.$router.push({ name: scanName });
-      }
+      this.$router.push({ name: "ScanWait" });
     }
   },
   beforeDestroy() {

+ 35 - 0
src/modules/client/views/ScanWait.vue

@@ -0,0 +1,35 @@
+<template>
+  <div class="scan-wait part-box">
+    <Button type="error" @click="resetConfig">重新设置采集信息</Button>
+    <Button type="primary" @click="toScan">开始采集</Button>
+  </div>
+</template>
+
+<script>
+import { mapState } from "vuex";
+
+export default {
+  name: "scan-wait",
+  data() {
+    return {};
+  },
+  computed: {
+    ...mapState("client", ["clientConfig"])
+  },
+  methods: {
+    resetConfig() {
+      this.$router.push({ name: "ScanArea" });
+    },
+    toScan() {
+      const scanRouter = this.clientConfig.packageScan
+        ? "GroupScan"
+        : "LineScan";
+      const routerName = this.clientConfig.paperStage
+        ? "CheckInfo"
+        : scanRouter;
+
+      this.$router.push({ name: routerName });
+    }
+  }
+};
+</script>

+ 1 - 1
src/plugins/imageOcr.js

@@ -59,7 +59,7 @@ function decodeImageCode(imgPath, codeArea) {
         return;
       }
       // 暂时不删除临时文件
-      // fs.unlink(tmpFile, () => {});
+      fs.unlink(tmpFile, () => {});
 
       resolve(code);
     });

+ 2 - 1
src/plugins/imageUpload.js

@@ -51,7 +51,8 @@ function toSaveCollectLog(options) {
     clientUserId: options.clientUserId,
     clientUserLoginTime: options.clientUserLoginTime,
     time: formatDate(),
-    name: options.studentName
+    name: options.studentName,
+    manual: options.isManual + ""
   };
   return saveCollectLog(datas);
 }

+ 3 - 2
src/views/Home.vue

@@ -25,7 +25,7 @@
       </div>
       <div class="head-info">
         <span>{{ examName }}</span>
-        <span v-if="curSubject && curSubject.name"></span>
+        <i v-if="curSubject && curSubject.name"></i>
         <span>{{ curSubject.name }}</span>
       </div>
     </div>
@@ -53,7 +53,8 @@ export default {
         Subject: "Login",
         Camera: "Subject",
         ScanArea: "Camera",
-        CheckInfo: "ScanArea",
+        ScanWait: "ScanArea",
+        CheckInfo: "ScanWait",
         GroupScan: "",
         LineScan: ""
       }

+ 3 - 3
src/views/Login.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="login">
+  <div class="login" @keyup.enter="submit">
     <div class="login-header home-header">
       <div class="head-actions">
         <span class="action-icon" title="最小化" @click="minWin"
@@ -68,7 +68,7 @@ export default {
     return {
       loginModel: {
         loginname: "scan01",
-        password: "111111"
+        password: "123456"
       },
       loginRules: {
         loginname: username,
@@ -118,7 +118,7 @@ export default {
       this.$store.commit("client/setClientConfig", {
         imageEncrypt: data.paramSetting.imageEncrypt,
         packageScan: data.paramSetting.packageScan,
-        paperStage: !data.paramSetting.paperStage
+        paperStage: data.paramSetting.paperStage
       });
       this.$router.push({
         name: "Subject"