|
@@ -60,6 +60,7 @@ import { Task } from "@/types";
|
|
import { defineComponent, ref, watch, watchEffect } from "vue";
|
|
import { defineComponent, ref, watch, watchEffect } from "vue";
|
|
import { store } from "./store";
|
|
import { store } from "./store";
|
|
import { CloseOutlined, SearchOutlined } from "@ant-design/icons-vue";
|
|
import { CloseOutlined, SearchOutlined } from "@ant-design/icons-vue";
|
|
|
|
+import { cloneDeep } from "lodash";
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: "MarkHistory",
|
|
name: "MarkHistory",
|
|
@@ -113,11 +114,25 @@ export default defineComponent({
|
|
});
|
|
});
|
|
loading.value = false;
|
|
loading.value = false;
|
|
if (res.data) {
|
|
if (res.data) {
|
|
- store.historyTasks = res.data;
|
|
|
|
|
|
+ let data = cloneDeep(res.data) as Array<Task>;
|
|
|
|
+ data = data.map((t) => {
|
|
|
|
+ t.questionList.map((q) => {
|
|
|
|
+ q.__origScore = q.score;
|
|
|
|
+ return q;
|
|
|
|
+ });
|
|
|
|
+ return t;
|
|
|
|
+ });
|
|
|
|
+ store.historyTasks = data;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function replaceCurrentTask(task: Task | undefined) {
|
|
function replaceCurrentTask(task: Task | undefined) {
|
|
|
|
+ if (task) {
|
|
|
|
+ task.questionList = task.questionList.map((q) => {
|
|
|
|
+ q.score = q.__origScore;
|
|
|
|
+ return q;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
store.currentTask = task;
|
|
store.currentTask = task;
|
|
}
|
|
}
|
|
|
|
|