Kaynağa Gözat

采集流程

zhangjie 2 yıl önce
ebeveyn
işleme
5efae45b25

+ 1 - 0
.eslintignore

@@ -2,3 +2,4 @@
 public
 vue.config.js
 src/plugins/env.js
+extra

+ 1 - 1
.gitignore

@@ -1,6 +1,6 @@
 .DS_Store
 node_modules
-/dist
+/dist*
 modules-old*
 
 # local env files

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 138
dist_electron/index.js


+ 0 - 60
dist_electron/package.json

@@ -1,60 +0,0 @@
-{
-  "name": "paper-library-client",
-  "version": "1.0.0",
-  "description": "paper-library client",
-  "scripts": {
-    "start": "yarn run e:serve",
-    "serve": "vue-cli-service serve",
-    "build": "vue-cli-service build",
-    "lint": "vue-cli-service lint",
-    "win:build": "vue-cli-service electron:build",
-    "e:build": "vue-cli-service electron:build --win --x64 --ia32",
-    "e:serve": "vue-cli-service electron:serve",
-    "postinstall": "electron-builder install-app-deps",
-    "postuninstall": "electron-builder install-app-deps"
-  },
-  "main": "background.js",
-  "dependencies": {
-    "axios": "^0.19.2",
-    "core-js": "^3.6.4",
-    "crypto": "^1.0.1",
-    "crypto-js": "^4.0.0",
-    "deepmerge": "^4.2.2",
-    "element-ui": "^2.14.1",
-    "log4js": "^6.3.0",
-    "sqlite3": "^4.2.0",
-    "vue": "^2.6.11",
-    "vue-ls": "^3.2.2",
-    "vue-router": "^3.2.0",
-    "vuex": "^3.4.0"
-  },
-  "devDependencies": {
-    "@vue/cli-plugin-babel": "~4.3.0",
-    "@vue/cli-plugin-eslint": "~4.3.0",
-    "@vue/cli-plugin-router": "~4.3.0",
-    "@vue/cli-plugin-vuex": "~4.3.0",
-    "@vue/cli-service": "~4.3.0",
-    "@vue/eslint-config-prettier": "^6.0.0",
-    "babel-eslint": "^10.1.0",
-    "electron": "^9.4.4",
-    "eslint": "^6.7.2",
-    "eslint-plugin-prettier": "^3.1.1",
-    "eslint-plugin-vue": "^6.2.2",
-    "lint-staged": "^9.5.0",
-    "prettier": "^1.19.1",
-    "sass": "^1.26.5",
-    "sass-loader": "^8.0.2",
-    "terser-webpack-plugin": "^3.0.1",
-    "vue-cli-plugin-electron-builder": "~1.4.6",
-    "vue-template-compiler": "^2.6.11"
-  },
-  "gitHooks": {
-    "pre-commit": "lint-staged"
-  },
-  "lint-staged": {
-    "*.{js,jsx,vue}": [
-      "vue-cli-service lint",
-      "git add"
-    ]
-  }
-}

BIN
extra/scan/scan.exe


+ 3 - 0
src/assets/styles/base.scss

