|
@@ -77,6 +77,8 @@ import {
|
|
RightOutlined,
|
|
RightOutlined,
|
|
PictureFilled,
|
|
PictureFilled,
|
|
} from "@ant-design/icons-vue";
|
|
} from "@ant-design/icons-vue";
|
|
|
|
+import { message } from "ant-design-vue";
|
|
|
|
+
|
|
import { computed, nextTick, ref, unref } from "vue";
|
|
import { computed, nextTick, ref, unref } from "vue";
|
|
import {
|
|
import {
|
|
objAssign,
|
|
objAssign,
|
|
@@ -184,7 +186,7 @@ function updateRecogList() {
|
|
const ABC = abc.split("");
|
|
const ABC = abc.split("");
|
|
regdata.question.forEach((gGroup) => {
|
|
regdata.question.forEach((gGroup) => {
|
|
gGroup.fill_result.forEach((qRecog) => {
|
|
gGroup.fill_result.forEach((qRecog) => {
|
|
- const result = dataCheckStore.curPage.question.result[index] || "";
|
|
|
|
|
|
+ const result = dataCheckStore.curPage?.question.result[index] || "";
|
|
qRecog.index = ++index;
|
|
qRecog.index = ++index;
|
|
|
|
|
|
const questionResult = result ? result.split("") : [];
|
|
const questionResult = result ? result.split("") : [];
|
|
@@ -212,10 +214,7 @@ function parseRecogBlocks() {
|
|
const curBorderWidth = Math.max(1, borderWidth * rate);
|
|
const curBorderWidth = Math.max(1, borderWidth * rate);
|
|
|
|
|
|
recogBlocks.value = unref(recogList.value).map((item) => {
|
|
recogBlocks.value = unref(recogList.value).map((item) => {
|
|
- const nitem: RecogBlock = { ...item };
|
|
|
|
- nitem.areaImg = "";
|
|
|
|
-
|
|
|
|
- nitem.fillAreaStyle = {
|
|
|
|
|
|
+ const fillAreaStyle = {
|
|
position: "absolute",
|
|
position: "absolute",
|
|
left: `${item.fillArea.x * rate}px`,
|
|
left: `${item.fillArea.x * rate}px`,
|
|
top: `${item.fillArea.y * rate}px`,
|
|
top: `${item.fillArea.y * rate}px`,
|
|
@@ -223,7 +222,7 @@ function parseRecogBlocks() {
|
|
height: `${item.fillArea.h * rate}px`,
|
|
height: `${item.fillArea.h * rate}px`,
|
|
zIndex: 9,
|
|
zIndex: 9,
|
|
};
|
|
};
|
|
- nitem.fillOptionStyles = item.optionSizes
|
|
|
|
|
|
+ const fillOptionStyles = item.optionSizes
|
|
.map((op) => {
|
|
.map((op) => {
|
|
const opStyle = {
|
|
const opStyle = {
|
|
position: "absolute",
|
|
position: "absolute",
|
|
@@ -232,6 +231,7 @@ function parseRecogBlocks() {
|
|
width: `${op.w * rate}px`,
|
|
width: `${op.w * rate}px`,
|
|
height: `${op.h * rate}px`,
|
|
height: `${op.h * rate}px`,
|
|
zIndex: 9,
|
|
zIndex: 9,
|
|
|
|
+ border: "",
|
|
};
|
|
};
|
|
|
|
|
|
if (op.filled && fillShow) {
|
|
if (op.filled && fillShow) {
|
|
@@ -244,10 +244,17 @@ function parseRecogBlocks() {
|
|
return opStyle;
|
|
return opStyle;
|
|
}
|
|
}
|
|
|
|
|
|
- return;
|
|
|
|
|
|
+ return opStyle;
|
|
})
|
|
})
|
|
.filter((item) => item);
|
|
.filter((item) => item);
|
|
|
|
|
|
|
|
+ const nitem: RecogBlock = {
|
|
|
|
+ ...item,
|
|
|
|
+ fillAreaStyle,
|
|
|
|
+ fillOptionStyles,
|
|
|
|
+ areaImg: "",
|
|
|
|
+ };
|
|
|
|
+
|
|
return nitem;
|
|
return nitem;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -255,6 +262,7 @@ function parseRecogBlocks() {
|
|
// area click
|
|
// area click
|
|
const recogEditDialogRef = ref();
|
|
const recogEditDialogRef = ref();
|
|
async function onAreaClick(data: RecogBlock) {
|
|
async function onAreaClick(data: RecogBlock) {
|
|
|
|
+ if (!curPage.value) return;
|
|
curRecogBlock.value = data;
|
|
curRecogBlock.value = data;
|
|
// 基于 fillArea 四周扩展一个 fillSize 尺寸
|
|
// 基于 fillArea 四周扩展一个 fillSize 尺寸
|
|
const area = {
|
|
const area = {
|
|
@@ -264,7 +272,7 @@ async function onAreaClick(data: RecogBlock) {
|
|
h: data.fillArea.h + data.fillSize.h * 2,
|
|
h: data.fillArea.h + data.fillSize.h * 2,
|
|
};
|
|
};
|
|
curRecogBlock.value.areaImg = await getSliceFileUrl(
|
|
curRecogBlock.value.areaImg = await getSliceFileUrl(
|
|
- curPage.value?.sheetUri,
|
|
|
|
|
|
+ curPage.value.sheetUri,
|
|
area
|
|
area
|
|
);
|
|
);
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
@@ -273,7 +281,7 @@ async function onAreaClick(data: RecogBlock) {
|
|
}
|
|
}
|
|
|
|
|
|
async function onRecogEditConfirm(result: string[]) {
|
|
async function onRecogEditConfirm(result: string[]) {
|
|
- if (!curRecogBlock.value) return;
|
|
|
|
|
|
+ if (!curRecogBlock.value || !dataCheckStore.curPage) return;
|
|
|
|
|
|
const data = curRecogBlock.value;
|
|
const data = curRecogBlock.value;
|
|
|
|
|