|
@@ -67,11 +67,13 @@
|
|
|
<div v-if="curPagePapers.length" class="data-check-content-page">
|
|
|
<el-button
|
|
|
:type="curPagePaperIndex === 0 ? 'primary' : 'default'"
|
|
|
+ :disabled="isSwitchFb"
|
|
|
@click="switchCurPage(0)"
|
|
|
>正面</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
:type="curPagePaperIndex === 1 ? 'primary' : 'default'"
|
|
|
+ :disabled="isSwitchFb"
|
|
|
@click="switchCurPage(1)"
|
|
|
>反面</el-button
|
|
|
>
|
|
@@ -99,6 +101,35 @@
|
|
|
:page-data="curPage"
|
|
|
@confirm="toBind"
|
|
|
></relate-student-dialog>
|
|
|
+ <!-- ocr-result -->
|
|
|
+ <el-dialog
|
|
|
+ class="page-dialog"
|
|
|
+ :visible.sync="ocrResultDialogIsShow"
|
|
|
+ title="OCR识别结果"
|
|
|
+ top="10vh"
|
|
|
+ width="500px"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <div class="part-box part-box-pad mb-0">
|
|
|
+ <el-table :data="ocrResult">
|
|
|
+ <el-table-column prop="result" label="结果"></el-table-column>
|
|
|
+ <el-table-column class-name="action-column" label="操作" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ @click="selectOcrResule(scope.row)"
|
|
|
+ >
|
|
|
+ <span class="cont-link">选择</span>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div slot="footer"></div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -171,11 +202,13 @@ export default {
|
|
|
curPagePaperIndex: 0,
|
|
|
curPagePaper: { url: "" },
|
|
|
lastPaperScanTaskId: "",
|
|
|
+ isSwitchFb: false,
|
|
|
// ocr
|
|
|
isSetOcrSet: false,
|
|
|
openOcr: false,
|
|
|
ocrArea: { x: null, y: null, width: null, height: null },
|
|
|
- ocrResult: []
|
|
|
+ ocrResult: [],
|
|
|
+ ocrResultDialogIsShow: false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -242,11 +275,17 @@ export default {
|
|
|
toSelectTaskStd() {
|
|
|
this.$refs.RelateStudentDialog.open();
|
|
|
},
|
|
|
- switchCurPage(curPagePaperIndex) {
|
|
|
+ async switchCurPage(curPagePaperIndex) {
|
|
|
+ if (this.isSwitchFb) return;
|
|
|
this.curPagePaperIndex = curPagePaperIndex;
|
|
|
this.curPagePaper = {
|
|
|
url: this.curPagePapers[this.curPagePaperIndex]
|
|
|
};
|
|
|
+ if (this.openOcr) {
|
|
|
+ this.isSwitchFb = true;
|
|
|
+ await this.getOrcResult().catch(() => {});
|
|
|
+ this.isSwitchFb = false;
|
|
|
+ }
|
|
|
},
|
|
|
async getUndoPageList() {
|
|
|
const data = await studentUnbindTaskListPage({ ...this.filterData });
|
|
@@ -275,12 +314,11 @@ export default {
|
|
|
this.curPagePapers = this.curPage.fileUrls;
|
|
|
this.switchCurPage(this.curPagePaperIndex);
|
|
|
|
|
|
- if (this.openOcr) {
|
|
|
- this.getOrcResult();
|
|
|
- } else {
|
|
|
- if (this.lastPaperScanTaskId !== this.curPage.paperScanTaskId) {
|
|
|
- this.getStudentList();
|
|
|
- }
|
|
|
+ if (
|
|
|
+ !this.openOcr &&
|
|
|
+ this.lastPaperScanTaskId !== this.curPage.paperScanTaskId
|
|
|
+ ) {
|
|
|
+ this.getStudentList();
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -336,14 +374,23 @@ export default {
|
|
|
...this.ocrArea
|
|
|
});
|
|
|
if (res && res.length) {
|
|
|
- this.ocrResult = res;
|
|
|
if (res.length === 1) {
|
|
|
this.studentNameOrNo = res[0];
|
|
|
} else {
|
|
|
- // todo:选择一个结果
|
|
|
+ this.ocrResult = res.map(result => {
|
|
|
+ return {
|
|
|
+ result
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.ocrResultDialogIsShow = true;
|
|
|
}
|
|
|
}
|
|
|
this.getStudentList();
|
|
|
+ },
|
|
|
+ selectOcrResule(cont) {
|
|
|
+ this.studentNameOrNo = cont.result;
|
|
|
+ this.getStudentList();
|
|
|
+ this.ocrResultDialogIsShow = false;
|
|
|
}
|
|
|
}
|
|
|
};
|