@@ -349,6 +349,7 @@ body {
 .btn-danger {
   &.el-button--text:not(.is-disabled) {
     color: $--color-danger !important;
+    font-size: 14px;
 
     &:hover {
       font-weight: 600;
@@ -362,6 +363,7 @@ body {
 .btn-primary {
   &.el-button--text:not(.is-disabled) {
     color: $--color-text-dark-1 !important;
+    font-size: 14px;
     &:hover {
       font-weight: 600;
       color: $--color-primary !important;
@@ -372,6 +374,7 @@ body {
 .btn-white {
   background-color: #fff !important;
   color: #999 !important;
+  font-size: 14px;
 }
 .font-bold {
   font-weight: bold;

+ 10 - 0
src/assets/styles/pages.scss

@@ -1,3 +1,13 @@
 .task-manage{
   padding: 20px;
 }
+.scan-task-dialog{
+  .scan-head-btn{
+    position: absolute;
+    top: 10px;
+    right: 20px;
+    line-height: 30px;
+    font-size: 20px;
+    z-index: 9;
+  }
+}

+ 76 - 0
src/components/base/ArchivesSelect.vue

@@ -0,0 +1,76 @@
+<template>
+  <el-select
+    v-model="selected"
+    class="archives-select"
+    :placeholder="placeholder"
+    filterable
+    :clearable="clearable"
+    :disabled="disabled"
+    @change="select"
+  >
+    <el-option
+      v-for="item in optionList"
+      :key="item.id"
+      :value="item.id"
+      :label="item.name"
+    >
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+import { commonArchivesQuery } from "../../modules/client/api";
+
+export default {
+  name: "archives-select",
+  props: {
+    disabled: { type: Boolean, default: false },
+    placeholder: { type: String, default: "请选择学期" },
+    value: { type: [Number, String], default: "" },
+    clearable: { type: Boolean, default: true },
+    semesterId: { type: String, default: "" }
+  },
+  data() {
+    return {
+      optionList: [],
+      selected: ""
+    };
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler(val) {
+        this.selected = val;
+      }
+    },
+    semesterId(val, oldval) {
+      if (val !== oldval) {
+        this.search("");
+        this.$emit("input", "");
+        this.$emit("change", {});
+      }
+    }
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    async search() {
+      this.optionList = [];
+
+      let data = {};
+      if (this.semesterId) data.semesterId = this.semesterId;
+
+      const res = await commonArchivesQuery(data);
+      this.optionList = res;
+    },
+    select() {
+      this.$emit("input", this.selected);
+      this.$emit(
+        "change",
+        this.optionList.find(item => item.id === this.selected)
+      );
+    }
+  }
+};
+</script>

+ 86 - 0
src/components/base/CourseSelect.vue

@@ -0,0 +1,86 @@
+<template>
+  <el-select
+    v-model="selected"
+    class="course-select"
+    :placeholder="placeholder"
+    filterable
+    :clearable="clearable"
+    :disabled="disabled"
+    @change="select"
+  >
+    <el-option
+      v-for="item in optionList"
+      :key="item.id"
+      :value="item.id"
+      :label="item.name"
+    >
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+import { commonCourseQuery } from "../../modules/client/api";
+
+export default {
+  name: "course-select",
+  props: {
+    disabled: { type: Boolean, default: false },
+    placeholder: { type: String, default: "请选择" },
+    value: { type: [Number, String], default: "" },
+    clearable: { type: Boolean, default: true },
+    filterData: {
+      type: Object,
+      default() {
+        return {
+          paperArchivesId: "",
+          semesterId: ""
+        };
+      }
+    }
+  },
+  data() {
+    return {
+      optionList: [],
+      selected: ""
+    };
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler(val) {
+        this.selected = val;
+      }
+    },
+    "filterData.paperArchivesId": {
+      handler(val, oldval) {
+        console.log(val);
+        if (val !== oldval) {
+          this.search();
+          this.$emit("input", "");
+          this.$emit("change", {});
+        }
+      }
+    }
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    async search() {
+      this.optionList = [];
+      if (!this.filterData.paperArchivesId) return;
+      const res = await commonCourseQuery({
+        ...this.filterData
+      });
+      this.optionList = res;
+    },
+    select() {
+      this.$emit("input", this.selected);
+      this.$emit(
+        "change",
+        this.optionList.find(item => item.code === this.selected)
+      );
+    }
+  }
+};
+</script>

+ 86 - 0
src/components/base/TeachClazzSelect.vue

@@ -0,0 +1,86 @@
+<template>
+  <el-select
+    v-model="selected"
+    class="teach-class-select"
+    :placeholder="placeholder"
+    filterable
+    :clearable="clearable"
+    :disabled="disabled"
+    @change="select"
+  >
+    <el-option
+      v-for="item in optionList"
+      :key="item.id"
+      :value="item.id"
+      :label="item.name"
+    >
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+import { commonTeachClazzQuery } from "../../modules/client/api";
+
+export default {
+  name: "teach-class-select",
+  props: {
+    disabled: { type: Boolean, default: false },
+    placeholder: { type: String, default: "请选择" },
+    value: { type: [Number, String], default: "" },
+    clearable: { type: Boolean, default: true },
+    filterData: {
+      type: Object,
+      default() {
+        return {
+          paperArchivesId: "",
+          courseName: ""
+        };
+      }
+    }
+  },
+  data() {
+    return {
+      optionList: [],
+      selected: ""
+    };
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler(val) {
+        this.selected = val;
+      }
+    },
+    "filterData.courseName": {
+      handler(val, oldval) {
+        console.log(val);
+        if (val !== oldval) {
+          this.search();
+          this.$emit("input", "");
+          this.$emit("change", {});
+        }
+      }
+    }
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    async search() {
+      this.optionList = [];
+      if (!this.filterData.courseName) return;
+      const res = await commonTeachClazzQuery({
+        ...this.filterData
+      });
+      this.optionList = res;
+    },
+    select() {
+      this.$emit("input", this.selected);
+      this.$emit(
+        "change",
+        this.optionList.find(item => item.id === this.selected)
+      );
+    }
+  }
+};
+</script>

+ 26 - 0
src/modules/client/api.js

@@ -1,5 +1,31 @@
 import { $post, $postParam } from "@/plugins/axios";
 
+// 课程
+export const commonCourseQuery = ({
+  paperArchivesId = "",
+  semesterId = ""
+}) => {
+  return $postParam("/api/admin/common/course/query", {
+    paperArchivesId,
+    semesterId
+  });
+};
+// 教学班
+export const commonTeachClazzQuery = ({
+  paperArchivesId = "",
+  courseName = ""
+}) => {
+  return $postParam("/api/admin/common/teach_clazz/query", {
+    paperArchivesId,
+    courseName
+  });
+};
+// 档案
+export const commonArchivesQuery = data => {
+  return $postParam("/api/admin/common/archives/query", data);
+};
+
+// scan
 export const uploadFormalImage = (datas, config = {}) => {
   return $post(`/api/admin/client/picture/upload`, datas, {
     ...config,

+ 22 - 2
src/modules/client/components/ScanTaskDialog.vue

@@ -6,15 +6,25 @@
     width="550px"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
-    :show-close="true"
+    :show-close="false"
     append-to-body
     @open="visibleChange"
   >
+    <div class="scan-head" slot="title">
+      <h3>扫描</h3>
+      <div
+        v-if="scanStatus !== 'START'"
+        class="scan-head-btn cont-link"
+        @click="closeDialog"
+      >
+        <i class="el-icon-close"></i>
+      </div>
+    </div>
     <el-form
       ref="modalFormComp"
       :model="modalForm"
       :rules="rules"
-      label-width="120px"
+      label-width="100px"
     >
       <el-form-item label="课程名称:">
         {{ task.courseName }}
@@ -124,6 +134,16 @@ export default {
     open() {
       this.modalIsShow = true;
     },
+    closeDialog() {
+      if (this.scanStatus === "START") return;
+
+      if (this.scanStatus === "INIT") {
+        this.close();
+        return;
+      }
+
+      this.cancel();
+    },
     async startTask() {
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});
       if (!valid) return;

+ 27 - 4
src/modules/client/components/ScanTaskProcessDialog.vue

@@ -10,11 +10,21 @@
     append-to-body
     @open="visibleChange"
   >
+    <div class="scan-head" slot="title">
+      <h3>扫描</h3>
+      <div
+        v-if="scanStatus !== 'START'"
+        class="scan-head-btn cont-link"
+        @click="closeDialog"
+      >
+        <i class="el-icon-close"></i>
+      </div>
+    </div>
     <el-form
       ref="modalFormComp"
       :model="modalForm"
       :rules="rules"
-      label-width="120px"
+      label-width="100px"
     >
       <el-form-item label="课程名称:">
         {{ task.courseName }}
@@ -125,6 +135,16 @@ export default {
     open() {
       this.modalIsShow = true;
     },
+    closeDialog() {
+      if (this.scanStatus === "START") return;
+
+      if (this.scanStatus === "INIT") {
+        this.close();
+        return;
+      }
+
+      this.cancel();
+    },
     async startTask() {
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});
       if (!valid) return;
@@ -146,9 +166,12 @@ export default {
     },
     async evokeScanExe() {
       console.log("唤起扫描仪");
-      const { stdout, stderr } = await childProcessExec("").catch(error => {
-        console.log(error);
-      });
+      const commandStr = `scan -scan -d ${this.GLOBAL.input}`;
+      const { stdout, stderr } = await childProcessExec(commandStr).catch(
+        error => {
+          console.log(error);
+        }
+      );
 
       console.log("扫描仪停止");
       this.scanStatus = "PAUSE";

+ 14 - 33
src/modules/client/views/TaskManage.vue

@@ -3,46 +3,27 @@
     <div class="part-box part-box-filter part-box-flex">
       <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
         <el-form-item label="档案:">
-          <el-select
-            v-model="filter.recordId"
+          <archives-select
+            v-model="filter.paperArchivesId"
             placeholder="请选择档案"
-            clearable
           >
-            <el-option
-              v-for="item in recordList"
-              :key="item.id"
-              :value="item.id"
-              :label="item.name"
-            ></el-option>
-          </el-select>
+          </archives-select>
         </el-form-item>
         <el-form-item label="课程:">
-          <el-select
-            v-model="filter.courseCode"
+          <course-select
+            v-model="filter.courseName"
+            :filter-data="filter"
             placeholder="请选择课程"
-            clearable
           >
-            <el-option
-              v-for="item in courseList"
-              :key="item.courseCode"
-              :value="item.courseCode"
-              :label="item.courseName"
-            ></el-option>
-          </el-select>
+          </course-select>
         </el-form-item>
         <el-form-item label="教学班:">
-          <el-select
-            v-model="filter.teachingClassId"
+          <teach-clazz-select
+            v-model="filter.teachClazzName"
             placeholder="请选择教学班"
-            clearable
+            :filter-data="filter"
           >
-            <el-option
-              v-for="item in teachingClassList"
-              :key="item.id"
-              :value="item.id"
-              :label="item.name"
-            ></el-option>
-          </el-select>
+          </teach-clazz-select>
         </el-form-item>
         <el-form-item label-width="0px">
           <el-button type="primary" @click="search">查询</el-button>
@@ -156,9 +137,9 @@ export default {
         my: {}
       },
       filter: {
-        recordId: "",
-        courseCode: "",
-        teachingClassId: ""
+        paperArchivesId: "",
+        courseName: "",
+        teachClazzName: ""
       },
       current: 1,
       size: 10,

+ 7 - 1
src/plugins/globalVuePlugins.js

@@ -2,10 +2,16 @@ import { objAssign, randomCode } from "@/plugins/utils";
 import globalMixins from "./mixins";
 import ViewHeader from "@/components/ViewHeader.vue";
 import ViewFooter from "@/components/ViewFooter.vue";
+import ArchivesSelect from "../components/base/ArchivesSelect.vue";
+import CourseSelect from "../components/base/CourseSelect.vue";
+import TeachClazzSelect from "../components/base/TeachClazzSelect.vue";
 
 const components = {
   ViewFooter,
-  ViewHeader
+  ViewHeader,
+  ArchivesSelect,
+  CourseSelect,
+  TeachClazzSelect
 };
 
 export default {

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor