刘洋 6 months ago
parent
commit
f59fe25296
2 changed files with 5 additions and 20 deletions
  1. 1 20
      src/components/Abnormal.vue
  2. 4 0
      src/features/mark/MinimapModal.vue

+ 1 - 20
src/components/Abnormal.vue

@@ -1,6 +1,6 @@
 <template>
   <div
-    v-if="store.currentTask?.collationLabelCode && !isInMiniDialog"
+    v-if="store.currentTask?.collationLabelCode"
     ref="abnormalRef"
     class="abnormal"
   >
@@ -22,26 +22,7 @@ import { store } from "@/store/store";
 
 import { UpOutlined } from "@ant-design/icons-vue";
 
-const findParent = (child, selector) => {
-  let parent = child.parentNode;
-  while (parent && parent !== document.documentElement) {
-    if (parent.matches(selector)) {
-      return parent;
-    }
-    parent = parent.parentNode;
-  }
-
-  return null;
-};
-
 const abnormalRef = ref();
-const isInMiniDialog = ref(false);
-
-onMounted(() => {
-  if (findParent(abnormalRef.value, ".mini-map-container")) {
-    isInMiniDialog.value = true;
-  }
-});
 
 const show = ref(true);
 const result = computed(() => {

+ 4 - 0
src/features/mark/MinimapModal.vue

@@ -33,6 +33,10 @@ onBeforeUpdate(() => {
   imagesHtml =
     document.querySelector(".mark-body-container div:first-of-type")
       ?.innerHTML ?? "请关闭或重新打开";
+  setTimeout(() => {
+    let element = document.querySelector(".mini-map-container .abnormal");
+    element && element.remove();
+  });
 });
 
 const setScrollTo = (e: MouseEvent) => {