|
@@ -93,7 +93,6 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
const fs = require("fs");
|
|
const fs = require("fs");
|
|
-import db from "../../../plugins/db";
|
|
|
|
import { getStudentGroupByExamNumber } from "../api";
|
|
import { getStudentGroupByExamNumber } from "../api";
|
|
import {
|
|
import {
|
|
decodeImageCode,
|
|
decodeImageCode,
|
|
@@ -103,7 +102,7 @@ import {
|
|
import { deepCopy } from "../../../plugins/utils";
|
|
import { deepCopy } from "../../../plugins/utils";
|
|
import ScanAreaDialog from "../components/ScanAreaDialog";
|
|
import ScanAreaDialog from "../components/ScanAreaDialog";
|
|
import ScanExceptionDialog from "../components/ScanExceptionDialog";
|
|
import ScanExceptionDialog from "../components/ScanExceptionDialog";
|
|
-import { mapState, mapMutations, mapActions } from "vuex";
|
|
|
|
|
|
+import { mapState } from "vuex";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "group-scan",
|
|
name: "group-scan",
|
|
@@ -118,6 +117,7 @@ export default {
|
|
showAction: true,
|
|
showAction: true,
|
|
message: ""
|
|
message: ""
|
|
},
|
|
},
|
|
|
|
+ scanList: [],
|
|
historyLimit: 30,
|
|
historyLimit: 30,
|
|
historyList: [],
|
|
historyList: [],
|
|
setT: "",
|
|
setT: "",
|
|
@@ -130,7 +130,6 @@ export default {
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState("client", [
|
|
...mapState("client", [
|
|
- "scanNo",
|
|
|
|
"unuploadNo",
|
|
"unuploadNo",
|
|
"curSubject",
|
|
"curSubject",
|
|
"clientConfig",
|
|
"clientConfig",
|
|
@@ -160,6 +159,9 @@ export default {
|
|
},
|
|
},
|
|
curSubjectStartCountTime() {
|
|
curSubjectStartCountTime() {
|
|
return this.startCountTime[this.curSubject.id];
|
|
return this.startCountTime[this.curSubject.id];
|
|
|
|
+ },
|
|
|
|
+ scanNo() {
|
|
|
|
+ return this.scanList.length;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -170,8 +172,6 @@ export default {
|
|
this.getInitFile();
|
|
this.getInitFile();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...mapMutations("client", ["setScanNo", "setStartCountTime"]),
|
|
|
|
- ...mapActions("client", ["updateStartCountTime"]),
|
|
|
|
async test() {
|
|
async test() {
|
|
this.curImage = getEarliestFile();
|
|
this.curImage = getEarliestFile();
|
|
const codeAreas = {
|
|
const codeAreas = {
|
|
@@ -348,6 +348,9 @@ export default {
|
|
isManual: type === "MANUAL"
|
|
isManual: type === "MANUAL"
|
|
});
|
|
});
|
|
this.updateHistory(this.curStudent);
|
|
this.updateHistory(this.curStudent);
|
|
|
|
+
|
|
|
|
+ // 更新采集数
|
|
|
|
+ this.updateScanList(this.curStudent.examNumber);
|
|
}
|
|
}
|
|
// 删除扫描文件,继续开始下一个任务
|
|
// 删除扫描文件,继续开始下一个任务
|
|
fs.unlinkSync(this.curImage.url);
|
|
fs.unlinkSync(this.curImage.url);
|
|
@@ -389,15 +392,16 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- // 更新采集数
|
|
|
|
- this.updateScanNo();
|
|
|
|
-
|
|
|
|
- this.allReScan();
|
|
|
|
|
|
+ this.scanList = [];
|
|
|
|
+ this.students = [];
|
|
|
|
+ this.historyList = [];
|
|
|
|
+ this.restartInitFile();
|
|
},
|
|
},
|
|
allReScan() {
|
|
allReScan() {
|
|
this.$Modal.confirm({
|
|
this.$Modal.confirm({
|
|
content: "确定要整包重扫吗?",
|
|
content: "确定要整包重扫吗?",
|
|
onOk: () => {
|
|
onOk: () => {
|
|
|
|
+ this.scanList = [];
|
|
this.students = [];
|
|
this.students = [];
|
|
this.historyList = [];
|
|
this.historyList = [];
|
|
this.restartInitFile();
|
|
this.restartInitFile();
|
|
@@ -413,18 +417,13 @@ export default {
|
|
(this.curTaskScanCount - 6) * 71;
|
|
(this.curTaskScanCount - 6) * 71;
|
|
},
|
|
},
|
|
// count
|
|
// count
|
|
- async updateScanNo() {
|
|
|
|
- const scanNo = await db.getScanCount(
|
|
|
|
- this.curSubjectStartCountTime,
|
|
|
|
- this.curSubject.id
|
|
|
|
- );
|
|
|
|
- this.setScanNo(scanNo);
|
|
|
|
|
|
+ updateScanList(examNumber) {
|
|
|
|
+ if (this.scanList.indexOf(examNumber) === -1) {
|
|
|
|
+ this.scanList.push(examNumber);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- async resetStartCountTime() {
|
|
|
|
- await this.updateStartCountTime({
|
|
|
|
- [this.curSubject.id]: Math.floor(Date.now() / 1000)
|
|
|
|
- });
|
|
|
|
- await this.updateScanNo();
|
|
|
|
|
|
+ resetStartCountTime() {
|
|
|
|
+ this.scanList = [];
|
|
this.historyList = [];
|
|
this.historyList = [];
|
|
},
|
|
},
|
|
// history
|
|
// history
|