Переглянути джерело

右键-定位轨迹功能的bug fix

刘洋 2 роки тому
батько
коміт
0e669462ef
2 змінених файлів з 46 додано та 4 видалено
  1. 11 0
      src/devLoginParams.ts
  2. 35 4
      src/features/mark/MarkBoardTrack.vue

+ 11 - 0
src/devLoginParams.ts

@@ -33,6 +33,17 @@ export const LOGIN_CONFIG = {
 // };
 // export const LOGIN_CONFIG = {
 //   isAdmin: false,
+//   forceChange: true,
+//   loginName: "6-X-M_pj01",
+//   // loginName: "liuyang",
+//   password: "123456",
+//   examId: "432",
+//   markerId: "3123",
+//   // markerId: "482",
+//   // markerId: "483",
+// };
+// export const LOGIN_CONFIG = {
+//   isAdmin: false,
 //   forceChange: false,
 //   loginName: "spj111-01",
 //   // loginName: "spj432-01",

+ 35 - 4
src/features/mark/MarkBoardTrack.vue

@@ -136,7 +136,14 @@
             @blur="rightBlur"
           >
             <div
-              v-if="activeRightMenuItem"
+              v-if="
+                activeRightMenuItem?.id ==
+                (store.isScoreBoardCollapsed
+                  ? props.modal
+                    ? ['bq', question.mainNumber, question.subNumber].join('-')
+                    : ''
+                  : ['bq', question.mainNumber, question.subNumber].join('-'))
+              "
               class="tw-fixed right-menu-box"
               :style="tmpStyle"
             >
@@ -144,10 +151,14 @@
                 定位
               </div>
             </div>
-            <div v-if="!!question.questionName" @click="positioning(question)">
+            <div
+              v-if="!!question.questionName"
+              class="tihao"
+              @click="positioning(question)"
+            >
               {{ question.questionName }}
             </div>
-            <div v-else @click="positioning(question)">
+            <div v-else class="tihao" @click="positioning(question)">
               {{ question.title }} {{ question.mainNumber }}-{{
                 question.subNumber
               }}
@@ -287,6 +298,17 @@ const tmpStyle = reactive<any>({
   top: 0,
   zIndex: 300,
 });
+function getParentNode(el: any, c: string): any {
+  if (el.className?.includes(c)) {
+    return el;
+  } else {
+    if (el.parentNode) {
+      return getParentNode(el.parentNode, c);
+    } else {
+      return null;
+    }
+  }
+}
 const onRightClick = (e: any, index?: any) => {
   e.preventDefault();
   if (
@@ -295,7 +317,11 @@ const onRightClick = (e: any, index?: any) => {
   ) {
     tmpStyle.left = e.clientX + "px";
     tmpStyle.top = e.clientY + "px";
-    activeRightMenuItem.value = e;
+    let parentNode = getParentNode(e.target, "question");
+    if (parentNode) {
+      activeRightMenuItem.value = parentNode;
+    }
+    console.log("activeRightMenuItem:", activeRightMenuItem.value);
   }
 };
 const rightBlur = () => {
@@ -587,6 +613,11 @@ const buttonHeightForSelective = $computed(() =>
   padding: 10px;
   background-color: var(--app-container-bg-color);
   position: relative;
+  .tihao {
+    &:hover {
+      // font-weight: bold;
+    }
+  }
 }
 
 .current-question {