|
@@ -21,6 +21,7 @@ import { SliceImage, SpecialTag, Track, ModeEnum } from "@/types";
|
|
|
// @ts-ignore
|
|
|
import CustomCursor from "custom-cursor.js";
|
|
|
import CommonMarkBody from "./CommonMarkBody.vue";
|
|
|
+// import { message } from "ant-design-vue";
|
|
|
// 开启本组件,测试后台在整卷的还原效果
|
|
|
// import MarkBody from "@/features/student/studentInspect/MarkBody.vue";
|
|
|
|
|
@@ -50,6 +51,28 @@ const makeScoreTrack = (
|
|
|
track.positionX = (track.offsetX - item.dx) / maxSliceWidth;
|
|
|
track.positionY =
|
|
|
(track.offsetY - item.dy + item.accumTopHeight) / theFinalHeight;
|
|
|
+
|
|
|
+ // const isIllegalRange = (testNum: number, min: number, max: number) => {
|
|
|
+ // return testNum < min || testNum > max;
|
|
|
+ // };
|
|
|
+
|
|
|
+ // // 检测有问题,此处没有给原图的宽高,如果有的话,要稍微修改下数据类型
|
|
|
+ // // 但其实下面也做了一个基本检测
|
|
|
+ // if (
|
|
|
+ // isIllegalRange(track.offsetX, 0, target.naturalWidth) ||
|
|
|
+ // isIllegalRange(track.offsetY, 0, target.naturalHeight) ||
|
|
|
+ // isIllegalRange(track.positionX, 0, 1) ||
|
|
|
+ // isIllegalRange(track.positionY, 0, 1)
|
|
|
+ // ) {
|
|
|
+ // console.error(
|
|
|
+ // "错误的track",
|
|
|
+ // track,
|
|
|
+ // target.naturalWidth,
|
|
|
+ // target.naturalHeight
|
|
|
+ // );
|
|
|
+ // void message.error("系统错误,请联系管理员!");
|
|
|
+ // }
|
|
|
+
|
|
|
if (track.offsetX > item.effectiveWidth + item.dx) {
|
|
|
console.log("不在有效宽度内,轨迹不生效");
|
|
|
return;
|
|
@@ -126,10 +149,24 @@ const makeSpecialTagTrack = (
|
|
|
track.positionX = (track.offsetX - item.dx) / maxSliceWidth;
|
|
|
track.positionY =
|
|
|
(track.offsetY - item.dy + item.accumTopHeight) / theFinalHeight;
|
|
|
- if (track.offsetX > item.effectiveWidth + item.dx) {
|
|
|
- console.log("不在有效宽度内,轨迹不生效");
|
|
|
- return;
|
|
|
- }
|
|
|
+
|
|
|
+ // const isIllegalRange = (testNum: number, min: number, max: number) => {
|
|
|
+ // return testNum < min || testNum > max;
|
|
|
+ // };
|
|
|
+
|
|
|
+ // if (
|
|
|
+ // isIllegalRange(track.offsetX, 0, target.naturalWidth) ||
|
|
|
+ // isIllegalRange(track.offsetY, 0, target.naturalHeight) ||
|
|
|
+ // isIllegalRange(track.positionX, 0, 1) ||
|
|
|
+ // isIllegalRange(track.positionY, 0, 1)
|
|
|
+ // ) {
|
|
|
+ // console.error("错误的track", track);
|
|
|
+ // void message.error("系统错误,请联系管理员!");
|
|
|
+ // }
|
|
|
+ // if (track.offsetX > item.effectiveWidth + item.dx) {
|
|
|
+ // console.log("不在有效宽度内,轨迹不生效");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
if (
|
|
|
item.tagList.some((t) => {
|
|
|
return (
|