|
@@ -8,11 +8,11 @@
|
|
<el-button :disabled="!hasSelectedData" type="primary" @click="toBind"
|
|
<el-button :disabled="!hasSelectedData" type="primary" @click="toBind"
|
|
>重新绑定</el-button
|
|
>重新绑定</el-button
|
|
>
|
|
>
|
|
- <el-button :disabled="!canSave" type="danger" @click="clearStage"
|
|
|
|
|
|
+ <el-button :disabled="!canClear" type="danger" @click="clearStage"
|
|
>清空</el-button
|
|
>清空</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
- :disabled="!canSave"
|
|
|
|
|
|
+ :disabled="!canSave || isNormalTab"
|
|
:loading="saving"
|
|
:loading="saving"
|
|
type="primary"
|
|
type="primary"
|
|
@click="toSave"
|
|
@click="toSave"
|
|
@@ -21,7 +21,7 @@
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
:loading="scanStatus === 'SCAN'"
|
|
:loading="scanStatus === 'SCAN'"
|
|
- :disabled="!canScan"
|
|
|
|
|
|
+ :disabled="!canScan || isNormalTab"
|
|
@click="toScan"
|
|
@click="toScan"
|
|
>
|
|
>
|
|
{{ statusDesc[scanStatus] }}
|
|
{{ statusDesc[scanStatus] }}
|
|
@@ -64,7 +64,7 @@
|
|
@delete-paper="deletePaperHandle"
|
|
@delete-paper="deletePaperHandle"
|
|
></scan-result-table>
|
|
></scan-result-table>
|
|
</div>
|
|
</div>
|
|
- <div class="scan-result-foot">
|
|
|
|
|
|
+ <div v-if="isNormalTab" class="scan-result-foot">
|
|
共{{ studentCount }}人,{{ paperCount }}张图片
|
|
共{{ studentCount }}人,{{ paperCount }}张图片
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -94,6 +94,7 @@ import {
|
|
getPreUploadFiles,
|
|
getPreUploadFiles,
|
|
saveOutputImage,
|
|
saveOutputImage,
|
|
clearDir,
|
|
clearDir,
|
|
|
|
+ deleteFiles,
|
|
decodeImageCode,
|
|
decodeImageCode,
|
|
getDirScanFile,
|
|
getDirScanFile,
|
|
} from "../../../plugins/imageOcr";
|
|
} from "../../../plugins/imageOcr";
|
|
@@ -147,10 +148,17 @@ export default {
|
|
computed: {
|
|
computed: {
|
|
...mapState("client", ["ocrArea"]),
|
|
...mapState("client", ["ocrArea"]),
|
|
canSave() {
|
|
canSave() {
|
|
- return this.scanStatus === "FINISH" && this.scanStageList.length;
|
|
|
|
|
|
+ return (
|
|
|
|
+ this.scanStatus === "FINISH" &&
|
|
|
|
+ this.normalCount > 0 &&
|
|
|
|
+ this.errorCount === 0
|
|
|
|
+ );
|
|
},
|
|
},
|
|
canScan() {
|
|
canScan() {
|
|
- return this.scanStageList.length <= this.maxCacheCount;
|
|
|
|
|
|
+ return this.errorCount + this.normalCount <= this.maxCacheCount;
|
|
|
|
+ },
|
|
|
|
+ canClear() {
|
|
|
|
+ return this.studentCount > 0;
|
|
},
|
|
},
|
|
hasSelectedData() {
|
|
hasSelectedData() {
|
|
return Boolean(this.selectList.length);
|
|
return Boolean(this.selectList.length);
|
|
@@ -208,7 +216,6 @@ export default {
|
|
logger.info(`99退出扫描`);
|
|
logger.info(`99退出扫描`);
|
|
},
|
|
},
|
|
switchTab(tab) {
|
|
switchTab(tab) {
|
|
- this.$refs.scanResultTableRef.clearSelection();
|
|
|
|
this.curTab = tab;
|
|
this.curTab = tab;
|
|
this.selectList = [];
|
|
this.selectList = [];
|
|
},
|
|
},
|
|
@@ -543,13 +550,38 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
async clearStage() {
|
|
async clearStage() {
|
|
- const res = await this.$confirm(`确定要清空数据吗?`, "警告", {
|
|
|
|
- type: "warning",
|
|
|
|
- }).catch(() => {});
|
|
|
|
|
|
+ const name = this.isNormalTab ? "正常" : "异常";
|
|
|
|
+ const res = await this.$confirm(
|
|
|
|
+ `确定要清空所有【${name}】数据吗?`,
|
|
|
|
+ "警告",
|
|
|
|
+ {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }
|
|
|
|
+ ).catch(() => {});
|
|
if (res !== "confirm") return;
|
|
if (res !== "confirm") return;
|
|
|
|
|
|
- this.initData();
|
|
|
|
- this.clearFiles();
|
|
|
|
|
|
+ if (this.isNormalTab) {
|
|
|
|
+ const files = this.scanStageList
|
|
|
|
+ .map((row) =>
|
|
|
|
+ row.papers.map((p) => [p.frontOriginImgPath, p.versoOriginImgPath])
|
|
|
|
+ )
|
|
|
|
+ .flat(2);
|
|
|
|
+ deleteFiles(files);
|
|
|
|
+ this.scanStageList = [];
|
|
|
|
+ } else {
|
|
|
|
+ const files = this.errorStageList
|
|
|
|
+ .map((row) =>
|
|
|
|
+ row.papers.map((p) => [p.frontOriginImgPath, p.versoOriginImgPath])
|
|
|
|
+ )
|
|
|
|
+ .flat(2);
|
|
|
|
+ deleteFiles(files);
|
|
|
|
+ this.errorStageList = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.curPagePapers = [];
|
|
|
|
+ this.curPagePaperIndex = 0;
|
|
|
|
+ this.curPagePaper = { url: "" };
|
|
|
|
+
|
|
logger.info(`99数据清空`);
|
|
logger.info(`99数据清空`);
|
|
this.$message.success("数据已清空!");
|
|
this.$message.success("数据已清空!");
|
|
},
|
|
},
|