|
@@ -114,6 +114,10 @@ import type { Question } from "@/types";
|
|
|
import { message } from "ant-design-vue";
|
|
|
import { reactive, watch } from "vue";
|
|
|
import { store } from "@/store/store";
|
|
|
+import {
|
|
|
+ addFocusTrack,
|
|
|
+ removeFocusTrack,
|
|
|
+} from "@/features/mark/use/focusTracks";
|
|
|
|
|
|
const emit = defineEmits(["inspect", "reject"]);
|
|
|
let checkedQuestions = reactive([] as Array<Question>);
|
|
@@ -180,43 +184,6 @@ function groupClicked(groupNumber: number) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function addFocusTrack(
|
|
|
- groupNumber: number | undefined,
|
|
|
- mainNumber: number | undefined,
|
|
|
- subNumber: string | undefined
|
|
|
-) {
|
|
|
- store.focusTracks.splice(0);
|
|
|
-
|
|
|
- if (groupNumber) {
|
|
|
- questions
|
|
|
- ?.filter((q) => q.groupNumber === groupNumber)
|
|
|
- ?.map((q) => q.trackList)
|
|
|
- .reduce((acc, ts) => acc.concat(ts))
|
|
|
- .forEach((t) => {
|
|
|
- store.focusTracks.push(t);
|
|
|
- });
|
|
|
- } else {
|
|
|
- questions
|
|
|
- ?.map((q) => q.trackList)
|
|
|
- .reduce((acc, ts) => acc.concat(ts))
|
|
|
- .filter((t) => {
|
|
|
- if (mainNumber) {
|
|
|
- return t.mainNumber === mainNumber && t.subNumber === subNumber;
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- })
|
|
|
- .forEach((t) => {
|
|
|
- store.focusTracks.push(t);
|
|
|
- });
|
|
|
- }
|
|
|
- // console.log(store.focusTracks);
|
|
|
-}
|
|
|
-
|
|
|
-function removeFocusTrack() {
|
|
|
- store.focusTracks.splice(0);
|
|
|
-}
|
|
|
-
|
|
|
function reject() {
|
|
|
if (checkedQuestions.length === 0) {
|
|
|
message.warn({ content: "请先选择试题。" });
|