Merge branch 'dev-3.4' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.4

This commit is contained in:
likexuan
2022-07-05 13:30:18 +08:00
2 changed files with 6 additions and 5 deletions

View File

@@ -172,10 +172,11 @@ export default {
const step = bus.getStep(startTime, endTime)
startTime = this.$stringTimeParseToUnix(startTime)
endTime = this.$stringTimeParseToUnix(endTime)
if (!this.chartInfo.oldElements) {
this.chartInfo.oldElements = this.chartInfo.elements || []
if (!this.chartInfo.oldElements) { // 创建一个备份 用于判断变量替换 能拿到原本变量的位置
this.chartInfo.oldElements = this.chartInfo.elements ? JSON.parse(JSON.stringify(this.chartInfo.elements)) : []
}
this.chartInfo.elements = this.chartInfo.oldElements.map(item => {
this.chartInfo.elements = this.chartInfo.oldElements.filter(item => item.state) // 处理不显示的表达式
this.chartInfo.elements = this.chartInfo.elements.map(item => { // 处理表达式的变量
const variables = this.variablesReplace(item.expression)
this.myVariables.push(variables)
return {

View File

@@ -348,7 +348,7 @@ export default {
this.filter.searchName = ''
// this.$refs.searchInput.select();
this.showPanel = val
this.variables = this.showPanel.param.variables
this.variables = this.$loadsh.get(this, 'showPanel.param.variables', []) || []
this.showPanel.type = 'dashboard'
this.filter.panelId = this.showPanel.id
this.panelId = this.showPanel.id
@@ -785,7 +785,7 @@ export default {
this.$message.error(response)
}
}
this.variables = this.showPanel.param.variables
this.variables = this.$loadsh.get(this, 'showPanel.param.variables', []) || []
}).catch((error) => {
// console.log('error................'+JSON.stringify(error));
if (error) {