NEZ-2389 feat:dashboard chart(group)支持根据variable实现repeat功能

This commit is contained in:
zyh
2022-11-17 17:54:58 +08:00
parent a058d74f0a
commit 336b131d94
7 changed files with 170 additions and 17 deletions

View File

@@ -389,13 +389,22 @@ export default {
})
},
close () {
let flag = false
this.labelArr.forEach((item) => {
if (item.visible && item.multi) {
this.$store.dispatch('dispatchVariablesArr', [...this.labelArr])
flag = true
}
item.visible = false
})
if (flag) {
const oldVariables = this.$store.state.panel.variablesArr
// 如果新旧值相等 则不执行
if (JSON.stringify(oldVariables) !== JSON.stringify(this.labelArr)) {
this.$store.dispatch('dispatchVariablesArr', [...this.labelArr])
}
}
}
},
beforeDestroy () {
this.$store.dispatch('dispatchVariablesArr', [])