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

This commit is contained in:
zhangyu
2023-05-26 09:37:19 +08:00
2 changed files with 7 additions and 7 deletions

View File

@@ -205,9 +205,9 @@ export default {
display: '',
oldValue: ''
}
if (/\{\{.+\}\}/.test(column.display)) {
column.display = this.globalVariablesReplace(column.display)
const labelValue = column.display.replace(/(\{\{.+?\}\})/g, function (i) {
const display = this.globalVariablesReplace(column.display)
if (/\{\{.+\}\}/.test(display)) {
const labelValue = display.replace(/(\{\{.+?\}\})/g, function (i) {
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
let value = null
if (lodash.get(params, label)) {
@@ -237,7 +237,7 @@ export default {
}
return value || ''
})
const oldLabelValue = column.display.replace(/(\{\{.+?\}\})/g, function (i) {
const oldLabelValue = display.replace(/(\{\{.+?\}\})/g, function (i) {
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
let value = null
if (lodash.get(params, label)) {
@@ -270,8 +270,8 @@ export default {
}
} else {
obj[column.title + 'display'] = {
display: column.display,
oldValue: column.display
display: display,
oldValue: display
}
}
})

View File

@@ -147,13 +147,13 @@ export default {
methods: {
isGroup,
variablesHandle (searchTime) {
this.setGlobalVariablesValue(searchTime)
this.myVariables = []
// eslint-disable-next-line vue/no-mutating-props
this.chartInfo.elements = this.$loadsh.cloneDeep(this.chartInfo.oldElements.filter(item => item.state)) // 处理不显示的表达式
// eslint-disable-next-line vue/no-mutating-props
this.chartInfo.elements = this.chartInfo.elements.map((item, index) => { // 处理表达式的变量
// 全局变量替换
this.setGlobalVariablesValue(searchTime)
item.expression = this.globalVariablesReplace(item.expression, searchTime)
// group图表设置repeat的表达式替换
if (this.chartInfo.repeatVariable) {