mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	fix: 修复点击iframe页面无法关闭右键标签页面板以及右键标签页面板被遮挡的问题
				
					
				
			This commit is contained in:
		
							parent
							
								
									a0c56e99b7
								
							
						
					
					
						commit
						02c2e4fc4b
					
				@ -6,10 +6,10 @@ import { useTags } from "../../hooks/useTag";
 | 
				
			|||||||
import { routerArrays } from "@/layout/types";
 | 
					import { routerArrays } from "@/layout/types";
 | 
				
			||||||
import { handleAliveRoute, getTopMenu } from "@/router/utils";
 | 
					import { handleAliveRoute, getTopMenu } from "@/router/utils";
 | 
				
			||||||
import { useSettingStoreHook } from "@/store/modules/settings";
 | 
					import { useSettingStoreHook } from "@/store/modules/settings";
 | 
				
			||||||
import { useResizeObserver, useFullscreen } from "@vueuse/core";
 | 
					 | 
				
			||||||
import { isEqual, isAllEmpty, debounce } from "@pureadmin/utils";
 | 
					import { isEqual, isAllEmpty, debounce } from "@pureadmin/utils";
 | 
				
			||||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
 | 
					import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
 | 
				
			||||||
import { ref, watch, unref, toRaw, nextTick, onBeforeUnmount } from "vue";
 | 
					import { ref, watch, unref, toRaw, nextTick, onBeforeUnmount } from "vue";
 | 
				
			||||||
 | 
					import { useResizeObserver, useFullscreen, onClickOutside } from "@vueuse/core";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
 | 
					import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
 | 
				
			||||||
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
 | 
					import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
 | 
				
			||||||
@ -49,6 +49,7 @@ const {
 | 
				
			|||||||
const tabDom = ref();
 | 
					const tabDom = ref();
 | 
				
			||||||
const containerDom = ref();
 | 
					const containerDom = ref();
 | 
				
			||||||
const scrollbarDom = ref();
 | 
					const scrollbarDom = ref();
 | 
				
			||||||
 | 
					const contextmenuRef = ref();
 | 
				
			||||||
const isShowArrow = ref(false);
 | 
					const isShowArrow = ref(false);
 | 
				
			||||||
const topPath = getTopMenu()?.path;
 | 
					const topPath = getTopMenu()?.path;
 | 
				
			||||||
const { VITE_HIDE_HOME } = import.meta.env;
 | 
					const { VITE_HIDE_HOME } = import.meta.env;
 | 
				
			||||||
@ -328,6 +329,7 @@ function handleCommand(command: any) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/** 触发右键中菜单的点击事件 */
 | 
					/** 触发右键中菜单的点击事件 */
 | 
				
			||||||
function selectTag(key, item) {
 | 
					function selectTag(key, item) {
 | 
				
			||||||
 | 
					  closeMenu();
 | 
				
			||||||
  onClickDrop(key, item, currentSelect.value);
 | 
					  onClickDrop(key, item, currentSelect.value);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -462,6 +464,10 @@ function tagOnClick(item) {
 | 
				
			|||||||
  // showMenuModel(item?.path, item?.query);
 | 
					  // showMenuModel(item?.path, item?.query);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					onClickOutside(contextmenuRef, closeMenu, {
 | 
				
			||||||
 | 
					  detectIframe: true
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
watch(route, () => {
 | 
					watch(route, () => {
 | 
				
			||||||
  activeIndex.value = -1;
 | 
					  activeIndex.value = -1;
 | 
				
			||||||
  dynamicTagView();
 | 
					  dynamicTagView();
 | 
				
			||||||
@ -558,6 +564,7 @@ onBeforeUnmount(() => {
 | 
				
			|||||||
    <transition name="el-zoom-in-top">
 | 
					    <transition name="el-zoom-in-top">
 | 
				
			||||||
      <ul
 | 
					      <ul
 | 
				
			||||||
        v-show="visible"
 | 
					        v-show="visible"
 | 
				
			||||||
 | 
					        ref="contextmenuRef"
 | 
				
			||||||
        :key="Math.random()"
 | 
					        :key="Math.random()"
 | 
				
			||||||
        :style="getContextMenuStyle"
 | 
					        :style="getContextMenuStyle"
 | 
				
			||||||
        class="contextmenu"
 | 
					        class="contextmenu"
 | 
				
			||||||
 | 
				
			|||||||
@ -58,7 +58,6 @@ onMounted(() => {
 | 
				
			|||||||
.frame {
 | 
					.frame {
 | 
				
			||||||
  position: absolute;
 | 
					  position: absolute;
 | 
				
			||||||
  inset: 0;
 | 
					  inset: 0;
 | 
				
			||||||
  z-index: 998;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .frame-iframe {
 | 
					  .frame-iframe {
 | 
				
			||||||
    box-sizing: border-box;
 | 
					    box-sizing: border-box;
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +1,6 @@
 | 
				
			|||||||
import {
 | 
					import {
 | 
				
			||||||
  ref,
 | 
					  ref,
 | 
				
			||||||
  unref,
 | 
					  unref,
 | 
				
			||||||
  watch,
 | 
					 | 
				
			||||||
  computed,
 | 
					  computed,
 | 
				
			||||||
  reactive,
 | 
					  reactive,
 | 
				
			||||||
  onMounted,
 | 
					  onMounted,
 | 
				
			||||||
@ -9,7 +8,6 @@ import {
 | 
				
			|||||||
  getCurrentInstance
 | 
					  getCurrentInstance
 | 
				
			||||||
} from "vue";
 | 
					} from "vue";
 | 
				
			||||||
import { tagsViewsType } from "../types";
 | 
					import { tagsViewsType } from "../types";
 | 
				
			||||||
import { useEventListener } from "@vueuse/core";
 | 
					 | 
				
			||||||
import { useRoute, useRouter } from "vue-router";
 | 
					import { useRoute, useRouter } from "vue-router";
 | 
				
			||||||
import { transformI18n, $t } from "@/plugins/i18n";
 | 
					import { transformI18n, $t } from "@/plugins/i18n";
 | 
				
			||||||
import { responsiveStorageNameSpace } from "@/config";
 | 
					import { responsiveStorageNameSpace } from "@/config";
 | 
				
			||||||
@ -215,13 +213,6 @@ export function useTags() {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  watch(
 | 
					 | 
				
			||||||
    () => visible.value,
 | 
					 | 
				
			||||||
    () => {
 | 
					 | 
				
			||||||
      useEventListener(document, "click", closeMenu);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return {
 | 
					  return {
 | 
				
			||||||
    route,
 | 
					    route,
 | 
				
			||||||
    router,
 | 
					    router,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user