diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/endpointQueryTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/endpointQueryTab.vue index f83bf34d4..2317f2492 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/endpointQueryTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/endpointQueryTab.vue @@ -265,12 +265,13 @@ }); }, tableReload() { - this.tableShow = false; - setTimeout(() => { - this.tableShow = true; - //this.queryEndpoint(); - }, 300); - //this.$nextTick(() => {this.tableShow = true}); + var table = this.$refs.endpointQueryTable; + let resizeTimeout = setInterval(() => { + if (!window.resizing) { + table.setHeight(); + clearInterval(resizeTimeout); + } + }, 200); }, queryEndpoint() { this.loading = true; @@ -684,6 +685,7 @@ mounted() { this.getPanelData(); //this.$nextTick(() => { + setTimeout(() => {this.$refs.endpointQueryTable.setHeight();}, 700); setTimeout(() => { //绑定滚动条事件,控制top按钮 let el = this.$refs.endpointQueryTable.$el.querySelector(".el-table__body-wrapper"); diff --git a/nezha-fronted/src/main.js b/nezha-fronted/src/main.js index 08f55d1bc..b97735634 100644 --- a/nezha-fronted/src/main.js +++ b/nezha-fronted/src/main.js @@ -99,7 +99,7 @@ Vue.use(plTable); /*指令*/ Vue.directive('clickoutside', clickoutside); Vue.directive('scrollBar', scrollBar); - +window.resizing = false; window.vm = new Vue({ el: '#app', router, diff --git a/nezha-fronted/src/tools.js b/nezha-fronted/src/tools.js index 2e19ccbb4..da2537434 100644 --- a/nezha-fronted/src/tools.js +++ b/nezha-fronted/src/tools.js @@ -183,6 +183,7 @@ export const scrollBar = { export const bottomBoxWindow = { // 鼠标拖动二级列表 listResize(vm, e) { + window.resizing = true; let mainListDom = document.querySelector(".main-list-with-sub"); //主列表 let subListDom = document.querySelector(".sub-list"); //副列表 let contentRightDom = document.querySelector(".content-right"); //右侧内容区 @@ -194,6 +195,7 @@ export const bottomBoxWindow = { let mouseInitialY = e.clientY; document.onmousemove = (e) => { + window.resizing = true; mainListDom.classList.remove('main-and-sub-transition'); subListDom.classList.remove('main-and-sub-transition'); e.preventDefault(); @@ -213,17 +215,17 @@ export const bottomBoxWindow = { subListDom.style.height = subInitialHeight-mouseMoveY+'px'; } - // 主、副列表最小高度限制为15px - if(parseInt(mainListDom.style.height) >= contentRightHeight-15){ + // 主、副列表最小高度限制为15px; 23是因为拖动区域有8的高度 + if(parseInt(mainListDom.style.height) > contentRightHeight-23){ vm.toTopBtnTop = contentRightHeight+5+'px'; - mainListDom.style.height = contentRightHeight-15+'px'; + mainListDom.style.height = contentRightHeight-23+'px'; } if(parseInt(mainListDom.style.height) <= 15){ vm.toTopBtnTop = '35px'; mainListDom.style.height = '15px'; } - if(parseInt(subListDom.style.height) >= contentRightHeight-15){ - subListDom.style.height = contentRightHeight-15+'px'; + if(parseInt(subListDom.style.height) > contentRightHeight-23){ + subListDom.style.height = contentRightHeight-23+'px'; } if(parseInt(subListDom.style.height) <= 15){ subListDom.style.height = '15px'; @@ -249,6 +251,7 @@ export const bottomBoxWindow = { } }; document.onmouseup = () => { + window.resizing = false; mainListDom.classList.add('main-and-sub-transition'); subListDom.classList.add('main-and-sub-transition'); document.onmousemove = null;