|
@@ -68,17 +68,24 @@ export default defineComponent({
|
|
message.warn({ content: "没有可以标记的任务", duration: 5 });
|
|
message.warn({ content: "没有可以标记的任务", duration: 5 });
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- const res = await doProblemType(problemId);
|
|
|
|
- if (res?.data.success) {
|
|
|
|
- message.success({ content: "问题卷处理成功", duration: 3 });
|
|
|
|
- visible.value = false;
|
|
|
|
- removeSubmitedTask();
|
|
|
|
- if (store.historyOpen) {
|
|
|
|
- emit("should-reload-history");
|
|
|
|
|
|
+ try {
|
|
|
|
+ const res = await doProblemType(problemId);
|
|
|
|
+ if (res?.data.success) {
|
|
|
|
+ message.success({ content: "问题卷处理成功", duration: 3 });
|
|
|
|
+ visible.value = false;
|
|
|
|
+ removeSubmitedTask();
|
|
|
|
+ if (store.historyOpen) {
|
|
|
|
+ emit("should-reload-history");
|
|
|
|
+ }
|
|
|
|
+ updateStatus();
|
|
|
|
+ } else {
|
|
|
|
+ message.error({ content: res?.data.message || "错误", duration: 5 });
|
|
}
|
|
}
|
|
- updateStatus();
|
|
|
|
- } else {
|
|
|
|
- message.error({ content: res?.data.message || "错误", duration: 5 });
|
|
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log("问题卷处理失败", error);
|
|
|
|
+ message.error({ content: "网络异常", duration: 5 });
|
|
|
|
+ await new Promise((res) => setTimeout(res, 1500));
|
|
|
|
+ window.location.reload();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|