|
@@ -109,18 +109,18 @@ async function updateTask() {
|
|
res = await getOneOfStuTask();
|
|
res = await getOneOfStuTask();
|
|
}
|
|
}
|
|
void message.success({
|
|
void message.success({
|
|
- content: res.data.studentId ? "获取成功" : "无任务",
|
|
|
|
|
|
+ content: res.data ? "获取成功" : "当前无评卷任务",
|
|
key: mkey,
|
|
key: mkey,
|
|
});
|
|
});
|
|
|
|
|
|
- if (res.data.studentId) {
|
|
|
|
|
|
+ if (res.data) {
|
|
let rawTask = res.data;
|
|
let rawTask = res.data;
|
|
rawTask.sheetUrls = rawTask.sheetUrls || [];
|
|
rawTask.sheetUrls = rawTask.sheetUrls || [];
|
|
// rawTask.sheetUrls = ["/1-1.jpg", "/1-2.jpg"];
|
|
// rawTask.sheetUrls = ["/1-1.jpg", "/1-2.jpg"];
|
|
rawTask.sliceUrls = [...rawTask.sheetUrls];
|
|
rawTask.sliceUrls = [...rawTask.sheetUrls];
|
|
store.currentTask = rawTask;
|
|
store.currentTask = rawTask;
|
|
} else {
|
|
} else {
|
|
- store.message = res.data.message || "无任务";
|
|
|
|
|
|
+ store.message = "当前无评卷任务";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -176,9 +176,9 @@ const saveTaskToServer = async (
|
|
if (!store.currentTask) return;
|
|
if (!store.currentTask) return;
|
|
const markResult = store.currentTask.markResult;
|
|
const markResult = store.currentTask.markResult;
|
|
if (!markResult) return;
|
|
if (!markResult) return;
|
|
- console.log("save inspect task to server");
|
|
|
|
|
|
+
|
|
const mkey = "save_task_key";
|
|
const mkey = "save_task_key";
|
|
- void message.loading({ content: "保存评卷任务...", key: mkey });
|
|
|
|
|
|
+
|
|
let res;
|
|
let res;
|
|
if (unselective) {
|
|
if (unselective) {
|
|
res = await saveArbitrateTask(
|
|
res = await saveArbitrateTask(
|
|
@@ -195,6 +195,7 @@ const saveTaskToServer = async (
|
|
error: string;
|
|
error: string;
|
|
};
|
|
};
|
|
const errors: SubmitError[] = [];
|
|
const errors: SubmitError[] = [];
|
|
|
|
+
|
|
markResult.scoreList.forEach((score, index) => {
|
|
markResult.scoreList.forEach((score, index) => {
|
|
if (!store.currentTask) return;
|
|
if (!store.currentTask) return;
|
|
const question = store.currentTask.questionList[index];
|
|
const question = store.currentTask.questionList[index];
|
|
@@ -235,19 +236,33 @@ const saveTaskToServer = async (
|
|
specialTagList
|
|
specialTagList
|
|
);
|
|
);
|
|
}
|
|
}
|
|
- if (res.data.success && store.currentTask) {
|
|
|
|
- void message.success({ content: "仲裁成功", key: mkey, duration: 2 });
|
|
|
|
- if (!store.historyOpen) {
|
|
|
|
- store.currentTask = undefined;
|
|
|
|
- if (!isSingleStudent) await fetchTask();
|
|
|
|
- } else {
|
|
|
|
- EventBus.emit("should-reload-history");
|
|
|
|
- }
|
|
|
|
- } else if (res.data.message) {
|
|
|
|
- console.log(res.data.message);
|
|
|
|
- void message.error({ content: res.data.message, key: mkey, duration: 10 });
|
|
|
|
- } else if (!store.currentTask) {
|
|
|
|
- void message.warn({ content: "暂无新任务", key: mkey, duration: 10 });
|
|
|
|
|
|
+ if (!res.data.success) {
|
|
|
|
+ void message.error({
|
|
|
|
+ content: res.data.message || "仲裁失败,请重新尝试!",
|
|
|
|
+ key: mkey,
|
|
|
|
+ duration: 5,
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (isSingleStudent) {
|
|
|
|
+ void message.success({
|
|
|
|
+ content: "仲裁成功,页面将在3秒钟之后关闭",
|
|
|
|
+ key: mkey,
|
|
|
|
+ duration: 2,
|
|
|
|
+ });
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ window.close();
|
|
|
|
+ }, 3000);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ void message.success({ content: "仲裁成功", key: mkey, duration: 2 });
|
|
|
|
+ if (!store.historyOpen) {
|
|
|
|
+ store.currentTask = undefined;
|
|
|
|
+ await fetchTask();
|
|
|
|
+ } else {
|
|
|
|
+ EventBus.emit("should-reload-history");
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|