From 7cd0a044c597e9e2e4878dcad8e2f7a806152ce0 Mon Sep 17 00:00:00 2001 From: wjh Date: Wed, 18 Sep 2024 16:43:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=80=E5=87=BA=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E9=80=82=E9=85=8D=E5=AF=BC=E8=88=AA=20(#1541?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1541 Reviewed-by: sealday Co-authored-by: wjh Co-committed-by: wjh --- .../built-in/context-menu/ContextMenuItemsProps.tsx | 10 ++++++---- packages/core/client/src/locale/zh-CN.json | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/core/client/src/built-in/context-menu/ContextMenuItemsProps.tsx b/packages/core/client/src/built-in/context-menu/ContextMenuItemsProps.tsx index a04253f3d..1c09554db 100644 --- a/packages/core/client/src/built-in/context-menu/ContextMenuItemsProps.tsx +++ b/packages/core/client/src/built-in/context-menu/ContextMenuItemsProps.tsx @@ -98,6 +98,8 @@ const checkedAutoPage = (position, message, t) => { if (!sibling.classList.contains('autoPage')) { const element = document.elementFromPoint(position?.x, position?.y); const blockElement = element.closest('.ant-card'); + const navbar = document.querySelector('.ant-layout-header'); + const navbarHeight = navbar.getBoundingClientRect(); if (blockElement) { //需要展示的区块 const copyBlockElement = blockElement.cloneNode(true); @@ -107,17 +109,17 @@ const checkedAutoPage = (position, message, t) => { copyBlockElement.style.backgroundColor = '#ffffff'; const autoNode = document.createElement('div'); - autoNode.style.marginTop = '2.5%'; + autoNode.style.marginTop = `${navbarHeight.height}px`; autoNode.style.width = '100%'; autoNode.className = 'autoPage'; //退出按钮 const exitNode = document.createElement('div'); exitNode.style.width = '100%'; - exitNode.style.height = '3vh'; + exitNode.style.height = '4vh'; exitNode.style.textAlign = 'center'; - exitNode.style.lineHeight = '3vh'; + exitNode.style.lineHeight = '4vh'; exitNode.style.backgroundColor = '#e6e6e6'; - exitNode.textContent = '退出全屏'; + exitNode.textContent = `${t('Exit Full Screen')}`; autoNode.appendChild(exitNode); autoNode.appendChild(copyBlockElement); autoNode.addEventListener('click', () => { diff --git a/packages/core/client/src/locale/zh-CN.json b/packages/core/client/src/locale/zh-CN.json index 63810b06d..5e6085bf2 100644 --- a/packages/core/client/src/locale/zh-CN.json +++ b/packages/core/client/src/locale/zh-CN.json @@ -956,5 +956,6 @@ "Disable Right Menu":"禁用右键菜单", "Full Screen":"切换全屏", "Designer Mode":"设计者模式", - "There are no full screen blocks available at the current location":"当前位置没有可全屏区块" + "There are no full screen blocks available at the current location":"当前位置没有可全屏区块", + "Exit Full Screen":"退出全屏" }