|
@@ -15,7 +15,10 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="arbitrate-body">
|
|
<div class="arbitrate-body">
|
|
- <RecognizeImage />
|
|
|
|
|
|
+ <RecognizeImage
|
|
|
|
+ v-if="curArbitrateTaskDetail"
|
|
|
|
+ :img-src="curArbitrateTaskDetail.uri"
|
|
|
|
+ />
|
|
|
|
|
|
<!-- arbitrate action modal -->
|
|
<!-- arbitrate action modal -->
|
|
<div v-if="curArbitrateTaskDetail" class="arbitrate-modal">
|
|
<div v-if="curArbitrateTaskDetail" class="arbitrate-modal">
|
|
@@ -128,12 +131,8 @@ async function updateProgress() {
|
|
|
|
|
|
const curArbitrateTaskDetails = ref([] as RecognizeArbitrateTaskDetail[]);
|
|
const curArbitrateTaskDetails = ref([] as RecognizeArbitrateTaskDetail[]);
|
|
const curArbitrateTaskDetailIndex = ref(0);
|
|
const curArbitrateTaskDetailIndex = ref(0);
|
|
-const curTaskDetails = ref([] as RecognizeArbitrateTaskDetail[]);
|
|
|
|
const curArbitrateTaskDetail = ref<RecognizeArbitrateTaskDetail | null>(null);
|
|
const curArbitrateTaskDetail = ref<RecognizeArbitrateTaskDetail | null>(null);
|
|
|
|
|
|
-// TODO: 缓存所有仲裁结果
|
|
|
|
-// const cacheArbitrateTaskDetailResults: Record<string, string[]> = {}
|
|
|
|
-
|
|
|
|
const nextArbitrateTaskDetail = computed(() => {
|
|
const nextArbitrateTaskDetail = computed(() => {
|
|
return curArbitrateTaskDetails.value[curArbitrateTaskDetailIndex.value + 1];
|
|
return curArbitrateTaskDetails.value[curArbitrateTaskDetailIndex.value + 1];
|
|
});
|
|
});
|
|
@@ -141,16 +140,6 @@ const nextArbitrateTaskDetail = computed(() => {
|
|
const nextDetailIsAnotherTask = computed(() => {
|
|
const nextDetailIsAnotherTask = computed(() => {
|
|
return !nextArbitrateTaskDetail.value;
|
|
return !nextArbitrateTaskDetail.value;
|
|
});
|
|
});
|
|
-// 下一个细分任务是否是另一页的
|
|
|
|
-const nextDetailIsAnotherPage = computed(() => {
|
|
|
|
- if (!curArbitrateTaskDetail.value) return false;
|
|
|
|
-
|
|
|
|
- return (
|
|
|
|
- !nextArbitrateTaskDetail.value ||
|
|
|
|
- nextArbitrateTaskDetail.value.pageIndex !==
|
|
|
|
- curArbitrateTaskDetail.value.pageIndex
|
|
|
|
- );
|
|
|
|
-});
|
|
|
|
|
|
|
|
const curTaskDetailName = computed(() => {
|
|
const curTaskDetailName = computed(() => {
|
|
if (!curArbitrateTaskDetail.value) return "";
|
|
if (!curArbitrateTaskDetail.value) return "";
|
|
@@ -167,14 +156,16 @@ async function getTask() {
|
|
const res = await recognizeArbitrateTask(groupId).catch(() => false);
|
|
const res = await recognizeArbitrateTask(groupId).catch(() => false);
|
|
curTask = res || null;
|
|
curTask = res || null;
|
|
if (!curTask) {
|
|
if (!curTask) {
|
|
- message.error("获取任务失败");
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- curTaskDetails.value = parseDetails(curTask);
|
|
|
|
- curArbitrateTaskDetails.value = curTaskDetails.value.filter(
|
|
|
|
- (item) => item.arbitrate
|
|
|
|
- );
|
|
|
|
|
|
+ curArbitrateTaskDetails.value = parseDetails(curTask);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+async function initData() {
|
|
|
|
+ await getTask();
|
|
|
|
+ curArbitrateTaskDetailIndex.value = 0;
|
|
|
|
+ setCurTaskDetail();
|
|
}
|
|
}
|
|
|
|
|
|
// 解析仲裁任务详情
|
|
// 解析仲裁任务详情
|
|
@@ -187,39 +178,45 @@ function parseDetails(
|
|
if (!recogData) return;
|
|
if (!recogData) return;
|
|
|
|
|
|
// 缺考
|
|
// 缺考
|
|
- details.push({
|
|
|
|
- ...parseDetailSize(recogData.absent.fill_result[0], "absent", 0, []),
|
|
|
|
- result1: page.absent ? page.absent[0] : "",
|
|
|
|
- result2: page.absent ? page.absent[1] : "",
|
|
|
|
- pageIndex: page.index,
|
|
|
|
- groupId: groupId,
|
|
|
|
- arbitrate: Boolean(page.absent),
|
|
|
|
- });
|
|
|
|
|
|
+ if (page.absent) {
|
|
|
|
+ details.push({
|
|
|
|
+ ...parseDetailSize(recogData.absent.fill_result[0], "absent", 0, []),
|
|
|
|
+ result1: page.absent ? page.absent[0] : "",
|
|
|
|
+ result2: page.absent ? page.absent[1] : "",
|
|
|
|
+ pageIndex: page.index,
|
|
|
|
+ groupId: groupId,
|
|
|
|
+ uri: page.uri,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
// 违纪
|
|
// 违纪
|
|
- details.push({
|
|
|
|
- ...parseDetailSize(recogData.breach.fill_result[0], "breach", 0, []),
|
|
|
|
- result1: page.breach ? page.breach[0] : "",
|
|
|
|
- result2: page.breach ? page.breach[1] : "",
|
|
|
|
- pageIndex: page.index,
|
|
|
|
- groupId: groupId,
|
|
|
|
- arbitrate: Boolean(page.breach),
|
|
|
|
- });
|
|
|
|
|
|
+ if (page.breach) {
|
|
|
|
+ details.push({
|
|
|
|
+ ...parseDetailSize(recogData.breach.fill_result[0], "breach", 0, []),
|
|
|
|
+ result1: page.breach ? page.breach[0] : "",
|
|
|
|
+ result2: page.breach ? page.breach[1] : "",
|
|
|
|
+ pageIndex: page.index,
|
|
|
|
+ groupId: groupId,
|
|
|
|
+ uri: page.uri,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
// 试卷类型
|
|
// 试卷类型
|
|
- details.push({
|
|
|
|
- ...parseDetailSize(
|
|
|
|
- recogData.paperType.fill_result[0],
|
|
|
|
- "paperType",
|
|
|
|
- 0,
|
|
|
|
- []
|
|
|
|
- ),
|
|
|
|
- result1: page.paperType ? page.paperType[0] : "",
|
|
|
|
- result2: page.paperType ? page.paperType[1] : "",
|
|
|
|
- pageIndex: page.index,
|
|
|
|
- groupId: groupId,
|
|
|
|
- arbitrate: Boolean(page.paperType),
|
|
|
|
- });
|
|
|
|
|
|
+ if (page.paperType) {
|
|
|
|
+ details.push({
|
|
|
|
+ ...parseDetailSize(
|
|
|
|
+ recogData.paperType.fill_result[0],
|
|
|
|
+ "paperType",
|
|
|
|
+ 0,
|
|
|
|
+ []
|
|
|
|
+ ),
|
|
|
|
+ result1: page.paperType ? page.paperType[0] : "",
|
|
|
|
+ result2: page.paperType ? page.paperType[1] : "",
|
|
|
|
+ pageIndex: page.index,
|
|
|
|
+ groupId: groupId,
|
|
|
|
+ uri: page.uri,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
// 试题
|
|
// 试题
|
|
let index = 0;
|
|
let index = 0;
|
|
@@ -228,16 +225,14 @@ function parseDetails(
|
|
qRecog.index = ++index;
|
|
qRecog.index = ++index;
|
|
const questionResult = page.question[qRecog.index];
|
|
const questionResult = page.question[qRecog.index];
|
|
const arbitrate = questionResult && questionResult.length >= 2;
|
|
const arbitrate = questionResult && questionResult.length >= 2;
|
|
- const fillResult = arbitrate ? [] : questionResult;
|
|
|
|
-
|
|
|
|
|
|
+ if (!arbitrate) return;
|
|
details.push({
|
|
details.push({
|
|
- ...parseDetailSize(qRecog, "question", qRecog.index, fillResult),
|
|
|
|
- result,
|
|
|
|
|
|
+ ...parseDetailSize(qRecog, "question", qRecog.index, []),
|
|
result1: questionResult ? questionResult[0] : "",
|
|
result1: questionResult ? questionResult[0] : "",
|
|
result2: questionResult ? questionResult[1] : "",
|
|
result2: questionResult ? questionResult[1] : "",
|
|
pageIndex: page.index,
|
|
pageIndex: page.index,
|
|
groupId: groupId,
|
|
groupId: groupId,
|
|
- arbitrate,
|
|
|
|
|
|
+ uri: page.uri,
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
@@ -292,7 +287,7 @@ async function changePrevTaskDetail() {
|
|
}, 500);
|
|
}, 500);
|
|
}
|
|
}
|
|
|
|
|
|
-async function getNextTask() {
|
|
|
|
|
|
+async function getPrevTask() {
|
|
let result = true;
|
|
let result = true;
|
|
const res = await recognizeArbitrateHistory({
|
|
const res = await recognizeArbitrateHistory({
|
|
groupId,
|
|
groupId,
|
|
@@ -312,16 +307,12 @@ async function getNextTask() {
|
|
}
|
|
}
|
|
|
|
|
|
curTask = res;
|
|
curTask = res;
|
|
- curTaskDetails.value = parseDetails(curTask);
|
|
|
|
- curArbitrateTaskDetails.value = curTaskDetails.value.filter(
|
|
|
|
- (item) => item.arbitrate
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
|
|
+ curArbitrateTaskDetails.value = parseDetails(curTask);
|
|
curArbitrateTaskDetailIndex.value = curArbitrateTaskDetails.value.length - 1;
|
|
curArbitrateTaskDetailIndex.value = curArbitrateTaskDetails.value.length - 1;
|
|
setCurTaskDetail();
|
|
setCurTaskDetail();
|
|
}
|
|
}
|
|
|
|
|
|
-async function getPrevTask() {
|
|
|
|
|
|
+async function getNextTask() {
|
|
let result = true;
|
|
let result = true;
|
|
const res = await recognizeArbitrateHistory({
|
|
const res = await recognizeArbitrateHistory({
|
|
groupId,
|
|
groupId,
|
|
@@ -341,10 +332,8 @@ async function getPrevTask() {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- curTaskDetails.value = parseDetails(curTask);
|
|
|
|
- curArbitrateTaskDetails.value = curTaskDetails.value.filter(
|
|
|
|
- (item) => item.arbitrate
|
|
|
|
- );
|
|
|
|
|
|
+ curTask = res;
|
|
|
|
+ curArbitrateTaskDetails.value = parseDetails(curTask);
|
|
|
|
|
|
curArbitrateTaskDetailIndex.value = 0;
|
|
curArbitrateTaskDetailIndex.value = 0;
|
|
setCurTaskDetail();
|
|
setCurTaskDetail();
|
|
@@ -481,6 +470,7 @@ function goback() {
|
|
}
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
+ initData();
|
|
registKeyEvent();
|
|
registKeyEvent();
|
|
});
|
|
});
|
|
|
|
|