From 639c4458be8309985aaf81a1cb6e52fb20e42540 Mon Sep 17 00:00:00 2001 From: Soybean Date: Wed, 24 Aug 2022 00:15:46 +0800 Subject: [PATCH] =?UTF-8?q?build(projects):=20=E5=8D=87=E7=BA=A7=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E3=80=81=E4=BF=AE=E5=A4=8DT=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95=E8=BF=9E=E7=BB=AD=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ISSUES CLOSED: #125 --- package.json | 4 +-- .../GlobalTab/components/TabDetail/index.vue | 26 ++++++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 98dd829d..06272418 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@better-scroll/core": "^2.4.2", "@soybeanjs/vue-admin-layout": "^1.1.1", "@soybeanjs/vue-admin-tab": "^1.0.5", - "@vueuse/core": "^9.1.0", + "@vueuse/core": "^9.1.1", "axios": "^0.27.2", "clipboard": "^2.0.11", "colord": "^2.9.3", @@ -87,7 +87,7 @@ "@soybeanjs/eslint-config": "0.2.10", "@types/bmapgl": "^0.0.5", "@types/crypto-js": "^4.1.1", - "@types/node": "^18.7.9", + "@types/node": "^18.7.11", "@types/qs": "^6.9.7", "@types/ua-parser-js": "^0.7.36", "@vitejs/plugin-vue": "^3.0.3", diff --git a/src/layouts/common/GlobalTab/components/TabDetail/index.vue b/src/layouts/common/GlobalTab/components/TabDetail/index.vue index 877231b3..b982628e 100644 --- a/src/layouts/common/GlobalTab/components/TabDetail/index.vue +++ b/src/layouts/common/GlobalTab/components/TabDetail/index.vue @@ -18,10 +18,11 @@ @@ -76,14 +77,31 @@ function setDropdown(x: number, y: number, currentPath: string) { Object.assign(dropdown, { x, y, currentPath }); } +let isClickContextMenu = false; + +function handleDropdownVisible(visible: boolean) { + if (!isClickContextMenu) { + dropdown.visible = visible; + } +} + /** 点击右键菜单 */ async function handleContextMenu(e: MouseEvent, fullPath: string) { e.preventDefault(); + const { clientX, clientY } = e; + + isClickContextMenu = true; + + const DURATION = dropdown.visible ? 150 : 0; + hideDropdown(); - setDropdown(clientX, clientY, fullPath); - await nextTick(); - showDropdown(); + + setTimeout(() => { + setDropdown(clientX, clientY, fullPath); + showDropdown(); + isClickContextMenu = false; + }, DURATION); } watch(