|
@@ -73,7 +73,7 @@ import {
|
|
|
saveOutputImage,
|
|
|
renamePreUploadJsonFile,
|
|
|
clearDir,
|
|
|
- decodeImageCode,
|
|
|
+ decodeImageCode
|
|
|
} from "../../../plugins/imageOcr";
|
|
|
import setTimeMixins from "../../../mixins/setTimeMixins";
|
|
|
import db from "../../../plugins/db";
|
|
@@ -88,8 +88,8 @@ export default {
|
|
|
type: Object,
|
|
|
default() {
|
|
|
return {};
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
mixins: [setTimeMixins],
|
|
|
data() {
|
|
@@ -99,20 +99,20 @@ export default {
|
|
|
user: this.$ls.get("user", { id: "" }),
|
|
|
scanStatus: "INIT", // INIT:初始状态,START:已开始,PAUSE:已暂停
|
|
|
modalForm: {
|
|
|
- preScanCount: 0,
|
|
|
+ preScanCount: 0
|
|
|
},
|
|
|
rules: {
|
|
|
preScanCount: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请输入预扫张数",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
+ trigger: "change"
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
scaningImageList: [],
|
|
|
realScanCount: 0,
|
|
|
- taskScanUserId: "",
|
|
|
+ taskScanUserId: ""
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -122,7 +122,7 @@ export default {
|
|
|
},
|
|
|
taskBound() {
|
|
|
return this.user.id === this.taskScanUserId;
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
this.clearSetTs();
|
|
@@ -168,7 +168,7 @@ export default {
|
|
|
if (!this.taskBound) {
|
|
|
await bingScanUser({
|
|
|
paperScanTaskId: this.task.id,
|
|
|
- userId: this.user.id,
|
|
|
+ userId: this.user.id
|
|
|
});
|
|
|
this.taskScanUserId = this.user.id;
|
|
|
}
|
|
@@ -189,7 +189,7 @@ export default {
|
|
|
async evokeScanExe() {
|
|
|
logger.info("02唤起扫描仪");
|
|
|
// console.log(commandStr);
|
|
|
- await evokeScanner(this.GLOBAL.input).catch((error) => {
|
|
|
+ await evokeScanner(this.GLOBAL.input).catch(error => {
|
|
|
console.error(error);
|
|
|
});
|
|
|
this.scanStatus = "PAUSE";
|
|
@@ -222,7 +222,7 @@ export default {
|
|
|
logger.info(`04-2保存数据结束`);
|
|
|
|
|
|
const confirm = await this.$confirm(`是否继续扫描?`, "提示", {
|
|
|
- type: "warning",
|
|
|
+ type: "warning"
|
|
|
}).catch(() => {});
|
|
|
this.clearScanList();
|
|
|
|
|
@@ -238,7 +238,7 @@ export default {
|
|
|
`取消扫描后,当前未保存的数据将会被清空,确定要取消扫描吗?`,
|
|
|
"提示",
|
|
|
{
|
|
|
- type: "warning",
|
|
|
+ type: "warning"
|
|
|
}
|
|
|
).catch(() => {});
|
|
|
if (confirm !== "confirm") return;
|
|
@@ -262,7 +262,7 @@ export default {
|
|
|
const ouputImageList = saveOutputImage(
|
|
|
[files.frontFile, files.versoFile],
|
|
|
{
|
|
|
- taskId: this.task.id,
|
|
|
+ taskId: this.task.id
|
|
|
}
|
|
|
);
|
|
|
const fileInfo = {
|
|
@@ -276,18 +276,18 @@ export default {
|
|
|
examNumber: "",
|
|
|
clientUserId: this.user.id,
|
|
|
clientUsername: this.user.name,
|
|
|
- clientUserLoginTime: this.user.loginTime,
|
|
|
+ clientUserLoginTime: this.user.loginTime
|
|
|
};
|
|
|
|
|
|
if (this.openScan) {
|
|
|
- const num = await decodeImageCode(ouputImageList[0]).catch(() => {
|
|
|
+ const num = await decodeImageCode(ouputImageList[0]).catch(err => {
|
|
|
console.error(err);
|
|
|
logger.error(`04-2条码解析失败,${err}`);
|
|
|
});
|
|
|
fileInfo.examNumber = num || "";
|
|
|
}
|
|
|
|
|
|
- await db.saveUploadInfo(fileInfo).catch((err) => {
|
|
|
+ await db.saveUploadInfo(fileInfo).catch(err => {
|
|
|
console.error(err);
|
|
|
logger.error(`04-1保存数据错误,${err}`);
|
|
|
});
|
|
@@ -296,7 +296,7 @@ export default {
|
|
|
clearScanList() {
|
|
|
this.scaningImageList = [];
|
|
|
clearDir(this.GLOBAL.input);
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|