|
@@ -40,10 +40,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { doProblemType, getStatus } from "@/api/markPage";
|
|
|
import { message } from "ant-design-vue";
|
|
|
import { useMarkStore } from "@/store";
|
|
|
-import EventBus from "@/plugins/eventBus";
|
|
|
import { reactive } from "vue";
|
|
|
|
|
|
const markStore = useMarkStore();
|
|
@@ -63,14 +61,9 @@ const formModel: FormModel = reactive({
|
|
|
problemRemark: "",
|
|
|
});
|
|
|
|
|
|
-async function updateStatus() {
|
|
|
- const res = await getStatus();
|
|
|
- markStore.status = res.data;
|
|
|
-}
|
|
|
-
|
|
|
-const handleOk = async () => {
|
|
|
- if (!markStore.currentTask) {
|
|
|
- void message.warn({ content: "没有可以标记的任务", duration: 5 });
|
|
|
+const handleOk = () => {
|
|
|
+ if (!markStore.currentQuestion) {
|
|
|
+ void message.warn({ content: "没有可以标记的试题" });
|
|
|
return;
|
|
|
}
|
|
|
if (!formModel.problemType) {
|
|
@@ -81,32 +74,34 @@ const handleOk = async () => {
|
|
|
void message.error({ content: "请输入原因" });
|
|
|
return;
|
|
|
}
|
|
|
- try {
|
|
|
- const res = await doProblemType({
|
|
|
- problemType: formModel.problemType,
|
|
|
- problemRemark:
|
|
|
- formModel.problemType === "OTHER" ? formModel.problemRemark : undefined,
|
|
|
- });
|
|
|
- if (res?.data.success) {
|
|
|
- void message.success({ content: "问题卷处理成功", duration: 3 });
|
|
|
- visible = false;
|
|
|
- markStore.currentTask = undefined;
|
|
|
- if (markStore.historyOpen) {
|
|
|
- EventBus.emit("should-reload-history");
|
|
|
- } else {
|
|
|
- markStore.tasks.shift();
|
|
|
- markStore.currentTask = markStore.tasks[0];
|
|
|
- }
|
|
|
- await updateStatus();
|
|
|
- } else {
|
|
|
- void message.error({ content: res?.data.message || "错误", duration: 5 });
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log("问题卷处理失败", error);
|
|
|
- void message.error({ content: "网络异常", duration: 5 });
|
|
|
- await new Promise((res) => setTimeout(res, 1500));
|
|
|
- window.location.reload();
|
|
|
- }
|
|
|
+
|
|
|
+ markStore.currentQuestion.problem = true;
|
|
|
+ markStore.currentQuestion.problemType = formModel.problemType;
|
|
|
+ markStore.currentQuestion.problemRemark = formModel.problemRemark;
|
|
|
+
|
|
|
+ const markResult = markStore.currentTask.markResult;
|
|
|
+ // markResult.questionList.forEach((item) => {
|
|
|
+ // if (item.questionId === markStore.currentQuestion.questionId) {
|
|
|
+ // item.problem = true;
|
|
|
+ // item.problemType = formModel.problemType;
|
|
|
+ // item.problemRemark = formModel.problemRemark;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ markStore.removeScoreTracks = markResult.markerTrackList.filter(
|
|
|
+ (q) =>
|
|
|
+ q.mainNumber === markStore.currentQuestion?.mainNumber &&
|
|
|
+ q.subNumber === markStore.currentQuestion?.subNumber
|
|
|
+ );
|
|
|
+ markResult.markerTrackList = markResult.markerTrackList.filter(
|
|
|
+ (q) =>
|
|
|
+ q.mainNumber !== markStore.currentQuestion?.mainNumber ||
|
|
|
+ q.subNumber !== markStore.currentQuestion?.subNumber
|
|
|
+ );
|
|
|
+ const { __index } = markStore.currentQuestion;
|
|
|
+ markResult.scoreList[__index] = null;
|
|
|
+ markStore.currentScore = null;
|
|
|
+
|
|
|
+ visible = false;
|
|
|
};
|
|
|
|
|
|
const handleCancel = () => {
|