diff --git a/nezha-fronted/src/components/chart/chart/chartTable.vue b/nezha-fronted/src/components/chart/chart/chartTable.vue index 40740db9c..3f4ba7257 100644 --- a/nezha-fronted/src/components/chart/chart/chartTable.vue +++ b/nezha-fronted/src/components/chart/chart/chartTable.vue @@ -300,6 +300,7 @@ export default { oldValue: '' } const display = this.globalVariablesReplace(column.display) + console.log(column, display, /\{\{.+\}\}/.test(display), params) if (/\{\{.+\}\}/.test(display)) { const labelValue = display.replace(/(\{\{.+?\}\})/g, function (i) { const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2) @@ -309,7 +310,8 @@ export default { if (label.indexOf('$value') !== -1) { value = chartDataFormat.getUnit(column.unit ? column.unit : 2).compute(value, null, -1, 2) } - if (!((typeof value) == 'string' && value.constructor == String)) { + console.log(value) + if (!((typeof value) == 'string' && value.constructor == String) && isNaN(value)) { let legend = '' if (value.__name__) { legend += `${value.__name__}{` @@ -336,7 +338,7 @@ export default { let value = null if (lodash.get(params, label)) { value = lodash.get(params, label) - if (!((typeof value) == 'string' && value.constructor == String)) { + if (!((typeof value) == 'string' && value.constructor == String) && isNaN(value)) { let legend = '' if (value.__name__) { legend += `${value.__name__}{` @@ -358,6 +360,7 @@ export default { } return value || '' }) + console.log(labelValue) obj[column.title + 'display'] = { display: labelValue, oldValue: oldLabelValue @@ -391,7 +394,7 @@ export default { if (label.indexOf('$value') !== -1) { value = chartDataFormat.getUnit(col.unit ? col.unit : 2).compute(value, null, -1, 2) } - if (!((typeof value) == 'string' && value.constructor == String)) { + if (!((typeof value) == 'string' && value.constructor == String) && isNaN(value)) { let legend = '' if (value.__name__) { legend += `${value.__name__}{`