From 1889f6b13bb80a75a0a156e0b7d7c59ec1e1edcd Mon Sep 17 00:00:00 2001 From: hanyuxia Date: Tue, 9 Aug 2022 11:02:59 +0800 Subject: [PATCH] =?UTF-8?q?CN-643=20=E9=83=A8=E7=BD=B2=E5=88=B044.54?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E7=82=B9=E5=87=BB=E7=AC=AC=E5=9B=9B=E7=BA=A7?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/Header.vue | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/components/layout/Header.vue b/src/components/layout/Header.vue index 6acc2938..90bf15b0 100644 --- a/src/components/layout/Header.vue +++ b/src/components/layout/Header.vue @@ -256,6 +256,7 @@ export default { }, mounted () { this.from = Object.keys(this.entityType)[0] + this.initDropdownList() }, setup () { const dateRangeValue = 60 @@ -291,7 +292,8 @@ export default { window.location.reload() }) }, - initDropdownList (currentValue) { + initDropdownList () { + const currentValue = document.getElementById('breadcrumbValue')?document.getElementById('breadcrumbValue').innerText:'' const columnName = this.$store.getters.getBreadcrumbColumnName let type = 'ip' const tabObjGroup = networkOverviewTabList.filter(item => item.label == columnName) @@ -312,28 +314,26 @@ export default { if (response.code === 200) { this.breadcrumbColumnValueListShow = response.data.result this.$nextTick(() => { - setTimeout(() => { - this.breadcrumbColumnValueListShow.forEach(item => { - const selectedDom = document.getElementById(item) - if (selectedDom) { - if (item === currentValue) { - selectedDom.style.cssText = 'color:#0091ff;font-weight: bold;' - } else { - selectedDom.style.cssText = '' - } + this.breadcrumbColumnValueListShow.forEach(item => { + const selectedDom = document.getElementById(item) + if (selectedDom) { + if (item === currentValue) { + selectedDom.style.cssText = 'color:#0091ff;font-weight: bold;' + } else { + selectedDom.style.cssText = '' } - }) - }, 250) + } + }) }) } }) }, showBreadcrumbPopover (valueMenuId) { + this.breadcrumbColumnValueListShow.splice(0,this.breadcrumbColumnValueListShow.length) this.curPageNum = 1 this.showBackground = true this.dropDownValue = '' - const currentValue = document.getElementById('breadcrumbValue').innerText - this.initDropdownList(currentValue) + this.initDropdownList() this.valueMenuId = 'breadcrumb' + valueMenuId }, hideBreadcrumbPopover () { @@ -344,9 +344,8 @@ export default { document.getElementById('breadcrumbValue').innerText = value document.getElementById('breadcrumbButton').setAttribute('title', value) document.getElementById(this.valueMenuId).setAttribute('title', value) - this.$refs.breadcrumbPopover.hide() + document.getElementById('breadcrumbButton').click() const columnName = this.$store.getters.getBreadcrumbColumnName - const tabObjGroup = networkOverviewTabList.filter(item => item.label == columnName) if (tabObjGroup && tabObjGroup.length > 0) { const curTab = tabObjGroup[0]