|
@@ -15,12 +15,10 @@
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item label="卷型号" :span="6">
|
|
|
<template v-if="simple">
|
|
|
- {{ info.paperType || "#" }}
|
|
|
+ {{ paperTypeDisplay }}
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <a-button class="ant-gray m-r-4px">{{
|
|
|
- info.paperType || "#"
|
|
|
- }}</a-button>
|
|
|
+ <a-button class="ant-gray m-r-4px">{{ paperTypeDisplay }}</a-button>
|
|
|
<a-button v-if="paperTypeArea && editable" @click="onEditPaperType">
|
|
|
<template #icon><SwapOutlined /></template>
|
|
|
</a-button>
|
|
@@ -95,6 +93,7 @@
|
|
|
ref="modifyPaperTypeRef"
|
|
|
:area-img="paperTypeImg"
|
|
|
:area-result="paperTypeResult"
|
|
|
+ :ocr-result="paperTypeOrcResult"
|
|
|
@confirm="paperTypeModified"
|
|
|
/>
|
|
|
</template>
|
|
@@ -230,50 +229,56 @@ const modifyPaperTypeRef = ref();
|
|
|
const paperTypeArea = ref<AreaSize | null>(null);
|
|
|
const paperTypeImg = ref("");
|
|
|
const paperTypeResult = ref("");
|
|
|
-async function onEditPaperType() {
|
|
|
+const paperTypeOrcResult = ref("");
|
|
|
+const paperTypeType = ref("");
|
|
|
+const paperTypeDisplay = computed(() => {
|
|
|
+ if (paperTypeResult.value === "#") return "空";
|
|
|
+ if (paperTypeResult.value === "?") return "异常";
|
|
|
+ return paperTypeResult.value;
|
|
|
+});
|
|
|
+function onEditPaperType() {
|
|
|
if (!dataCheckStore.curPage) return;
|
|
|
-
|
|
|
- if (paperTypeArea.value) {
|
|
|
- paperTypeImg.value = await getSliceFileUrl(
|
|
|
- dataCheckStore.curPage.sheetUri,
|
|
|
- paperTypeArea.value
|
|
|
- );
|
|
|
- paperTypeResult.value = dataCheckStore.curPage.paperType.result;
|
|
|
- } else {
|
|
|
- paperTypeImg.value = "";
|
|
|
- }
|
|
|
modifyPaperTypeRef.value?.open();
|
|
|
}
|
|
|
const curPage = computed(() => dataCheckStore.curPage);
|
|
|
async function paperTypeModified(paperType: string) {
|
|
|
- if (!dataCheckStore.curPage) return;
|
|
|
- dataCheckStore.modifyPaperType({
|
|
|
- paperIndex: curPage.value?.paperIndex as number,
|
|
|
- pageIndex: curPage.value?.pageIndex as number,
|
|
|
- paperType: paperType || "#",
|
|
|
- });
|
|
|
+ if (!dataCheckStore.curStudent) return;
|
|
|
+
|
|
|
await dataCheckStore.updateField({
|
|
|
field: "PAPER_TYPE",
|
|
|
value: JSON.stringify({
|
|
|
- ...dataCheckStore.curPage.paperType,
|
|
|
+ type: paperTypeType.value,
|
|
|
result: paperType || "#",
|
|
|
}),
|
|
|
});
|
|
|
- dataCheckStore.curPage.paperType.result = paperType;
|
|
|
+ dataCheckStore.modifyPaperType(paperType);
|
|
|
+ paperTypeResult.value = paperType;
|
|
|
}
|
|
|
|
|
|
watch(
|
|
|
- () => dataCheckStore.curPage?.recogData,
|
|
|
- (val) => {
|
|
|
+ () => dataCheckStore.curStudent,
|
|
|
+ async (val) => {
|
|
|
paperTypeArea.value = null;
|
|
|
if (!val) return;
|
|
|
|
|
|
- const regdata = parseRecogData(val);
|
|
|
+ // 只取第一张第一页的数据
|
|
|
+ const curStudentFirstPage = val.papers[0]?.pages[0];
|
|
|
+ if (!curStudentFirstPage) return;
|
|
|
+
|
|
|
+ paperTypeResult.value = curStudentFirstPage.paperType.result;
|
|
|
+ paperTypeType.value = curStudentFirstPage.paperType.type;
|
|
|
+ const recogData = curStudentFirstPage.recogData;
|
|
|
+ const regdata = parseRecogData(recogData);
|
|
|
if (!regdata) return;
|
|
|
|
|
|
+ // console.log(regdata);
|
|
|
+ paperTypeOrcResult.value = regdata.paperType.content;
|
|
|
+ if (!paperTypeOrcResult.value) paperTypeOrcResult.value = "空";
|
|
|
+
|
|
|
const rect = regdata.paperType.rect || null;
|
|
|
if (!rect) {
|
|
|
paperTypeArea.value = null;
|
|
|
+ paperTypeImg.value = "";
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -286,6 +291,15 @@ watch(
|
|
|
h: rect[3],
|
|
|
}
|
|
|
: null;
|
|
|
+
|
|
|
+ if (paperTypeArea.value) {
|
|
|
+ paperTypeImg.value = await getSliceFileUrl(
|
|
|
+ curStudentFirstPage.sheetUri,
|
|
|
+ paperTypeArea.value
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ paperTypeImg.value = "";
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
immediate: true,
|