zhangjie 3 年之前
父节点
当前提交
4cc8f61cfc
共有 3 个文件被更改,包括 135 次插入135 次删除
  1. 124 124
      README.md
  2. 2 2
      package.json
  3. 9 9
      src/modules/cropper-task/taskUtils.js

+ 124 - 124
README.md

@@ -1,124 +1,124 @@
-# msyj-client 美术阅卷采集端系统
-
-## 项目操作
-
-#### 项目安装
-
-```
-yarn install
-```
-
-#### 开发模式
-
-```
-yarn start
-```
-
-#### 项目打包
-
-```
-yarn run electron:build
-```
-
-#### lint 项目文件,并修正格式
-
-```
-yarn run lint
-```
-
-### 自定义配置
-
-- See [Configuration Reference](https://cli.vuejs.org/config/).
-- See [Vue CLI Plugin Electron Builder](https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/guide.html).
-- See [electron-builder Common Configuration](https://www.electron.build/configuration/configuration).
-
-## 系统开发目录说明
-
-- 开发目录:`当前代码目录`
-- 开发运行环境目录:`${开发目录}/node_modules/electron/dist/`
-- 正式运行环境目录:
-  - window: `C:~\AppData\Local\Programs\{系统名称}\`
-
-## 关于使用第三方工具的处理办法
-
-**所有第三方工具统一存放在根目录`extra`文件夹中**
-
-- 设置文件`vue.config.js`
-
-> [配置 api](https://www.electron.build/configuration/contents#extrafiles)
-
-```js
-// config中新增如下配置
-pluginOptions: {
-  electronBuilder: {
-    builderOptions: {
-      extraFiles: ["extra/**"]
-    }
-  }
-},
-```
-
-- 设置`plugins/env.js`
-
-```js
-// 运行系统的根目录
-const homePath = path.dirname(process.execPath);
-// 开放环境中,使用开发代码的根目录;正式包中,使用运行系统的根目录。
-const extraPath =
-  process.env.NODE_ENV === "production"
-    ? path.join(homePath, "extra")
-    : path.join(__static, "../extra");
-```
-
-## 配置打包参数(可选)
-
-```json
-{
-  "pluginOptions": {
-    "electronBuilder": {
-      "builderOptions": {
-        "appId": "com.example.app",
-        "productName": "aDemo", // 项目名,也是生成的安装文件名,即aDemo.exe
-        "copyright": "Copyright © 2020", //版权信息
-        "directories": {
-          "output": "./dist" //输出文件路径
-        },
-        "win": {
-          // win相关配置
-          "icon": "./shanqis.ico", // 图标,当前图标在根目录下,注意这里有两个坑
-          "target": [
-            {
-              "target": "nsis", // 利用nsis制作安装程序
-              "arch": [
-                "x64" // 64位
-              ]
-            }
-          ]
-        },
-        "nsis": {
-          "oneClick": false, // 是否一键安装
-          "allowElevation": true, // 允许请求提升。 如果为false,则用户必须使用提升的权限重新启动安装程序。
-          "allowToChangeInstallationDirectory": true, // 允许修改安装目录
-          "installerIcon": "./shanqis.ico", // 安装图标
-          "uninstallerIcon": "./shanqis.ico", //卸载图标
-          "installerHeaderIcon": "./shanqis.ico", // 安装时头部图标
-          "createDesktopShortcut": true, // 创建桌面图标
-          "createStartMenuShortcut": true, // 创建开始菜单图标
-          "shortcutName": "demo" // 图标名称
-        }
-      }
-    }
-  }
-}
-```
-
-## config.json 配置说明
-
-- 根目录下会有一个`config.sample.json`文件,当需要设置配置参数时,可以复制一份,保存为`config.json`文件。
-- 系统内部预设了一组 config 参数,当根目录`config.json`文件中的参数有缺失时,默认使用预设 config 参数。
-- `input`默认为`/stores/in/`
-- `compressRate`为图片压缩参数,当`compressRate`的值不存在,或者大于 100,或者小于 1 时,默认为 100;实际使用时一般配置 80,此时图片大小会减小约 75%;
-
-## postinstall
-
-- 32/64 切换,`--arch=ia32/x64`
+# msyj-client 美术阅卷采集端系统
+
+## 项目操作
+
+#### 项目安装
+
+```
+yarn install
+```
+
+#### 开发模式
+
+```
+yarn start
+```
+
+#### 项目打包
+
+```
+yarn run electron:build
+```
+
+#### lint 项目文件,并修正格式
+
+```
+yarn run lint
+```
+
+### 自定义配置
+
+- See [Configuration Reference](https://cli.vuejs.org/config/).
+- See [Vue CLI Plugin Electron Builder](https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/guide.html).
+- See [electron-builder Common Configuration](https://www.electron.build/configuration/configuration).
+
+## 系统开发目录说明
+
+- 开发目录:`当前代码目录`
+- 开发运行环境目录:`${开发目录}/node_modules/electron/dist/`
+- 正式运行环境目录:
+  - window: `C:~\AppData\Local\Programs\{系统名称}\`
+
+## 关于使用第三方工具的处理办法
+
+**所有第三方工具统一存放在根目录`extra`文件夹中**
+
+- 设置文件`vue.config.js`
+
+> [配置 api](https://www.electron.build/configuration/contents#extrafiles)
+
+```js
+// config中新增如下配置
+pluginOptions: {
+  electronBuilder: {
+    builderOptions: {
+      extraFiles: ["extra/**"]
+    }
+  }
+},
+```
+
+- 设置`plugins/env.js`
+
+```js
+// 运行系统的根目录
+const homePath = path.dirname(process.execPath);
+// 开放环境中,使用开发代码的根目录;正式包中,使用运行系统的根目录。
+const extraPath =
+  process.env.NODE_ENV === "production"
+    ? path.join(homePath, "extra")
+    : path.join(__static, "../extra");
+```
+
+## 配置打包参数(可选)
+
+```json
+{
+  "pluginOptions": {
+    "electronBuilder": {
+      "builderOptions": {
+        "appId": "com.example.app",
+        "productName": "aDemo", // 项目名,也是生成的安装文件名,即aDemo.exe
+        "copyright": "Copyright © 2020", //版权信息
+        "directories": {
+          "output": "./dist" //输出文件路径
+        },
+        "win": {
+          // win相关配置
+          "icon": "./shanqis.ico", // 图标,当前图标在根目录下,注意这里有两个坑
+          "target": [
+            {
+              "target": "nsis", // 利用nsis制作安装程序
+              "arch": [
+                "x64" // 64位
+              ]
+            }
+          ]
+        },
+        "nsis": {
+          "oneClick": false, // 是否一键安装
+          "allowElevation": true, // 允许请求提升。 如果为false,则用户必须使用提升的权限重新启动安装程序。
+          "allowToChangeInstallationDirectory": true, // 允许修改安装目录
+          "installerIcon": "./shanqis.ico", // 安装图标
+          "uninstallerIcon": "./shanqis.ico", //卸载图标
+          "installerHeaderIcon": "./shanqis.ico", // 安装时头部图标
+          "createDesktopShortcut": true, // 创建桌面图标
+          "createStartMenuShortcut": true, // 创建开始菜单图标
+          "shortcutName": "demo" // 图标名称
+        }
+      }
+    }
+  }
+}
+```
+
+## config.json 配置说明
+
+- 根目录下会有一个`config.sample.json`文件,当需要设置配置参数时,可以复制一份,保存为`config.json`文件。
+- 系统内部预设了一组 config 参数,当根目录`config.json`文件中的参数有缺失时,默认使用预设 config 参数。
+- `input`默认为`/stores/in/`
+- `compressRate`为图片压缩参数,当`compressRate`的值不存在,或者大于 100,或者小于 1 时,默认为 100;实际使用时一般配置 80,此时图片大小会减小约 75%;
+
+## postinstall
+
+- 32/64 切换,`"postinstall": "electron-builder install-app-deps --arch=ia32"`

+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "msyj-client",
-  "version": "2.0.0",
+  "version": "3.0.0",
   "private": true,
   "description": "scan client",
   "author": "chulinice",
@@ -11,7 +11,7 @@
     "lint": "vue-cli-service lint",
     "e:build": "vue-cli-service electron:build --win --x64 --ia32",
     "e:serve": "vue-cli-service electron:serve",
-    "postinstall": "electron-builder install-app-deps",
+    "postinstall": "electron-builder install-app-deps --arch=ia32",
     "postuninstall": "electron-builder install-app-deps"
   },
   "main": "background.js",

+ 9 - 9
src/modules/cropper-task/taskUtils.js

@@ -86,19 +86,19 @@ function saveSliceImage(paperInfo, collectConfig) {
   const imgPath = paperInfo.originImgPath;
   const outputSlicelPath = getOutputImagePath(paperInfo, "slice");
 
-  const { codeArea, coverArea, tailorTailorArea, imageRotate } = collectConfig;
+  const { coverArea, tailorTailorArea, imageRotate } = collectConfig;
 
   // slice图:完整处理流程
   let imgObj = gm(imgPath);
   // 条形码覆盖区
-  imgObj
-    .fill("#5f5f5f")
-    .drawRectangle(
-      codeArea.x,
-      codeArea.y,
-      codeArea.x + codeArea.width,
-      codeArea.y + codeArea.height
-    );
+  // imgObj
+  //   .fill("#5f5f5f")
+  //   .drawRectangle(
+  //     codeArea.x,
+  //     codeArea.y,
+  //     codeArea.x + codeArea.width,
+  //     codeArea.y + codeArea.height
+  //   );
 
   // 保密覆盖区
   imgObj