|
@@ -65,10 +65,12 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { bingScanUser } from "../api";
|
|
import {
|
|
import {
|
|
getPreUploadFiles,
|
|
getPreUploadFiles,
|
|
getPreUploadFileCount,
|
|
getPreUploadFileCount,
|
|
saveOutputImage,
|
|
saveOutputImage,
|
|
|
|
+ renamePreUploadJsonFile,
|
|
clearDir
|
|
clearDir
|
|
} from "../../../plugins/imageOcr";
|
|
} from "../../../plugins/imageOcr";
|
|
import setTimeMixins from "../../../mixins/setTimeMixins";
|
|
import setTimeMixins from "../../../mixins/setTimeMixins";
|
|
@@ -90,6 +92,7 @@ export default {
|
|
return {
|
|
return {
|
|
modalIsShow: false,
|
|
modalIsShow: false,
|
|
loading: false,
|
|
loading: false,
|
|
|
|
+ user: this.$ls.get("user", { id: "" }),
|
|
scanStatus: "INIT", // INIT:初始状态,START:已开始,PAUSE:已暂停
|
|
scanStatus: "INIT", // INIT:初始状态,START:已开始,PAUSE:已暂停
|
|
modalForm: {
|
|
modalForm: {
|
|
preScanCount: 0
|
|
preScanCount: 0
|
|
@@ -108,8 +111,8 @@ export default {
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- user() {
|
|
|
|
- return this.$store.state.user;
|
|
|
|
|
|
+ taskBound() {
|
|
|
|
+ return this.user.id === this.task.scanUserId;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
@@ -150,6 +153,13 @@ export default {
|
|
if (this.loading) return;
|
|
if (this.loading) return;
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
|
|
|
|
|
+ if (!this.taskBound) {
|
|
|
|
+ await bingScanUser({
|
|
|
|
+ paperScanTaskId: this.task.id,
|
|
|
|
+ userId: this.user.id
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
this.scaningImageList = [];
|
|
this.scaningImageList = [];
|
|
this.scanStatus = "START";
|
|
this.scanStatus = "START";
|
|
this.getInitFile();
|
|
this.getInitFile();
|
|
@@ -166,7 +176,7 @@ export default {
|
|
console.log("唤起扫描仪");
|
|
console.log("唤起扫描仪");
|
|
// console.log(commandStr);
|
|
// console.log(commandStr);
|
|
await evokeScanner(this.GLOBAL.input).catch(error => {
|
|
await evokeScanner(this.GLOBAL.input).catch(error => {
|
|
- console.dir(error);
|
|
|
|
|
|
+ console.error(error);
|
|
});
|
|
});
|
|
console.log("扫描仪停止");
|
|
console.log("扫描仪停止");
|
|
this.scanStatus = "PAUSE";
|
|
this.scanStatus = "PAUSE";
|
|
@@ -178,8 +188,8 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.scaningImageList.push(...res.data);
|
|
this.scaningImageList.push(...res.data);
|
|
-
|
|
|
|
- console.log(this.scaningImageList);
|
|
|
|
|
|
+ // console.log(this.scaningImageList);
|
|
|
|
+ renamePreUploadJsonFile(this.GLOBAL.input);
|
|
},
|
|
},
|
|
async confirm() {
|
|
async confirm() {
|
|
if (!this.scaningImageList.length) {
|
|
if (!this.scaningImageList.length) {
|
|
@@ -246,7 +256,7 @@ export default {
|
|
};
|
|
};
|
|
|
|
|
|
await db.saveUploadInfo(fileInfo).catch(err => {
|
|
await db.saveUploadInfo(fileInfo).catch(err => {
|
|
- console.log(err);
|
|
|
|
|
|
+ console.error(err);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|