fix(仪表板): 修复普通用户点击仪表板可能无发显示问题

This commit is contained in:
wangjiahao 2024-07-01 11:16:59 +08:00
parent 53bb42777b
commit 7089665fd2

View File

@ -675,13 +675,13 @@ export default {
},
filterText(val) {
this.searchPids = []
this.$refs.default_panel_tree.filter(val)
this.$refs.panel_list_tree.filter(val)
this.$refs.default_panel_tree?.filter(val)
this.$refs.panel_list_tree?.filter(val)
},
searchType(val) {
this.searchPids = []
this.$refs.default_panel_tree.filter(this.filterText)
this.$refs.panel_list_tree.filter(this.filterText)
this.$refs.default_panel_tree?.filter(this.filterText)
this.$refs.panel_list_tree?.filter(this.filterText)
}
},
beforeDestroy() {
@ -1054,14 +1054,14 @@ export default {
}
if (this.filterText) {
this.$nextTick(() => {
this.$refs.default_panel_tree.filter(this.filterText)
this.$refs.default_panel_tree?.filter(this.filterText)
})
}
this.$nextTick(() => {
const currentKey = this.$refs.default_panel_tree?.getCurrentKey()
if (currentKey) {
this.$nextTick(() =>{
this.$refs.default_panel_tree.setCurrentKey(currentKey)
this.$refs.default_panel_tree?.setCurrentKey(currentKey)
})
}
})
@ -1070,9 +1070,9 @@ export default {
nodeClick(data, node) {
if (data.panelType === 'self') {
this.$refs.default_panel_tree.setCurrentKey(null)
this.$refs.default_panel_tree?.setCurrentKey(null)
} else {
this.$refs.panel_list_tree.setCurrentKey(null)
this.$refs.panel_list_tree?.setCurrentKey(null)
}
this.lastActiveNode = node
this.lastActiveNodeData = data
@ -1163,7 +1163,7 @@ export default {
// CurrentKey
_this.$refs.panel_list_tree.setCurrentKey(panelInfo.id)
// default_tree
_this.$refs.default_panel_tree.setCurrentKey(null)
_this.$refs.default_panel_tree?.setCurrentKey(null)
_this.$nextTick(() => {
document.querySelector('.is-current').firstChild.click()
//
@ -1180,9 +1180,9 @@ export default {
const _this = this
_this.$nextTick(() => {
// CurrentKey
_this.$refs.panel_list_tree.setCurrentKey(panelInfo.id)
_this.$refs.panel_list_tree?.setCurrentKey(panelInfo.id)
// default_tree
_this.$refs.default_panel_tree.setCurrentKey(null)
_this.$refs.default_panel_tree?.setCurrentKey(null)
if (panelInfo.parents) {
_this.expandedArray = panelInfo.parents
}
@ -1197,9 +1197,9 @@ export default {
if (panelId) {
const _this = this
_this.$nextTick(() => {
_this.$refs.panel_list_tree.setCurrentKey(null)
_this.$refs.panel_list_tree?.setCurrentKey(null)
// CurrentKey
_this.$refs.default_panel_tree.setCurrentKey(panelId)
_this.$refs.default_panel_tree?.setCurrentKey(panelId)
_this.$nextTick(() => {
document.querySelector('.is-current').firstChild.click()
})