|
@@ -34,8 +34,23 @@
|
|
|
<div class="scan-main scan-picture" v-else>
|
|
|
<img class="img-contain" :src="curImage.url" :alt="curImage.name" />
|
|
|
</div>
|
|
|
+ <div class="scan-info">
|
|
|
+ <p>
|
|
|
+ <span>已采集:</span>
|
|
|
+ <span>{{ scanNo }}</span>
|
|
|
+ <span>,</span>
|
|
|
+ <span>未上传:</span>
|
|
|
+ <span>{{ unuploadNo }}</span>
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <Button type="error" @click="resetStartCountTime">清零</Button>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="scan-history">
|
|
|
+ <div class="scan-reset-area">
|
|
|
+ <Button type="primary" @click="toResetArea">重新设置采集信息</Button>
|
|
|
+ </div>
|
|
|
<div
|
|
|
class="history-item"
|
|
|
v-for="(task, tindex) in historyList"
|
|
@@ -72,6 +87,7 @@
|
|
|
|
|
|
<script>
|
|
|
const fs = require("fs");
|
|
|
+import db from "../plugins/db";
|
|
|
import { getStudentGroupByExamNumber } from "../api";
|
|
|
import {
|
|
|
decodeImageCode,
|
|
@@ -81,7 +97,7 @@ import {
|
|
|
import { deepCopy } from "../../../plugins/utils";
|
|
|
import ScanAreaDialog from "../components/ScanAreaDialog";
|
|
|
import ScanExceptionDialog from "../components/ScanExceptionDialog";
|
|
|
-import { mapState } from "vuex";
|
|
|
+import { mapState, mapMutations } from "vuex";
|
|
|
|
|
|
export default {
|
|
|
name: "group-scan",
|
|
@@ -126,7 +142,14 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState("client", ["curSubject", "clientConfig", "curLevel"]),
|
|
|
+ ...mapState("client", [
|
|
|
+ "scanNo",
|
|
|
+ "unuploadNo",
|
|
|
+ "curSubject",
|
|
|
+ "clientConfig",
|
|
|
+ "curLevel",
|
|
|
+ "startCountTime"
|
|
|
+ ]),
|
|
|
user() {
|
|
|
return this.$store.state.user;
|
|
|
},
|
|
@@ -139,14 +162,14 @@ export default {
|
|
|
return 0;
|
|
|
});
|
|
|
},
|
|
|
- scanNo() {
|
|
|
+ curTaskScanCount() {
|
|
|
return this.students.filter(item => item.isClient).length;
|
|
|
},
|
|
|
- taskNo() {
|
|
|
+ taskCount() {
|
|
|
return this.students.length;
|
|
|
},
|
|
|
isFinished() {
|
|
|
- return this.taskNo && this.scanNo === this.taskNo;
|
|
|
+ return this.taskCount && this.curTaskScanCount === this.taskCount;
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -158,6 +181,7 @@ export default {
|
|
|
// this.test();
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...mapMutations("client", ["setScanNo", "setStartCountTime"]),
|
|
|
async test() {
|
|
|
this.curImage = getEarliestFile();
|
|
|
const codeAreas = {
|
|
@@ -373,6 +397,9 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ // 更新采集数
|
|
|
+ this.updateScanNo();
|
|
|
+
|
|
|
this.allReScan();
|
|
|
},
|
|
|
allReScan() {
|
|
@@ -383,6 +410,15 @@ export default {
|
|
|
getCurCollectConfig() {
|
|
|
return this.curStudent.collectConfig || this.curSubject.collectConfig;
|
|
|
},
|
|
|
+ // count
|
|
|
+ async updateScanNo() {
|
|
|
+ const scanNo = await db.getScanCount(this.startCountTime);
|
|
|
+ this.setScanNo(scanNo);
|
|
|
+ },
|
|
|
+ resetStartCountTime() {
|
|
|
+ this.setStartCountTime(Math.floor(Date.now() / 1000));
|
|
|
+ this.updateScanNo();
|
|
|
+ },
|
|
|
// history
|
|
|
updateHistory(curStudent) {
|
|
|
const student = deepCopy(curStudent);
|
|
@@ -400,13 +436,9 @@ export default {
|
|
|
this.curStudent.collectConfig = setting;
|
|
|
this.startDecodeTask(setting.codeArea);
|
|
|
},
|
|
|
- goBack() {
|
|
|
- this.$confirm({
|
|
|
- content: "当前正处于采集状态,确定要退出吗?",
|
|
|
- onOk: () => {
|
|
|
- this.$router.go(-1);
|
|
|
- }
|
|
|
- });
|
|
|
+ // toreset
|
|
|
+ toResetArea() {
|
|
|
+ this.$router.push({ name: "ScanArea" });
|
|
|
}
|
|
|
},
|
|
|
beforeDestroy() {
|