|
@@ -1,6 +1,7 @@
|
|
import { SliceImage, SpecialTag, Track, Question, SplitConfig } from "@/types";
|
|
import { SliceImage, SpecialTag, Track, Question, SplitConfig } from "@/types";
|
|
import { useMarkStore } from "@/store";
|
|
import { useMarkStore } from "@/store";
|
|
import { randomCode } from "@/utils/utils";
|
|
import { randomCode } from "@/utils/utils";
|
|
|
|
+import { message } from "ant-design-vue";
|
|
|
|
|
|
export default function useMakeTrack() {
|
|
export default function useMakeTrack() {
|
|
const markStore = useMarkStore();
|
|
const markStore = useMarkStore();
|
|
@@ -131,8 +132,26 @@ export default function useMakeTrack() {
|
|
item.tagList.push(track);
|
|
item.tagList.push(track);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function checkTrackValidate(item: SliceImage): boolean {
|
|
|
|
+ if (!markStore.currentQuestion) return true;
|
|
|
|
+
|
|
|
|
+ const valid = (markStore.currentQuestion.picList || []).some(
|
|
|
|
+ (area) =>
|
|
|
|
+ `${area.i}_${area.x}_${area.y}_${area.w}_${area.h}` === item.sliceId
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ return valid;
|
|
|
|
+ }
|
|
|
|
+
|
|
// 标记轨迹
|
|
// 标记轨迹
|
|
function makeTrack(event: MouseEvent, item: SliceImage) {
|
|
function makeTrack(event: MouseEvent, item: SliceImage) {
|
|
|
|
+ if (markStore.currentQuestion && !checkTrackValidate(item)) {
|
|
|
|
+ void message.warning({
|
|
|
|
+ content: "只能在设置的评卷区中评卷",
|
|
|
|
+ duration: 3,
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (markStore.currentSpecialTagType) {
|
|
if (markStore.currentSpecialTagType) {
|
|
makeSpecialTagTrack(event, item);
|
|
makeSpecialTagTrack(event, item);
|
|
if (markStore.currentSpecialTagType === "TEXT") {
|
|
if (markStore.currentSpecialTagType === "TEXT") {
|