CN-484 交互优化(页面跳转定位):锚点定位

This commit is contained in:
hyx
2022-05-24 09:32:33 +08:00
parent c13b943d3d
commit e8de279a01
2 changed files with 15 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ export default {
if (!this.$_.isEmpty(res.data.theme)) { if (!this.$_.isEmpty(res.data.theme)) {
localStorage.setItem(storageKey.theme, res.data.theme) localStorage.setItem(storageKey.theme, res.data.theme)
} }
res.loginSuccessPath = this.loginSuccessPath res.loginSuccessPath = this.$route.query.redirect
this.loginSuccess(res) this.loginSuccess(res)
localStorage.setItem(storageKey.username, this.username) localStorage.setItem(storageKey.username, this.username)
} else if (res.code === 518005) { } else if (res.code === 518005) {

View File

@@ -89,6 +89,14 @@ export default {
this.currentTab = this.detailTabs[0].id + '' this.currentTab = this.detailTabs[0].id + ''
} }
window.addEventListener('mousewheel', this.handleWholeScreen) window.addEventListener('mousewheel', this.handleWholeScreen)
if (this.currentPath != wholeScreenRouterMapping.dns) {
this.$nextTick(() => {
setTimeout(() => {
this.gotoAnchor(this.$route.query.anchor)
}, 200)
})
}
}, },
beforeMount () { beforeMount () {
window.removeEventListener('mousewheel', this.handleWholeScreen) window.removeEventListener('mousewheel', this.handleWholeScreen)
@@ -237,6 +245,12 @@ export default {
}, },
groupParentCalcHeight (params) { groupParentCalcHeight (params) {
this.$refs.panelChartList.groupParentCalcHeight(params.chart, params.childrenList) this.$refs.panelChartList.groupParentCalcHeight(params.chart, params.childrenList)
},
gotoAnchor (id) {
const anchor = document.getElementById(id)
if (anchor) {
anchor.scrollIntoView()
}
} }
} }
} }