From bcfbbb656a2a35ee2a38abdf9752f6f95c17642c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Thu, 11 Jul 2024 13:04:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=E5=85=A8=E5=B1=8F=E9=AB=98=E5=BA=A6=E5=A4=84=E7=90=86?= =?UTF-8?q?=20(#5760)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file-management/code-editor/index.vue | 73 +++++++++++-------- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/frontend/src/views/host/file-management/code-editor/index.vue b/frontend/src/views/host/file-management/code-editor/index.vue index 2f12a6ca2..3e35680bd 100644 --- a/frontend/src/views/host/file-management/code-editor/index.vue +++ b/frontend/src/views/host/file-management/code-editor/index.vue @@ -10,7 +10,7 @@ :fullscreen="isFullscreen" > - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + + + +
@@ -139,10 +146,10 @@
@@ -226,13 +233,15 @@ const baseDir = ref(); const treeData = ref([]); const codeBox = ref(); const defaultHeight = ref(55); -const fullScreenHeight = ref(80); const treeHeight = ref(0); const codeHeight = ref('55vh'); const codeReq = reactive({ path: '', expand: false, page: 1, pageSize: 100 }); const isShow = ref(true); const isEdit = ref(false); const oldFileContent = ref(''); +const dialogHeader = ref(null); +const dialogForm = ref(null); +const dialogFooter = ref(null); const toggleShow = () => { isShow.value = !isShow.value; @@ -340,8 +349,14 @@ onMounted(() => { const updateHeights = () => { const vh = window.innerHeight / 100; if (isFullscreen.value) { - treeHeight.value = fullScreenHeight.value * vh - 31; - codeHeight.value = `${fullScreenHeight.value}vh`; + let paddingHeight = 75; + const headerHeight = dialogHeader.value.offsetHeight; + const formHeight = dialogForm.value.offsetHeight; + const footerHeight = dialogFooter.value.offsetHeight; + treeHeight.value = window.innerHeight - headerHeight - formHeight - footerHeight - paddingHeight - 31; + codeHeight.value = `${ + ((window.innerHeight - headerHeight - formHeight - footerHeight - paddingHeight) / window.innerHeight) * 100 + }vh`; } else { treeHeight.value = defaultHeight.value * vh - 31; codeHeight.value = `${defaultHeight.value}vh`;