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`;